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