File indexing completed on 2025-01-18 10:03:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _CDM_Document_HeaderFile
0018 #define _CDM_Document_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <CDM_ListOfReferences.hxx>
0024 #include <CDM_CanCloseStatus.hxx>
0025 #include <TColStd_SequenceOfExtendedString.hxx>
0026 #include <TCollection_ExtendedString.hxx>
0027 #include <Standard_OStream.hxx>
0028 #include <CDM_ListOfDocument.hxx>
0029
0030 class CDM_MetaData;
0031 class CDM_Application;
0032 class CDM_Reference;
0033 class Resource_Manager;
0034
0035 class CDM_Document;
0036 DEFINE_STANDARD_HANDLE(CDM_Document, Standard_Transient)
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 class CDM_Document : public Standard_Transient
0070 {
0071
0072 public:
0073
0074
0075
0076
0077
0078 Standard_EXPORT virtual void Update (const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Address aModifContext);
0079
0080
0081
0082
0083
0084
0085
0086
0087 Standard_EXPORT virtual Standard_Boolean Update (TCollection_ExtendedString& ErrorString);
0088
0089
0090
0091
0092 Standard_EXPORT virtual TCollection_ExtendedString StorageFormat() const = 0;
0093
0094
0095 Standard_EXPORT virtual void Extensions (TColStd_SequenceOfExtendedString& Extensions) const;
0096
0097
0098
0099
0100 Standard_EXPORT virtual Standard_Boolean GetAlternativeDocument (const TCollection_ExtendedString& aFormat, Handle(CDM_Document)& anAlternativeDocument);
0101
0102
0103
0104
0105
0106
0107
0108
0109 Standard_EXPORT Standard_Integer CreateReference (const Handle(CDM_Document)& anOtherDocument);
0110
0111
0112
0113 Standard_EXPORT void RemoveReference (const Standard_Integer aReferenceIdentifier);
0114
0115
0116 Standard_EXPORT void RemoveAllReferences();
0117
0118
0119
0120
0121 Standard_EXPORT Handle(CDM_Document) Document (const Standard_Integer aReferenceIdentifier) const;
0122
0123
0124
0125
0126 Standard_EXPORT Standard_Boolean IsInSession (const Standard_Integer aReferenceIdentifier) const;
0127
0128
0129
0130
0131 Standard_EXPORT Standard_Boolean IsStored (const Standard_Integer aReferenceIdentifier) const;
0132
0133
0134
0135 Standard_EXPORT TCollection_ExtendedString Name (const Standard_Integer aReferenceIdentifier) const;
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145 Standard_EXPORT void UpdateFromDocuments (const Standard_Address aModifContext) const;
0146
0147
0148
0149 Standard_EXPORT Standard_Integer ToReferencesNumber() const;
0150
0151
0152
0153 Standard_EXPORT Standard_Integer FromReferencesNumber() const;
0154
0155
0156 Standard_EXPORT Standard_Boolean ShallowReferences (const Handle(CDM_Document)& aDocument) const;
0157
0158
0159 Standard_EXPORT Standard_Boolean DeepReferences (const Handle(CDM_Document)& aDocument) const;
0160
0161
0162
0163
0164
0165 Standard_EXPORT Standard_Integer CopyReference (const Handle(CDM_Document)& aFromDocument, const Standard_Integer aReferenceIdentifier);
0166
0167
0168 Standard_EXPORT Standard_Boolean IsReadOnly() const;
0169
0170
0171 Standard_EXPORT Standard_Boolean IsReadOnly (const Standard_Integer aReferenceIdentifier) const;
0172
0173 Standard_EXPORT void SetIsReadOnly();
0174
0175 Standard_EXPORT void UnsetIsReadOnly();
0176
0177
0178
0179 Standard_EXPORT void Modify();
0180
0181
0182 Standard_EXPORT Standard_Integer Modifications() const;
0183
0184 Standard_EXPORT void UnModify();
0185
0186
0187
0188
0189
0190 Standard_EXPORT Standard_Boolean IsUpToDate (const Standard_Integer aReferenceIdentifier) const;
0191
0192
0193
0194
0195
0196 Standard_EXPORT void SetIsUpToDate (const Standard_Integer aReferenceIdentifier);
0197
0198
0199 Standard_EXPORT void SetComment (const TCollection_ExtendedString& aComment);
0200
0201
0202 Standard_EXPORT void AddComment (const TCollection_ExtendedString& aComment);
0203
0204
0205 Standard_EXPORT void SetComments (const TColStd_SequenceOfExtendedString& aComments);
0206
0207
0208
0209 Standard_EXPORT void Comments (TColStd_SequenceOfExtendedString& aComments) const;
0210
0211
0212
0213 Standard_EXPORT Standard_ExtString Comment() const;
0214
0215 Standard_EXPORT Standard_Boolean IsStored() const;
0216
0217
0218
0219 Standard_EXPORT Standard_Integer StorageVersion() const;
0220
0221
0222
0223
0224 Standard_EXPORT void SetMetaData (const Handle(CDM_MetaData)& aMetaData);
0225
0226 Standard_EXPORT void UnsetIsStored();
0227
0228 Standard_EXPORT Handle(CDM_MetaData) MetaData() const;
0229
0230 Standard_EXPORT TCollection_ExtendedString Folder() const;
0231
0232
0233 Standard_EXPORT void SetRequestedFolder (const TCollection_ExtendedString& aFolder);
0234
0235 Standard_EXPORT TCollection_ExtendedString RequestedFolder() const;
0236
0237 Standard_EXPORT Standard_Boolean HasRequestedFolder() const;
0238
0239
0240 Standard_EXPORT void SetRequestedName (const TCollection_ExtendedString& aName);
0241
0242
0243
0244
0245 Standard_EXPORT TCollection_ExtendedString RequestedName();
0246
0247 Standard_EXPORT void SetRequestedPreviousVersion (const TCollection_ExtendedString& aPreviousVersion);
0248
0249 Standard_EXPORT void UnsetRequestedPreviousVersion();
0250
0251 Standard_EXPORT Standard_Boolean HasRequestedPreviousVersion() const;
0252
0253 Standard_EXPORT TCollection_ExtendedString RequestedPreviousVersion() const;
0254
0255
0256 Standard_EXPORT void SetRequestedComment (const TCollection_ExtendedString& aComment);
0257
0258 Standard_EXPORT TCollection_ExtendedString RequestedComment() const;
0259
0260
0261 Standard_EXPORT void LoadResources();
0262
0263 Standard_EXPORT Standard_Boolean FindFileExtension();
0264
0265
0266 Standard_EXPORT TCollection_ExtendedString FileExtension();
0267
0268 Standard_EXPORT Standard_Boolean FindDescription();
0269
0270
0271 Standard_EXPORT TCollection_ExtendedString Description();
0272
0273
0274
0275 Standard_EXPORT Standard_Boolean IsModified() const;
0276
0277 Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const;
0278 Standard_OStream& operator << (Standard_OStream& anOStream);
0279
0280 Standard_EXPORT Standard_Boolean IsOpened() const;
0281
0282 Standard_EXPORT void Open (const Handle(CDM_Application)& anApplication);
0283
0284 Standard_EXPORT CDM_CanCloseStatus CanClose() const;
0285
0286 Standard_EXPORT void Close();
0287
0288 Standard_EXPORT const Handle(CDM_Application)& Application() const;
0289
0290
0291
0292
0293
0294 Standard_EXPORT virtual Standard_Boolean CanCloseReference (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceIdentifier) const;
0295
0296
0297
0298
0299
0300 Standard_EXPORT virtual void CloseReference (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceIdentifier);
0301
0302
0303
0304
0305
0306 Standard_EXPORT Standard_Boolean IsOpened (const Standard_Integer aReferenceIdentifier) const;
0307
0308 Standard_EXPORT void CreateReference (const Handle(CDM_MetaData)& aMetaData, const Standard_Integer aReferenceIdentifier, const Handle(CDM_Application)& anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration);
0309
0310 Standard_EXPORT Standard_Integer CreateReference (const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication, const Standard_Integer aDocumentVersion, const Standard_Boolean UseStorageConfiguration);
0311
0312 Standard_EXPORT Standard_Integer ReferenceCounter() const;
0313
0314
0315
0316
0317
0318 Standard_EXPORT virtual void Update();
0319
0320 Standard_EXPORT Handle(CDM_Reference) Reference (const Standard_Integer aReferenceIdentifier) const;
0321
0322 Standard_EXPORT void SetModifications (const Standard_Integer Modifications);
0323
0324 Standard_EXPORT void SetReferenceCounter (const Standard_Integer aReferenceCounter);
0325
0326
0327 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0328
0329 friend class CDM_Reference;
0330 friend class CDM_ReferenceIterator;
0331 friend class CDM_Application;
0332
0333
0334 DEFINE_STANDARD_RTTIEXT(CDM_Document,Standard_Transient)
0335
0336 protected:
0337
0338
0339 Standard_EXPORT CDM_Document();
0340
0341 Standard_EXPORT ~CDM_Document();
0342
0343 Standard_Boolean myResourcesAreLoaded;
0344
0345 private:
0346
0347
0348
0349
0350 Standard_EXPORT Handle(Resource_Manager) StorageResource();
0351
0352 Standard_EXPORT void AddToReference (const Handle(CDM_Reference)& aReference);
0353
0354 Standard_EXPORT void AddFromReference (const Handle(CDM_Reference)& aReference);
0355
0356 Standard_EXPORT void RemoveFromReference (const Standard_Integer aReferenceIdentifier);
0357
0358
0359 TColStd_SequenceOfExtendedString myComments;
0360 CDM_ListOfReferences myFromReferences;
0361 CDM_ListOfReferences myToReferences;
0362 Standard_Integer myVersion;
0363 Standard_Integer myActualReferenceIdentifier;
0364 Standard_Integer myStorageVersion;
0365 Handle(CDM_MetaData) myMetaData;
0366 TCollection_ExtendedString myRequestedComment;
0367 TCollection_ExtendedString myRequestedFolder;
0368 Standard_Boolean myRequestedFolderIsDefined;
0369 TCollection_ExtendedString myRequestedName;
0370 Standard_Boolean myRequestedNameIsDefined;
0371 Standard_Boolean myRequestedPreviousVersionIsDefined;
0372 TCollection_ExtendedString myRequestedPreviousVersion;
0373 TCollection_ExtendedString myFileExtension;
0374 TCollection_ExtendedString myDescription;
0375 Standard_Boolean myFileExtensionWasFound;
0376 Standard_Boolean myDescriptionWasFound;
0377 Handle(CDM_Application) myApplication;
0378 };
0379
0380
0381
0382
0383
0384
0385
0386 #endif