1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_io_XPersistObject_idl__
24#define __com_sun_star_io_XPersistObject_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_io_IOException_idl__
31#include <com/sun/star/io/IOException.idl>
32#endif
33
34
35//=============================================================================
36
37module com {  module sun {  module star {  module io {
38
39 published interface XObjectInputStream;
40 published interface XObjectOutputStream;
41
42//=============================================================================
43
44/** allows to make UNO objects persistent
45
46  <p>Every UNO object, that wants to be serializable, should implement
47     this interface. The object stores stores itself, when the
48     write method is called.
49     <p>
50     The object needs to be created before it deserializes
51     itself again (by using the read method). Therefor it must be
52     createable by name via a factory, which is in general
53     the global service manager. The create and read mechanism
54     is implemented by the <type scope="com::sun::star::io">ObjectInputStream</type>.
55
56     <p>The serialization format (the series of strings, integers, objects) must
57     be specified at the specification of the concrete service.
58
59     <p>The interface does not support any special versioning mechanism.
60
61     @see com::sun::star::io::XObjectOutputStream
62     @see com::sun::star::io::XObjectInputStream
63 */
64published interface XPersistObject: com::sun::star::uno::XInterface
65{
66	//-------------------------------------------------------------------------
67
68	/** gives the service name of the object
69
70      @returns
71			the service name that specifies the behavior and the
72			persistent data format of this implementation.
73
74		<p>This name is used to create such an object by a factory
75        during deserialization. </p>
76
77		@see com::sun::star::lang::XServiceInfo::getAvailableServiceNames
78	 */
79	string getServiceName();
80
81	//-------------------------------------------------------------------------
82
83	// DocMerge from xml: method com::sun::star::io::XPersistObject::write
84	/** writes all the persistent data of the object to the stream.
85        <p>The implementation
86        must write the data in the order documented in the service specification.
87        @param OutStream the stream, the data shall be written to. The stream
88               supports simple types and other XPersistObject implementations.
89	 */
90	void write( [in] com::sun::star::io::XObjectOutputStream OutStream )
91			raises( com::sun::star::io::IOException );
92
93	//-------------------------------------------------------------------------
94
95	// DocMerge from xml: method com::sun::star::io::XPersistObject::read
96	/** reads all the persistent data of the object from the stream.
97        <p>In case
98        other XPersistObjects are read from the stream, the implementation uses a factory
99        to create these objects (in general the global service manager).
100        <p> The implementation must read the data in the order documented at
101        the service specification.
102        @param InStream the stream, the data shall be read from.
103	 */
104	void read( [in] com::sun::star::io::XObjectInputStream InStream )
105			raises( com::sun::star::io::IOException );
106
107};
108
109//=============================================================================
110
111}; }; }; };
112
113#endif
114