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 // $Id: FWSelectionManager.h,v 1.7 2009/11/20 17:53:58 chrjones Exp $
20 //
21 
22 // system include files
23 #include "sigc++/signal.h"
24 #include "sigc++/connection.h"
25 #include <set>
26 #include <vector>
27 
28 // user include files
30 
31 // forward declarations
32 class FWEventItem;
34 
36 {
37  //only an item can set the selection
38  friend class FWEventItem;
39 public:
41  //virtual ~FWSelectionManager();
42 
43  // ---------- const member functions ---------------------
44  const std::set<FWModelId>& selected() const;
45 
46  const std::set<FWEventItem*>& selectedItems() const;
47  // ---------- static member functions --------------------
48 
49  // ---------- member functions ---------------------------
50  void clearSelection();
51  void clearItemSelection();
53 
54  sigc::signal<void, const FWSelectionManager&> selectionChanged_;
55  sigc::signal<void, const FWSelectionManager&> itemSelectionChanged_;
56 
57 private:
58  void finishedAllSelections();
59  void select(const FWModelId& iId);
60  void unselect(const FWModelId& iId);
61  void itemChanged(const FWEventItem*);
62 
63  void selectItem(FWEventItem*);
65 
66  FWSelectionManager(const FWSelectionManager&); // stop default
67 
68  const FWSelectionManager& operator=(const FWSelectionManager&); // stop default
69 
70  // ---------- member data --------------------------------
72  std::set<FWModelId> m_selection;
73  std::set<FWModelId> m_newSelection;
75  std::vector<std::pair<int,sigc::connection> > m_itemConnectionCount;
76  std::set<FWEventItem*> m_itemSelection;
77 };
78 
79 
80 #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 *)