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

  1. #ifndef _IDMRENDR_
  2. #define _IDMRENDR_
  3. /*******************************************************************************
  4. * FILE NAME: idmrendr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IDMRenderer - Direct manipulation renderer common base class, or base    *
  9. *                   class.  Objects of this class render items during a        *
  10. *                   direct manipulation operation.                             *
  11. *                                                                              *
  12. * COPYRIGHT:                                                                   *
  13. *   Licensed Materials - Property of IBM                                       *
  14. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  15. *   All Rights Reserved                                                        *
  16. *   US Government Users Restricted Rights - Use, duplication, or               *
  17. *   disclosure                                                                 *
  18. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  19. *                                                                              *
  20. *******************************************************************************/
  21. #ifndef _IVBASE_
  22.   #include <ivbase.hpp>
  23. #endif
  24.  
  25. #ifndef _ISTRING_
  26.   #include <istring.hpp>
  27. #endif
  28.  
  29. /*----------------------------------------------------------------------------*/
  30. /* Align classes on four byte boundary.                                       */
  31. /*----------------------------------------------------------------------------*/
  32. #pragma pack(4)
  33.  
  34. /* Forward Declarations */
  35.  
  36.  
  37. class IDMRenderer : public IVBase {
  38. typedef IVBase
  39.   Inherited;
  40. /*******************************************************************************
  41. * The IDMRenderer class is the common base class, or abstract class, for the   *
  42. * direct manipulation source and target renderer classes.                      *
  43. *                                                                              *
  44. * Objects of this class render items during a direct manipulation operation.   *
  45. * Rendering is essentially the transfer or recreation of the dragged object    *
  46. * from the source window to the target window.                                 *
  47. *                                                                              *
  48. * The IDMRenderer class defines the common protocol for both source and target *
  49. * renderers.  The derived classes, IDMSourceRenderer and IDMTargetRenderer     *
  50. * define the specific protocol for source renderers and target renderers,      *
  51. * renderers, respectively.                                                     *
  52. *                                                                              *
  53. * A generic renderer object possesses the following attributes:                *
  54. *   o A set of supported types of drag items that this renderer can work with. *
  55. *     An example of a drag item type is a string.                              *
  56. *   o A set of supported rendering mechanisms and formats (RMFs).  These       *
  57. *     rendering mechanisms and formats describe the various means this         *
  58. *     renderer can use to transfer the dragged object.  An example of a        *
  59. *     rendering mechanism is IDM::rmFile, and an example of a rendering        *
  60. *     IDM::rfText (See IDMCOMM.HPP for the definitions of other RMFs).         *
  61. *                                                                              *
  62. * Two basic categories of operations can be performed on objects of this       *
  63. * class:                                                                       *
  64. *   o Queries to see if the renderer can render a given item.                  *
  65. *   o Requests to perform one of the basic rendering processes.                *
  66. *******************************************************************************/
  67. public:
  68.  
  69. /*------------------------ Constructor/Destructor ------------------------------
  70. | Objects of this class are constructed in the following manner:               |
  71. |   o By providing rmfs and types which indicates which drag item can be       |
  72. |     rendered by this renderer.                                               |
  73. |   o No arguments.                                                            |
  74. ------------------------------------------------------------------------------*/
  75.   IDMRenderer     ( const char *rmfs, const char *types );
  76.  
  77.   IDMRenderer     ( );
  78.  
  79. virtual
  80.   ~IDMRenderer    ( );
  81.  
  82. /*------------------------- Supported Types and RMFs ---------------------------
  83. | The following functions return and set the rendering types, mechanisms, and  |
  84. | formats supported by an IDMRenderer object:                                  |
  85. |   supportedTypes           - Returns the types of items supported by the     |
  86. |                              renderer.                                       |
  87. |   supportedRMFs            - Returns the rendering mechanisms and formats    |
  88. |                              supported by this renderer.                     |
  89. |   setSupportedTypes        - Sets the types of items supported by the        |
  90. |                              renderer.                                       |
  91. |   setSupportedRMFs         - Sets the rendering mechanisms and formats       |
  92. |                              supported by this renderer.                     |
  93. ------------------------------------------------------------------------------*/
  94. virtual IString
  95.   supportedTypes              ( ) const,
  96.   supportedRMFs               ( ) const;
  97.  
  98. virtual IDMRenderer
  99.  &setSupportedTypes           ( const char *types ),
  100.  &setSupportedRMFs            ( const char *rmfs );
  101.  
  102. /*---------------------------- Default Renderers -------------------------------
  103. | These functions maintain default source/target renderers that are added      |
  104. | automatically to newly created source/target handlers:                       |
  105. |   defaultSourceRenderer    - Returns the default source renderer; an         |
  106. |                              instance of class IDMSourceRenderer unless      |
  107. |                              the default has been set otherwise.             |
  108. |   setDefaultSourceRenderer - Sets the default source renderer.               |
  109. |   defaultTargetRenderer    - Returns the default target renderer; an         |
  110. |                              instance of class IDMTargetRenderer unless      |
  111. |                              the default has been set otherwise.             |
  112. |   setDefaultTargetRenderer - Sets the default target renderer.               |
  113. ------------------------------------------------------------------------------*/
  114. static IDMSourceRenderer
  115.  &defaultSourceRenderer ( );
  116.  
  117. static IDMTargetRenderer
  118.  &defaultTargetRenderer ( );
  119.  
  120. static void
  121.   setDefaultSourceRenderer ( IDMSourceRenderer &sourceRenderer ),
  122.   setDefaultTargetRenderer ( IDMTargetRenderer &targetRenderer );
  123.  
  124. protected:
  125. private: /*------------------------ PRIVATE ----------------------------------*/
  126. IString
  127.   strTypes,
  128.   strRMFs;
  129. static IDMSourceRenderer
  130.  *pSource;
  131. static IDMTargetRenderer
  132.  *pTarget;
  133. }; // class IDMRenderer
  134.  
  135. /*----------------------------------------------------------------------------*/
  136. /* Resume compiler default packing.                                           */
  137. /*----------------------------------------------------------------------------*/
  138. #pragma pack()
  139.  
  140. #endif // _IDMRENDR_
  141.