test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
36  //only an item can set the selection
37  friend class FWEventItem;
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 private:
57  void finishedAllSelections();
58  void select(const FWModelId& iId);
59  void unselect(const FWModelId& iId);
60  void itemChanged(const FWEventItem*);
61 
62  void selectItem(FWEventItem*);
64 
65  FWSelectionManager(const FWSelectionManager&); // stop default
66 
67  const FWSelectionManager& operator=(const FWSelectionManager&); // stop default
68 
69  // ---------- member data --------------------------------
71  std::set<FWModelId> m_selection;
72  std::set<FWModelId> m_newSelection;
74  std::vector<std::pair<int,sigc::connection> > m_itemConnectionCount;
75  std::set<FWEventItem*> m_itemSelection;
76 };
77 
78 
79 #endif
const std::set< FWModelId > & selected() const
void itemChanged(const FWEventItem *)
void select(const FWModelId &iId)
const FWSelectionManager & operator=(const FWSelectionManager &)
const std::set< FWEventItem * > & selectedItems() const
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 & > itemSelectionChanged_
std::vector< std::pair< int, sigc::connection > > m_itemConnectionCount
sigc::signal< void, const FWSelectionManager & > selectionChanged_
FWSelectionManager(FWModelChangeManager *iCM)
std::set< FWModelId > m_selection
void selectItem(FWEventItem *)