Salome HOME
add an argument to selected() specifying a selector
[modules/gui.git] / src / SalomeApp / SalomeApp_SelectionMgr.h
1 #ifndef SALOMEAPP_SELECTIONMGR_H
2 #define SALOMEAPP_SELECTIONMGR_H
3
4 #include "SalomeApp.h"
5
6 #include <SUIT_SelectionMgr.h>
7 #include <SALOME_InteractiveObject.hxx>
8
9 #include <qmap.h>
10
11 class SALOME_ListIO;
12 class SalomeApp_Application;
13 class TColStd_IndexedMapOfInteger;
14 class TColStd_MapOfInteger;
15
16 class SALOMEAPP_EXPORT SalomeApp_SelectionMgr : public SUIT_SelectionMgr
17 {
18   Q_OBJECT
19
20 public:
21   SalomeApp_SelectionMgr( SalomeApp_Application*, const bool = true );
22   virtual ~SalomeApp_SelectionMgr();
23
24   typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
25   typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
26
27   SalomeApp_Application* application() const;
28
29   void                   selectedObjects( SALOME_ListIO&, const QString& = QString::null ) const;
30   void                   setSelectedObjects( const SALOME_ListIO&, const bool = false );
31
32   void                   GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, 
33                                      TColStd_IndexedMapOfInteger& theIndex );
34   void                   GetIndexes( const QString& theEntry, 
35                                      TColStd_IndexedMapOfInteger& theIndex );
36
37   bool                   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, 
38                                            const TColStd_MapOfInteger& theIndices, 
39                                            bool modeShift );
40
41   void                   selectObjects( const Handle(SALOME_InteractiveObject)& IObject, 
42                                         TColStd_IndexedMapOfInteger theIndex, bool append );
43   void                   selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
44
45   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
46
47 signals:
48   void                   currentSelectionChanged();
49
50 private:
51   virtual void           selectionChanged( SUIT_Selector* );
52
53 private:
54   SalomeApp_Application* myApp;
55 };
56
57 #endif