1 #ifndef DFAPPLICATION_HXX
2 #define DFAPPLICATION_HXX
4 #include "DF_definitions.hxx"
5 #include "DF_Document.hxx"
9 //Class DF_Application responsible for creation and manipulation of Documents
10 class DF_Application {
13 Standard_EXPORT DF_Application();
15 Standard_EXPORT ~DF_Application();
17 //Creates a new document with given type, returns a smart pointer to
18 //newly created document.
19 Standard_EXPORT DF_Document* NewDocument(const std::string& theDocumentType);
21 //Closes and removes the given Document
22 Standard_EXPORT void Close(const DF_Document* theDocument);
24 //Returns a Document by Document's ID
25 Standard_EXPORT DF_Document* GetDocument(int theDocumentID);
27 //Returns a list of IDs of all currently opened documents
28 Standard_EXPORT std::vector<int> GetDocumentIDs();
30 //Returns a number of existent documents
31 Standard_EXPORT int NbDocuments();
33 //Virtual methods to be redefined if required by specific application
35 //Restores a Document from the given file, returns a smart
36 //pointer to opened document.
37 Standard_EXPORT virtual DF_Document* Open(const std::string& theFileName);
39 //Saves a Document in a given file with name theFileName
40 Standard_EXPORT virtual void SaveAs(const DF_Document* theDocument, const std::string& theFileName);
44 std::map<int, DF_Document*> _documents;