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_XSimpleRegistry_idl__ 24cdf0e10cSrcweir#define __com_sun_star_registry_XSimpleRegistry_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_registry_InvalidRegistryException_idl__ 31cdf0e10cSrcweir#include <com/sun/star/registry/InvalidRegistryException.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_registry_XRegistryKey_idl__ 35cdf0e10cSrcweir#include <com/sun/star/registry/XRegistryKey.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_registry_MergeConflictException_idl__ 39cdf0e10cSrcweir#include <com/sun/star/registry/MergeConflictException.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir//============================================================================= 44cdf0e10cSrcweir 45cdf0e10cSrcweirmodule com { module sun { module star { module registry { 46cdf0e10cSrcweir 47cdf0e10cSrcweir//============================================================================= 48cdf0e10cSrcweir/** allows access to a registry (a persistent data source). 49cdf0e10cSrcweir The data is stored in a hierarchical key structure beginning with a root key. 50cdf0e10cSrcweir Each key can store a value and can have multiple subkeys. 51cdf0e10cSrcweir 52cdf0e10cSrcweir @see XRegistryKey 53cdf0e10cSrcweir*/ 54cdf0e10cSrcweirpublished interface XSimpleRegistry: com::sun::star::uno::XInterface 55cdf0e10cSrcweir{ 56cdf0e10cSrcweir //--------------------------------------------------------------------- 57cdf0e10cSrcweir /** returns the URL of the current data source of the registry. 58cdf0e10cSrcweir */ 59cdf0e10cSrcweir string getURL(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir //------------------------------------------------------------------------- 62cdf0e10cSrcweir /** connects the registry to a persistent data source represented by 63cdf0e10cSrcweir an URL. 64cdf0e10cSrcweir 65cdf0e10cSrcweir <p>If a local registry is already open, this function 66cdf0e10cSrcweir will close the currently open registry. 67cdf0e10cSrcweir 68cdf0e10cSrcweir @param aURL 69cdf0e10cSrcweir specifies the complete URL to access the data source. 70cdf0e10cSrcweir 71cdf0e10cSrcweir @param bReadOnly 72cdf0e10cSrcweir specifies if the data source should be opened for 73cdf0e10cSrcweir read only. 74cdf0e10cSrcweir 75cdf0e10cSrcweir @param bCreate 76cdf0e10cSrcweir specifies if the data source should be created if it 77cdf0e10cSrcweir does not already exist. 78cdf0e10cSrcweir 79cdf0e10cSrcweir @throws InvalidRegistryException 80cdf0e10cSrcweir if the registry does not exist. 81cdf0e10cSrcweir */ 82cdf0e10cSrcweir void open( [in] string rURL, 83cdf0e10cSrcweir [in] boolean bReadOnly, 84cdf0e10cSrcweir [in] boolean bCreate ) 85cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir //------------------------------------------------------------------------- 88cdf0e10cSrcweir /** checks if the registry points to a valid data-source. 89cdf0e10cSrcweir */ 90cdf0e10cSrcweir boolean isValid(); 91cdf0e10cSrcweir 92cdf0e10cSrcweir //------------------------------------------------------------------------- 93cdf0e10cSrcweir /** disconnects the registry from the data-source. 94cdf0e10cSrcweir 95cdf0e10cSrcweir @throws InvalidRegistryException 96cdf0e10cSrcweir if the registry is not open. 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir void close() 99cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException ); 100cdf0e10cSrcweir 101cdf0e10cSrcweir //------------------------------------------------------------------------- 102cdf0e10cSrcweir /** destroys the registry and the data source. 103cdf0e10cSrcweir 104cdf0e10cSrcweir @throws InvalidRegistryException 105cdf0e10cSrcweir if the registry is not open. 106cdf0e10cSrcweir */ 107cdf0e10cSrcweir void destroy() 108cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException ); 109cdf0e10cSrcweir 110cdf0e10cSrcweir //------------------------------------------------------------------------- 111cdf0e10cSrcweir /** @returns 112cdf0e10cSrcweir the root key of the registry. 113cdf0e10cSrcweir 114cdf0e10cSrcweir @throws InvalidRegistryException 115cdf0e10cSrcweir if no registry is open 116cdf0e10cSrcweir */ 117cdf0e10cSrcweir com::sun::star::registry::XRegistryKey getRootKey() 118cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException ); 119cdf0e10cSrcweir 120cdf0e10cSrcweir //------------------------------------------------------------------------- 121cdf0e10cSrcweir /** checks if the registry is readonly. 122cdf0e10cSrcweir 123cdf0e10cSrcweir @throws InvalidRegistryException 124cdf0e10cSrcweir if the registry is not open. 125cdf0e10cSrcweir */ 126cdf0e10cSrcweir boolean isReadOnly() 127cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException ); 128cdf0e10cSrcweir 129cdf0e10cSrcweir //------------------------------------------------------------------------- 130cdf0e10cSrcweir /** DEPRECATED: this method lacks a registry key (better than a URL). 131cdf0e10cSrcweir 132cdf0e10cSrcweir merges a registry under the specified key. 133cdf0e10cSrcweir 134cdf0e10cSrcweir <p>If the key does not exist it will be created. Existing 135cdf0e10cSrcweir keys will be overridden from keys of registry specified by 136cdf0e10cSrcweir <var>aUrl</var>. 137cdf0e10cSrcweir 138cdf0e10cSrcweir @throws InvalidRegistryException 139cdf0e10cSrcweir if the registry is not open. 140cdf0e10cSrcweir 141cdf0e10cSrcweir @throws MergeConflictException 142cdf0e10cSrcweir if any differences occur during merging 143cdf0e10cSrcweir */ 144cdf0e10cSrcweir void mergeKey( [in] string aKeyName, 145cdf0e10cSrcweir [in] string aUrl ) 146cdf0e10cSrcweir raises( com::sun::star::registry::InvalidRegistryException, 147cdf0e10cSrcweir com::sun::star::registry::MergeConflictException ); 148cdf0e10cSrcweir 149cdf0e10cSrcweir}; 150cdf0e10cSrcweir 151cdf0e10cSrcweir//============================================================================= 152cdf0e10cSrcweir 153cdf0e10cSrcweir}; }; }; }; 154cdf0e10cSrcweir 155cdf0e10cSrcweir#endif 156