1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef DFAPPLICATION_HXX
21 #define DFAPPLICATION_HXX
23 #include "DF_definitions.hxx"
24 #include "DF_Document.hxx"
28 //Class DF_Application responsible for creation and manipulation of Documents
29 class DF_Application {
32 Standard_EXPORT DF_Application();
34 Standard_EXPORT ~DF_Application();
36 //Creates a new document with given type, returns a smart pointer to
37 //newly created document.
38 Standard_EXPORT DF_Document* NewDocument(const std::string& theDocumentType);
40 //Closes and removes the given Document
41 Standard_EXPORT void Close(const DF_Document* theDocument);
43 //Returns a Document by Document's ID
44 Standard_EXPORT DF_Document* GetDocument(int theDocumentID);
46 //Returns a list of IDs of all currently opened documents
47 Standard_EXPORT std::vector<int> GetDocumentIDs();
49 //Returns a number of existent documents
50 Standard_EXPORT int NbDocuments();
52 //Virtual methods to be redefined if required by specific application
54 //Restores a Document from the given file, returns a smart
55 //pointer to opened document.
56 Standard_EXPORT virtual DF_Document* Open(const std::string& theFileName);
58 //Saves a Document in a given file with name theFileName
59 Standard_EXPORT virtual void SaveAs(const DF_Document* theDocument, const std::string& theFileName);
63 std::map<int, DF_Document*> _documents;