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_configuration_ConfigurationProvider_idl__
24cdf0e10cSrcweir#define __com_sun_star_configuration_ConfigurationProvider_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_lang_XMultiServiceFactory_idl__
27cdf0e10cSrcweir#include <com/sun/star/lang/XMultiServiceFactory.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
31cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir//=============================================================================
35cdf0e10cSrcweir
36cdf0e10cSrcweirmodule com { module sun { module star { module configuration {
37cdf0e10cSrcweir
38cdf0e10cSrcweir//=============================================================================
39cdf0e10cSrcweir/** manages one, or more, complete sets of configuration data for
40cdf0e10cSrcweir administrative puposes and serves as a factory for objects that
41cdf0e10cSrcweir provide access to subsets of these shared configurations.
42cdf0e10cSrcweir
43cdf0e10cSrcweir <p>Shared sets of configuration data usually serve to provide defaults,
44cdf0e10cSrcweir which are used if no individual settings are present. Depending on the data
45cdf0e10cSrcweir store multiple layers of defaults may be combined with a user-specific layer
46cdf0e10cSrcweir to make up the final configuration.
47cdf0e10cSrcweir </p>
48cdf0e10cSrcweir <p>Many aspects of the supported behavior depend strongly on the underlying
49cdf0e10cSrcweir data store and on the administrative structures it defines. With some data
50cdf0e10cSrcweir stores this service also enables access to individual users' configuration
51cdf0e10cSrcweir data by an administrator.
52cdf0e10cSrcweir </p>
53cdf0e10cSrcweir <p>On the other hand, in the simplest model there is only a single layer of
54cdf0e10cSrcweir default data which is accessible through this service.
55cdf0e10cSrcweir </p>
56cdf0e10cSrcweir <p>An implementation is usually obtained from a
57cdf0e10cSrcweir <type scope="com::sun::star::lang">ServiceManager</type>. The arguments passed to
58cdf0e10cSrcweir <member scope="com::sun::star::lang">XMultiComponentFactory::createInstanceWithContextAndArguments()</member>
59cdf0e10cSrcweir select the configuration data source. They may also define the scope of
60cdf0e10cSrcweir administrable data or contain credentials to be used to authorize the
61cdf0e10cSrcweir administrative access. Missing parameters may be filled in
62cdf0e10cSrcweir from the context or the environment.
63cdf0e10cSrcweir </p>
64cdf0e10cSrcweir
65cdf0e10cSrcweir @see com::sun::star::configuration::ConfigurationProvider
66cdf0e10cSrcweir	Offers the same services and creates the same accessor objects as this
67cdf0e10cSrcweir	service, but accesses the personal configuration.
68cdf0e10cSrcweir
69cdf0e10cSrcweir	<p>A <type> ConfigurationProvider</type> provides access to the personal
70cdf0e10cSrcweir	layer of configuration data of the current user context. It should in
71cdf0e10cSrcweir	most cases be used when <em>using</em> the configuration data, although
72cdf0e10cSrcweir	for most contexts a <type>AdministrationProvider</type> can be used as
73cdf0e10cSrcweir	a drop-in replacement.
74cdf0e10cSrcweir	</p>
75cdf0e10cSrcweir */
76cdf0e10cSrcweirpublished service AdministrationProvider
77cdf0e10cSrcweir{
78cdf0e10cSrcweir/** allows creating access objects for specific views such as subsets and fragments
79cdf0e10cSrcweir of the configuration.
80cdf0e10cSrcweir
81cdf0e10cSrcweir <p>The parameter <var>aServiceSpecifier</var> passed to
82cdf0e10cSrcweir <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
83cdf0e10cSrcweir supports at least the service specifiers
84cdf0e10cSrcweir <code>"com.sun.star.configuration.ConfigurationAccess"</code> and
85cdf0e10cSrcweir <code>"com.sun.star.configuration.ConfigurationUpdateAccess"</code>.
86cdf0e10cSrcweir </p>
87cdf0e10cSrcweir
88cdf0e10cSrcweir <p>Using the first of these service specifiers requests a read-only view of
89cdf0e10cSrcweir the configuration.
90cdf0e10cSrcweir The object that is created implements service <type>ConfigurationAccess</type>.
91cdf0e10cSrcweir To reflect its <em>element role</em> as root of the view, it implements
92cdf0e10cSrcweir service <type>AccessRootElement</type>.
93cdf0e10cSrcweir </p>
94cdf0e10cSrcweir
95cdf0e10cSrcweir <p>Using the second form requests an updatable view of the configuration.
96cdf0e10cSrcweir The object that is created should implement service
97cdf0e10cSrcweir <type>ConfigurationUpdateAccess</type>. To reflect its <em>element role</em>
98cdf0e10cSrcweir which includes controlling updates for the whole view, it implements
99cdf0e10cSrcweir service <type>UpdateRootElement</type>.
100cdf0e10cSrcweir <BR />If the root element of the view is marked read-only (as indicated
101cdf0e10cSrcweir by <const scope="com::sun::star::beans">PropertyAttributes::READONLY</const>),
102cdf0e10cSrcweir the implementation may either raise an exception or return a (read-only)
103cdf0e10cSrcweir <type>ConfigurationAccess</type>/<type>AccessRootElement</type> instead.
104cdf0e10cSrcweir </p>
105cdf0e10cSrcweir
106cdf0e10cSrcweir <p>The arguments passed to
107cdf0e10cSrcweir <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
108cdf0e10cSrcweir in parameter <var>aArguments</var> specify the administrative entity for which
109cdf0e10cSrcweir data should be administered. In other words they determine the layer to which
110cdf0e10cSrcweir changes will apply. They also specify the view of that configuration that
111cdf0e10cSrcweir should be created. That is, they determine the subset of elements that can be
112cdf0e10cSrcweir accessed starting from the returned object. Each element of the argument
113cdf0e10cSrcweir sequence should be a <type scope="com::sun::star::beans">PropertyValue</type>
114cdf0e10cSrcweir or a <type scope="com::sun::star::beans">NamedValue</type>,
115cdf0e10cSrcweir so that the parameters can be identified by name rather than by position.
116cdf0e10cSrcweir </p>
117cdf0e10cSrcweir
118cdf0e10cSrcweir <p>What combinations of arguments are supported depends on the service name
119cdf0e10cSrcweir and on the data store being administered.
120cdf0e10cSrcweir </p>
121cdf0e10cSrcweir
122cdf0e10cSrcweir <p>With both of the standard service-specifiers above, an implementation must
123cdf0e10cSrcweir accept a single argument named <code>nodepath</code> of type <atom>string</atom>.
124cdf0e10cSrcweir This argument must contain the absolute path to an element of the
125cdf0e10cSrcweir configuration. The view that is selected consists of the named element and
126cdf0e10cSrcweir all its decendants. The administrative entity is the default for the
127cdf0e10cSrcweir <type>AdministrationProvider</type>. Usually this is the largest entity
128cdf0e10cSrcweir encompassing all entities accessible from this instance. In other words this
129cdf0e10cSrcweir can be used to influence as global a scope as possible.
130cdf0e10cSrcweir </p>
131cdf0e10cSrcweir
132cdf0e10cSrcweir <p>Other arguments can be used to select a more specific entity and to control
133cdf0e10cSrcweir the behavior of the view. These are different for different implementations
134cdf0e10cSrcweir and data stores. Whether and how they are used may also depend on properties
135cdf0e10cSrcweir that were selected when the provider was created.
136cdf0e10cSrcweir </p>
137cdf0e10cSrcweir
138cdf0e10cSrcweir <p>An implementation may ignore unknown arguments.</p>
139cdf0e10cSrcweir
140cdf0e10cSrcweir <p>Some parameters that are commonly supported are described for service
141cdf0e10cSrcweir <type>ConfigurationProvider</type>.
142cdf0e10cSrcweir </p>
143cdf0e10cSrcweir <p>One notable difference exists for parameter <code>"Locale"</code>. For a
144cdf0e10cSrcweir <type>ConfigurationProvider</type> the default behavior usually is to select
145cdf0e10cSrcweir the locale set up for the user. But this service by default gets data for all
146cdf0e10cSrcweir locales for which data is present. Locale-dependent values in this case are
147cdf0e10cSrcweir replaced by a <type>SetAccess</type> using the language names as accessors.
148cdf0e10cSrcweir This also allows targetted setting of values for selected locales.
149cdf0e10cSrcweir This behavior can be requested explicitly by specifing a special argument
150cdf0e10cSrcweir value <code>locale = "*"</code>.
151cdf0e10cSrcweir </p>
152cdf0e10cSrcweir
153cdf0e10cSrcweir <p><member scope="com::sun::star::lang">XMultiServiceFactory::createInstance()</member>
154cdf0e10cSrcweir may be unusable. Only an implementation that supports service names that can be
155cdf0e10cSrcweir used with no further arguments support this method. It should return the
156cdf0e10cSrcweir same result as if
157cdf0e10cSrcweir <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
158cdf0e10cSrcweir had been called using an empty sequence of arguments.
159cdf0e10cSrcweir </p>
160cdf0e10cSrcweir*/
161cdf0e10cSrcweir	interface com::sun::star::lang::XMultiServiceFactory;
162cdf0e10cSrcweir
163cdf0e10cSrcweir
164cdf0e10cSrcweir/** allows controlling or observing the lifetime of the configuration.
165cdf0e10cSrcweir
166cdf0e10cSrcweir <p>The owner of the provider may dispose of this object
167cdf0e10cSrcweir using <member scope="com::sun::star::lang">XComponent::dispose()</member>.
168cdf0e10cSrcweir </p>
169cdf0e10cSrcweir
170cdf0e10cSrcweir <p>Views created by the provider generally refer to data that is managed by
171cdf0e10cSrcweir  the provider. Therefore, disposing of the provider will cause all objects
172cdf0e10cSrcweir  belonging to these views to be disposed of as well. This does not apply to
173cdf0e10cSrcweir  <em>snapshot</em> views that have their own copy of the data, if available.
174cdf0e10cSrcweir </p>
175cdf0e10cSrcweir
176cdf0e10cSrcweir*/
177cdf0e10cSrcweir	interface com::sun::star::lang::XComponent;
178cdf0e10cSrcweir
179cdf0e10cSrcweir};
180cdf0e10cSrcweir
181cdf0e10cSrcweir//=============================================================================
182cdf0e10cSrcweir
183cdf0e10cSrcweir}; }; }; };
184cdf0e10cSrcweir
185cdf0e10cSrcweir#endif
186cdf0e10cSrcweir
187cdf0e10cSrcweir
188