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_ucb_HierarchyDataReadAccess_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_ucb_HierarchyDataReadAccess_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_container_XNameAccess_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/container/XNameAccess.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir#ifndef __com_sun_star_container_XHierarchicalNameAccess_idl__ 34*cdf0e10cSrcweir#include <com/sun/star/container/XHierarchicalNameAccess.idl> 35*cdf0e10cSrcweir#endif 36*cdf0e10cSrcweir#ifndef __com_sun_star_util_XChangesNotifier_idl__ 37*cdf0e10cSrcweir#include <com/sun/star/util/XChangesNotifier.idl> 38*cdf0e10cSrcweir#endif 39*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__ 40*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl> 41*cdf0e10cSrcweir#endif 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir//============================================================================= 44*cdf0e10cSrcweir 45*cdf0e10cSrcweirmodule com { module sun { module star { module ucb { 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir//============================================================================= 48*cdf0e10cSrcweir/** provides read access to a fragment of the hierarchy data. 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir <p>A hierarchy data source provides access to a tree of hierarchy data 51*cdf0e10cSrcweir nodes. Each hierarchy data node, except the root node, has a parent that 52*cdf0e10cSrcweir is a hierarchy data node too. A hierarchy data node has a name. 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir <p>Each hierarchy data node has three data members: 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir <ul> 57*cdf0e10cSrcweir <li>"Title", which is of type <atom>string</atom>. It contains a title 58*cdf0e10cSrcweir for the node. This value must not be empty. 59*cdf0e10cSrcweir <li>"TargetURL", which is of type <atom>string</atom></li> It may contain 60*cdf0e10cSrcweir any URL, which will be treated as the target of a hierarchy link. 61*cdf0e10cSrcweir <li>"Children", which is of type <type>HierarchyDataReadAccess</type> or 62*cdf0e10cSrcweir of type <type>HierarchyDataReadWriteAccess</type></li>, depending on the 63*cdf0e10cSrcweir type of the node. This member provides access to the children of a node. 64*cdf0e10cSrcweir </ul> 65*cdf0e10cSrcweir*/ 66*cdf0e10cSrcweirpublished service HierarchyDataReadAccess 67*cdf0e10cSrcweir{ 68*cdf0e10cSrcweir //------------------------------------------------------------------------- 69*cdf0e10cSrcweir /** gives access to the data members of a hierarchy data node. 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir <p>Examples: 72*cdf0e10cSrcweir <ul> 73*cdf0e10cSrcweir <li><code>getByName( "Title" )</code> will return an <atom>any</atom> 74*cdf0e10cSrcweir containing a string containing the title of the node. 75*cdf0e10cSrcweir </li> 76*cdf0e10cSrcweir <li><code>getByName( "Children" )</code> will return an <atom>any</atom> 77*cdf0e10cSrcweir containing an implementation of service 78*cdf0e10cSrcweir <type>HierarchyDataReadAccess</type>, if it was called on a read-only 79*cdf0e10cSrcweir node. It will return an implementation of service 80*cdf0e10cSrcweir <type>HierarchyDataReadWriteAccess</type> if it was called on a 81*cdf0e10cSrcweir writable node. 82*cdf0e10cSrcweir </li> 83*cdf0e10cSrcweir </ul> 84*cdf0e10cSrcweir */ 85*cdf0e10cSrcweir interface com::sun::star::container::XNameAccess; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir //------------------------------------------------------------------------- 88*cdf0e10cSrcweir /** gives access to the data members of a hierarchy data node as well 89*cdf0e10cSrcweir as to any child nodes or to the data members of child nodes using a 90*cdf0e10cSrcweir hierarchical name. 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir <p>A hierarchical name consists of segments that are separated by a 93*cdf0e10cSrcweir single slash ('/'). There is neither a leading nor a trailing slash 94*cdf0e10cSrcweir allowed. 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir <ul> 97*cdf0e10cSrcweir <li> 98*cdf0e10cSrcweir path = segment ( '/' segement )* 99*cdf0e10cSrcweir </li> 100*cdf0e10cSrcweir <li> 101*cdf0e10cSrcweir segment = '[' quoted-string ']' 102*cdf0e10cSrcweir </li> 103*cdf0e10cSrcweir <li> 104*cdf0e10cSrcweir quoted-string = "'" escaped-string "'" 105*cdf0e10cSrcweir </li> 106*cdf0e10cSrcweir <li> 107*cdf0e10cSrcweir escaped-string = escaped accoding to XML attribute naming conventions 108*cdf0e10cSrcweir </li> 109*cdf0e10cSrcweir </ul> 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir <p>Examples: 112*cdf0e10cSrcweir <ul> 113*cdf0e10cSrcweir <li> 114*cdf0e10cSrcweir <code>getByHierarchicalName( "Title" )</code> will return an 115*cdf0e10cSrcweir <atom>any</atom> containing a string containing the title of the node 116*cdf0e10cSrcweir itself. 117*cdf0e10cSrcweir </li> 118*cdf0e10cSrcweir <li> 119*cdf0e10cSrcweir <code>getByHierarchicalName( "Children/['subnode1']" )</code> will give 120*cdf0e10cSrcweir access to the child node named "subnode1" of the node. It will return 121*cdf0e10cSrcweir an <atom>any</atom> containing an implementation of service 122*cdf0e10cSrcweir <type>HierarchyDataReadAccess</type>, if it was called on a read-only 123*cdf0e10cSrcweir node. It will return an implementation of service 124*cdf0e10cSrcweir <type>HierarchyDataReadWriteAccess</type> if it was called on a 125*cdf0e10cSrcweir writable node. 126*cdf0e10cSrcweir </li> 127*cdf0e10cSrcweir <li> 128*cdf0e10cSrcweir <code>getByHierarchicalName( "Children/['subnode2']/TargetURL" )</code> 129*cdf0e10cSrcweir will give direct access to the "TargetURL" data member of the child node 130*cdf0e10cSrcweir named "subnode2" of the node. It will return an <atom>any</atom> 131*cdf0e10cSrcweir containing a <atom>string</atom> containing the target URL of the node. 132*cdf0e10cSrcweir </li> 133*cdf0e10cSrcweir <li> 134*cdf0e10cSrcweir <code>getByHierarchicalName( "Children/['subnode3']/Children" )</code> 135*cdf0e10cSrcweir will give direct access to the "Children" data member of the child node 136*cdf0e10cSrcweir named "subnode3" of the node. It will return an <atom>any</atom> 137*cdf0e10cSrcweir conntaining an implementation of service 138*cdf0e10cSrcweir <type>HierarchyDataReadAccess</type>, if it was called on a read-only 139*cdf0e10cSrcweir node. It will return an implementation of service 140*cdf0e10cSrcweir <type>HierarchyDataReadWriteAccess</type> if it was called on a 141*cdf0e10cSrcweir writable node. 142*cdf0e10cSrcweir </li> 143*cdf0e10cSrcweir </ul> 144*cdf0e10cSrcweir */ 145*cdf0e10cSrcweir interface com::sun::star::container::XHierarchicalNameAccess; 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir //------------------------------------------------------------------------- 148*cdf0e10cSrcweir /** allows registering listeners that observe the hierarchy data source. 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir <p>A client can register an 151*cdf0e10cSrcweir <type scope="com::sun::star::util">XChangesListener</type>, which will 152*cdf0e10cSrcweir receive notifications for any changes within the hierarchy (fragment) 153*cdf0e10cSrcweir this object represents. 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir <p>An implementation should collect as many changes as possible into a 156*cdf0e10cSrcweir single <type scope="com::sun::star::util">ChangesEvent</type>. 157*cdf0e10cSrcweir */ 158*cdf0e10cSrcweir interface com::sun::star::util::XChangesNotifier; 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir //------------------------------------------------------------------------- 161*cdf0e10cSrcweir /** allows controlling or observing the lifetime of the hierarchy data 162*cdf0e10cSrcweir access object. 163*cdf0e10cSrcweir */ 164*cdf0e10cSrcweir interface com::sun::star::lang::XComponent; 165*cdf0e10cSrcweir}; 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir//============================================================================= 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir}; }; }; }; 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir#endif 172