1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_registry_XSimpleRegistry_idl__
28#define __com_sun_star_registry_XSimpleRegistry_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_registry_InvalidRegistryException_idl__
35#include <com/sun/star/registry/InvalidRegistryException.idl>
36#endif
37
38#ifndef __com_sun_star_registry_XRegistryKey_idl__
39#include <com/sun/star/registry/XRegistryKey.idl>
40#endif
41
42#ifndef __com_sun_star_registry_MergeConflictException_idl__
43#include <com/sun/star/registry/MergeConflictException.idl>
44#endif
45
46
47//=============================================================================
48
49module com { module sun { module star { module registry {
50
51//=============================================================================
52/** allows access to a registry (a persistent data source).
53    The data is stored in a hierarchical key structure beginning with a root key.
54    Each key can store a value and can have multiple subkeys.
55
56	@see XRegistryKey
57*/
58published interface XSimpleRegistry: com::sun::star::uno::XInterface
59{
60	//---------------------------------------------------------------------
61	/** returns the URL of the current data source of the registry.
62	 */
63	string	getURL();
64
65	//-------------------------------------------------------------------------
66	/** connects the registry to a persistent data source represented by
67		an URL.
68
69		<p>If a local registry is already open, this function
70		will close the currently open registry.
71
72		@param aURL
73		specifies the complete URL to access the data source.
74
75		@param bReadOnly
76		specifies if the data source should be opened for
77		read only.
78
79		@param bCreate
80		specifies if the data source should be created if it
81		does not already exist.
82
83		@throws InvalidRegistryException
84		if the registry does not exist.
85	*/
86	void open( [in] string rURL,
87			 [in] boolean bReadOnly,
88			 [in] boolean bCreate )
89			raises( com::sun::star::registry::InvalidRegistryException );
90
91	//-------------------------------------------------------------------------
92	/** checks if the registry points to a valid data-source.
93	*/
94	boolean isValid();
95
96	//-------------------------------------------------------------------------
97	/** disconnects the registry from the data-source.
98
99		@throws InvalidRegistryException
100		if the registry is not open.
101	*/
102	void close()
103			raises( com::sun::star::registry::InvalidRegistryException );
104
105	//-------------------------------------------------------------------------
106	/** destroys the registry and the data source.
107
108		@throws InvalidRegistryException
109		if the registry is not open.
110	*/
111	void destroy()
112			raises( com::sun::star::registry::InvalidRegistryException );
113
114	//-------------------------------------------------------------------------
115	/**	@returns
116		the root key of the registry.
117
118		@throws InvalidRegistryException
119		if no registry is open
120	*/
121	com::sun::star::registry::XRegistryKey getRootKey()
122			raises( com::sun::star::registry::InvalidRegistryException );
123
124	//-------------------------------------------------------------------------
125	/** checks if the registry is readonly.
126
127		@throws InvalidRegistryException
128		if the registry is not open.
129	*/
130	boolean isReadOnly()
131			raises( com::sun::star::registry::InvalidRegistryException );
132
133	//-------------------------------------------------------------------------
134	/** DEPRECATED: this method lacks a registry key (better than a URL).
135
136        merges a registry under the specified key.
137
138		<p>If the key does not exist it will be created. Existing
139		keys will be overridden from keys of registry specified by
140		<var>aUrl</var>.
141
142		@throws InvalidRegistryException
143		if the registry is not open.
144
145		@throws MergeConflictException
146		if any differences occur during merging
147	*/
148	void mergeKey( [in] string aKeyName,
149			 [in] string aUrl )
150			raises( com::sun::star::registry::InvalidRegistryException,
151					com::sun::star::registry::MergeConflictException );
152
153};
154
155//=============================================================================
156
157}; }; }; };
158
159#endif
160