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