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

  1. #ifndef _ICNRDIEV_
  2. #define _ICNRDIEV_
  3. /*******************************************************************************
  4. * FILE NAME: icnrdiev.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     ICnrDrawItemEvent                                                        *
  9. *     ICnrDrawBackgroundEvent                                                  *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or               *
  16. *   disclosure                                                                 *
  17. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  18. *                                                                              *
  19. *******************************************************************************/
  20.  
  21. #ifndef _IDIEVT_
  22.   #include <idievt.hpp>
  23. #endif
  24.  
  25. /*----------------------------------------------------------------------------*/
  26. /* Align classes on four byte boundary.                                       */
  27. /*----------------------------------------------------------------------------*/
  28. #pragma pack(4)
  29.  
  30. // forward declares
  31. class IContainerObject;
  32. class IContainerControl;
  33. class IContainerColumn;
  34.  
  35. class ICnrDrawItemEvent : public IDrawItemEvent
  36. {
  37. typedef IDrawItemEvent
  38.   Inherited;
  39. /*******************************************************************************
  40. * The ICnrDrawItemEvent class provides the information necessary to draw       *
  41. * objects in the container.  This event will not be dispatched unless the:     *
  42. *   - IContainerControl::handleDrawItem style is set when the container is     *
  43. *     created, or                                                              *
  44. *   - IContainerControl::enableDrawItem function is called after construction. *
  45. *******************************************************************************/
  46. public:
  47. /*------------------------ Constructors ----------------------------------------
  48. | The only way to construct an instance of this class is from an instance of   |
  49. | the IEvent class.                                                            |
  50. ------------------------------------------------------------------------------*/
  51.   ICnrDrawItemEvent    ( IEvent& event);
  52.  ~ICnrDrawItemEvent    ( );
  53.  
  54. /*----------------------- Related Types  ---------------------------------------
  55. | The following type is used to identify the area where drawing occurs:        |
  56. |   ItemType  - The type of the item being drawn.  Valid values are:           |
  57. |       text         - The text in all views except the details view.          |
  58. |       icon         - An icon in the icon, name or tree view.                 |
  59. |       treeIcon     - An expanded or collapsed tree icon.                     |
  60. |       detailsView  - Any drawing in the details view.                        |
  61. |       title        - The container title.                                    |
  62. ------------------------------------------------------------------------------*/
  63. enum ItemType  {
  64.   text,
  65.   icon,
  66.   treeIcon,
  67.   detailsView,
  68.   title };
  69.  
  70. /*-------------------------- Accessors -----------------------------------------
  71. | These functions provide a means of getting the accessible attributes of      |
  72. | instances of this class:                                                     |
  73. |   container           - Returns the container being drawn.                   |
  74. |   object              - Returns the object in the container being drawn.     |
  75. |   column              - If an object being drawn is in the details view, the |
  76. |                         column is returned. If an object is not being drawn  |
  77. |                         or the view is other than a details view, 0 is       |
  78. |                         returned.                                            |
  79. |   itemType            - Returns the type of the item being drawn.            |
  80. |   itemPresSpaceHandle - Returns the item's presentation space.               |
  81. |   itemRect            - Returns the rectangle of the item's size.            |
  82. ------------------------------------------------------------------------------*/
  83. virtual IContainerObject
  84.  *object               ( ) const;
  85. virtual IContainerControl
  86.  *container            ( ) const;
  87. virtual IContainerColumn
  88.  *column               ( ) const;
  89. virtual ItemType
  90.   itemType             ( ) const;
  91.  
  92. virtual IPresSpaceHandle
  93.   itemPresSpaceHandle  ( ) const;
  94.  
  95. virtual IRectangle
  96.   itemRect             ( ) const;
  97.  
  98. };
  99.  
  100. class ICnrDrawBackgroundEvent : public IEvent
  101. {
  102. typedef IEvent
  103.   Inherited;
  104. /*******************************************************************************
  105. * The ICnrDrawBackgroundEvent class provides the information necessary to      *
  106. * draw objects in a container.  This event is not dispatched unless the:       *
  107. *    - IContainerControl::handleDrawItem style is set when the container is    *
  108. *      created, or                                                             *
  109. *    - IContainerControl::enableDrawItem function is called after construction.*
  110. *******************************************************************************/
  111. public:
  112. /*------------------------ Constructors ----------------------------------------
  113. | The only way to construct an instance of this class is from an instance of   |
  114. | the IEvent class.                                                            |
  115. ------------------------------------------------------------------------------*/
  116.   ICnrDrawBackgroundEvent  ( IEvent& event);
  117.  ~ICnrDrawBackgroundEvent  ( );
  118.  
  119. /*-------------------------- Accessors -----------------------------------------
  120. | These functions provide a means of getting the accessible attributes of      |
  121. | instances of this class:                                                     |
  122. |   container           - Returns the container being drawn.                   |
  123. |   itemPresSpaceHandle - Returns the item's presentation space handle.        |
  124. |   itemId              - Returns the item's ID.                               |
  125. |   itemRect            - Returns the rectangle of the item.                   |
  126. ------------------------------------------------------------------------------*/
  127. virtual IContainerControl
  128.  *container            ( ) const;
  129.  
  130. virtual IPresSpaceHandle
  131.   itemPresSpaceHandle  ( ) const;
  132.  
  133. virtual unsigned long
  134.   itemId               ( ) const;
  135.  
  136. virtual IRectangle
  137.   itemRect             ( ) const;
  138.  
  139. };
  140.  
  141. /*----------------------------------------------------------------------------*/
  142. /* Resume compiler default packing.                                           */
  143. /*----------------------------------------------------------------------------*/
  144. #pragma pack()
  145.  
  146. #endif // _ICNRDIEV_
  147.