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