Salome HOME
Removed includes and libraries of OCC
[modules/kernel.git] / src / DF / DF_Application.hxx
1 #ifndef DFAPPLICATION_HXX
2 #define DFAPPLICATION_HXX
3
4 #include "DF_definitions.hxx"
5 #include "DF_Document.hxx"
6 #include <string>
7 #include <map>
8
9 //Class DF_Application responsible for creation and manipulation of Documents
10 class DF_Application {
11 public:
12   //Constructor
13   Standard_EXPORT DF_Application();
14
15   Standard_EXPORT ~DF_Application();
16   
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);
20
21   //Closes and removes the given Document
22   Standard_EXPORT void Close(const DF_Document* theDocument);
23
24   //Returns a Document by Document's ID
25   Standard_EXPORT DF_Document* GetDocument(int theDocumentID);
26
27   //Returns a list of IDs of all currently opened documents
28   Standard_EXPORT std::vector<int> GetDocumentIDs();
29
30   //Returns a number of existent documents
31   Standard_EXPORT int NbDocuments();
32
33   //Virtual methods to be redefined if required by specific application
34
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);
38
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);
41
42 private:
43   int                           _currentID;
44   std::map<int, DF_Document*> _documents;
45
46 };
47 #endif