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