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