CMS 3D CMS Logo

FWTableManagerBase.h
Go to the documentation of this file.
1 #ifndef Fireworks_TableWidget_FWTableManagerBase_h
2 #define Fireworks_TableWidget_FWTableManagerBase_h
3 // -*- C++ -*-
4 //
5 // Package: TableWidget
6 // Class : FWTableManagerBase
7 //
28 //
29 // Original Author: Chris Jones
30 // Created: Mon Feb 2 16:40:52 EST 2009
31 //
32 
33 // system include files
34 #include <vector>
35 #include <string>
36 #include "TQObject.h"
37 #include "GuiTypes.h"
38 
39 // user include files
40 
41 // forward declarations
43 
44 class FWTableManagerBase : public TQObject {
45 public:
47  ~FWTableManagerBase() override;
48 
49  // ---------- const member functions ---------------------
51  virtual int numberOfRows() const = 0;
53  virtual int numberOfColumns() const = 0;
54 
56  virtual std::vector<std::string> getTitles() const = 0;
57 
59  virtual int unsortedRowNumber(int iSortedRowNumber) const = 0;
60 
66  virtual FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const = 0;
67 
69  virtual unsigned int cellHeight() const;
70 
72  virtual std::vector<unsigned int> maxWidthForColumns() const;
73 
74  virtual bool hasLabelHeaders() const;
75 
77  virtual bool hasRowHeaders() const;
79  virtual FWTableCellRendererBase* rowHeader(int iSortedRowNumber) const;
80 
81  virtual bool cellDataIsSortable() const { return true; }
82 
84  virtual void buttonPressedInRowHeader(Int_t row, Event_t* event, Int_t relX, Int_t relY);
85  virtual void buttonReleasedInRowHeader(Int_t row, Event_t* event, Int_t relX, Int_t relY);
86 
87  // ---------- static member functions --------------------
88 
89  // ---------- member functions ---------------------------
91  void sort(int iCol, bool iSortOrder);
92 
94  void dataChanged(); //*SIGNAL*
95 
97  void visualPropertiesChanged(); //*SIGNAL*
98 
100 
102  bool sortOrder(void) { return m_sortOrder; }
103 
105  int sortColumn(void) { return m_sortColumn; }
106 
107 protected:
109  virtual void implSort(int iCol, bool iSortOrder) = 0;
110 
111 private:
112  //FWTableManagerBase(const FWTableManagerBase&); // stop default
113 
114  //const FWTableManagerBase& operator=(const FWTableManagerBase&); // stop default
115 
116  // ---------- member data --------------------------------
119 };
120 
121 #endif
FWTableManagerBase::cellRenderer
virtual FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const =0
FWTableManagerBase::sort
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
Definition: FWTableManagerBase.cc:54
FWTableManagerBase::buttonReleasedInRowHeader
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
Definition: FWTableManagerBase.cc:113
FWTableManagerBase::buttonPressedInRowHeader
virtual void buttonPressedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
Called if mouse button pressed in Row Header, defaults is to do nothing.
Definition: FWTableManagerBase.cc:112
FWTableManagerBase::numberOfRows
virtual int numberOfRows() const =0
Number of rows in the table.
FWTableManagerBase::visualPropertiesChanged
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e....
Definition: FWTableManagerBase.cc:70
FWTableManagerBase::hasRowHeaders
virtual bool hasRowHeaders() const
Returns 'true' if this table has row headers. Defaults return value is false.
Definition: FWTableManagerBase.cc:109
FWTableManagerBase::~FWTableManagerBase
~FWTableManagerBase() override
Definition: FWTableManagerBase.cc:37
FWTableManagerBase
Definition: FWTableManagerBase.h:44
FWTableManagerBase::hasLabelHeaders
virtual bool hasLabelHeaders() const
Definition: FWTableManagerBase.cc:107
FWTableManagerBase::sortColumn
int sortColumn(void)
The current sort column.
Definition: FWTableManagerBase.h:105
FWTableManagerBase::dataChanged
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Definition: FWTableManagerBase.cc:63
FWTableManagerBase::numberOfColumns
virtual int numberOfColumns() const =0
Number of columns in the table.
FWTableManagerBase::implSort
virtual void implSort(int iCol, bool iSortOrder)=0
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.
FWTableManagerBase::cellDataIsSortable
virtual bool cellDataIsSortable() const
Definition: FWTableManagerBase.h:81
FWTableCellRendererBase
Definition: FWTableCellRendererBase.h:44
FWTableManagerBase::getTitles
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition: FWTableManagerBase.h:102
FWTableManagerBase::rowHeader
virtual FWTableCellRendererBase * rowHeader(int iSortedRowNumber) const
Returns the renderer for the row header for the sorted row number iSortedRowNumber.
Definition: FWTableManagerBase.cc:110
FWTableManagerBase::m_sortOrder
bool m_sortOrder
Definition: FWTableManagerBase.h:118
FWTableManagerBase::m_sortColumn
int m_sortColumn
Definition: FWTableManagerBase.h:117
FWTableManagerBase::unsortedRowNumber
virtual int unsortedRowNumber(int iSortedRowNumber) const =0
when passed the index to the sorted order of the rows it returns the original row number from the und...
event
Definition: event.py:1
FWTableManagerBase::ClassDefOverride
ClassDefOverride(FWTableManagerBase, 0)
FWTableManagerBase::cellHeight
virtual unsigned int cellHeight() const
require all cells to be the same height
Definition: FWTableManagerBase.cc:75
FWTableManagerBase::maxWidthForColumns
virtual std::vector< unsigned int > maxWidthForColumns() const
for each column in the table this returns the present maximum width for that column
Definition: FWTableManagerBase.cc:89
FWTableManagerBase::FWTableManagerBase
FWTableManagerBase()
Definition: FWTableManagerBase.cc:30