1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_registry_XSimpleRegistry_idl__
24#define __com_sun_star_registry_XSimpleRegistry_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_registry_InvalidRegistryException_idl__
31#include <com/sun/star/registry/InvalidRegistryException.idl>
32#endif
33
34#ifndef __com_sun_star_registry_XRegistryKey_idl__
35#include <com/sun/star/registry/XRegistryKey.idl>
36#endif
37
38#ifndef __com_sun_star_registry_MergeConflictException_idl__
39#include <com/sun/star/registry/MergeConflictException.idl>
40#endif
41
42
43//=============================================================================
44
45module com { module sun { module star { module registry {
46
47//=============================================================================
48/** allows access to a registry (a persistent data source).
49    The data is stored in a hierarchical key structure beginning with a root key.
50    Each key can store a value and can have multiple subkeys.
51
52	@see XRegistryKey
53*/
54published interface XSimpleRegistry: com::sun::star::uno::XInterface
55{
56	//---------------------------------------------------------------------
57	/** returns the URL of the current data source of the registry.
58	 */
59	string	getURL();
60
61	//-------------------------------------------------------------------------
62	/** connects the registry to a persistent data source represented by
63		an URL.
64
65		<p>If a local registry is already open, this function
66		will close the currently open registry.
67
68		@param aURL
69		specifies the complete URL to access the data source.
70
71		@param bReadOnly
72		specifies if the data source should be opened for
73		read only.
74
75		@param bCreate
76		specifies if the data source should be created if it
77		does not already exist.
78
79		@throws InvalidRegistryException
80		if the registry does not exist.
81	*/
82	void open( [in] string rURL,
83			 [in] boolean bReadOnly,
84			 [in] boolean bCreate )
85			raises( com::sun::star::registry::InvalidRegistryException );
86
87	//-------------------------------------------------------------------------
88	/** checks if the registry points to a valid data-source.
89	*/
90	boolean isValid();
91
92	//-------------------------------------------------------------------------
93	/** disconnects the registry from the data-source.
94
95		@throws InvalidRegistryException
96		if the registry is not open.
97	*/
98	void close()
99			raises( com::sun::star::registry::InvalidRegistryException );
100
101	//-------------------------------------------------------------------------
102	/** destroys the registry and the data source.
103
104		@throws InvalidRegistryException
105		if the registry is not open.
106	*/
107	void destroy()
108			raises( com::sun::star::registry::InvalidRegistryException );
109
110	//-------------------------------------------------------------------------
111	/**	@returns
112		the root key of the registry.
113
114		@throws InvalidRegistryException
115		if no registry is open
116	*/
117	com::sun::star::registry::XRegistryKey getRootKey()
118			raises( com::sun::star::registry::InvalidRegistryException );
119
120	//-------------------------------------------------------------------------
121	/** checks if the registry is readonly.
122
123		@throws InvalidRegistryException
124		if the registry is not open.
125	*/
126	boolean isReadOnly()
127			raises( com::sun::star::registry::InvalidRegistryException );
128
129	//-------------------------------------------------------------------------
130	/** DEPRECATED: this method lacks a registry key (better than a URL).
131
132        merges a registry under the specified key.
133
134		<p>If the key does not exist it will be created. Existing
135		keys will be overridden from keys of registry specified by
136		<var>aUrl</var>.
137
138		@throws InvalidRegistryException
139		if the registry is not open.
140
141		@throws MergeConflictException
142		if any differences occur during merging
143	*/
144	void mergeKey( [in] string aKeyName,
145			 [in] string aUrl )
146			raises( com::sun::star::registry::InvalidRegistryException,
147					com::sun::star::registry::MergeConflictException );
148
149};
150
151//=============================================================================
152
153}; }; }; };
154
155#endif
156