File indexing completed on 2025-01-18 10:05:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef TObj_Application_HeaderFile
0019 #define TObj_Application_HeaderFile
0020
0021 #include <TDocStd_Application.hxx>
0022 #include <Message_Gravity.hxx>
0023 #include <Message_Messenger.hxx>
0024
0025
0026
0027
0028
0029 class TObj_Application : public TDocStd_Application
0030 {
0031 public:
0032
0033 Standard_EXPORT static Handle(TObj_Application) GetInstance();
0034
0035
0036 Handle(Message_Messenger) &Messenger() { return myMessenger; }
0037
0038 public:
0039
0040
0041
0042
0043
0044 Standard_EXPORT virtual Standard_Boolean SaveDocument
0045 (const Handle(TDocStd_Document)& theSourceDoc,
0046 const TCollection_ExtendedString& theTargetFile);
0047
0048
0049 Standard_EXPORT virtual Standard_Boolean SaveDocument
0050 (const Handle(TDocStd_Document)& theSourceDoc,
0051 Standard_OStream& theOStream);
0052
0053
0054 Standard_EXPORT virtual Standard_Boolean LoadDocument
0055 (const TCollection_ExtendedString& theSourceFile,
0056 Handle(TDocStd_Document)& theTargetDoc);
0057
0058
0059 Standard_EXPORT virtual Standard_Boolean LoadDocument
0060 (Standard_IStream& theIStream,
0061 Handle(TDocStd_Document)& theTargetDoc);
0062
0063
0064 virtual Standard_EXPORT Standard_Boolean CreateNewDocument
0065 (Handle(TDocStd_Document)& theDoc,
0066 const TCollection_ExtendedString& theFormat);
0067
0068
0069
0070 virtual Standard_EXPORT void ErrorMessage
0071 (const TCollection_ExtendedString &theMsg,
0072 const Message_Gravity theLevel);
0073
0074
0075
0076 virtual void ErrorMessage
0077 (const TCollection_ExtendedString &theMsg)
0078 { ErrorMessage( theMsg, Message_Alarm ); }
0079
0080
0081
0082
0083 void SetVerbose (const Standard_Boolean isVerbose)
0084 { myIsVerbose = isVerbose; }
0085
0086
0087 Standard_Boolean IsVerbose () const
0088 { return myIsVerbose; }
0089
0090
0091 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0092
0093 public:
0094
0095
0096
0097
0098
0099 virtual Standard_EXPORT Standard_CString ResourcesName() Standard_OVERRIDE;
0100
0101 protected:
0102
0103
0104
0105
0106
0107
0108 Standard_EXPORT TObj_Application();
0109
0110
0111 void SetError (const PCDM_StoreStatus theStatus, const TCollection_ExtendedString& theInfo);
0112
0113
0114 void SetError (const PCDM_ReaderStatus theStatus, const TCollection_ExtendedString& theInfo);
0115
0116 private:
0117
0118
0119
0120
0121 Standard_Boolean myIsError;
0122 Standard_Boolean myIsVerbose;
0123 Handle(Message_Messenger) myMessenger;
0124
0125 public:
0126
0127 DEFINE_STANDARD_RTTIEXT(TObj_Application,TDocStd_Application)
0128 };
0129
0130
0131
0132 DEFINE_STANDARD_HANDLE(TObj_Application,TDocStd_Application)
0133
0134 #endif