1*408a4873SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*408a4873SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*408a4873SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*408a4873SAndrew Rist * distributed with this work for additional information
6*408a4873SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*408a4873SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*408a4873SAndrew Rist * "License"); you may not use this file except in compliance
9*408a4873SAndrew Rist * with the License.  You may obtain a copy of the License at
10*408a4873SAndrew Rist *
11*408a4873SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*408a4873SAndrew Rist *
13*408a4873SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*408a4873SAndrew Rist * software distributed under the License is distributed on an
15*408a4873SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*408a4873SAndrew Rist * KIND, either express or implied.  See the License for the
17*408a4873SAndrew Rist * specific language governing permissions and limitations
18*408a4873SAndrew Rist * under the License.
19*408a4873SAndrew Rist *
20*408a4873SAndrew Rist *************************************************************/
21*408a4873SAndrew Rist
22*408a4873SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_registry_DefaultRegistry_idl__
24cdf0e10cSrcweir#define __com_sun_star_registry_DefaultRegistry_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_registry_XSimpleRegistry_idl__
27cdf0e10cSrcweir#include <com/sun/star/registry/XSimpleRegistry.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir
31cdf0e10cSrcweir//=============================================================================
32cdf0e10cSrcweir
33cdf0e10cSrcweir module com {  module sun {  module star {  module registry {
34cdf0e10cSrcweir
35cdf0e10cSrcweir//=============================================================================
36cdf0e10cSrcweir
37cdf0e10cSrcweir// DocMerge from xml: service com::sun::star::registry::DefaultRegistry
38cdf0e10cSrcweir/** implicitly supports a local registry and a read-only
39cdf0e10cSrcweir	system registry for global information.
40cdf0e10cSrcweir	In the context of this service,
41cdf0e10cSrcweir	the functions <code>open</code>, <code>close</code>, and <code>destroy</code>
42cdf0e10cSrcweir	from <type>XSimpleRegistry</type> are not supported and throw an exception
43cdf0e10cSrcweir	if they are used.
44cdf0e10cSrcweir	<dl>
45cdf0e10cSrcweir	<dt>Functions of <type>XSimpleRegistry</type>:
46cdf0e10cSrcweir	<dl>
47cdf0e10cSrcweir	<dt>	<b>getURL</b>
48cdf0e10cSrcweir	</dt>
49cdf0e10cSrcweir	<dd> returns the name of the local registry.
50cdf0e10cSrcweir	</dd>
51cdf0e10cSrcweir	<dt>	<b>isValid</b>
52cdf0e10cSrcweir	</dt>
53cdf0e10cSrcweir	<dd> checks if the local registry is valid. If the interface is not <NULL/>
54cdf0e10cSrcweir	the local registry should always be valid.
55cdf0e10cSrcweir	</dd>
56cdf0e10cSrcweir	<dt>	<b>isReadOnly</b>  </dt>
57cdf0e10cSrcweir	<dd> checks if the local registry has write protection.
58cdf0e10cSrcweir	</dd>
59cdf0e10cSrcweir	<dt>	<b>mergeKey</b>
60cdf0e10cSrcweir	</dt>
61cdf0e10cSrcweir	<dd> merges all information from the specified registry in the local registry.
62cdf0e10cSrcweir	</dd>
63cdf0e10cSrcweir	<dt>	<b>getRootKey</b>
64cdf0e10cSrcweir	</dt>
65cdf0e10cSrcweir	<dd> returns a virtual rootkey of both registries.
66cdf0e10cSrcweir	</dd>
67cdf0e10cSrcweir	</dl>
68cdf0e10cSrcweir
69cdf0e10cSrcweir	<br>
70cdf0e10cSrcweir
71cdf0e10cSrcweir	</dt>
72cdf0e10cSrcweir	<dt>Functions of XRegistryKey:
73cdf0e10cSrcweir	<dl>
74cdf0e10cSrcweir	<dt> <b>openKey</b>
75cdf0e10cSrcweir	</dt>
76cdf0e10cSrcweir	<dd> returns a virtual key which is specified in the local or the sytem
77cdf0e10cSrcweir	registry.
78cdf0e10cSrcweir	</dd>
79cdf0e10cSrcweir	<dt> <b>deleteKey</b>
80cdf0e10cSrcweir	</dt>
81cdf0e10cSrcweir	<dd> deletes the key only if it is present in the local registry.
82cdf0e10cSrcweir	</dd>
83cdf0e10cSrcweir	<dt> <b>setLongValue, setAsciiValue, setStringValue, setBinaryValue</b>
84cdf0e10cSrcweir	</dt>
85cdf0e10cSrcweir	<dd> sets the value at the specified key in the local registry.
86cdf0e10cSrcweir	</dd>
87cdf0e10cSrcweir	<dt> <b>getLongValue, getAsciiValue, getStringValue, getBinaryValue</b>
88cdf0e10cSrcweir	</dt>
89cdf0e10cSrcweir	<dd> returns the value at the specified key in the local registry, or if
90cdf0e10cSrcweir	the value is not present in the local registry, it will return the value of the
91cdf0e10cSrcweir	system registry.
92cdf0e10cSrcweir	</dd>
93cdf0e10cSrcweir	<dt> <b>openKeys</b>
94cdf0e10cSrcweir	</dt>
95cdf0e10cSrcweir	<dd> returns a sequence of all subkeys in both registries.
96cdf0e10cSrcweir	</dd>
97cdf0e10cSrcweir	<dt> <b>getKeyNames</b>
98cdf0e10cSrcweir	</dt>
99cdf0e10cSrcweir	<dd> returns a sequence with the names of all subkeys in both registries.
100cdf0e10cSrcweir	</dd>
101cdf0e10cSrcweir	<dt>
102cdf0e10cSrcweir	<br>
103cdf0e10cSrcweir	<b>Note: all write functions only work on the local registry.</b>
104cdf0e10cSrcweir	</dt>
105cdf0e10cSrcweir	</dl>
106cdf0e10cSrcweir
107cdf0e10cSrcweir	<br>
108cdf0e10cSrcweir
109cdf0e10cSrcweir	</dt>
110cdf0e10cSrcweir	<dt>How to find the registries:
111cdf0e10cSrcweir	<dl>
112cdf0e10cSrcweir	<dt> search for the system registry:
113cdf0e10cSrcweir	</dt>
114cdf0e10cSrcweir	<dd> The system registry will always be searched in the same directory as the
115cdf0e10cSrcweir	executable. The name of the system registry is "applicat.rdb". If the system
116cdf0e10cSrcweir	registry was not found, then the environment variable STAR_REGISTRY will be checked.
117cdf0e10cSrcweir	If this variable was set, it must contain a full path to a valid system registry.
118cdf0e10cSrcweir	</dd>
119cdf0e10cSrcweir	<dt>	Search for the user registry using the following rules:
120cdf0e10cSrcweir	</dt>
121cdf0e10cSrcweir	<dd>
122cdf0e10cSrcweir	<dl>
123cdf0e10cSrcweir	<dt> 1. (for further use) search in sversion.ini (.sversionrc) for an entry
124cdf0e10cSrcweir	REGISTRY_VERSION_STRING (example: UserRegistry 5.0/505=test.rdb) in the section
125cdf0e10cSrcweir	[Registry]. If found, then take this value instead of "user.rdb" as "REGISTRY NAME".
126cdf0e10cSrcweir	</dt>
127cdf0e10cSrcweir	<dt> 2. Search in the config directory of the user for a file "REGISTRY NAME". If
128cdf0e10cSrcweir	found, return the full path and name of the file. If not found, retry this
129cdf0e10cSrcweir	step with a dot before "REGISTRY NAME".
130cdf0e10cSrcweir	</dt>
131cdf0e10cSrcweir	<dt> 3. If not found, a new user registry with name user.rdb will be created in the user
132cdf0e10cSrcweir	config directory.
133cdf0e10cSrcweir	</dt>
134cdf0e10cSrcweir	</dl>
135cdf0e10cSrcweir	</dd>
136cdf0e10cSrcweir	</dl>
137cdf0e10cSrcweir	</dt>
138cdf0e10cSrcweir	</dl>
139cdf0e10cSrcweir	<h4>Guarantees:</h4>
140cdf0e10cSrcweir
141cdf0e10cSrcweir	<ul>
142cdf0e10cSrcweir	<li>-thread safe</li>
143cdf0e10cSrcweir	</ul>
144cdf0e10cSrcweir */
145cdf0e10cSrcweirpublished service DefaultRegistry
146cdf0e10cSrcweir{
147cdf0e10cSrcweir	// DocMerge: empty anyway
148cdf0e10cSrcweir	interface com::sun::star::registry::XSimpleRegistry;
149cdf0e10cSrcweir
150cdf0e10cSrcweir};
151cdf0e10cSrcweir
152cdf0e10cSrcweir//=============================================================================
153cdf0e10cSrcweir
154cdf0e10cSrcweir}; }; }; };
155cdf0e10cSrcweir
156cdf0e10cSrcweir/*=============================================================================
157cdf0e10cSrcweir
158cdf0e10cSrcweir=============================================================================*/
159cdf0e10cSrcweir#endif
160