Salome HOME
7f69ed6bf0bbf95808bc4a3ab1fea814b58c7aea
[modules/gui.git] / src / LightApp / LightApp_SelectionMgr.h
1 #ifndef LIGHTAPP_SELECTIONMGR_H
2 #define LIGHTAPP_SELECTIONMGR_H
3
4 #include "LightApp.h"
5
6 #include <SUIT_SelectionMgr.h>
7 #include <SALOME_InteractiveObject.hxx>
8
9 #include <qmap.h>
10
11 class SALOME_ListIO;
12 class LightApp_Application;
13 class TColStd_IndexedMapOfInteger;
14 class TColStd_MapOfInteger;
15
16 class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr
17 {
18   Q_OBJECT
19
20 public:
21   LightApp_SelectionMgr( LightApp_Application*, const bool = true );
22   virtual ~LightApp_SelectionMgr();
23
24   typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
25   typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
26
27   LightApp_Application* application() const;
28
29   void                   selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) 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   LightApp_Application* myApp;
55 };
56
57 #endif