CMS 3D CMS Logo

FWSelectionManager.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWSelectionManager_h
2 #define Fireworks_Core_FWSelectionManager_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWSelectionManager
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri Jan 18 14:40:45 EST 2008
19 //
20 
21 // system include files
22 #include "sigc++/signal.h"
23 #include "sigc++/connection.h"
24 #include <set>
25 #include <vector>
26 
27 // user include files
29 
30 // forward declarations
31 class FWEventItem;
33 
35  //only an item can set the selection
36  friend class FWEventItem;
37 
38 public:
40  //virtual ~FWSelectionManager();
41 
42  // ---------- const member functions ---------------------
43  const std::set<FWModelId>& selected() const;
44 
45  const std::set<FWEventItem*>& selectedItems() const;
46  // ---------- static member functions --------------------
47 
48  // ---------- member functions ---------------------------
49  void clearSelection();
50  void clearItemSelection();
52 
53  sigc::signal<void(const FWSelectionManager&)> selectionChanged_;
54  sigc::signal<void(const FWSelectionManager&)> itemSelectionChanged_;
55 
56  FWSelectionManager(const FWSelectionManager&) = delete; // stop default
57 
58  const FWSelectionManager& operator=(const FWSelectionManager&) = delete; // stop default
59 private:
60  void finishedAllSelections();
61  void select(const FWModelId& iId);
62  void unselect(const FWModelId& iId);
63  void itemChanged(const FWEventItem*);
64 
65  void selectItem(FWEventItem*);
67 
68  // ---------- member data --------------------------------
70  std::set<FWModelId> m_selection;
71  std::set<FWModelId> m_newSelection;
73  std::vector<std::pair<int, sigc::connection> > m_itemConnectionCount;
74  std::set<FWEventItem*> m_itemSelection;
75 };
76 
77 #endif
void itemChanged(const FWEventItem *)
void select(const FWModelId &iId)
sigc::signal< void(const FWSelectionManager &)> itemSelectionChanged_
const FWSelectionManager & operator=(const FWSelectionManager &)=delete
std::set< FWEventItem * > m_itemSelection
std::set< FWModelId > m_newSelection
void unselectItem(FWEventItem *)
void unselect(const FWModelId &iId)
FWModelChangeManager * m_changeManager
sigc::signal< void(const FWSelectionManager &)> selectionChanged_
std::vector< std::pair< int, sigc::connection > > m_itemConnectionCount
FWSelectionManager(FWModelChangeManager *iCM)
std::set< FWModelId > m_selection
const std::set< FWModelId > & selected() const
const std::set< FWEventItem * > & selectedItems() const
void selectItem(FWEventItem *)