1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XRelationshipAccess_idl__
28*cdf0e10cSrcweir#define __com_sun_star_embed_XRelationshipAccess_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_beans_StringPair_idl__
35*cdf0e10cSrcweir#include <com/sun/star/beans/StringPair.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__
39*cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_container_ElementExistException_idl__
43*cdf0e10cSrcweir#include <com/sun/star/container/ElementExistException.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__
47*cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl>
48*cdf0e10cSrcweir#endif
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir//============================================================================
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir module com {  module sun {  module star {  module embed {
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir//============================================================================
55*cdf0e10cSrcweir/** This interface allows to ge access to relationship data.
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir	<p>
58*cdf0e10cSrcweir	The relationship data is organized as a set of entries. Each of entry
59*cdf0e10cSrcweir	is represented by a set of tags, where each tag has unique for this entry
60*cdf0e10cSrcweir	name and a string value. An entry must contain at least one tag named
61*cdf0e10cSrcweir	"ID", the value of this tag must be uniqued for the whole set of entries,
62*cdf0e10cSrcweir	this tag is used as a uniqued identified of an entry.
63*cdf0e10cSrcweir	</p>
64*cdf0e10cSrcweir */
65*cdf0e10cSrcweirpublished interface XRelationshipAccess : ::com::sun::star::uno::XInterface
66*cdf0e10cSrcweir{
67*cdf0e10cSrcweir	// -----------------------------------------------------------------------
68*cdf0e10cSrcweir	/** allows to detect whether there is an entry with specified value of
69*cdf0e10cSrcweir		"ID" tag.
70*cdf0e10cSrcweir
71*cdf0e10cSrcweir		@param sID
72*cdf0e10cSrcweir			the value of "ID" tag
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
75*cdf0e10cSrcweir			in case there is a problem reading the relations info
76*cdf0e10cSrcweir	 */
77*cdf0e10cSrcweir	boolean hasByID( [in] string sID )
78*cdf0e10cSrcweir		raises( ::com::sun::star::io::IOException );
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir	// -----------------------------------------------------------------------
81*cdf0e10cSrcweir	/** retrieves the value of "Target" tag from the entry with specified "ID"
82*cdf0e10cSrcweir		tag.
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir		<p>
85*cdf0e10cSrcweir		If the entry has no "Target" tag an empty string is returned.
86*cdf0e10cSrcweir		</p>
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir		@param sID
89*cdf0e10cSrcweir			the value of "ID" tag
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir		@throws ::com::sun::star::container::NoSuchElementException
92*cdf0e10cSrcweir			in case there is no entry with specified tag
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
95*cdf0e10cSrcweir			in case there is a problem reading the relations info
96*cdf0e10cSrcweir	 */
97*cdf0e10cSrcweir	string getTargetByID( [in] string sID )
98*cdf0e10cSrcweir		raises( ::com::sun::star::container::NoSuchElementException,
99*cdf0e10cSrcweir				::com::sun::star::io::IOException );
100*cdf0e10cSrcweir
101*cdf0e10cSrcweir	// -----------------------------------------------------------------------
102*cdf0e10cSrcweir	/** retrieves the value of "Type" tag from the entry with specified "ID"
103*cdf0e10cSrcweir		tag.
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir		<p>
106*cdf0e10cSrcweir		If the entry has no "Type" tag an empty string is returned.
107*cdf0e10cSrcweir		</p>
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir		@param sID
110*cdf0e10cSrcweir			the value of "ID" tag
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir		@throws ::com::sun::star::container::NoSuchElementException
113*cdf0e10cSrcweir			in case there is no entry with specified tag
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
116*cdf0e10cSrcweir			in case there is a problem reading the relations info
117*cdf0e10cSrcweir	 */
118*cdf0e10cSrcweir	string getTypeByID( [in] string sID )
119*cdf0e10cSrcweir		raises( ::com::sun::star::container::NoSuchElementException,
120*cdf0e10cSrcweir				::com::sun::star::io::IOException );
121*cdf0e10cSrcweir
122*cdf0e10cSrcweir	// -----------------------------------------------------------------------
123*cdf0e10cSrcweir	/** retrieves the sequence containing all the tags from the entry with
124*cdf0e10cSrcweir		specified value of "ID" tag.
125*cdf0e10cSrcweir
126*cdf0e10cSrcweir		@param sID
127*cdf0e10cSrcweir			the value of "ID" tag
128*cdf0e10cSrcweir
129*cdf0e10cSrcweir		@returns
130*cdf0e10cSrcweir			sequence, each element of the sequence represents tag,
131*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::First
132*cdf0e10cSrcweir			represents the tag name and
133*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::Second
134*cdf0e10cSrcweir			represents the tag value
135*cdf0e10cSrcweir
136*cdf0e10cSrcweir		@throws ::com::sun::star::container::NoSuchElementException
137*cdf0e10cSrcweir			in case there is no entry with specified tag
138*cdf0e10cSrcweir
139*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
140*cdf0e10cSrcweir			in case there is a problem reading the relations info
141*cdf0e10cSrcweir	 */
142*cdf0e10cSrcweir	sequence< ::com::sun::star::beans::StringPair >
143*cdf0e10cSrcweir			getRelationshipByID( [in] string sID )
144*cdf0e10cSrcweir		raises( ::com::sun::star::container::NoSuchElementException,
145*cdf0e10cSrcweir				::com::sun::star::io::IOException );
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir	// -----------------------------------------------------------------------
148*cdf0e10cSrcweir	/** retrieves the sequence containing all the entries which "Type" tag
149*cdf0e10cSrcweir		takes the specified value.
150*cdf0e10cSrcweir
151*cdf0e10cSrcweir		@param sType
152*cdf0e10cSrcweir			specified value of "Type" tag, the parameter can contain an empty
153*cdf0e10cSrcweir			string, in this case all the entries that have empty "Type" tag or
154*cdf0e10cSrcweir			no such tag at all are returned
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir		@returns
157*cdf0e10cSrcweir			sequence of entries, each entry is represented by sequence,
158*cdf0e10cSrcweir			each element of the sequence represents tag,
159*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::First
160*cdf0e10cSrcweir			represents the tag name and
161*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::Second
162*cdf0e10cSrcweir			represents the tag value.
163*cdf0e10cSrcweir			The sequence should contain the "ID" tag.
164*cdf0e10cSrcweir
165*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
166*cdf0e10cSrcweir			in case there is a problem reading the relations info
167*cdf0e10cSrcweir	 */
168*cdf0e10cSrcweir	sequence< sequence< ::com::sun::star::beans::StringPair > >
169*cdf0e10cSrcweir			getRelationshipsByType( [in] string sType )
170*cdf0e10cSrcweir		raises( ::com::sun::star::io::IOException );
171*cdf0e10cSrcweir
172*cdf0e10cSrcweir	// -----------------------------------------------------------------------
173*cdf0e10cSrcweir	/** retrieves the sequence containing all the entries controlled by the
174*cdf0e10cSrcweir		object.
175*cdf0e10cSrcweir
176*cdf0e10cSrcweir		@returns
177*cdf0e10cSrcweir			sequence of entries, each entry is represented by sequence,
178*cdf0e10cSrcweir			each element of the sequence represents tag,
179*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::First
180*cdf0e10cSrcweir			represents the tag name and
181*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::Second
182*cdf0e10cSrcweir			represents the tag value
183*cdf0e10cSrcweir
184*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
185*cdf0e10cSrcweir			in case there is a problem reading the relations info
186*cdf0e10cSrcweir	 */
187*cdf0e10cSrcweir	sequence< sequence< ::com::sun::star::beans::StringPair > >
188*cdf0e10cSrcweir			getAllRelationships()
189*cdf0e10cSrcweir		raises( ::com::sun::star::io::IOException );
190*cdf0e10cSrcweir
191*cdf0e10cSrcweir	// -----------------------------------------------------------------------
192*cdf0e10cSrcweir	/** allows to insert an entry.
193*cdf0e10cSrcweir
194*cdf0e10cSrcweir		@param sID
195*cdf0e10cSrcweir			the value of "ID" tag
196*cdf0e10cSrcweir
197*cdf0e10cSrcweir		@param aEntry
198*cdf0e10cSrcweir			a sequence, each element of the sequence represents tag,
199*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::First
200*cdf0e10cSrcweir			represents the tag name and
201*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::Second
202*cdf0e10cSrcweir			represents the tag value.
203*cdf0e10cSrcweir			May not contain "ID" tag, that is already specified in previous
204*cdf0e10cSrcweir			parameter.
205*cdf0e10cSrcweir
206*cdf0e10cSrcweir		@param bReplace
207*cdf0e10cSrcweir			specifies whether the replacement of existing entry is allowed
208*cdf0e10cSrcweir
209*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
210*cdf0e10cSrcweir			in case there is a problem reading/writing the relations info
211*cdf0e10cSrcweir
212*cdf0e10cSrcweir		@throws ::com::sun::star::container::ElementExistException
213*cdf0e10cSrcweir			in case an element with the specified "ID" tag exists already, and
214*cdf0e10cSrcweir			no replacement is allowed
215*cdf0e10cSrcweir	 */
216*cdf0e10cSrcweir	void insertRelationshipByID(
217*cdf0e10cSrcweir			[in] string sID,
218*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::StringPair > aEntry,
219*cdf0e10cSrcweir			[in] boolean bReplace )
220*cdf0e10cSrcweir		raises( ::com::sun::star::container::ElementExistException,
221*cdf0e10cSrcweir				::com::sun::star::io::IOException );
222*cdf0e10cSrcweir
223*cdf0e10cSrcweir	// -----------------------------------------------------------------------
224*cdf0e10cSrcweir	/** allows to remove an entry.
225*cdf0e10cSrcweir
226*cdf0e10cSrcweir		@param sID
227*cdf0e10cSrcweir			the value of "ID" tag
228*cdf0e10cSrcweir
229*cdf0e10cSrcweir		@throws ::com::sun::star::container::NoSuchElementException
230*cdf0e10cSrcweir			in case there is no entry with specified tag
231*cdf0e10cSrcweir
232*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
233*cdf0e10cSrcweir			in case there is a problem reading/writing the relations info
234*cdf0e10cSrcweir	 */
235*cdf0e10cSrcweir	void removeRelationshipByID( [in] string sID )
236*cdf0e10cSrcweir		raises( ::com::sun::star::container::NoSuchElementException,
237*cdf0e10cSrcweir				::com::sun::star::io::IOException );
238*cdf0e10cSrcweir
239*cdf0e10cSrcweir	// -----------------------------------------------------------------------
240*cdf0e10cSrcweir	/** allows to insert a set of entries
241*cdf0e10cSrcweir
242*cdf0e10cSrcweir		@param aEntries
243*cdf0e10cSrcweir			sequence of entries, each entry is represented by sequence,
244*cdf0e10cSrcweir			each element of the sequence represents tag,
245*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::First
246*cdf0e10cSrcweir			represents the tag name and
247*cdf0e10cSrcweir			<type scope="::com::sun::star::beans">StringPair</type>::Second
248*cdf0e10cSrcweir			represents the tag value.
249*cdf0e10cSrcweir			Each entry must contain "ID" tag.
250*cdf0e10cSrcweir
251*cdf0e10cSrcweir		@param bReplace
252*cdf0e10cSrcweir			specifies whether the replacement of existing entry is allowed
253*cdf0e10cSrcweir
254*cdf0e10cSrcweir		@throws ::com::sun::star::container::ElementExistException
255*cdf0e10cSrcweir			in case an element with the provided "ID" tag exists already, and
256*cdf0e10cSrcweir			no replacement is allowed
257*cdf0e10cSrcweir
258*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
259*cdf0e10cSrcweir			in case there is a problem reading/writing the relations info
260*cdf0e10cSrcweir	 */
261*cdf0e10cSrcweir	void insertRelationships(
262*cdf0e10cSrcweir			[in] sequence< sequence< ::com::sun::star::beans::StringPair > > aEntries,
263*cdf0e10cSrcweir			[in] boolean bReplace )
264*cdf0e10cSrcweir		raises( ::com::sun::star::container::ElementExistException,
265*cdf0e10cSrcweir				::com::sun::star::io::IOException );
266*cdf0e10cSrcweir
267*cdf0e10cSrcweir	// -----------------------------------------------------------------------
268*cdf0e10cSrcweir	/** allows to clear the set of entries.
269*cdf0e10cSrcweir
270*cdf0e10cSrcweir		@throws ::com::sun::star::io::IOException
271*cdf0e10cSrcweir			in case there is a problem reading/writing the relations info
272*cdf0e10cSrcweir	 */
273*cdf0e10cSrcweir	void clearRelationships()
274*cdf0e10cSrcweir		raises( ::com::sun::star::io::IOException );
275*cdf0e10cSrcweir
276*cdf0e10cSrcweir};
277*cdf0e10cSrcweir
278*cdf0e10cSrcweir//============================================================================
279*cdf0e10cSrcweir
280*cdf0e10cSrcweir}; }; }; };
281*cdf0e10cSrcweir
282*cdf0e10cSrcweir#endif
283*cdf0e10cSrcweir
284