xref: /aoo41x/main/offapi/com/sun/star/frame/XStorable.idl (revision d1766043)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_frame_XStorable_idl__
24cdf0e10cSrcweir#define __com_sun_star_frame_XStorable_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__
31cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
35cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweir//=============================================================================
40cdf0e10cSrcweir
41cdf0e10cSrcweir module com {  module sun {  module star {  module frame {
42cdf0e10cSrcweir
43cdf0e10cSrcweir//=============================================================================
44cdf0e10cSrcweir/** offers a simple way to store a component to an URL.
45cdf0e10cSrcweir
46cdf0e10cSrcweir    <p>
47cdf0e10cSrcweir    It is usually only useful for two cases:
48cdf0e10cSrcweir	</p>
49cdf0e10cSrcweir	<ol>
50cdf0e10cSrcweir        <li>
51cdf0e10cSrcweir            Large components which are wrapped up in UNO interfaces
52cdf0e10cSrcweir            and for which distinct filters are not available separately as
53cdf0e10cSrcweir            components.
54cdf0e10cSrcweir        </li>
55cdf0e10cSrcweir        <li>
56cdf0e10cSrcweir            Very small components for which only one or very few hard
57cdf0e10cSrcweir            coded file format filters make sense or even exist.
58cdf0e10cSrcweir        </li>
59cdf0e10cSrcweir	</ol>
60cdf0e10cSrcweir */
61cdf0e10cSrcweirpublished interface XStorable: com::sun::star::uno::XInterface
62cdf0e10cSrcweir{
63cdf0e10cSrcweir	//-------------------------------------------------------------------------
64cdf0e10cSrcweir    /** The object may know the location because it was loaded from there,
65cdf0e10cSrcweir        or because it is stored there.
66cdf0e10cSrcweir
67cdf0e10cSrcweir        @returns
68cdf0e10cSrcweir            <TRUE/> if the object knows a location where it is persistent
69cdf0e10cSrcweir            <FALSE/> otherwise
70cdf0e10cSrcweir	 */
71cdf0e10cSrcweir	boolean hasLocation();
72cdf0e10cSrcweir
73cdf0e10cSrcweir	//-------------------------------------------------------------------------
74cdf0e10cSrcweir    /** After <member>XStorable::storeAsURL()</member> it returns the
75cdf0e10cSrcweir        URL the object was stored to.
76cdf0e10cSrcweir
77cdf0e10cSrcweir        @returns
78cdf0e10cSrcweir            the URL of the resource which is represented by this object.
79cdf0e10cSrcweir	 */
80cdf0e10cSrcweir	string getLocation();
81cdf0e10cSrcweir
82cdf0e10cSrcweir	//-------------------------------------------------------------------------
83cdf0e10cSrcweir    /** It is not possible to call <member>XStorable::store()</member> successfully
84cdf0e10cSrcweir        when the data store is read-only.
85cdf0e10cSrcweir
86cdf0e10cSrcweir        @returns
87cdf0e10cSrcweir            <TRUE/> if the data store is readonly or opened readonly
88cdf0e10cSrcweir            <FALSE/> otherwise
89cdf0e10cSrcweir	 */
90cdf0e10cSrcweir	boolean isReadonly();
91cdf0e10cSrcweir
92cdf0e10cSrcweir	//-------------------------------------------------------------------------
93cdf0e10cSrcweir	/** stores the data to the URL from which it was loaded.
94cdf0e10cSrcweir
95cdf0e10cSrcweir		<p>Only objects which know their locations can be stored.</p>
96cdf0e10cSrcweir
97cdf0e10cSrcweir        @throws com::sun::star::io::IOException
98cdf0e10cSrcweir            if an IO error occured during save operation
99cdf0e10cSrcweir            (may the location is unknown)
100cdf0e10cSrcweir
101cdf0e10cSrcweir        @see XStorable::storeAsURL
102cdf0e10cSrcweir        @see XStorable::storeToURL
103cdf0e10cSrcweir	 */
104cdf0e10cSrcweir	void store()
105cdf0e10cSrcweir			raises( com::sun::star::io::IOException );
106cdf0e10cSrcweir
107cdf0e10cSrcweir	//-------------------------------------------------------------------------
108cdf0e10cSrcweir	/** stores the object's persistent data to a URL and
109cdf0e10cSrcweir        makes this URL the new location of the object.
110cdf0e10cSrcweir
111cdf0e10cSrcweir        <p>This is the normal behavior for UI's "save-as" feature.</p>
112cdf0e10cSrcweir
113cdf0e10cSrcweir        <p>The change of the location makes it necessary to store the document in
114cdf0e10cSrcweir        a format that the object can load. For this reason the implementation of
115cdf0e10cSrcweir        <member>XStorable::storeAsURL()</member> will throw an exception if a pure
116cdf0e10cSrcweir        export filter is used, it will accept only combined import/export filters.
117cdf0e10cSrcweir        For such filters the method <member>XStorable::storeToURL()</member>
118cdf0e10cSrcweir        must be used that does not change the location of the object.</p>
119cdf0e10cSrcweir
120cdf0e10cSrcweir        @param sURL
121cdf0e10cSrcweir            specifies the new location of this component
122cdf0e10cSrcweir
123cdf0e10cSrcweir        @param lArguments
124cdf0e10cSrcweir            optional parameters for saving
125cdf0e10cSrcweir            (see <type scope="com::sun::star::document">MediaDescriptor</type> for further details)
126cdf0e10cSrcweir
127cdf0e10cSrcweir        @throws com::sun::star::io::IOException
128cdf0e10cSrcweir            if an IO error occured during save operation
129cdf0e10cSrcweir            (may the location is unknown)
130cdf0e10cSrcweir
131cdf0e10cSrcweir        @see XStorable::store
132cdf0e10cSrcweir        @see XStorable::storeToURL
133cdf0e10cSrcweir        @see com::sun::star::document::MediaDescriptor
134cdf0e10cSrcweir	 */
135cdf0e10cSrcweir    void storeAsURL(
136cdf0e10cSrcweir        [in] string sURL,
137cdf0e10cSrcweir        [in] sequence<com::sun::star::beans::PropertyValue> lArguments )
138cdf0e10cSrcweir        raises( com::sun::star::io::IOException );
139cdf0e10cSrcweir
140cdf0e10cSrcweir	//-------------------------------------------------------------------------
141cdf0e10cSrcweir	/** stores the object's persistent data to a URL and
142cdf0e10cSrcweir		continues to be a representation of the old URL.
143cdf0e10cSrcweir
144cdf0e10cSrcweir        <p>This is the normal behavior for UI's export feature.</p>
145cdf0e10cSrcweir
146cdf0e10cSrcweir        <p>This method accepts all kinds of export filters, not only combined
147cdf0e10cSrcweir        import/export filters because it implements an exporting capability, not a
148cdf0e10cSrcweir        persistence capability.</p>
149cdf0e10cSrcweir
150cdf0e10cSrcweir        @throws com::sun::star::io::IOException
151cdf0e10cSrcweir            if an IO error occured during save operation
152cdf0e10cSrcweir            (may the location is unknown)
153cdf0e10cSrcweir
154cdf0e10cSrcweir        @param lArguments
155cdf0e10cSrcweir            optional parameters for saving
156cdf0e10cSrcweir            (see <type scope="com::sun::star::document">MediaDescriptor</type> for further details)
157cdf0e10cSrcweir
158cdf0e10cSrcweir        @see XStorable::store
159cdf0e10cSrcweir        @see XStorable::storeAsURL
160cdf0e10cSrcweir        @see com::sun::star::document::MediaDescriptor
161cdf0e10cSrcweir	 */
162cdf0e10cSrcweir    void storeToURL(
163cdf0e10cSrcweir        [in] string sURL,
164cdf0e10cSrcweir        [in] sequence<com::sun::star::beans::PropertyValue> lArguments )
165cdf0e10cSrcweir        raises( com::sun::star::io::IOException );
166cdf0e10cSrcweir};
167cdf0e10cSrcweir
168cdf0e10cSrcweir//=============================================================================
169cdf0e10cSrcweir
170cdf0e10cSrcweir}; }; }; };
171cdf0e10cSrcweir
172cdf0e10cSrcweir#endif
173