home *** CD-ROM | disk | FTP | other *** search
/ WordPerfect for Linux Bible / WP4LinuxBible.iso / sdk / wpx / code / wt / wtdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-25  |  7.0 KB  |  163 lines

  1.  
  2. /* HEADER FILE *****************************************************
  3.  * WTDEF.H  -  Writing Tools API definitions for client and writing 
  4.  *             tool use.  Platform Independent Information.
  5.  *******************************************************************
  6.  *  Copyright (C) 1992, 1993 WordPerfect Corp., All Rights Reserved
  7.  *******************************************************************/
  8. #ifndef WTDEF_H
  9. #define WTDEF_H
  10.  
  11. #define WTAPI_VERSION    0x0006            /* hi byte = major, low byte = minor */
  12.  
  13. /* DEFINITIONS FOR API MESSAGES */
  14.  
  15. /* ENUMERATED TYPES */
  16.  
  17. typedef enum {                        /* Writing tool message identifiers */
  18.     WTC_NOMESSAGE,                        /* 00 Message #0 is not an API message */
  19.     WTC_RQINIT,                            /* 01 request API initialization */
  20.     WTC_INIT,                            /* 02 initialize API communication */
  21.     WTQ_INFOBLOCK,                        /* 03 request the client infoblock */
  22.     WTR_INFOBLOCK,                        /* 04 return the infoblock */
  23.     WTQ_UNITINFO,                        /* 05 request text unit info */
  24.     WTR_UNITINFO,                        /* 06 return unit info */
  25.     WTQ_READTOOLDATA,                    /* 07 request a tool data area */
  26.     WTR_READTOOLDATA,                    /* 08 return a tool data area */
  27.     WTQ_WRITETOOLDATA,                    /* 09 write a tool data area */
  28.     WTR_WRITETOOLDATA,                    /* 0A acknowledge tool data area write */
  29.     WTQ_TEXTBLOCK,                        /* 0B request a text block */
  30.     WTQ_NEXTTEXTBLOCK,                    /* 0C request the next text block */
  31.     WTR_TEXTBLOCK,                        /* 0D return a text block */
  32.     WTQ_READTEXTOBJECT,                    /* 0E request a text object */
  33.     WTR_READTEXTOBJECT,                    /* 0F return a text object */
  34.     WTQ_WRITETEXTOBJECT,                /* 10 write a text object */
  35.     WTR_WRITETEXTOBJECT,                /* 11 acknowledge text object write */
  36.     WTQ_GOTO,                            /* 12 goto an API position */
  37.     WTR_GOTO,                            /* 13 acknowledge new position */
  38.     WTQ_HILITE,                            /* 14 highlight an area */
  39.     WTR_HILITE,                            /* 15 acknowledge highlight */
  40.     WTQ_DEHILITE,                        /* 16 dehighlight an area */
  41.     WTR_DEHILITE,                        /* 17 acknowledge dehighlight */
  42.     WTQ_REPLACE,                        /* 18 replace text in a text block */
  43.     WTQ_UNDOREPLACE,                    /* 19 undo the last replace */
  44.     WTR_REPLACE,                        /* 1A acknowledge replacement */
  45.     WTC_RQCLACTIVE,                        /* 1B request client activation */
  46.     WTC_CLACTIVE,                        /* 1C client was activated */
  47.     WTC_CLINACTIVE,                        /* 1D client was deactivated */
  48.     WTC_TLINACTIVE,                        /* 1E tool was deactivated */
  49.     WTQ_TLACTIVE,                        /* 1F tool was reactivated */
  50.     WTR_TLACTIVE,                        /* 20 update tool on text query status */
  51.     WTC_RQTLTERM,                        /* 21 reqest tool termination */
  52.     WTC_TLTERM                            /* 22 tool termination */
  53. } WTMSGID;
  54.  
  55. typedef enum {                        /* Writing tool status types */
  56.     WTS_OK,                                /* ok status */
  57.     WTS_NOMEMORY,                        /* not enough memory */
  58.     WTS_COMERROR,                        /* error in WTAPI communication */
  59.     WTS_BADREQUEST,                        /* bad API request message */
  60.     WTS_APIERROR = WTS_BADREQUEST,        /* use WTS_BADREQUEST instead */
  61.     WTS_CLIENTERROR,                    /* client internal error */
  62.     WTS_USER,                            /* user intervention */
  63.     WTS_QUITAPI,                        /* termination requested */
  64.     WTS_TOOLBUSY,                        /* writing tool is busy */
  65.     WTS_NOTSUPPORTED                    /* API request not supported */
  66. } WTSTATUS;
  67.  
  68. typedef enum {                        /* Writing tool Boolean types */
  69.     WT_FALSE,                            /* false condition or flag */
  70.     WT_TRUE                                /* true condition or flag */
  71. } WTBOOL;
  72.  
  73. typedef enum {                        /* Writing tool positioning methods */
  74.     WTP_REL,                            /* relative positioning */
  75.     WTP_BEG,                            /* positioning from the block begin */
  76.     WTP_END                                /* positioning from the block end */
  77. } WTPOS;
  78.  
  79. typedef enum {                        /* Writing tool execution modes */
  80.     WTM_NORMAL,                            /* Normal execution */
  81.     WTM_SETUP,                            /* Setup mode */
  82.     WTM_HELP                            /* Help mode */
  83. } WTMODE;
  84.  
  85. typedef enum {                        /* Writing tool types */
  86.     WTT_DEFAULT,                        /* default writing tool type */
  87.     WTT_SPELLER,                        /* spell checking */
  88.     WTT_THESAURUS,                        /* thesaurus lookup */
  89.     WTT_GRAMMAR,                        /* grammar checking */
  90.     WTT_DICTIONARY,                        /* definitional dictionary */
  91.     WTT_HYPHENATION,                    /* word hyphenation */
  92.     WTT_STATISTICS,                        /* statistical analysis */
  93.     WTT_PHONETIC,                        /* phonetic analysis */
  94.     WTT_SYNTAX,                            /* syntactical analysis/compilation */
  95.     WTT_INPUT,                            /* input method */
  96.     WTT_TRANSLATOR                        /* language translation */
  97. } WTTOOL;
  98.  
  99. typedef enum {                        /* Types of text block queries */
  100.     WTB_INIT,                            /* initialize a new query */
  101.     WTB_RESUME,                            /* resume the query in progress */
  102.     WTB_EXTEND,                            /* extend the query lower bound */
  103.     WTB_ROLLBACK                        /* roll the query back to a block */
  104. } WTTBQTYPE;
  105.  
  106. typedef enum {                        /* End of TEXTBLOCK query causes */
  107.     WTE_FULL,                            /* text block buffer is full */
  108.     WTE_ENDQUERY,                        /* end of the query was reached */
  109.     WTE_NEWCONTAINER,                    /* starting a nested container */
  110.     WTE_ENDCONTAINER,                    /* end of current text container */
  111.     WTE_LANGCHANGE,                        /* language change encountered */
  112.     WTE_ERROR                            /* error encountered */
  113. } WTENDBLOCK;
  114.  
  115.  
  116.     /* WTDAMODE -- Writing tool data storage modes */
  117. #define WTD_PRODUCT        0x0001            /* product area */
  118. #define WTD_DOCUMENT    0x0002            /* document area */
  119. #define WTD_CURSOR        0x0004            /* at the cursor */
  120. #define WTD_VISIBLE        0x0008            /* tool data is visible */
  121. #define WTD_TEMPORARY    0x0010            /* tool data is temporary */
  122. #define WTD_START        0x0020            /* start of tool data */
  123. #define WTD_END            0x0040            /* end of tool data */
  124.  
  125.     /* WTTEXT -- writing tool text types */
  126. #define WTX_NATIVE        0x00000001        /* native operating system format */
  127. #define WTX_STYLE        0x00000002        /* native with style information */
  128. #define WTX_UNICODE        0x00000004        /* Unicode */
  129. /* reserved                0x00000008 */
  130. #define WTX_WPWRD        0x00000010        /* WordPerfect word string format */
  131. #define WTX_WP6            0x00000020        /* WordPerfect 6.x document format */
  132. /* reserved                0x00000040 */
  133. /* reserved                0x00000080 */
  134. #define WTX_RTF            0x00000100        /* Microsoft RTF */
  135.  
  136.     /* WTUNIT -- writing tool text units */
  137. #define WTU_DEFUNIT        0x00000000        /* default client text unit */
  138. #define WTU_SELECTION    0x00000001        /* user-selected text */
  139. #define WTU_CHAR        0x00000002        /* character unit */
  140. #define WTU_WORD        0x00000004        /* word unit */
  141. #define WTU_LINE        0x00000008        /* line unit */
  142. #define WTU_SENTENCE    0x00000010        /* sentence unit */
  143. #define WTU_PARAGRAPH    0x00000020        /* paragraph unit */
  144. #define WTU_PAGE        0x00000040        /* page unit */
  145. #define WTU_DOCUMENT    0x00000080        /* document unit */
  146. #define WTU_ENTRYBOX    0x00000100        /* text entry box unit */
  147.  
  148.     /* WTACTION -- Action to be taken by writing tool */
  149. #define WTA_SUSPEND        0x0000            /* suspend writing tool session */
  150. #define WTA_RESUME        0x0001            /* resume writing tool session */
  151. #define WTA_FRONT        0x0000            /* stay in front of the client window */
  152. #define WTA_BACK        0x0002            /* move in back of the client window */
  153. #define WTA_SHOW        0x0000            /* show the writing tool window */
  154. #define WTA_HIDE        0x0004            /* hide the window */
  155. #define WTA_WINDOW        0x0000            /* tool should appear as a window */
  156. #define WTA_ICON        0x0008            /* tool should appear as an icon */
  157.  
  158.     /* WTINFO -- Info that needs to be resent after writing tool becomes active */
  159. #define WTI_INFOBLOCK    0x0001            /* INFOBLOCK needs to be resent */
  160. #define WTI_UNITINFO    0x0002            /* UNITINFO needs to be resent */
  161.  
  162. #endif    /* WTDEF_H */
  163.