home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / ftsiface.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  6.4 KB  |  141 lines

  1. // FTSIFACE.h -- DLL interface for FTSrch.dll
  2.  
  3. #ifndef __FTSIFACE_H__
  4. #define __FTSIFACE_H__
  5.  
  6. typedef HANDLE HINDEX;
  7. typedef HANDLE HSEARCHER;
  8. typedef HANDLE HCOMPRESSOR;
  9. typedef HANDLE HHILITER;
  10. typedef INT    ERRORCODE;
  11. typedef struct { int base; int limit; } HILITE;
  12.  
  13. #define NO_TITLE              UINT(-1)  // ERRORCODE values
  14. #define NOT_INDEXER           UINT(-2)
  15. #define NOT_SEARCHER          UINT(-3)
  16. #define NOT_COMPRESSOR        UINT(-4)
  17. #define CANNOT_SAVE           UINT(-5)
  18. #define OUT_OF_MEMORY         UINT(-6)
  19. #define CANNOT_OPEN           UINT(-7)
  20. #define CANNOT_LOAD           UINT(-8)
  21. #define INVALID_INDEX         UINT(-9)
  22. #define ALREADY_WEIGHED       UINT(-10)
  23. #define NO_TEXT_SCANNED       UINT(-11)
  24. #define ALIGNMENT_ERROR       UINT(-12)
  25. #define INVALID_PHRASE_TABLE  UINT(-13)
  26. #define INVALID_LCID          UINT(-14)
  27. #define NO_INDICES_LOADED     UINT(-15)
  28. #define INDEX_LOADED_ALREADY  UINT(-16)
  29. #define GROUP_LOADED_ALREADY  UINT(-17)
  30. #define DIALOG_ALREADY_ACTIVE UINT(-18)
  31. #define EMPTY_PHRASE_TABLE    UINT(-19)
  32. #define OUT_OF_DISK           UINT(-20)
  33. #define DISK_READ_ERROR       UINT(-21)
  34. #define DISK_WRITE_ERROR      UINT(-22)
  35. #define SEARCH_ABORTED        UINT(-23)
  36. #define UNKNOWN_EXCEPTION     UINT(-24)
  37. #define SYSTEM_ERROR          UINT(-25)
  38. #define NOT_HILITER              UINT(-26)
  39. #define INVALID_CHARSET       UINT(-27)
  40. #define INVALID_SOURCE_NAME   UINT(-28)
  41. #define INVALID_TIMESTAMP     UINT(-29)
  42.  
  43. // -------------- Index Construction Interface ---------------------------
  44.  
  45. #define TOPIC_SEARCH    0x00000001   // Options for NewIndex
  46. #define PHRASE_SEARCH   0x00000002
  47. #define PHRASE_FEEDBACK 0x00000004
  48. #define VECTOR_SEARCH   0x00000008
  49. #define WINHELP_INDEX   0x00000010
  50. #define USE_VA_ADDR     0x00000020
  51. #define USE_QWORD_JUMP  0x00000040
  52.  
  53. #define USE_DEFAULT     UINT(-1) // Surrogate for default charset or default lcid
  54.  
  55. extern "C" HINDEX APIENTRY NewIndex(const PBYTE pbSourceName,
  56.                            UINT uiTime1, UINT uiTime2,
  57.                            UINT iCharsetDefault, UINT lcidDefault, UINT fdwOptions                 
  58.                           );                                                     
  59.  
  60. extern "C" ERRORCODE APIENTRY ScanTopicTitle(HINDEX hinx, PBYTE pbTitle, UINT cbTitle, 
  61.                                     UINT iTopic, HANDLE hTopic, UINT iCharset, UINT lcid
  62.                                    );
  63. extern "C" ERRORCODE APIENTRY ScanTopicText (HINDEX hinx, PBYTE pbText, UINT cbText, UINT iCharset, UINT lcid);
  64. extern "C" ERRORCODE APIENTRY SaveIndex     (HINDEX hinx, PSZ pszFileName);
  65. extern "C" ERRORCODE APIENTRY DeleteIndex   (HINDEX hinx);
  66.  
  67. typedef void  (__stdcall *ANIMATOR)(void);
  68.  
  69. extern "C" ERRORCODE APIENTRY RegisterAnimator(ANIMATOR pAnimator, HWND hwndAnimator);
  70.  
  71. // ----------------- Querying the Validity of an Index File --------------
  72.  
  73. extern "C" BOOL      APIENTRY IsValidIndex(PSZ pszFileName, UINT dwOptions);
  74.  
  75. extern "C" void      APIENTRY SetDirectoryLocator(HWND hwndLocator);
  76.  
  77. // ----------------- Searcher Interface ----------------------------------
  78.  
  79. extern "C" HSEARCHER APIENTRY NewSearcher();                                          
  80.  
  81. extern "C" INT       APIENTRY OpenIndex(HSEARCHER hsrch, PSZ pszIndexFileName,        // returns iIndex for index file
  82.                                PBYTE pbSourceName, PUINT pcbSourceNameLimit, // or      -ErrorCode
  83.                                PUINT pTime1, PUINT pTime2
  84.                               );
  85.  
  86. extern "C" ERRORCODE APIENTRY DiscardIndex  (HSEARCHER hsrch, INT iIndex);
  87. extern "C" ERRORCODE APIENTRY QueryOptions  (HSEARCHER hsrch, INT iIndex, PUINT pfdwOptions);
  88. extern "C" ERRORCODE APIENTRY SaveGroup     (HSEARCHER hsrch, PSZ pszFileName);
  89. extern "C" ERRORCODE APIENTRY LoadGroup     (HSEARCHER hsrch, PSZ pszFileName);
  90. extern "C" HWND      APIENTRY OpenDialog    (HSEARCHER hsrch, HWND hwndParent);
  91. extern "C" ERRORCODE APIENTRY DeleteSearcher(HSEARCHER hsrch);
  92.  
  93. // Messages for talking to WinHelp
  94.  
  95. #define MSG_FTS_JUMP_HASH    (WM_USER + 32)  // wParam = index, lParam = HashValue
  96. #define MSG_FTS_JUMP_VA     (WM_USER + 33)  // wParam = index, lParam = VirtualAddress
  97. #define MSG_FTS_GET_TITLE    (WM_USER + 34)    // wParam = index, lParam = &pszTitle
  98. #define MSG_FTS_JUMP_QWORD  (WM_USER + 35)  // wParam = index, lParam = address of QWordAddress structure
  99. #define MSG_REINDEX_REQUEST (WM_USER + 36)  // wParam = unused,lParam = unused
  100. #define MSG_FTS_WHERE_IS_IT (WM_USER + 37)    // wParam = fStartEnumeration, lParam = &pszFile
  101. #define MSG_GET_DEFFONT     (WM_USER + 45)    // return default font handle
  102.  
  103. typedef struct _QWordAddress
  104.         {
  105.             UINT   iSerial;
  106.             HANDLE hTopic;
  107.  
  108.         } QWordAddress, *PQWordAddress;
  109.  
  110. // ------------------- Phrase Compression Interface ----------------------
  111.  
  112. extern "C" HCOMPRESSOR APIENTRY NewCompressor(UINT iCharsetDefault);
  113.  
  114. extern "C" ERRORCODE   APIENTRY ScanText(HCOMPRESSOR hcmp, PBYTE pbText, UINT cbText, UINT iCharset);
  115.  
  116. extern "C" ERRORCODE   APIENTRY GetPhraseTable(HCOMPRESSOR hcmp, PUINT pcPhrases, PBYTE *ppbImages, PUINT pcbImages,            
  117.                                       PBYTE *ppacbImageCompressed, PUINT pcbCompressed
  118.                                      );
  119.  
  120. extern "C" ERRORCODE   APIENTRY SetPhraseTable(HCOMPRESSOR hcmp, PBYTE pbImages, UINT cbImages,
  121.                                       PBYTE pacbImageCompressed, UINT cbCompressed
  122.                                      );
  123.  
  124. extern "C" INT APIENTRY CompressText  (HCOMPRESSOR hcmp, PBYTE pbText,       UINT cbText,       PBYTE *ppbCompressed, UINT iCharset);      
  125. extern "C" INT APIENTRY DecompressText(HCOMPRESSOR hcmp, PBYTE pbCompressed, UINT cbCompressed, PBYTE  pbText                      );
  126.  
  127. extern "C" ERRORCODE   APIENTRY DeleteCompressor(HCOMPRESSOR hcmp);
  128.  
  129. //----------------------- Hiliting Interface ------------------------------
  130.  
  131. extern "C" HHILITER APIENTRY NewHiliter(HSEARCHER hSearch);
  132. extern "C" ERRORCODE APIENTRY DeleteHiliter(HHILITER hhil);
  133. extern "C" ERRORCODE APIENTRY ScanDisplayText(HHILITER hhil, PBYTE pbText, int cbText, 
  134.                                                       UINT iCharset, LCID lcid);
  135. extern "C" ERRORCODE APIENTRY ClearDisplayText(HHILITER hhil);
  136. extern "C" int APIENTRY CountHilites(HHILITER hhil, int base, int limit);
  137. extern "C" int APIENTRY QueryHilites(HHILITER hhil, int base, int limit,
  138.                                                       int cHilites, HILITE* paHilites);
  139.  
  140. #endif // __FTSIFACE_H__
  141.