home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IFONTHDR.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  6KB  |  95 lines

  1. #ifndef _IFONTHDR_
  2. #define _IFONTHDR_
  3. /*******************************************************************************
  4. * FILE NAME: IFONTHDR.HPP                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IFontPkg - Package of font information for the font dialog.              *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   (C) Copyright IBM Corporation 1992                                         *
  12. *   All Rights Reserved                                                        *
  13. *   Licensed Materials * Property of IBM                                       *
  14. *                                                                              *
  15. * HISTORY:                                                                     *
  16. *******************************************************************************/
  17. #ifndef _IHANDLER_
  18.   #include <ihandler.hpp>
  19. #endif
  20. #ifndef _IHANDLE_
  21.   #include <ihandle.hpp>
  22. #endif
  23.  
  24. /*----------------------------------------------------------------------------*/
  25. /* Align classes on four byte boundary.                                       */
  26. /*----------------------------------------------------------------------------*/
  27. #pragma pack(4)
  28.  
  29. // Forward declarations for other classes:
  30. class IEvent;
  31. class IFontDialog;
  32.  
  33. class IFontDialogHandler : public IHandler {
  34. /*******************************************************************************
  35. * The IFontDialogHandler class handles the various messages that affect the    *
  36. * font dialog.                                                                 *
  37. *                                                                              *
  38. * To use it, you must create a handler derived from IFontDialogHandler.  This  *
  39. * handler must then be attached to an instance of an IFontDialog.  To add a    *
  40. * handler to a modal IFontDialog, you must pass a pointer to the handler on    *
  41. * the IFontDialog constructor.                                                 *
  42. *                                                                              *
  43. * Example:                                                                     *
  44. *    // Attaching a handler to a modeless dialog                               *
  45. *    MyFontHandler mfh;                                                        *
  46. *    IFontDialog* fntd =                                                       *
  47. *       new IFontDialog(desktopWindow(), pwin, IFontDialog::modeless);         *
  48. *    mfh->handleEventsFor(fntd);                                               *
  49. *                                                                              *
  50. *                                                                              *
  51. *******************************************************************************/
  52. public:
  53. /*------------------------ Constructor/Destructor ------------------------------
  54. | The only way to construct an instance of this class is by using the          |
  55. | default constructor.                                                         |
  56. ------------------------------------------------------------------------------*/
  57.    IFontDialogHandler();
  58.    ~IFontDialogHandler();
  59.  
  60. protected:
  61. /*---------------------------- Dispatch Events ---------------------------------
  62. | This method determines if the event is one of the font dialog events. If it  |
  63. | is, it calls the appropriate method.                                         |
  64. |    dispatchHandlerEvent - Checks for font dialog events.                     |
  65. ------------------------------------------------------------------------------*/
  66. virtual Boolean
  67.    dispatchHandlerEvent(IEvent& evt);
  68.  
  69. /*------------------------ Font Dialog Dismissal -------------------------------
  70. | This function is called when a font dialog is dismissed. You should override |
  71. | so that you get can the dialog results.                                      |
  72. |    modelessResults - Called when a modeless dialog is dismissed.  This       |
  73. |                      function is called even if the dialog is cancelled.     |
  74. |                      This is done so that you can destroy the IFontDialog    |
  75. |                      if needed.  Use IFontDialog::pressedOK to determine     |
  76. |                      whether the user dismissed the dialog by pressing the   |
  77. |                      OK push button.                                         |
  78. |                                                                              |
  79. |                      If you need to destroy the IFontDialog object, do not   |
  80. |                      delete the IFontDialog* pointer from within             |
  81. |                      modelessResults.  Instead, call                         |
  82. |                      endingDialog->setAutoDeleteObject().                    |
  83. ------------------------------------------------------------------------------*/
  84. virtual Boolean
  85.    modelessResults     (IFontDialog* endingDialog);
  86.  
  87. };
  88.  
  89. /*----------------------------------------------------------------------------*/
  90. /* Resume compiler default packing.                                           */
  91. /*----------------------------------------------------------------------------*/
  92. #pragma pack()
  93.  
  94. #endif /* IFONTHDR */
  95.