home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ihelp.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  7.0 KB  |  210 lines

  1. #ifndef _IHELP_
  2. #define _IHELP_
  3. /*******************************************************************************
  4. * FILE NAME: ihelp.hpp                                                         *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IHelpWindow                                                              *
  9. *     IHelpWindow::Settings                                                    *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   IBM Open Class Library                                                     *
  13. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  14. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #include <iwindow.hpp>
  20. #include <ibitflag.hpp>
  21. #include <istring.hpp>
  22.  
  23. class IEvent;
  24. class IFrameWindow;
  25. class IHelpSettingsData;
  26. class IHelpWindowData;
  27. class IPoint;
  28. class IRectangle;
  29. class IResourceId;
  30. class ISize;
  31. class IWindowHandle;
  32.  
  33. #pragma pack(4)
  34.  
  35. class IHelpWindow : public IWindow {
  36. typedef IWindow
  37.   Inherited;
  38. public:
  39. class Settings;
  40. class Style;
  41. /*------------------------------- Constructors -------------------------------*/
  42.   IHelpWindow ( IFrameWindow*             associatedWindow = 0,
  43.                 const IHelpWindow::Style& style = defaultStyle() );
  44.  
  45.   IHelpWindow ( const IResourceId&        helpTable,
  46.                 IFrameWindow*             associatedWindow,
  47.                 const IHelpWindow::Style& style = defaultStyle() );
  48.  
  49.   IHelpWindow ( const Settings&           settings,
  50.                 IFrameWindow*             associatedWindow = 0,
  51.                 const IHelpWindow::Style& style = defaultStyle() );
  52.  
  53.   IHelpWindow ( const IWindowHandle& helpWindowHandle );
  54.  
  55. virtual
  56.  ~IHelpWindow ( );
  57.  
  58. /*---------------------------------- Styles ----------------------------------*/
  59. INESTEDBITFLAGCLASSDEF0(Style, IHelpWindow);
  60. static const Style
  61.   IC_IMPORTU noStyle,
  62.   IC_IMPORTU classDefaultStyle,
  63.   IC_IMPORTU ipfCompatible;
  64.  
  65. static Style
  66.   defaultStyle      ( );
  67.  
  68. static void
  69.   setDefaultStyle   ( const Style&    style );
  70.  
  71. /*-------------------------------- Attributes --------------------------------*/
  72. Boolean
  73.   isIPFCompatible   ( ) const;
  74.  
  75. /*------------------------------ Settings -------------------------------*/
  76. class Settings : public IBase {
  77. typedef IBase
  78.   Inherited;
  79. public:
  80. /*---------------------------- Constructors -----------------------------*/
  81.   Settings ( );
  82.  
  83. /*-------------------------- Help Information ---------------------------*/
  84. Settings
  85.  &setHelpResLibrary ( const char*   helpTableResLibrary ),
  86.  &setHelpTable      ( unsigned long helpTable ),
  87.  &setLibraries      ( const char*   helpLibraryNames ),
  88. #ifndef IC_WIN_FLAGNOP
  89.  &setTutorial       ( const char*   tutorial ),
  90. #endif
  91.  &setUsingHelp      ( unsigned long panelId );
  92.  
  93. /*---------------------- Help Window Customization ----------------------*/
  94. Settings
  95.  &setAccelerator     ( unsigned long      acceleratorId ),
  96.  &setAccelResLibrary ( const char*        menuAccelResLibrary ),
  97.  &setMenuBar         ( unsigned long      menuBarId ),
  98.  &setTitle           ( const char*        titleText ),
  99.  &setTitle           ( const IResourceId& titleId );
  100.  
  101. private:
  102. /*------------------------------- Private -------------------------------*/
  103. friend class IHelpWindow;
  104.  
  105. IString
  106.   title,
  107.   tutorial,
  108.   helpLibraries,
  109.   HTResLib,
  110.   MAResLib;
  111.  
  112. unsigned long
  113.   usingHelpId,
  114.   helpTableId,
  115.   menuBarId,
  116.   acceleratorId;
  117.  
  118. IHelpSettingsData
  119.  *pHelpSettings;
  120. };  // IHelpWindow::Settings
  121.  
  122. /*--------------------------- Application Windows ----------------------------*/
  123. virtual IHelpWindow
  124.  &setActiveWindow     ( IFrameWindow* activeWindow,
  125.                         IFrameWindow* relativeWindow = 0 ),
  126.  &setAssociatedWindow ( IFrameWindow* associatedWindow );
  127.  
  128. /*------------------------------- Enumerations -------------------------------*/
  129. enum HelpType {
  130.   index,
  131.   general,
  132.   contents,
  133.   keys,
  134.   usingHelp
  135. #if (IC_OBSOLETE <= IC_OBSOLETE_2)
  136.  ,using=usingHelp
  137. #endif
  138. }; // HelpType
  139.  
  140. /*------------------------------- Help Panels --------------------------------*/
  141. virtual IHelpWindow
  142.  &addLibraries ( const char*        helpLibraryNames ),
  143.  &hide         ( ),
  144.  &setHelpTable ( const IResourceId& helpTable ),
  145.  &setUsingHelp ( unsigned long      panelId ),
  146.  &show         ( HelpType           helpType ),
  147.  &show         ( const IResourceId& panelId ),
  148.  &show         ( const char*        panelName );
  149.  
  150. /*-------------------------------- Title Text --------------------------------*/
  151. virtual IHelpWindow
  152.  &setTitle ( const char*        titleText ),
  153.  &setTitle ( const IResourceId& titleId );
  154.  
  155. /*----------------------------- Window Accessing -----------------------------*/
  156. IWindowHandle
  157.   communicationWindow ( ) const,
  158.   contentsWindow      ( ) const,
  159.   coverPageWindow     ( ) const,
  160.   indexWindow         ( ) const,
  161.   searchListWindow    ( ) const,
  162.   viewedPagesWindow   ( ) const;
  163. virtual IWindowHandle
  164.   handle              ( ) const;
  165. static IHelpWindow
  166.  *helpWindow          ( const IWindow* window );
  167.  
  168. /*---------------------------- Panel Identifiers -----------------------------*/
  169. virtual IHelpWindow
  170.  &hidePanelIds ( ),
  171.  &showPanelIds ( Boolean visibleId = true );
  172.  
  173. /*---------------------------- Window Positioning ----------------------------*/
  174. virtual IHelpWindow
  175.  &sizeTo     ( const ISize&      size ),
  176.  &moveTo     ( const IPoint&     point ),
  177.  &moveSizeTo ( const IRectangle& rectangle );
  178.  
  179. /*------------------------ Sending and Posting Events ------------------------*/
  180. virtual IEventResult
  181.   sendEvent ( EventType               eventType,
  182.               const IEventParameter1& parm1 = 0,
  183.               const IEventParameter2& parm2 = 0 ) const,
  184.   sendEvent ( unsigned long           eventId,
  185.               const IEventParameter1& parm1 = 0,
  186.               const IEventParameter2& parm2 = 0 ) const,
  187.   sendEvent ( const IEvent&           event ) const;
  188.  
  189. private:
  190. /*------------------------------ Hidden Members ------------------------------*/
  191.   IHelpWindow ( const IHelpWindow& helpWindow );
  192. IHelpWindow
  193.  &operator=   ( const IHelpWindow& helpWindow );
  194. IHelpWindow
  195.  &show        ( Boolean            show = true );
  196.  
  197. /*--------------------------------- Private ----------------------------------*/
  198. IHelpWindowData
  199.  *fHelpWindowData;
  200. static Style
  201.   currentDefaultStyle;
  202.  
  203. }; // IHelpWindow
  204.  
  205. #pragma pack()
  206.  
  207.   #include <ihelp.inl>
  208.  
  209. #endif /* _IHELP_ */
  210.