home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ipfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-08  |  17.6 KB  |  395 lines

  1. /****************************************************************************\
  2.  *    
  3.  * SOURCE FILE NAME: ipfx.h 
  4.  *
  5.  * DESCRIPTION: This is the public include file for ipf 
  6.  *
  7.  * COPYRIGHT =
  8.  *   COPYRIGHT (C) SINGALAB PTE LTD 1992, 1993
  9.  *   All Rights Reserved
  10.  *
  11.  ****************************************************************************/
  12.  
  13. #ifndef _IPFX_H
  14. #define _IPFX_H
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {            /* Assume C declarations for C++ */
  18. #endif    /* __cplusplus */
  19.  
  20. #include <windows.h>
  21.  
  22. /****************************************************************************/
  23. /* Help Manager Initialization Structure used on the                        */
  24. /* XhCreateHelpInstance() call.                                             */
  25. /****************************************************************************/
  26.  
  27. #ifndef PFUNC_TYPE
  28. #define PFUNC_TYPE
  29. #define PFUNC   FARPROC
  30. #endif
  31.  
  32.    /************************************************************************/
  33.    /* HelpSubTable entry structure                                         */
  34.    /************************************************************************/
  35. typedef unsigned short HELPSUBTABLE;
  36. typedef HELPSUBTABLE FAR *PHELPSUBTABLE;
  37.  
  38.    /************************************************************************/
  39.    /* HelpTable entry structure                                            */
  40.    /*                                                                      */
  41.    /************************************************************************/
  42.  
  43. typedef struct _HelpTableRec
  44. {
  45.       unsigned short  usTopic;
  46.       PHELPSUBTABLE   pHelpSubTable;
  47.       unsigned short  usExtPanel;
  48. } HELPTABLE;
  49. typedef HELPTABLE FAR * PHELPTABLE;
  50.  
  51.    /************************************************************************/
  52.    /* IPF Initialization Structure used on the                             */
  53.    /* XhCreateHelpInstance() call.                                         */
  54.    /************************************************************************/
  55.  
  56. typedef struct _HELPINIT
  57. {
  58.       unsigned short usHelpTableID;
  59.       PHELPTABLE    pHelpTable;
  60.       HINSTANCE     hHelpTableModule;
  61.       HINSTANCE     hAccelMenuBarModule;
  62.       unsigned long ulAccelTable;
  63.       unsigned long menuBarHierarchy;
  64.       LPSTR         pszHelpWindowTitle;
  65.       unsigned short usShowPanelId;
  66.       LPSTR         pszHelpLibraryNames;
  67. } HELPINIT;
  68. typedef HELPINIT far *PHELPINIT;
  69.  
  70.  
  71.  
  72. /* AC Viewport stucture definitions                                       */
  73. /**************************************************************************/
  74. #if (!defined WIN32) && (!defined _WIN32)
  75. typedef struct _RECTL { 
  76.     LONG  lXLeft;
  77.     LONG  lYBottom;
  78.     LONG  lXRight;
  79.     LONG  lYTop;
  80. } RECTL;
  81. typedef RECTL FAR * PRECTL;
  82. #endif
  83.  
  84. /**************************************************************************/
  85. /* Property name used to set help topic ID of a dialog box or a popup     */
  86. /* menu which may require help from IPF.                                  */
  87. /**************************************************************************/
  88. #define PROP_HELP_TOPIC_ID             "PROP_HELP_TOPIC_ID"
  89.  
  90. /**************************************************************************/
  91. /* Constants used to define the how the panel IDs are displayed on        */
  92. /* help panels.                                                           */
  93. /**************************************************************************/
  94.  
  95. #define CMIC_HIDE_PANEL_ID              0x0000
  96. #define CMIC_SHOW_PANEL_ID              0x0001
  97. #define CMIC_TOGGLE_PANEL_ID            0x0002
  98.  
  99. /**************************************************************************/
  100. /* Type Flag for HM_DISPLAY_HELP                                          */
  101. /**************************************************************************/
  102. #define HM_RESOURCEID                   0x0000
  103. #define HM_PANELNAME                    0x0001
  104.  
  105. /**************************************************************************/
  106. /* Res number for the default push buttons                                */
  107. /**************************************************************************/
  108.  
  109. #define CTRL_PREVIOUS_ID         0
  110. #define CTRL_SEARCH_ID           1
  111. #define CTRL_PRINT_ID            2
  112. #define CTRL_INDEX_ID            3
  113. #define CTRL_CONTENTS_ID         4
  114. #define CTRL_BACK_ID             5
  115. #define CTRL_FORWARD_ID          6
  116. #define CTRL_TUTORIAL_ID         255
  117.  
  118. /**************************************************************************/
  119. /* Help Manager message base.                                             */
  120. /**************************************************************************/
  121.  
  122. #define HM_MSG_BASE                     WM_USER+0x0220
  123.  
  124. /**************************************************************************/
  125. /* Messages applications can send to the Help Manager.                    */
  126. /**************************************************************************/
  127.  
  128. #define HM_DISMISS_WINDOW               HM_MSG_BASE+0x0001
  129. #define HM_DISPLAY_HELP                 HM_MSG_BASE+0x0002
  130. #define HM_GENERAL_HELP                 HM_MSG_BASE+0x0003     
  131. #define HM_EXT_HELP                     HM_GENERAL_HELP 
  132. #define HM_SET_ACTIVE_WINDOW            HM_MSG_BASE+0x0004
  133. #define HM_LOAD_HELP_TABLE              HM_MSG_BASE+0x0005
  134. #define HM_CREATE_HELP_TABLE            HM_MSG_BASE+0x0006
  135. #define HM_SET_HELP_WINDOW_TITLE        HM_MSG_BASE+0x0007
  136. #define HM_SET_SHOW_PANEL_ID            HM_MSG_BASE+0x0008
  137. #define HM_REPLACE_USING_HELP           HM_MSG_BASE+0x0009     
  138. #define HM_HELP_INDEX                   HM_MSG_BASE+0x000a
  139. #define HM_HELP_CONTENTS                HM_MSG_BASE+0x000b
  140. #define HM_KEYS_HELP                    HM_MSG_BASE+0x000c
  141. #define HM_SET_HELP_LIBRARY_NAME        HM_MSG_BASE+0x000d
  142.  
  143. /**************************************************************************/
  144. /* Messages the Help Manager sends to the applications active window      */
  145. /* as defined by the Help Manager.                                        */
  146. /**************************************************************************/
  147.  
  148. #define HM_ERROR                        HM_MSG_BASE+0x000e
  149. #define HM_QUERY_KEYS_HELP              HM_MSG_BASE+0x0010
  150. #define HM_QUERY_GENERAL_HELP           HM_MSG_BASE+0x0012
  151. #define HM_ACTIONBAR_COMMAND            HM_MSG_BASE+0x0013
  152. #define HM_INFORM                       HM_MSG_BASE+0x0014
  153.  
  154. #define HM_SET_OBJCOM_WINDOW            HM_MSG_BASE+0x001a
  155. #define HM_UPDATE_OBJCOM_WINDOW_CHAIN   HM_MSG_BASE+0x001b
  156. #define HM_QUERY                        HM_MSG_BASE+0x001c
  157. #define HM_SET_COVERPAGE_SIZE           HM_MSG_BASE+0x001d
  158. #define HM_SET_USERDATA                 HM_MSG_BASE+0x0023
  159. #define HM_NOTIFY                       HM_MSG_BASE+0x0024
  160.  
  161. #define HM_QUERY_DDF_DATA               HM_MSG_BASE+0x0025
  162. #define HM_CONTROL                      HM_MSG_BASE+0x0026
  163.  
  164. #define HM_GENERAL_HELP_UNDEFINED       HM_MSG_BASE+0x0027
  165. #define HM_EXT_HELP_UNDEFINED           HM_GENERAL_HELP_UNDEFINED
  166.  
  167. /**************************************************************************/
  168. /*  Constants used to query the info from IPF in HM_QUERY message         */
  169. /**************************************************************************/
  170. #define HMQW_COVERPAGE           0x0001
  171. #define HMQW_INDEX               0x0002
  172. #define HMQW_TOC                 0x0003
  173. #define HMQW_SEARCH              0x0004
  174. #define HMQW_VIEWPAGES           0x0005
  175. #define HMQW_LIBRARY             0x0006
  176. #define HMQW_VIEWPORT            0x0007
  177. #define HMQW_OBJCOM_WINDOW       0x0008
  178. #define HMQW_INSTANCE            0x0009
  179. #define HMQW_ACTIVEVIEWPORT      0x000a
  180. #define CONTROL_SELECTED         0x000b
  181. #define HELP_REQUESTED           0x000c
  182.  
  183. #define HMQW_GROUP_VIEWPORT      0x00f1
  184. #define HMQW_RES_VIEWPORT        0x00f2
  185. #define USERDATA                 0x00f3
  186.  
  187. /* param2 of HMQW_VIEWPORT */
  188. #define HMQVP_NUMBER             0x0001
  189. #define HMQVP_NAME               0x0002
  190. #define HMQVP_GROUP              0x0003
  191.  
  192. #define HMERR_INVALID_APPL_WIDGET    1001  /* Invalid application widget */
  193. #define HMERR_INVALID_HELP_WIDGET    1002  /* Invalid help instance widget */
  194. #define HMERR_HELPTABLE_UNDEFINED    1003  /* Help table not defined */
  195.  
  196. #define HMERR_HELPITEM_NOT_FOUND     1005  /* Invalid help item */
  197. #define HMERR_INVALID_HELPITEM_SIZE  1006  /* Invalid help item size */
  198. #define HMERR_INVALID_HELPTABLE      1007  /* Invalise help table */
  199. #define HMERR_INVALID_CONTROL_ID     1008  /* Invalid control id */
  200. #define HMERR_INVALID_HELP_ID        1009  /* Invalid help id */
  201.  
  202. #define HMERR_INDEX_NOT_FOUND        1011  /* no index in file */
  203. #define HMERR_CONTENT_NOT_FOUND      1012  /* no table of contents in file */
  204. #define HMERR_LIB_FILE_NOT_FOUND     1013  /* cannot find the library file */
  205. #define HMERR_OPEN_LIB_FILE          1014  /* can't open library file */
  206. #define HMERR_INVALID_HELP_STRUCTURE 1015  /* invalid PHELPINIT structure */ 
  207. #define HMERR_INVALID_PARAMETERS     1016  /* invalid parameters */
  208. #define HMERR_INVALID_MESSAGE        1017  /* invalid message sent to IPF */
  209. #define HMERR_READ_LIB_FILE          1018  /* error reading library file */
  210. #define HMERR_CLOSE_LIB_FILE         1019  /* can't close library file */
  211. #define HMERR_INVALID_LIB_FILE       1020  /* improper library file given */
  212. #define HMERR_MEMORY_ERROR           1021  /* out of memory */
  213. #define HMERR_PANEL_NOT_FOUND        1022  /* can't find requested panel */
  214.                                            /* or it cannot be loaded   */
  215. #define HMERR_RES_FILE_NOT_FOUND     1024  /* the UID file cannot be found */
  216. #define HMERR_CLASS_REGISTER_FAIL    1025  /* error Registering IPF Class  */
  217. #define HMERR_FONTSET_CREATION_FAIL  1026  /* error creating fonts */
  218. #define HMERR_FREE_MEMORY            1027  /* error freeing memory */  
  219.  
  220. #define HMERR_OPEN_COPY_FILE         1031  /* error opening file for copy */
  221. #define HMERR_READ_APPEND_FILE       1032  /* error reading file for append */
  222. #define HMERR_WRITE_COPY_FILE        1033  /* error copying to file */
  223. #define HMERR_INVALID_RES_FILE       1034  /* Resource file is not valid */ 
  224.  
  225. /*************************************************************************/
  226. /* error codes returned by DDF API functions                             */
  227. /*************************************************************************/
  228. #define HMERR_DDF_MEMORY             2001  /* Not enough memory */
  229. #define HMERR_DDF_ALIGN_TYPE         2002  /* Invalid alignment type */
  230. #define HMERR_DDF_BACKCOLOR          2003  /* Invalid background color */
  231. #define HMERR_DDF_FORECOLOR          2004  /* Invalid foreground color */
  232. #define HMERR_DDF_FONTSTYLE          2005  /* Invalid font style */
  233. #define HMERR_DDF_REFTYPE            2006  /* Invalid hyper text type */
  234. #define HMERR_DDF_LIST_UNCLOSED      2007  /* List definition is not closed */
  235. #define HMERR_DDF_LIST_UNINITIALIZED 2008  /* List definition is not ready */
  236. #define HMERR_DDF_LIST_BREAKTYPE     2009  /* Invalid break type of list def */
  237. #define HMERR_DDF_LIST_SPACING       2010  /* Invalid space type of list def */
  238. #define HMERR_DDF_HINSTANCE          2011  /* Invalid help instance handle */
  239. #define HMERR_DDF_EXCEED_MAX_LENGTH  2012  /* Buffer length is too large */
  240. #define HMERR_DDF_EXCEED_MAX_INC     2013  /* Increment length is too large */
  241. #define HMERR_DDF_INVALID_DDF        2014  /* Invalid DDF handle */
  242. #define HMERR_DDF_FORMAT_TYPE        2015  /* Invalid format type */
  243. #define HMERR_DDF_INVALID_PARM       2016  /* Invalid parameter */
  244. #define HMERR_DDF_BITMAP             2017  /* Invalid bitmap handle */
  245. #define HMERR_DDF_MAX_DDF_FONTS      2018  /* DDF fonts are too many */
  246.  
  247.  
  248. /**************************************************************************/
  249. /* Help API declarations                                                  */
  250. /**************************************************************************/
  251.  
  252. long FAR PASCAL XhDestroyHelpInstance  ( HWND wndHelpInstance);
  253. long FAR PASCAL XhCreateHelpInstance   ( HWND wndtAppl, PHELPINIT pHelpInit,
  254.                                          HWND * wndHelpInstance);
  255. long FAR PASCAL XhAssociateHelpInstance( HWND wndHelpInstance, HWND wndtAppl);
  256. long FAR PASCAL XhQueryHelpInstance    ( HWND wndtAppl, HWND * wndHelpInstance);
  257. long FAR PASCAL XhCallIPF              ( HWND wndHelpInstance,
  258.                                          unsigned short usMsgType, 
  259.                                          void FAR * param1, void FAR * param2);
  260. long FAR PASCAL XhCreateHelpTable      ( HWND wndHelpInstance,
  261.                                          PHELPTABLE pHelpTable);
  262. long FAR PASCAL XhLoadHelpTable        ( HWND wndHelpInstance,
  263.                                          unsigned short usHelpTableId,
  264.                                          HMODULE hHelpModule);
  265.  
  266.  
  267. /**************************************************************************/
  268. /* AC Viewport stucture definitions                                       */
  269. /**************************************************************************/
  270. typedef struct _ACVP        /* acvp */
  271. {
  272.    unsigned long  cb;                 /* size of the structure */
  273.    unsigned long  ObjectID;           /* object identifier */
  274.    HWND           wgtParent;          /* IPF viewport handle */
  275.    HWND           wgtOwner;           /* IPF main window handle */
  276.    HWND           wgtACVP;            /* applications window hwnd */
  277. } ACVP, far *PACVP;
  278.  
  279. /**************************************************************************/
  280. /* DDF defines and prototypes                                             */
  281. /**************************************************************************/
  282. #ifndef PMDDF_H
  283.    #define PMDDF_H
  284. #endif
  285.  
  286. /*************************************************************************/
  287. /* Define Handle to DDF                                                  */
  288. /*************************************************************************/
  289. typedef void *HDDF;
  290.  
  291. /* DdfHyperText Flags */
  292. #define REFERENCE_BY_ID     0L
  293. #define REFERENCE_BY_RES    1L
  294.  
  295. /* DdfBeginList formatting flags */
  296. #define HMBT_NONE           1L
  297. #define HMBT_ALL            2L
  298. #define HMBT_FIT            3L
  299.  
  300. #define HMLS_SINGLELINE     1L
  301. #define HMLS_DOUBLELINE     2L
  302.  
  303. /* DdfBitmap alignment flags */
  304. #define ART_RUNIN           0x10L
  305. #define ART_LEFT            0x01L
  306. #define ART_RIGHT           0x02L
  307. #define ART_CENTER          0x04L
  308.  
  309. /* DdfSetTextAlign align flags */
  310. #define ALIGN_LEFT     0x01L
  311. #define ALIGN_RIGHT    0x02L
  312. #define ALIGN_CENTER   0x04L
  313.  
  314. /* DdfSetFontStyle font style flags */
  315. #define FM_SEL_ITALIC       0x01L
  316. #define FM_SEL_BOLD         0x02L
  317. #define FM_SEL_UNDERSCORE   0x04L
  318.  
  319. /* DdfSetColor Color Flag */
  320. #define CLR_UNCHANGED     -6
  321. #define CLR_DEFAULT       -1
  322. #define CLR_WHITE         0
  323. #define CLR_BLUE          1
  324. #define CLR_RED           2
  325. #define CLR_PINK          3
  326. #define CLR_GREEN         4
  327. #define CLR_CYAN          5
  328. #define CLR_YELLOW        6
  329. #define CLR_BROWN         7
  330. #define CLR_DARKGRAY      8
  331. #define CLR_DARKBLUE      9
  332. #define CLR_DARKRED      10
  333. #define CLR_DARKPINK     11
  334. #define CLR_DARKGREEN    12
  335. #define CLR_DARKCYAN     13
  336. #define CLR_BLACK        14
  337. #define CLR_PALEGRAY     15
  338.  
  339.  
  340. /*************************************************************************/
  341. /* DDF API declarations.                                                 */
  342. /*************************************************************************/
  343.  
  344. HDDF           FAR PASCAL   DdfInitialize   (HWND hwndHelpInstance,
  345.                                              unsigned long cbBuffer,
  346.                                              unsigned long ulIncrement);
  347.  
  348. unsigned short FAR PASCAL   DdfPara         (HDDF hDdf);
  349.  
  350. unsigned short FAR PASCAL   DdfSetFormat    (HDDF hDdf,
  351.                                              unsigned long fFormatType);
  352.  
  353. unsigned short FAR PASCAL   DdfSetTextAlign (HDDF hDdf,
  354.                                              unsigned long fAlign);
  355.  
  356. unsigned short FAR PASCAL   DdfSetColor     (HDDF hDdf,
  357.                                              unsigned long fBackColor,
  358.                                              unsigned long fForColor);
  359.  
  360. unsigned short FAR PASCAL   DdfInform       (HDDF hDdf, LPSTR pszText,
  361.                                              unsigned long resInformNumber);
  362.  
  363. unsigned short FAR PASCAL   DdfSetFontStyle (HDDF hDdf,
  364.                                              unsigned long fFontStyle);
  365.  
  366. unsigned short FAR PASCAL   DdfHyperText    (HDDF hDdf, LPSTR pszText,
  367.                                              LPSTR pszReference,
  368.                                              unsigned long fReferenceType);
  369.  
  370. unsigned short FAR PASCAL   DdfBeginList    (HDDF hDdf,
  371.                                              unsigned long ulWidthDT,
  372.                                              unsigned long fBreakType,
  373.                                              unsigned long fSpacing);
  374.  
  375. unsigned short FAR PASCAL   DdfListItem     (HDDF hDdf, LPSTR pszTerm,
  376.                                              LPSTR pszDescription); 
  377.  
  378. unsigned short FAR PASCAL   DdfEndList      (HDDF hDdf);
  379.  
  380. unsigned short FAR PASCAL   DdfText         (HDDF hDdf, LPSTR pszText);
  381.  
  382. unsigned short FAR PASCAL   DdfSetFont      (HDDF hDdf, LPSTR pszFaceName,
  383.                                              unsigned long ulWidth,
  384.                                              unsigned long ulHeight);
  385.  
  386. unsigned short FAR PASCAL   DdfBitmap       (HDDF hDdf, HBITMAP hbm,
  387.                                              unsigned long fAlign);
  388.  
  389. #ifdef __cplusplus
  390. }
  391. #endif    /* __cplusplus */
  392.  
  393. #endif  /* _IPFX_H */
  394.  
  395.