00001 #ifndef Fireworks_Core_FWCollectionSummaryTableManager_h 00002 #define Fireworks_Core_FWCollectionSummaryTableManager_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Core 00006 // Class : FWCollectionSummaryTableManager 00007 // 00016 // 00017 // Original Author: Chris Jones 00018 // Created: Sun Feb 22 10:13:37 CST 2009 00019 // $Id: FWCollectionSummaryTableManager.h,v 1.1 2009/03/04 16:40:51 chrjones Exp $ 00020 // 00021 00022 // system include files 00023 #include <vector> 00024 #include <boost/shared_ptr.hpp> 00025 00026 // user include files 00027 #include "Fireworks/TableWidget/interface/FWTableManagerBase.h" 00028 #include "Fireworks/TableWidget/interface/FWTextTableCellRenderer.h" 00029 #include "Fireworks/Core/src/FWCollectionSummaryModelCellRenderer.h" 00030 00031 // forward declarations 00032 class FWEventItem; 00033 class FWItemValueGetter; 00034 class FWCollectionSummaryWidget; 00035 00036 class FWCollectionSummaryTableManager : public FWTableManagerBase { 00037 00038 public: 00039 FWCollectionSummaryTableManager(FWEventItem* iCollection, const TGGC* iContext, const TGGC* iHighlightContext, FWCollectionSummaryWidget*); 00040 virtual ~FWCollectionSummaryTableManager(); 00041 00042 // ---------- const member functions --------------------- 00043 virtual int numberOfRows() const ; 00044 virtual int numberOfColumns() const ; 00045 virtual std::vector<std::string> getTitles() const; 00046 virtual int unsortedRowNumber(int iSortedRowNumber) const; 00047 00048 virtual FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const; 00049 00050 virtual bool hasRowHeaders() const ; 00051 virtual FWTableCellRendererBase* rowHeader(int iSortedRowNumber) const ; 00052 00053 // ---------- static member functions -------------------- 00054 00055 // ---------- member functions --------------------------- 00056 virtual void buttonReleasedInRowHeader(Int_t row, Event_t* event, Int_t relX, Int_t relY); 00057 00058 protected: 00059 virtual void implSort(int iCol, bool iSortOrder); 00060 private: 00061 FWCollectionSummaryTableManager(const FWCollectionSummaryTableManager&); // stop default 00062 00063 const FWCollectionSummaryTableManager& operator=(const FWCollectionSummaryTableManager&); // stop default 00064 00065 void dataChanged(); 00066 // ---------- member data -------------------------------- 00067 FWEventItem* m_collection; 00068 std::vector<int> m_sortedToUnsortedIndicies; 00069 std::vector<boost::shared_ptr<FWItemValueGetter> > m_valueGetters; 00070 00071 mutable FWCollectionSummaryModelCellRenderer m_renderer; 00072 mutable FWTextTableCellRenderer m_bodyRenderer; 00073 FWCollectionSummaryWidget* m_widget; 00074 }; 00075 00076 00077 #endif