1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SalomeApp_DataObject.h
24 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
26 #ifndef SALOMEAPP_DATAOBJECT_H
27 #define SALOMEAPP_DATAOBJECT_H
29 #include "SalomeApp.h"
30 #include <LightApp_DataObject.h>
31 #include <SALOMEDSClient.hxx>
33 class SalomeApp_Study;
35 class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual LightApp_DataObject
41 ValueId = RefEntryId + 1, //!< value column
42 IORId, //!< IOR column
43 LastId //!< indicates last Id value
47 SalomeApp_DataObject( SUIT_DataObject* = 0 );
48 SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
49 virtual ~SalomeApp_DataObject();
51 virtual QString name() const;
52 virtual QString entry() const;
54 virtual QString text( const int = NameId ) const;
55 virtual QPixmap icon( const int = NameId ) const;
56 virtual QColor color( const ColorRole, const int = NameId ) const;
57 virtual QString toolTip( const int = NameId ) const;
58 virtual QFont font( const int = NameId ) const;
60 virtual _PTR(SObject) object() const;
62 virtual QString refEntry() const;
63 virtual bool isReference() const;
64 _PTR(SObject) referencedObject() const;
66 bool hasChildren() const;
67 bool expandable() const;
69 virtual bool isVisible() const;
71 virtual QString componentDataType() const;
73 virtual bool customSorting( const int = NameId ) const;
74 virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
76 virtual void insertChildAtTag( SalomeApp_DataObject*, int );
77 virtual void updateItem();
80 QString ior( const _PTR(SObject)& ) const;
81 QString entry( const _PTR(SObject)& ) const;
82 QString value( const _PTR(SObject)& ) const;
85 _PTR(SObject) myObject;
88 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
89 public CAM_ModuleObject
92 SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
93 SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
94 SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
95 virtual ~SalomeApp_ModuleObject();
97 virtual QString name() const;
98 QPixmap icon( const int = NameId ) const;
99 QString toolTip( const int = NameId ) const;
102 class SALOMEAPP_EXPORT SalomeApp_RootObject : public SalomeApp_DataObject,
103 public LightApp_RootObject
106 SalomeApp_RootObject( LightApp_Study* );
107 virtual ~SalomeApp_RootObject();
109 QString name() const;
110 QString entry() const;
111 QString text( const int = NameId ) const;
112 QPixmap icon( const int = NameId ) const;
113 QColor color( const ColorRole, const int = NameId ) const;
114 QString toolTip( const int = NameId ) const;
115 void setToSynchronize(bool value){_toSynchronize=value;};
116 bool toSynchronize() const {return _toSynchronize;};
121 class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
124 SalomeApp_SavePointObject( SUIT_DataObject*, const int, SalomeApp_Study* );
125 virtual ~SalomeApp_SavePointObject();
127 virtual QString name() const;
128 virtual QString entry() const;
130 virtual QPixmap icon( const int = NameId ) const;
131 virtual QString toolTip( const int = NameId ) const;
137 SalomeApp_Study* myStudy;
140 class SALOMEAPP_EXPORT SalomeApp_SavePointRootObject : public SUIT_DataObject
143 SalomeApp_SavePointRootObject( SUIT_DataObject* );
145 virtual QString name() const;
146 virtual QString toolTip( const int = NameId ) const;