Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / LightApp / LightApp_OBSelector.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef LIGHTAPP_OBSELECTOR_H
20 #define LIGHTAPP_OBSELECTOR_H
21
22 #include "LightApp.h"
23
24 #include <SUIT_Selector.h>
25 #include <SUIT_DataOwner.h>
26
27 class OB_Browser;
28 class LightApp_DataObject;
29
30 /*!
31   \class LightApp_OBSelector
32   Custom selector to get/set selection from object browser
33 */
34 class LIGHTAPP_EXPORT LightApp_OBSelector : public SUIT_Selector
35 {
36   Q_OBJECT
37
38 public:
39   LightApp_OBSelector( OB_Browser*, SUIT_SelectionMgr* );
40   virtual ~LightApp_OBSelector();
41
42   OB_Browser*  browser() const;
43
44   /*!Return "ObjectBrowser"*/
45   virtual QString type() const { return "ObjectBrowser"; }
46
47   void         setModified();
48   unsigned long getModifiedTime() { return myModifiedTime; }
49
50 private slots:
51   void         onSelectionChanged();
52
53 protected:
54   virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
55   virtual void setSelection( const SUIT_DataOwnerPtrList& );
56
57 private:
58   void         fillEntries( QMap<QString, LightApp_DataObject*>& );
59
60 private:
61   OB_Browser*  myBrowser;
62   SUIT_DataOwnerPtrList  mySelectedList;
63
64   QMap<QString, LightApp_DataObject*> myEntries;
65
66   unsigned long myModifiedTime;
67 };
68
69 #endif