home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / imcelcv.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.9 KB  |  175 lines

  1. #ifndef _IMCELCV_
  2.   #define _IMCELCV_
  3. /*******************************************************************************
  4. * FILE NAME: imcelcv.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IMultiCellCanvas                                                         *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <icanvas.hpp>
  19. #include <irect.hpp>
  20.  
  21. class IColor;
  22. class IMCCvCell;
  23. class IMultiCellCanvasData;
  24. class IRCHeader;
  25. class ISize;
  26.  
  27. #pragma pack(4)
  28.  
  29. class IMultiCellCanvas : public ICanvas {
  30. typedef ICanvas
  31.   Inherited;
  32. public:
  33. class Style;
  34.  
  35. /*------------------------------- Constructors -------------------------------*/
  36.   IMultiCellCanvas ( unsigned long     windowIdentifier,
  37.                      IWindow*          parent,
  38.                      IWindow*          owner,
  39.                      const IRectangle& initialSize = IRectangle(),
  40.                      const Style&      style = defaultStyle() );
  41.  
  42. virtual
  43.  ~IMultiCellCanvas ( );
  44.  
  45. /*---------------------------------- Styles ----------------------------------*/
  46. INESTEDBITFLAGCLASSDEF2(Style, IMultiCellCanvas, ICanvas, IWindow);
  47. static const Style
  48.   IC_IMPORTU classDefaultStyle,
  49.   IC_IMPORTU dragLines,
  50.   IC_IMPORTU gridLines;
  51. static Style
  52.   defaultStyle      ( );
  53. static void
  54.   setDefaultStyle   ( const Style&    style );
  55.  
  56. virtual unsigned long
  57.   convertToGUIStyle ( const IBitFlag& style,
  58.                       Boolean         extendedOnly = false ) const;
  59.  
  60.  
  61. /*------------------------------ Cell Contents -------------------------------*/
  62. virtual IMultiCellCanvas
  63.  &addToCell      ( IWindow*      childWindow,
  64.                    unsigned long startingColumn,
  65.                    unsigned long startingRow,
  66.                    unsigned long numberOfColumns = 1,
  67.                    unsigned long numberOfRows = 1 );
  68. virtual IWindow
  69.  *removeFromCell ( IWindow*      childWindow ),
  70.  *removeFromCell ( unsigned long column,
  71.                    unsigned long row );
  72. virtual IWindow
  73.  *windowInCell   ( unsigned long startingColumn,
  74.                    unsigned long startingRow ) const;
  75.  
  76. /*-------------------------- Row and Column Sizing ---------------------------*/
  77. virtual IMultiCellCanvas
  78.  &setColumnWidth     ( unsigned long column,
  79.                        unsigned long widthInPixels,
  80.                        Boolean       expandable = false ),
  81.  &setRowHeight       ( unsigned long row,
  82.                        unsigned long heightInPixels,
  83.                        Boolean       expandable = false );
  84. unsigned long
  85.   columnWidth        ( unsigned long column ) const,
  86.   rowHeight          ( unsigned long row    ) const;
  87.  
  88. Boolean
  89.   isColumnExpandable ( unsigned long column ) const,
  90.   isRowExpandable    ( unsigned long row    ) const;
  91.  
  92. static void
  93.   setDefaultCell     ( const ISize&  widthAndHeight );
  94.  
  95. static ISize
  96.   defaultCell        ( );
  97.  
  98. /*--------------------------- Grid and Drag Lines ----------------------------*/
  99. Boolean
  100.   hasDragLines     ( ) const,
  101.   hasGridLines     ( ) const;
  102.  
  103. virtual IMultiCellCanvas
  104.  &disableDragLines ( ),
  105.  &enableDragLines  ( Boolean enable = true ),
  106.  &disableGridLines ( ),
  107.  &enableGridLines  ( Boolean enable = true );
  108.  
  109. /*------------------------------ Layout Support ------------------------------*/
  110. virtual IMultiCellCanvas
  111.  &setLayoutDistorted ( unsigned long layoutAttributesOn,
  112.                        unsigned long layoutAttributesOff );
  113.  
  114. protected:
  115. /*------------------------------ Layout Support ------------------------------*/
  116. virtual IMultiCellCanvas
  117.  &layout ( );
  118.  
  119. private:
  120. /*------------------------------ Hidden Members ------------------------------*/
  121.   IMultiCellCanvas ( const IMultiCellCanvas& canvas );
  122. IMultiCellCanvas
  123.  &operator=        ( const IMultiCellCanvas& canvas );
  124.  
  125. /*--------------------------------- Private ----------------------------------*/
  126. friend class IMultiCellCanvasList;
  127. friend class IMultiCellCanvasHandler;
  128. friend class IRowColumnHeaderList;
  129.  
  130. IMultiCellCanvas
  131.  &pass1                   ( ),
  132.  &pass2                   ( ),
  133.  &pass3                   ( ),
  134.  &pass4                   ( ),
  135.  &computeExpandedRowsCols ( );
  136.  
  137. static Style
  138.   currentDefaultStyle;
  139.  
  140. static unsigned long
  141.   ulDefaultWidth,
  142.   ulDefaultHeight;
  143.  
  144. unsigned long
  145.   fMulti,
  146.   fExpand;
  147.  
  148.  
  149. IMultiCellCanvasList
  150.  *pCanvasList;
  151.  
  152. IRowColumnHeaderList
  153.  *pRowColHeaderList;
  154.  
  155. IMultiCellCanvasHandler
  156.  *pCanvasHandler;
  157.  
  158. friend Boolean IRowColHeaderInitializer ( IRCHeader* const& header,
  159.                                           void*             anything );
  160. friend Boolean IMultiCellCanvasDeleter  ( IMCCvCell* const& cell,
  161.                                           void*             anything );
  162. friend Boolean IRowColumnHeaderDeleter  ( IRCHeader* const& header,
  163.                                           void*             anything );
  164.  
  165. IMultiCellCanvasData
  166.  *fMultiCellCanvasData;
  167.  
  168. }; // IMultiCellCanvas
  169.  
  170. INESTEDBITFLAGCLASSFUNCS(Style, IMultiCellCanvas);
  171.  
  172. #pragma pack()
  173.  
  174. #endif /* _IMCELCV_ */
  175.