Salome HOME
BugID: PAL10141, added a possibility to lock the study by several processes.
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeStudyProperties.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDSImpl_AttributeStudyProperties.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
25 #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
26
27 #include <Standard_DefineHandle.hxx>
28 #include <Standard.hxx>
29 #include <TDF_Attribute.hxx>
30 #include <TDF_Label.hxx>
31 #include <TCollection_AsciiString.hxx>
32 #include "SALOMEDSImpl_GenericAttribute.hxx"
33
34 class Standard_GUID;
35 class Handle(TDF_Attribute);
36 class Handle(TDF_RelocationTable);
37
38
39 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeStudyProperties, SALOMEDSImpl_GenericAttribute )
40
41 #include <TColStd_HSequenceOfExtendedString.hxx>
42 #include <TColStd_HSequenceOfInteger.hxx>
43
44 class SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
45 {
46 public:
47 Standard_EXPORT SALOMEDSImpl_AttributeStudyProperties();
48 Standard_EXPORT ~SALOMEDSImpl_AttributeStudyProperties() {}
49
50 Standard_EXPORT static const Standard_GUID& GetID();
51 Standard_EXPORT        const Standard_GUID&    ID() const;
52
53 Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeStudyProperties Set(const TDF_Label& label);
54
55 Standard_EXPORT void Init();
56
57 Standard_EXPORT virtual TCollection_AsciiString Save();
58 Standard_EXPORT virtual void Load(const TCollection_AsciiString&);
59
60 Standard_EXPORT   void SetModification(const TCollection_ExtendedString& theUserName,
61                                        const Standard_Integer            theMinute,
62                                        const Standard_Integer            theHour,
63                                        const Standard_Integer            theDay,
64                                        const Standard_Integer            theMonth,
65                                        const Standard_Integer            theYear);
66 Standard_EXPORT   void GetModifications(Handle(TColStd_HSequenceOfExtendedString)& theUserNames,
67                                         Handle(TColStd_HSequenceOfInteger)&        theMinutes,
68                                         Handle(TColStd_HSequenceOfInteger)&        theHours,
69                                         Handle(TColStd_HSequenceOfInteger)&        theDays,
70                                         Handle(TColStd_HSequenceOfInteger)&        theMonths,
71                                         Handle(TColStd_HSequenceOfInteger)&        theYears) const;
72
73 Standard_EXPORT   TCollection_ExtendedString GetCreatorName() const;
74 Standard_EXPORT   Standard_Boolean GetCreationDate(Standard_Integer&           theMinute,
75                                                    Standard_Integer&           theHour,
76                                                    Standard_Integer&           theDay,
77                                                    Standard_Integer&           theMonth,
78                                                    Standard_Integer&           theYear) const;
79
80 Standard_EXPORT   void ChangeCreatorName(const TCollection_ExtendedString& theUserName);
81
82 Standard_EXPORT   void SetCreationMode(const Standard_Integer theMode);
83 Standard_EXPORT   Standard_Integer GetCreationMode() const;
84
85 Standard_EXPORT   void SetModified(const Standard_Integer theModified);
86 Standard_EXPORT   Standard_Boolean IsModified() const;
87 Standard_EXPORT   Standard_Integer GetModified() const;
88
89 Standard_EXPORT   void SetLocked(const Standard_Boolean theLocked);
90 Standard_EXPORT   Standard_Boolean IsLocked() const;
91 Standard_EXPORT   Standard_Boolean IsLockChanged(const Standard_Boolean theErase);
92
93 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with);
94 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
95 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,
96                              const Handle(TDF_RelocationTable)& RT) const;
97
98 private:
99
100 Handle_TColStd_HSequenceOfExtendedString myUserName;
101 Handle_TColStd_HSequenceOfInteger myMinute;
102 Handle_TColStd_HSequenceOfInteger myHour;
103 Handle_TColStd_HSequenceOfInteger myDay;
104 Handle_TColStd_HSequenceOfInteger myMonth;
105 Handle_TColStd_HSequenceOfInteger myYear;
106 Standard_Integer myMode;
107 Standard_Integer myModified;
108 Standard_Boolean myLocked;
109 Standard_Boolean myLockChanged;
110
111 public:
112   DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeStudyProperties )
113
114 };
115
116 #endif