Salome HOME
1b5a4a57dfe11d31ea6816dee0898ca342abd697
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeStudyProperties.hxx
1 // Copyright (C) 2007-2023  CEA, EDF, 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   : SALOMEDSImpl_AttributeStudyProperties.hxx
24 //  Author : Sergey RUIN
25 //  Module : SALOME
26 //
27 #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
28 #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
29
30 #include "SALOMEDSImpl_Defines.hxx"
31 #include "DF_Attribute.hxx"
32 #include "DF_Label.hxx"
33 #include <string>
34 #include <vector>
35 #include <map>
36 #include "SALOMEDSImpl_GenericAttribute.hxx"
37
38 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
39 {
40 public:
41   SALOMEDSImpl_AttributeStudyProperties();
42   ~SALOMEDSImpl_AttributeStudyProperties() {}
43
44   static const std::string& GetID();
45   const std::string&    ID() const;
46
47   static  SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label);
48
49   void Init();
50
51   virtual std::string Save();
52   virtual void Load(const std::string&);
53
54   void SetModification(const std::string& theUserName,
55     const int          theMinute,
56     const int          theHour,
57     const int          theDay,
58     const int          theMonth,
59     const int          theYear);
60   void GetModifications(std::vector<std::string>& theUserNames,
61     std::vector<int>&         theMinutes,
62     std::vector<int>&         theHours,
63     std::vector<int>&         theDays,
64     std::vector<int>&         theMonths,
65     std::vector<int>&         theYears) const;
66
67   std::string GetCreatorName() const;
68   bool GetCreationDate(int&           theMinute,
69     int&           theHour,
70     int&           theDay,
71     int&           theMonth,
72     int&           theYear) const;
73
74   void ChangeCreatorName(const std::string& theUserName);
75
76   void SetUnits(const std::string& theUnits);
77   std::string GetUnits() const;
78
79   void SetComment(const std::string& theComment);
80   std::string GetComment() const;
81
82   void SetCreationMode(const int theMode);
83   int GetCreationMode() const;
84
85   void SetModified(const int theModified);
86   bool IsModified() const;
87   int GetModified() const;
88
89   void SetLocked(const bool theLocked);
90   bool IsLocked() const;
91   bool IsLockChanged(const bool theErase);
92
93   void SetComponentsVersions( const std::map< std::string, std::vector<std::string> >& theVersions );
94   void SetComponentVersion(const std::string& theComponent, const std::string& theVersion);
95   std::vector<std::string> GetStoredComponents() const;
96   std::string GetComponentVersion(const std::string& theComponent) const;
97   std::vector<std::string> GetComponentVersions(const std::string& theComponent) const;
98   std::map< std::string, std::vector<std::string> > GetComponentsVersions() const;
99
100   void Restore(DF_Attribute* with);
101   DF_Attribute* NewEmpty() const;
102   void Paste(DF_Attribute* into);
103
104 private:
105   typedef std::vector<std::string> versionList;
106   typedef std::map<std::string, versionList> versionMap;
107
108   std::vector<std::string> myUserName;
109   std::vector<int> myMinute;
110   std::vector<int> myHour;
111   std::vector<int> myDay;
112   std::vector<int> myMonth;
113   std::vector<int> myYear;
114   std::string      myUnits;
115   std::string      myComment;
116   int              myMode;
117   int              myModified;
118   bool             myLocked;
119   bool             myLockChanged;
120   versionMap       myComponentVersions;
121 };
122
123 #endif