1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __SALOMEDSIMPL_DRIVER_H__
21 #define __SALOMEDSIMPL_DRIVER_H__
23 #include <TCollection_AsciiString.hxx>
24 #include <SALOMEDSImpl_SComponent.hxx>
25 #include <SALOMEDSImpl_SObject.hxx>
26 #include <SALOMEDSImpl_TMPFile.hxx>
29 class SALOMEDSImpl_Driver
33 virtual TCollection_AsciiString GetIOR() = 0;
35 virtual Handle(SALOMEDSImpl_TMPFile) Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
36 const TCollection_AsciiString& theURL,
37 long& theStreamLength,
38 bool isMultiFile) = 0;
40 virtual Handle(SALOMEDSImpl_TMPFile) SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
41 const TCollection_AsciiString& theURL,
42 long& theStreamLength,
43 bool isMultiFile) = 0;
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;
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;
57 virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent) = 0;
59 virtual TCollection_AsciiString ComponentDataType() = 0;
62 virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
63 const TCollection_AsciiString& IORString,
67 virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
68 const TCollection_AsciiString& aLocalPersistentID,
72 virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
74 virtual Handle(SALOMEDSImpl_TMPFile) CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject,
76 long& theStreamLength) = 0;
78 virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID) = 0;
80 virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
81 const long theStreamLength,
83 const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
85 virtual Handle(SALOMEDSImpl_TMPFile) DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy,
88 long& theStreamLength) = 0;
91 class SALOMEDSImpl_DriverFactory
95 virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType) = 0;
97 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR) = 0;