Salome HOME
To avoid compilation pb on RedHat 8.0.
[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/ or email : webmaster.salome@opencascade.com
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 #include <SALOMEDSImpl_TMPFile.hxx>
27
28
29 class SALOMEDSImpl_Driver
30 {
31 public:
32
33   virtual TCollection_AsciiString GetIOR() = 0;
34
35   virtual Handle(SALOMEDSImpl_TMPFile) Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
36                                             const TCollection_AsciiString& theURL,
37                                             long& theStreamLength,
38                                             bool isMultiFile) = 0;
39
40   virtual Handle(SALOMEDSImpl_TMPFile) SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
41                                                  const TCollection_AsciiString& theURL,
42                                                  long& theStreamLength,
43                                                  bool isMultiFile) = 0;
44   
45   virtual bool Load(const Handle(SALOMEDSImpl_SComponent)& theComponent,
46                     const unsigned char* theStream,
47                     const long theStreamLength,
48                     const TCollection_AsciiString& theURL,
49                     bool isMultiFile) = 0;
50
51   virtual bool LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
52                          const unsigned char* theStream,
53                          const long theStreamLength,
54                          const TCollection_AsciiString& theURL,
55                          bool isMultiFile) = 0;
56
57   virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent) = 0;
58  
59   virtual TCollection_AsciiString ComponentDataType() = 0;
60
61
62   virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
63                                                          const TCollection_AsciiString& IORString,
64                                                          bool isMultiFile,
65                                                          bool isASCII) = 0;
66
67   virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
68                                                          const TCollection_AsciiString& aLocalPersistentID,
69                                                          bool isMultiFile,
70                                                          bool isASCII) = 0;
71
72   virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
73
74   virtual Handle(SALOMEDSImpl_TMPFile) CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject, 
75                                                 int& theObjectID,
76                                                 long& theStreamLength) = 0;
77   
78   virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID) = 0;
79
80   virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
81                                             const long theStreamLength,
82                                             int theObjectID,
83                                             const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
84
85   virtual Handle(SALOMEDSImpl_TMPFile) DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy, 
86                                                   bool isPublished, 
87                                                   bool& isValidScript,
88                                                   long& theStreamLength) = 0;
89 };
90
91 class SALOMEDSImpl_DriverFactory
92 {
93 public:
94   
95   virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType) = 0;
96
97   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR) = 0;
98 };
99
100 #endif