1 // Copyright (C) 2007-2019 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 : SALOMEDSImpl_AttributeStudyProperties.hxx
24 // Author : Sergey RUIN
27 #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
28 #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
30 #include "SALOMEDSImpl_Defines.hxx"
31 #include "DF_Attribute.hxx"
32 #include "DF_Label.hxx"
36 #include "SALOMEDSImpl_GenericAttribute.hxx"
38 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
41 SALOMEDSImpl_AttributeStudyProperties();
42 ~SALOMEDSImpl_AttributeStudyProperties() {}
44 static const std::string& GetID();
45 const std::string& ID() const;
47 static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label);
51 virtual std::string Save();
52 virtual void Load(const std::string&);
54 void SetModification(const std::string& theUserName,
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;
67 std::string GetCreatorName() const;
68 bool GetCreationDate(int& theMinute,
74 void ChangeCreatorName(const std::string& theUserName);
76 void SetUnits(const std::string& theUnits);
77 std::string GetUnits() const;
79 void SetComment(const std::string& theComment);
80 std::string GetComment() const;
82 void SetCreationMode(const int theMode);
83 int GetCreationMode() const;
85 void SetModified(const int theModified);
86 bool IsModified() const;
87 int GetModified() const;
89 void SetLocked(const bool theLocked);
90 bool IsLocked() const;
91 bool IsLockChanged(const bool theErase);
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;
100 void Restore(DF_Attribute* with);
101 DF_Attribute* NewEmpty() const;
102 void Paste(DF_Attribute* into);
105 typedef std::vector<std::string> versionList;
106 typedef std::map<std::string, versionList> versionMap;
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;
115 std::string myComment;
120 versionMap myComponentVersions;