]> SALOME platform Git repositories - modules/gui.git/blob - src/LightApp/LightApp_Selection.h
Salome HOME
4642a87935d363bf48dd5c44eb84cba25b591416
[modules/gui.git] / src / LightApp / LightApp_Selection.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  LightApp_Selection
23 //  File   : LightApp_Selection.h
24 //  Author : Alexander SOLOVYOV
25 //  Module : GUI
26 //  $Header$
27 //
28 #ifndef LIGHTAPP_SELECTION_HeaderFile
29 #define LIGHTAPP_SELECTION_HeaderFile
30
31 #include "LightApp.h"
32 #include <QtxPopupMgr.h>
33
34 class LightApp_SelectionMgr;
35 class LightApp_DataOwner;
36 class LightApp_Study;
37 class SUIT_ViewWindow;
38
39 /*!
40   \class LightApp_Selection 
41   Custom selection class, allowing to build popup with rules on the base
42   of owners selected in all selectors (popup client has more priority).
43   It is able to return values of standard object properties
44   (isVisible,isComponent,canBeDisplayed,isReference, etc)
45 */
46 class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
47 {
48 public:
49   LightApp_Selection();
50   virtual ~LightApp_Selection();
51
52   virtual void                   init( const QString&, LightApp_SelectionMgr* );
53   virtual void                   processOwner( const LightApp_DataOwner* );
54
55   virtual int                    count() const;
56   virtual QVariant               parameter( const int, const QString& ) const;
57   virtual QVariant               parameter( const QString& ) const;
58   void                           setModuleName( const QString );
59
60 protected:
61   QString                        entry( const int ) const;
62   bool                           isReference( const int ) const;
63   /*!Gets study.*/
64   LightApp_Study*                study() const { return myStudy; }
65   QString                        activeViewType() const;
66   SUIT_ViewWindow*               activeVW() const;
67   virtual QString                referencedToEntry( const QString& ) const;
68
69 private:
70   QString                        myPopupClient;
71   QMap<int,QString>              myEntries; // entries of selected objects
72   QMap<int,bool>                 myIsReferences; // whether i-th selected object was a reference
73   LightApp_Study*                myStudy;
74 };
75
76 #endif