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

  1. #ifndef _ITEXTCTL_
  2.   #define _ITEXTCTL_
  3. /*******************************************************************************
  4. * FILE NAME: itextctl.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ITextControl - This is an abstract base class for all text control       *
  9. *                    window classes.                                           *
  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 disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _ICONTROL_
  20.   #include <icontrol.hpp>
  21. #endif
  22.  
  23. /*----------------------------------------------------------------------------*/
  24. /* Align classes on four byte boundary.                                       */
  25. /*----------------------------------------------------------------------------*/
  26. #pragma pack(4)
  27.  
  28. // Forward declarations for other classes:
  29. class IResourceId;
  30. class ISize;
  31. class IString;
  32.  
  33.  
  34. class ITextControl : public IControl {
  35. typedef IControl
  36.   Inherited;
  37. /*******************************************************************************
  38. * The ITextControl class is an abstract base class for all text control        *
  39. * window classes.  It provides operations to manipulate text strings.          *
  40. *******************************************************************************/
  41. public:
  42. /*-------------------------- Constructor/Destructor ----------------------------
  43. | An instance of this class cannot be constructed.                             |
  44. ------------------------------------------------------------------------------*/
  45.   ITextControl           ( );
  46. virtual
  47.  ~ITextControl           ( );
  48.  
  49. /*-------------------------------- Accessors -----------------------------------
  50. | These functions provide a means of getting and setting the accessible        |
  51. | attributes of instances of this class:                                       |
  52. |  setText    - Sets the control window text.                                  |
  53. |  text       - Returns the control window text.                               |
  54. |  textLength - Returns the current length of the control window text, in      |
  55. |               bytes.                                                         |
  56. ------------------------------------------------------------------------------*/
  57. virtual ITextControl
  58.  &setText                ( const char* text ),
  59.  &setText                ( const IResourceId& text );
  60.  
  61. virtual IString
  62.   text                   ( ) const;
  63.  
  64. virtual unsigned long
  65.   textLength             ( ) const;
  66.  
  67. /*--------------------------- Clipboard Operations -----------------------------
  68. |  clipboardHasTextFormat - Queries whether the clipboard is in text format.   |
  69. ------------------------------------------------------------------------------*/
  70. Boolean
  71.   clipboardHasTextFormat ( ) const;
  72.  
  73. /*----------------------------- Window Painting --------------------------------
  74. | This function provides a means of updating the window:                       |
  75. |  displaySize - Returns the width and height of the rectangle that encloses   |
  76. |                the string when it is displayed on the window's presentation  |
  77. |                space.  This function takes into account the font attribute   |
  78. |                of the presentation space, including a sheared or rotated     |
  79. |                string.  This function also supports double-byte character    |
  80. |                set (DBCS) characters.                                        |
  81. |                                                                              |
  82. |                If a string is not given, the control's text rectangle size   |
  83. |                is returned.                                                  |
  84. ------------------------------------------------------------------------------*/
  85. ISize
  86.   displaySize            ( const char* text = 0 ) const;
  87.  
  88. /*-------------------------------- Overrides -----------------------------------
  89. | This class overrides the following protected function:                       |
  90. |   setLayoutDistorted - Treats a font change like a minimum size change.      |
  91. ------------------------------------------------------------------------------*/
  92. virtual ITextControl
  93.  &setLayoutDistorted     ( unsigned long layoutAttributeOn,
  94.                            unsigned long layoutAttributeOff );
  95.  
  96. private:
  97. /*--------------------------------- Private ----------------------------------*/
  98.   ITextControl           ( const ITextControl& );
  99. ITextControl
  100.  &operator=              ( const ITextControl& );
  101. }; // class ITextControl
  102.  
  103. /*----------------------------------------------------------------------------*/
  104. /* Resume compiler default packing.                                           */
  105. /*----------------------------------------------------------------------------*/
  106. #pragma pack()
  107.  
  108. #endif  // _ITEXTCTL_
  109.