1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_io_XPersistObject_idl__
28#define __com_sun_star_io_XPersistObject_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_io_IOException_idl__
35#include <com/sun/star/io/IOException.idl>
36#endif
37
38
39//=============================================================================
40
41module com {  module sun {  module star {  module io {
42
43 published interface XObjectInputStream;
44 published interface XObjectOutputStream;
45
46//=============================================================================
47
48/** allows to make UNO objects persistent
49
50  <p>Every UNO object, that wants to be serializable, should implement
51     this interface. The object stores stores itself, when the
52     write method is called.
53     <p>
54     The object needs to be created before it deserializes
55     itself again (by using the read method). Therefor it must be
56     createable by name via a factory, which is in general
57     the global service manager. The create and read mechanism
58     is implemented by the <type scope="com::sun::star::io">ObjectInputStream</type>.
59
60     <p>The serialization format (the series of strings, integers, objects) must
61     be specified at the specification of the concrete service.
62
63     <p>The interface does not support any special versioning mechanism.
64
65     @see com::sun::star::io::XObjectOutputStream
66     @see com::sun::star::io::XObjectInputStream
67 */
68published interface XPersistObject: com::sun::star::uno::XInterface
69{
70	//-------------------------------------------------------------------------
71
72	/** gives the service name of the object
73
74      @returns
75			the service name that specifies the behavior and the
76			persistent data format of this implementation.
77
78		<p>This name is used to create such an object by a factory
79        during deserialization. </p>
80
81		@see com::sun::star::lang::XServiceInfo::getAvailableServiceNames
82	 */
83	string getServiceName();
84
85	//-------------------------------------------------------------------------
86
87	// DocMerge from xml: method com::sun::star::io::XPersistObject::write
88	/** writes all the persistent data of the object to the stream.
89        <p>The implementation
90        must write the data in the order documented in the service specification.
91        @param OutStream the stream, the data shall be written to. The stream
92               supports simple types and other XPersistObject implementations.
93	 */
94	void write( [in] com::sun::star::io::XObjectOutputStream OutStream )
95			raises( com::sun::star::io::IOException );
96
97	//-------------------------------------------------------------------------
98
99	// DocMerge from xml: method com::sun::star::io::XPersistObject::read
100	/** reads all the persistent data of the object from the stream.
101        <p>In case
102        other XPersistObjects are read from the stream, the implementation uses a factory
103        to create these objects (in general the global service manager).
104        <p> The implementation must read the data in the order documented at
105        the service specification.
106        @param InStream the stream, the data shall be read from.
107	 */
108	void read( [in] com::sun::star::io::XObjectInputStream InStream )
109			raises( com::sun::star::io::IOException );
110
111};
112
113//=============================================================================
114
115}; }; }; };
116
117#endif
118