home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ifonthdr.hp_ / IFONTHDR.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  5.4 KB  |  98 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. *$Log:   R:/IBMCLASS/IBASEAPP/VCS/IFONTHDR.HPV  $                                                                         *
  17. //
  18. //   Rev 1.1   25 Oct 1992 16:57:10   nunn
  19. //changed library name to ICLUI
  20. //
  21. //   Rev 1.0   24 Oct 1992 17:37:12   tsuji
  22. //Initial revision.
  23. *******************************************************************************/
  24. #ifndef _IHANDLER_
  25.   #include <ihandler.hpp>
  26. #endif
  27. #ifndef _IHANDLE_
  28.   #include <ihandle.hpp>
  29. #endif
  30.  
  31. // Forward declarations for other classes:
  32. class IFontHandler;
  33. class IEvent;
  34.  
  35. class IFontHandler : public IHandler
  36. /*******************************************************************************
  37. * This class handles the various messages that affect the font dialog.         *
  38. *                                                                              *
  39. * To use it, you must call the enableCustomProc method on the font package,    *
  40. * then use the second constructor of the font dialog, add your instance of     *
  41. * the font handler, and, finally, call showDialog to begin the font dialog.    *
  42. *                                                                              *
  43. * EXAMPLE:                                                                     *
  44. *    IFontPkg fntp;                                                            *
  45. *    fntp.enableCustomProc();                                                  *
  46. *    IFontDialog* fntd =                                                       *
  47. *       new IFontDialog((IWindow*)0, (IWindow*)pwin, fntp, IResourceId(0));    *
  48. *    MyFontHandler mfh;                                                        *
  49. *    mfh->enable();                                                            *
  50. *    fntd->addHandler(mfh);                                                    *
  51. *    fntd->showDialog();                                                       *
  52. *                                                                              *
  53. *******************************************************************************/
  54. {
  55. public:
  56. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  57. | There is 1 way to construct an instance of this class:                       |
  58. |   1. default                                                                 |
  59. |      Constructs a font handler.                                              |
  60. ------------------------------------------------------------------------------*/
  61.    IFontHandler() {;}
  62.  
  63. /*---------------------------- DISPATCH EVENTS ---------------------------------
  64. | This method determines if the event is one of the font dialog events and,    |
  65. | if so, calls the appropriate method.                                         |
  66. |    dispatchHandlerEvent - Checks for font dialog events.                     |
  67. ------------------------------------------------------------------------------*/
  68. Boolean
  69.    dispatchHandlerEvent(IEvent& evt);
  70.  
  71. protected:
  72. /*------------------------ FONT DIALOG EVENTS ----------------------------------
  73. | These functions are called when a font dialog event occurs.  Override these  |
  74. | to provide your own processing.    .                                         |
  75. |    faceNameChanged - A new face name was selected in the dialog.             |
  76. |    filterFontName - Allows you to screen out a font name from the combo box  |
  77. |    filterStyle - Allows you to screen out a style from the combo box         |
  78. |    filterPointSize - Allows you to screen out a point size from the combo box|
  79. |    pointSizeChanged - A new point size was selected in the dialog.           |
  80. |    styleChanged - A new style was selected in the dialog.                    |
  81. |    updatePreviewArea - The preview area needs to be repainted.               |
  82. ------------------------------------------------------------------------------*/
  83. virtual Boolean
  84.    faceNameChanged     (char* pszNewFaceName),
  85.    filterFontName      (char* pszFontName,
  86.                         unsigned long ulFontType),
  87.    filterStyle         (char* pszStyle,
  88.                         unsigned long ulFontType),
  89.    filterPointSize     (char* pszPointSize,
  90.                         unsigned long ulFontType),
  91.    pointSizeChanged    (char* pszPointSize),
  92.    styleChanged        (void* pvStyleInfo),
  93.    updatePreviewArea   (IWindowHandle whPreviewArea);
  94.  
  95. };
  96.  
  97. #endif /* IFONTHDR */
  98.