]> SALOME platform Git repositories - modules/gui.git/blob - src/SalomeApp/SalomeApp_DataObject.h
Salome HOME
8a0462f4d297b70274b38e1d6dea700d5250e9ef
[modules/gui.git] / src / SalomeApp / SalomeApp_DataObject.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 // File   : SalomeApp_DataObject.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 //
25 #ifndef SALOMEAPP_DATAOBJECT_H
26 #define SALOMEAPP_DATAOBJECT_H
27
28 #include "SalomeApp.h"
29 #include <LightApp_DataObject.h>
30 #include <SALOMEDSClient.hxx>
31
32 class SalomeApp_Study;
33
34 class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual LightApp_DataObject
35 {
36
37 public:
38   //! Column id
39   enum {
40     ValueId = EntryId + 1,    //!< value column
41     IORId,                    //!< IOR column
42     RefEntryId                //!< reference entry column
43   };
44
45 public:
46   SalomeApp_DataObject( SUIT_DataObject* = 0 );
47   SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
48   virtual ~SalomeApp_DataObject();
49
50   virtual QString        name() const;
51   virtual QString        entry() const;
52
53   virtual QString        text( const int = NameId ) const;
54   virtual QPixmap        icon( const int = NameId ) const;
55   virtual QColor         color( const ColorRole, const int = NameId ) const;
56   virtual QString        toolTip( const int = NameId ) const;
57
58   virtual _PTR(SObject)  object() const;
59
60   bool                   isReference() const;
61   _PTR(SObject)          referencedObject() const;
62
63   virtual QString        componentDataType() const;
64
65   virtual bool           customSorting( const int = NameId ) const;
66   virtual bool           compare( const QVariant&, const QVariant&, const int = NameId ) const;
67
68 private:
69   QString                ior( const _PTR(SObject)& ) const;
70   QString                entry( const _PTR(SObject)& ) const;
71   QString                value( const _PTR(SObject)& ) const;
72
73 private:
74   _PTR(SObject)          myObject;
75 };
76
77 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
78                                                 public CAM_ModuleObject
79 {
80 public:
81   SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
82   SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
83   SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
84   virtual ~SalomeApp_ModuleObject();
85
86   virtual QString        name() const;
87   QPixmap                icon( const int = NameId ) const;
88   QString                toolTip( const int = NameId ) const;
89 };
90
91 class SALOMEAPP_EXPORT SalomeApp_RootObject : public SalomeApp_DataObject,
92                                               public LightApp_RootObject
93 {
94 public:
95   SalomeApp_RootObject( LightApp_Study* );
96   virtual ~SalomeApp_RootObject();
97
98   QString                name() const;
99   QString                entry() const;
100   QString                text( const int = NameId ) const;
101   QPixmap                icon( const int = NameId ) const;
102   QColor                 color( const ColorRole, const int = NameId ) const;
103   QString                toolTip( const int = NameId ) const;
104 };
105
106 class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
107 {
108 public:
109   SalomeApp_SavePointObject( SUIT_DataObject*, const int, SalomeApp_Study* );
110   virtual ~SalomeApp_SavePointObject();
111
112   virtual QString        name() const;
113   virtual QString        entry() const;
114
115   virtual QPixmap        icon( const int = NameId ) const;
116   virtual QString        toolTip( const int = NameId ) const;
117
118   int                    getId() const;
119
120 private:
121   int                    myId;
122   SalomeApp_Study*       myStudy;
123 };
124
125 class SALOMEAPP_EXPORT SalomeApp_SavePointRootObject : public SUIT_DataObject
126 {
127 public:
128   SalomeApp_SavePointRootObject( SUIT_DataObject* );
129
130   virtual QString        name() const;
131   virtual QString        toolTip( const int = NameId ) const;
132 };
133
134 #endif