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_embed_XLinkageSupport_idl__
24#define __com_sun_star_embed_XLinkageSupport_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_embed_XStorage_idl__
31#include <com/sun/star/embed/XStorage.idl>
32#endif
33
34#ifndef __com_sun_star_embed_XCommonEmbedPersist_idl__
35#include <com/sun/star/embed/XCommonEmbedPersist.idl>
36#endif
37
38#ifndef __com_sun_star_beans_PropertyValue_idl__
39#include <com/sun/star/beans/PropertyValue.idl>
40#endif
41
42#ifndef __com_sun_star_embed_WrongStateException_idl__
43#include <com/sun/star/embed/WrongStateException.idl>
44#endif
45
46//============================================================================
47
48 module com {  module sun {  module star {  module embed {
49
50//============================================================================
51/** specifies an additional implementation for linked embedded object support.
52 */
53published interface XLinkageSupport: XCommonEmbedPersist
54{
55	//------------------------------------------------------------------------
56    /** breaks the link and provides the object with a parent storage and a
57		name for object's entry
58
59		<p>
60		This method can be used only for links implementations that implement
61		the whole set of embedded object interfaces. Usually the sets of
62		interfaces are the same for links and objects. An example of exception
63		from this are OpenOffice links that do not implement
64		<type>XEmbedPersist</type> interface. For such cases the method will
65		throw an exception.
66		</p>
67
68		<p>
69		The link will be broken and the linked object will become a normal
70		embedded object.
71		</p>
72
73		<p>
74		An entry with the specified name should be created\opened inside
75		provided storage. This entry will be used for the object persistence.
76		If the entry exists already all it's contents will be ignored.
77		</p>
78
79		@param xStorage
80			a parent storage the entry should be created\opened in
81
82		@param sEntryName
83			a name for the entry
84
85		@throws ::com::sun::star::lang::IllegalArgumentException
86			one of arguments is illegal
87
88        @throws com::sun::star::embed::WrongStateException
89			the object is in wrong state or not a linked object
90
91        @throws com::sun::star::io::IOException
92			in case object has not persistence or other io problems
93
94        @throws com::sun::star::uno::Exception
95			in case of other problems
96
97		@see also XEmbedPersist::setPersistentEntry
98	 */
99	void breakLink( [in] ::com::sun::star::embed::XStorage xStorage,
100					[in] string sEntryName )
101		raises( ::com::sun::star::lang::IllegalArgumentException,
102				::com::sun::star::embed::WrongStateException,
103				::com::sun::star::io::IOException,
104				::com::sun::star::uno::Exception );
105
106
107	//------------------------------------------------------------------------
108    /** allows to detect whether the object is a linked one.
109		<p>
110			Most of embedded objects will not support this interface, but some
111		of them can do it, to allow conversion from link to object. After
112		the conversion the object does not change, so interface set staies the
113		same, but the object is not a link any more.
114		</p>
115
116		@return
117			<TRUE/> - the object is a linked one.
118			<FALSE/> - otherwise
119
120        @throws com::sun::star::embed::WrongStateException
121			the object is in wrong state
122	 */
123	boolean isLink()
124		raises( ::com::sun::star::embed::WrongStateException );
125
126	//------------------------------------------------------------------------
127    /** returns the URL of the link object.
128
129        @throws com::sun::star::embed::WrongStateException
130			the object is in wrong state or is not a link
131	 */
132	string getLinkURL()
133		raises( ::com::sun::star::embed::WrongStateException,
134				::com::sun::star::uno::Exception );
135};
136
137//============================================================================
138
139}; }; }; };
140
141#endif
142
143