]> SALOME platform Git repositories - modules/kernel.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx
Salome HOME
Copyrights update
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_Driver.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 #ifndef __SALOMEDSIMPL_DRIVER_H__
21 #define __SALOMEDSIMPL_DRIVER_H__
22
23 #include <TCollection_AsciiString.hxx>
24 #include <SALOMEDSImpl_SComponent.hxx>
25 #include <SALOMEDSImpl_SObject.hxx>
26
27
28 class SALOMEDSImpl_Driver
29 {
30 public:
31
32   virtual TCollection_AsciiString GetIOR() = 0;
33
34   virtual unsigned char* Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
35                               const TCollection_AsciiString& theURL,
36                               long& theStreamLength,
37                               bool isMultiFile) = 0;
38
39   virtual unsigned char* SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
40                                    const TCollection_AsciiString& theURL,
41                                    long& theStreamLength,
42                                    bool isMultiFile) = 0;
43   
44   virtual bool Load(const Handle(SALOMEDSImpl_SComponent)& theComponent,
45                     const unsigned char* theStream,
46                     const long theStreamLength,
47                     const TCollection_AsciiString& theURL,
48                     bool isMultiFile) = 0;
49
50   virtual bool LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
51                          const unsigned char* theStream,
52                          const long theStreamLength,
53                          const TCollection_AsciiString& theURL,
54                          bool isMultiFile) = 0;
55
56   virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent) = 0;
57  
58   virtual TCollection_AsciiString ComponentDataType() = 0;
59
60
61   virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
62                                                          const TCollection_AsciiString& IORString,
63                                                          bool isMultiFile,
64                                                          bool isASCII) = 0;
65
66   virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
67                                                          const TCollection_AsciiString& aLocalPersistentID,
68                                                          bool isMultiFile,
69                                                          bool isASCII) = 0;
70
71   virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
72
73   virtual unsigned char* CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject, 
74                                   int& theObjectID,
75                                   long& theStreamLength) = 0;
76
77   virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID) = 0;
78
79   virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
80                                             const long theStreamLength,
81                                             int theObjectID,
82                                             const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
83
84   virtual unsigned char* DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy, 
85                                     bool isPublished, 
86                                     bool& isValidScript,
87                                     long& theStreamLength) = 0;
88 };
89
90 class SALOMEDSImpl_DriverFactory
91 {
92 public:
93   
94   virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType) = 0;
95
96   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR) = 0;
97 };
98
99 #endif