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_registry_DefaultRegistry_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_registry_DefaultRegistry_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_registry_XSimpleRegistry_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/registry/XSimpleRegistry.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir//============================================================================= 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir module com { module sun { module star { module registry { 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir//============================================================================= 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir// DocMerge from xml: service com::sun::star::registry::DefaultRegistry 42*cdf0e10cSrcweir/** implicitly supports a local registry and a read-only 43*cdf0e10cSrcweir system registry for global information. 44*cdf0e10cSrcweir In the context of this service, 45*cdf0e10cSrcweir the functions <code>open</code>, <code>close</code>, and <code>destroy</code> 46*cdf0e10cSrcweir from <type>XSimpleRegistry</type> are not supported and throw an exception 47*cdf0e10cSrcweir if they are used. 48*cdf0e10cSrcweir <dl> 49*cdf0e10cSrcweir <dt>Functions of <type>XSimpleRegistry</type>: 50*cdf0e10cSrcweir <dl> 51*cdf0e10cSrcweir <dt> <b>getURL</b> 52*cdf0e10cSrcweir </dt> 53*cdf0e10cSrcweir <dd> returns the name of the local registry. 54*cdf0e10cSrcweir </dd> 55*cdf0e10cSrcweir <dt> <b>isValid</b> 56*cdf0e10cSrcweir </dt> 57*cdf0e10cSrcweir <dd> checks if the local registry is valid. If the interface is not <NULL/> 58*cdf0e10cSrcweir the local registry should always be valid. 59*cdf0e10cSrcweir </dd> 60*cdf0e10cSrcweir <dt> <b>isReadOnly</b> </dt> 61*cdf0e10cSrcweir <dd> checks if the local registry has write protection. 62*cdf0e10cSrcweir </dd> 63*cdf0e10cSrcweir <dt> <b>mergeKey</b> 64*cdf0e10cSrcweir </dt> 65*cdf0e10cSrcweir <dd> merges all information from the specified registry in the local registry. 66*cdf0e10cSrcweir </dd> 67*cdf0e10cSrcweir <dt> <b>getRootKey</b> 68*cdf0e10cSrcweir </dt> 69*cdf0e10cSrcweir <dd> returns a virtual rootkey of both registries. 70*cdf0e10cSrcweir </dd> 71*cdf0e10cSrcweir </dl> 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir <br> 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir </dt> 76*cdf0e10cSrcweir <dt>Functions of XRegistryKey: 77*cdf0e10cSrcweir <dl> 78*cdf0e10cSrcweir <dt> <b>openKey</b> 79*cdf0e10cSrcweir </dt> 80*cdf0e10cSrcweir <dd> returns a virtual key which is specified in the local or the sytem 81*cdf0e10cSrcweir registry. 82*cdf0e10cSrcweir </dd> 83*cdf0e10cSrcweir <dt> <b>deleteKey</b> 84*cdf0e10cSrcweir </dt> 85*cdf0e10cSrcweir <dd> deletes the key only if it is present in the local registry. 86*cdf0e10cSrcweir </dd> 87*cdf0e10cSrcweir <dt> <b>setLongValue, setAsciiValue, setStringValue, setBinaryValue</b> 88*cdf0e10cSrcweir </dt> 89*cdf0e10cSrcweir <dd> sets the value at the specified key in the local registry. 90*cdf0e10cSrcweir </dd> 91*cdf0e10cSrcweir <dt> <b>getLongValue, getAsciiValue, getStringValue, getBinaryValue</b> 92*cdf0e10cSrcweir </dt> 93*cdf0e10cSrcweir <dd> returns the value at the specified key in the local registry, or if 94*cdf0e10cSrcweir the value is not present in the local registry, it will return the value of the 95*cdf0e10cSrcweir system registry. 96*cdf0e10cSrcweir </dd> 97*cdf0e10cSrcweir <dt> <b>openKeys</b> 98*cdf0e10cSrcweir </dt> 99*cdf0e10cSrcweir <dd> returns a sequence of all subkeys in both registries. 100*cdf0e10cSrcweir </dd> 101*cdf0e10cSrcweir <dt> <b>getKeyNames</b> 102*cdf0e10cSrcweir </dt> 103*cdf0e10cSrcweir <dd> returns a sequence with the names of all subkeys in both registries. 104*cdf0e10cSrcweir </dd> 105*cdf0e10cSrcweir <dt> 106*cdf0e10cSrcweir <br> 107*cdf0e10cSrcweir <b>Note: all write functions only work on the local registry.</b> 108*cdf0e10cSrcweir </dt> 109*cdf0e10cSrcweir </dl> 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir <br> 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir </dt> 114*cdf0e10cSrcweir <dt>How to find the registries: 115*cdf0e10cSrcweir <dl> 116*cdf0e10cSrcweir <dt> search for the system registry: 117*cdf0e10cSrcweir </dt> 118*cdf0e10cSrcweir <dd> The system registry will always be searched in the same directory as the 119*cdf0e10cSrcweir executable. The name of the system registry is "applicat.rdb". If the system 120*cdf0e10cSrcweir registry was not found, then the environment variable STAR_REGISTRY will be checked. 121*cdf0e10cSrcweir If this variable was set, it must contain a full path to a valid system registry. 122*cdf0e10cSrcweir </dd> 123*cdf0e10cSrcweir <dt> Search for the user registry using the following rules: 124*cdf0e10cSrcweir </dt> 125*cdf0e10cSrcweir <dd> 126*cdf0e10cSrcweir <dl> 127*cdf0e10cSrcweir <dt> 1. (for further use) search in sversion.ini (.sversionrc) for an entry 128*cdf0e10cSrcweir REGISTRY_VERSION_STRING (example: UserRegistry 5.0/505=test.rdb) in the section 129*cdf0e10cSrcweir [Registry]. If found, then take this value instead of "user.rdb" as "REGISTRY NAME". 130*cdf0e10cSrcweir </dt> 131*cdf0e10cSrcweir <dt> 2. Search in the config directory of the user for a file "REGISTRY NAME". If 132*cdf0e10cSrcweir found, return the full path and name of the file. If not found, retry this 133*cdf0e10cSrcweir step with a dot before "REGISTRY NAME". 134*cdf0e10cSrcweir </dt> 135*cdf0e10cSrcweir <dt> 3. If not found, a new user registry with name user.rdb will be created in the user 136*cdf0e10cSrcweir config directory. 137*cdf0e10cSrcweir </dt> 138*cdf0e10cSrcweir </dl> 139*cdf0e10cSrcweir </dd> 140*cdf0e10cSrcweir </dl> 141*cdf0e10cSrcweir </dt> 142*cdf0e10cSrcweir </dl> 143*cdf0e10cSrcweir <h4>Guarantees:</h4> 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir <ul> 146*cdf0e10cSrcweir <li>-thread safe</li> 147*cdf0e10cSrcweir </ul> 148*cdf0e10cSrcweir */ 149*cdf0e10cSrcweirpublished service DefaultRegistry 150*cdf0e10cSrcweir{ 151*cdf0e10cSrcweir // DocMerge: empty anyway 152*cdf0e10cSrcweir interface com::sun::star::registry::XSimpleRegistry; 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir}; 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir//============================================================================= 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir}; }; }; }; 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir/*============================================================================= 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir=============================================================================*/ 163*cdf0e10cSrcweir#endif 164