txTextInfo is a general purpose function which, depending on the info_type value, returns information about various properties, objects or features found in a text document.
Parameter | Description |
---|---|
text_doc |
Handle of the associated text document instance. |
info_type |
A value that identifies the type of information requested. See below for details. |
param |
An input parameter specific to the type of information requested. |
reserved |
Reserved for future use. Must be set to 0. |
info |
A pointer to a variable that will hold the returned info value. |
extra |
A pointer to an array of extra info values that will be returned. This array is allocated by the user and its size must be big enough to hold the number of returned info values, as indicated below. In some situations, this array can also hold additional input parameters. Alternatively, this pointer can be set to DV_NULL. This means that no extra info values are needed and/or will be returned. |
If the function was successful, the return value is 1. Otherwise, the function returns 0.
The type of the information returned depends on the info_type value specified. At present, the following info_type values are supported:
If info_type is set to TX_INFO_TEXTAREA (0), param is the index of the textflow area in the text document and the function returns information about that textflow area as follows:
The size of the extra array in this case must be at least 4 elements.
If info_type is set to TX_INFO_FRAMESET (1), param is the index of the textflow area in the text document and the function returns information about that textflow area's frames that were generated by one or several previous calls to txTextDraw:
The size of the extra array in this case must be at least 6 elements.
If info_type is set to TX_INFO_CURSOR (2), param is a flag which describes the type of character index requested and the function returns cursor specific information based on the frames that were generated by one or several previous calls to txTextDraw:
The size of the extra array in this case must be at least 4 elements.
If info_type is set to TX_INFO_COMMAND (3), param is one of the following commands (a subset of commands that is normally passed to txTextCommand):
TX_CMD_LEFT 3 /* Go to previous visible character */ TX_CMD_RIGHT 4 /* Go to next visible character */ TX_CMD_UP 5 /* Go to previous row */ TX_CMD_DOWN 6 /* Go to next row */ TX_CMD_SHIFT_LEFT 7 /* Shift + Go to previous visible character */ TX_CMD_SHIFT_RIGHT 8 /* Shift + Go to next visible character */ TX_CMD_SHIFT_UP 9 /* Shift + Go to previous row */ TX_CMD_SHIFT_DOWN 10 /* Shift + Go to next row */ TX_CMD_SET 11 /* Set cursor to closest visible position */ TX_CMD_CURRCHAR 12 /* Go to current character */ TX_CMD_CURRTEXT 53 /* Same as TX_CMD_CURRCHAR but safer (checks bounds in case the text is changed externally) */ TX_CMD_PREVCHAR 13 /* Go to previous character */ TX_CMD_PREVWORD 14 /* Go to previous word */ TX_CMD_PREVLINE 15 /* Go to previous text line */ TX_CMD_PREVPARAGRAPH 16 /* Go to previous paragraph */ TX_CMD_PREVAREA 17 /* Go to previous text area */ TX_CMD_NEXTCHAR 18 /* Go to next character */ TX_CMD_NEXTWORD 19 /* Go to next word */ TX_CMD_NEXTLINE 20 /* Go to next text line */ TX_CMD_NEXTPARAGRAPH 21 /* Go to next paragraph */ TX_CMD_NEXTAREA 22 /* Go to next text area */ TX_CMD_SHIFT_PREVCHAR 23 /* Shift + Go to previous character */ TX_CMD_SHIFT_PREVWORD 24 /* Shift + Go to previous word */ TX_CMD_SHIFT_PREVLINE 25 /* Shift + Go to previous text line */ TX_CMD_SHIFT_PREVPARAGRAPH 26 /* Shift + Go to previous paragraph */ TX_CMD_SHIFT_PREVAREA 27 /* Shift + Go to previous text area */ TX_CMD_SHIFT_NEXTCHAR 28 /* Shift + Go to next character */ TX_CMD_SHIFT_NEXTWORD 29 /* Shift + Go to next word */ TX_CMD_SHIFT_NEXTLINE 30 /* Shift + Go to next text line */ TX_CMD_SHIFT_NEXTPARAGRAPH 31 /* Shift + Go to next paragraph */ TX_CMD_SHIFT_NEXTAREA 32 /* Shift + Go to next text area */ TX_CMD_STARTWORD 33 /* Go to start of word */ TX_CMD_STARTLINE 34 /* Go to start of text line */ TX_CMD_STARTPARAGRAPH 35 /* Go to start of paragraph */ TX_CMD_STARTAREA 36 /* Go to start of text area */ TX_CMD_STARTTEXT 37 /* Go to start of text */ TX_CMD_ENDWORD 38 /* Go to end of word */ TX_CMD_ENDLINE 39 /* Go to end of text line */ TX_CMD_ENDPARAGRAPH 40 /* Go to end of paragraph */ TX_CMD_ENDAREA 41 /* Go to end of text area */ TX_CMD_ENDTEXT 42 /* Go to end of text */ TX_CMD_SHIFT_STARTWORD 43 /* Shift + Go to start of word */ TX_CMD_SHIFT_STARTLINE 44 /* Shift + Go to start of text line */ TX_CMD_SHIFT_STARTPARAGRAPH 45 /* Shift + Go to start of paragraph */ TX_CMD_SHIFT_STARTAREA 46 /* Shift + Go to start of text area */ TX_CMD_SHIFT_STARTTEXT 47 /* Shift + Go to start of text */ TX_CMD_SHIFT_ENDWORD 48 /* Shift + Go to end of word */ TX_CMD_SHIFT_ENDLINE 49 /* Shift + Go to end of text line */ TX_CMD_SHIFT_ENDPARAGRAPH 50 /* Shift + Go to end of paragraph */ TX_CMD_SHIFT_ENDAREA 51 /* Shift + Go to end of text area */ TX_CMD_SHIFT_ENDTEXT 52 /* Shift + Go to end of text */
In this case the variable pointed by the info pointer will hold the character position to which the specified command would take the cursor to, if it was passed to txTextCommand. The pointer to the extra array is not used in this case and should be set to DV_NULL.
If info_type is set to TX_INFO_SELECTED (4), param is ignored and the function returns information about the selected textflow area.
If info_type is set to TX_INFO_HIT (5), the function returns information about the textflow area that encloses a hit point.
If no textflow area encloses the specified hit point and param is non-zero, the function will search for the closest textflow area on the same page. If param is zero, the function will not search for the closest textflow area.