home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / wgridd.hpp < prev    next >
C/C++ Source or Header  |  1996-12-11  |  7KB  |  214 lines

  1. /*************************************************************************
  2.  *
  3.  * WGridData --
  4.  *
  5.  *
  6.  ************************************************************************/
  7.  
  8. #ifndef _WGRIDD_HPP_INLCLUDED
  9. #define _WGRIDD_HPP_INLCLUDED
  10.  
  11.  
  12. #include "wgriddr.hpp"
  13. #ifndef _WOBJECT_HPP_INCLUDED
  14. #  include "wobject.hpp"
  15. #endif
  16.  
  17. struct WGridDataRowTitle {
  18.     WString          title;
  19.     WULong           rowNumber;
  20. };
  21. extern template WArrayReference<WGridDataRowTitle>;
  22. extern template WArray<WGridDataRowTitle>;
  23. typedef WArray<WGridDataRowTitle> WGridDataRowTitleArray;
  24.  
  25. struct WGridDataColumnTitle {
  26.     WString          title;
  27.     WULong           columnNumber;
  28. };
  29. extern template WArrayReference<WGridDataColumnTitle>;
  30. extern template WArray<WGridDataColumnTitle>;
  31. typedef WArray<WGridDataColumnTitle> WGridDataColumnTitleArray;
  32.  
  33. struct WGridDataRowHeight {
  34.     WInt             height;
  35.     WULong           rowNumber;
  36. };
  37. extern template WArrayReference<WGridDataRowHeight>;
  38. extern template WArray<WGridDataRowHeight>;
  39. typedef WArray<WGridDataRowHeight> WGridDataRowHeightArray;
  40.  
  41. struct WGridDataColumnWidth {
  42.     WInt             width;
  43.     WULong           columnNumber;
  44. };
  45. extern template WArrayReference<WGridDataColumnWidth>;
  46. extern template WArray<WGridDataColumnWidth>;
  47. typedef WArray<WGridDataColumnWidth> WGridDataColumnWidthArray;
  48.  
  49. struct WGridDataColumnReadOnly {
  50.     WBool            readOnly;
  51.     WULong           columnNumber;
  52. };
  53. extern template WArrayReference<WGridDataColumnReadOnly>;
  54. extern template WArray<WGridDataColumnReadOnly>;
  55. typedef WArray<WGridDataColumnReadOnly> WGridDataColumnReadOnlyArray;
  56.  
  57. class WCMCLASS WGridData : public WObject {
  58.  
  59.     public:
  60.         /**************************************************************
  61.          * Constructors and destructors
  62.          **************************************************************/
  63.     
  64.         WGridData();
  65.         ~WGridData();
  66.  
  67.         /**************************************************************
  68.          * Properties
  69.          **************************************************************/
  70.  
  71.         // UseArray
  72.  
  73.         WBool GetUseArray() const;
  74.         WBool SetUseArray( WBool useArray );
  75.  
  76.         // DefaultColumnWidth
  77.  
  78.         WInt GetDefaultColumnWidth() const;
  79.         WBool SetDefaultColumnWidth( WInt defaultColumnWidth );
  80.  
  81.         // DefaultRowHeight
  82.  
  83.         WInt GetDefaultRowHeight() const;
  84.         WBool SetDefaultRowHeight( WInt defaultRowHeight );
  85.  
  86.         // LeftColumnNumber
  87.  
  88.         WULong GetLeftColumnNumber() const;
  89.         WBool SetLeftColumnNumber( WULong leftCol );
  90.  
  91.         // MaximumColumnNumber
  92.         //
  93.         //  Note: The Set only works when UseArray == TRUE
  94.  
  95.         WLong GetMaximumColumnNumber() const;
  96.         WBool SetMaximumColumnNumber( WLong maxColNum );
  97.  
  98.         // MaximumRowNumber
  99.         //
  100.         //  Note: The Set only works when UseArray == TRUE
  101.  
  102.         WLong GetMaximumRowNumber() const;
  103.         WBool SetMaximumRowNumber( WLong maxRowNum );
  104.  
  105.         // MinimumColumnNumber
  106.  
  107.         WLong GetMinimumColumnNumber() const;
  108.  
  109.         // MinimumRowNumber
  110.  
  111.         WLong GetMinimumRowNumber() const;
  112.  
  113.         // TopRowNumber
  114.  
  115.         WULong GetTopRowNumber() const;
  116.         WBool SetTopRowNumber( WULong topRow );
  117.  
  118.         /**************************************************************
  119.          * Item Properties
  120.          **************************************************************/
  121.  
  122.         // ColumnTitle
  123.  
  124.         WString GetColumnTitle( WULong columnNumber ) const;
  125.         WBool SetColumnTitle( WULong columnNumber,
  126.                               const WString & columnTitle );
  127.  
  128.         // ColumnWidth
  129.  
  130.         WInt GetColumnWidth( WULong columnNumber ) const;
  131.         WBool SetColumnWidth( WULong columnNumber, WInt columnWidth );
  132.  
  133.         // ReadOnly
  134.  
  135.         WBool GetReadOnly( WULong columnNumber ) const;
  136.         WBool SetReadOnly( WULong columnNumber, WBool readOnly );
  137.         WBool GetReadOnly( WULong rowNumber, WULong columnNumber ) const;
  138.         WBool SetReadOnly( WULong rowNumber, WULong columnNumber,
  139.                            WBool readOnly );
  140.  
  141.         // Row
  142.  
  143.         WGridDataRow * GetRow( WULong rowNumber );
  144.  
  145.         // RowHeight
  146.  
  147.         WInt GetRowHeight( WULong rowNumber ) const;
  148.         WBool SetRowHeight( WULong rowNumber, WInt rowHeight );
  149.  
  150.         // RowTitle
  151.  
  152.         WString GetRowTitle( WULong rowNumber ) const;
  153.         WBool SetRowTitle( WULong rowNumber, const WString & rowTitle );
  154.  
  155.         // Text
  156.  
  157.         WString GetText( WULong rowNumber, WULong columnNumber ) const;
  158.         WBool SetText( WULong rowNumber, WULong columnNumber,
  159.                        const WString & string );
  160.  
  161.         // UserData
  162.  
  163.         void * GetUserData( WULong rowNumber, WULong columnNumber ) const;
  164.         WBool SetUserData( WULong rowNumber, WULong columnNumber,
  165.                            void * userData );
  166.  
  167.         // Value
  168.  
  169.         WGridDataValue GetValue( WULong rowNumber,
  170.                                  WULong columnNumber ) const;
  171.         WBool SetValue( WULong rowNumber, WULong columnNumber,
  172.                         const WGridDataValue & value );
  173.  
  174.         /**************************************************************
  175.          * Methods
  176.          **************************************************************/
  177.  
  178.         // DeleteAllRows
  179.  
  180.         WBool DeleteAllRows();
  181.  
  182.         // AddRow
  183.  
  184.         WBool AddRow( WULong rowNumber );
  185.  
  186.         // DeleteRow
  187.  
  188.         WBool DeleteRow( WULong rowNumber );
  189.  
  190.         /**************************************************************
  191.          * Data Members
  192.          **************************************************************/
  193.  
  194.     private:
  195.         WGridDataRow *                  _rowHead;
  196.         WGridDataValue **               _valueArray;
  197.         WLong                           _maxRow;
  198.         WLong                           _maxCol;
  199.         WLong                           _minRow;
  200.         WLong                           _minCol;
  201.         WInt                            _defaultColWidth;
  202.         WInt                            _defaultRowHeight;
  203.         WULong                          _topRow;
  204.         WULong                          _leftCol;
  205.         WGridDataColumnWidthArray       _colWidths;
  206.         WGridDataRowHeightArray         _rowHeights;
  207.         WGridDataColumnTitleArray       _colTitles;
  208.         WGridDataRowTitleArray          _rowTitles;
  209.         WGridDataColumnReadOnlyArray    _colReadOnly;
  210.         WBool                           _useArray;
  211. };
  212.  
  213. #endif // _WGRIDD_HPP_INCLUDED
  214.