Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SalomeApp_DataObject.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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 
23 // File : SalomeApp_DataObject.h
24 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 
26 #ifndef SALOMEAPP_DATAOBJECT_H
27 #define SALOMEAPP_DATAOBJECT_H
28 
29 #include "SalomeApp.h"
30 #include <LightApp_DataObject.h>
31 #include <SALOMEDSClient.hxx>
32 
33 class SalomeApp_Study;
34 
36 {
37 
38 public:
40  enum {
41  ValueId = RefEntryId + 1,
43  LastId
44  };
45 
46 public:
48  SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
49  virtual ~SalomeApp_DataObject();
50 
51  virtual QString name() const;
52  virtual QString entry() const;
53 
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;
59 
60  virtual _PTR(SObject) object() const;
61 
62  virtual QString refEntry() const;
63  virtual bool isReference() const;
64  _PTR(SObject) referencedObject() const;
65 
66  bool hasChildren() const;
67  bool expandable() const;
68 
69  virtual bool isVisible() const;
70 
71  virtual QString componentDataType() const;
72 
73  virtual bool customSorting( const int = NameId ) const;
74  virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
75 
76  virtual void insertChildAtTag( SalomeApp_DataObject*, int );
77  virtual void updateItem();
78 
79 private:
80  QString ior( const _PTR(SObject)& ) const;
81  QString entry( const _PTR(SObject)& ) const;
82  QString value( const _PTR(SObject)& ) const;
83 
84 private:
85  _PTR(SObject) myObject;
86 };
87 
88 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
89  public CAM_ModuleObject
90 {
91 public:
93  SalomeApp_ModuleObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
94  SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
95  virtual ~SalomeApp_ModuleObject();
96 
97  virtual QString name() const;
98  QPixmap icon( const int = NameId ) const;
99  QString toolTip( const int = NameId ) const;
100 };
101 
103  public LightApp_RootObject
104 {
105 public:
107  virtual ~SalomeApp_RootObject();
108 
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;};
117 protected:
118  bool _toSynchronize;
119 };
120 
122 {
123 public:
125  virtual ~SalomeApp_SavePointObject();
126 
127  virtual QString name() const;
128  virtual QString entry() const;
129 
130  virtual QPixmap icon( const int = NameId ) const;
131  virtual QString toolTip( const int = NameId ) const;
132 
133  int getId() const;
134 
135 private:
136  int myId;
138 };
139 
141 {
142 public:
144 
145  virtual QString name() const;
146  virtual QString toolTip( const int = NameId ) const;
147 };
148 
149 #endif