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