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 10cdf0e10cSrcweir * 11*408a4873SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 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#ifndef __com_sun_star_lang_XInitialization_idl__ 30cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl> 31cdf0e10cSrcweir#endif 32cdf0e10cSrcweir 33cdf0e10cSrcweir 34cdf0e10cSrcweir//============================================================================= 35cdf0e10cSrcweir 36cdf0e10cSrcweir module com { module sun { module star { module registry { 37cdf0e10cSrcweir 38cdf0e10cSrcweir//============================================================================= 39cdf0e10cSrcweir 40cdf0e10cSrcweir// DocMerge from xml: service com::sun::star::registry::NestedRegistry 41cdf0e10cSrcweir/** supports a shared view on two different registries. The registry 42cdf0e10cSrcweir files will be opened in two different modes, registry1 will be opened with read/write 43cdf0e10cSrcweir rights and registry2 will be opened read-only. 44cdf0e10cSrcweir In the context of this service, the functions <code>open</code>, <code>close</code>, 45cdf0e10cSrcweir and <code>destroy</code> from <type>XSimpleRegistry</type> are not supported and 46cdf0e10cSrcweir throw an exception if they are used. 47cdf0e10cSrcweir <dl> 48cdf0e10cSrcweir <dt>Functions of <type>XSimpleRegistry</type>: 49cdf0e10cSrcweir <dl> 50cdf0e10cSrcweir <dt> <b>getURL</b> 51cdf0e10cSrcweir </dt> 52cdf0e10cSrcweir <dd> returns the name of registry1. 53cdf0e10cSrcweir 54cdf0e10cSrcweir </dd> 55cdf0e10cSrcweir <dt> <b>isValid</b> 56cdf0e10cSrcweir </dt> 57cdf0e10cSrcweir <dd> checks if registry1 is valid. If the interface is not <NULL/> 58cdf0e10cSrcweir then registry1 should always be valid. 59cdf0e10cSrcweir 60cdf0e10cSrcweir </dd> 61cdf0e10cSrcweir <dt> <b>isReadOnly</b> 62cdf0e10cSrcweir </dt> 63cdf0e10cSrcweir <dd> checks if registry1 has write protection. 64cdf0e10cSrcweir </dd> 65cdf0e10cSrcweir <dt> <b>mergeKey</b> 66cdf0e10cSrcweir </dt> 67cdf0e10cSrcweir <dd> merges all information from the specified registry in registry1. 68cdf0e10cSrcweir 69cdf0e10cSrcweir </dd> 70cdf0e10cSrcweir <dt> <b>getRootKey</b> 71cdf0e10cSrcweir </dt> 72cdf0e10cSrcweir <dd> returns a virtual rootkey of both registries. 73cdf0e10cSrcweir </dd> 74cdf0e10cSrcweir </dl> 75cdf0e10cSrcweir 76cdf0e10cSrcweir <br> 77cdf0e10cSrcweir 78cdf0e10cSrcweir </dt> 79cdf0e10cSrcweir <dt>Functions of <type>XRegistryKey</type>: 80cdf0e10cSrcweir <dl> 81cdf0e10cSrcweir <dt> <b>openKey</b> 82cdf0e10cSrcweir </dt> 83cdf0e10cSrcweir <dd> returns a virtual key which is specified in registy1 or registry2. 84cdf0e10cSrcweir 85cdf0e10cSrcweir </dd> 86cdf0e10cSrcweir <dt> <b>deleteKey</b> 87cdf0e10cSrcweir </dt> 88cdf0e10cSrcweir <dd> deletes the key only if it is present in registry1. 89cdf0e10cSrcweir 90cdf0e10cSrcweir </dd> 91cdf0e10cSrcweir <dt> <b>setLongValue, setAsciiValue, setStringValue, setBinaryValue</b> 92cdf0e10cSrcweir </dt> 93cdf0e10cSrcweir <dd> sets the value at the specified key in registry1. 94cdf0e10cSrcweir 95cdf0e10cSrcweir </dd> 96cdf0e10cSrcweir <dt> <b>getLongValue, getAsciiValue, getStringValue, getBinaryValue</b> 97cdf0e10cSrcweir </dt> 98cdf0e10cSrcweir <dd> returns the value at the specified key in registry1, or if 99cdf0e10cSrcweir the value is not present in registry1, it will return the value of registry2. 100cdf0e10cSrcweir 101cdf0e10cSrcweir </dd> 102cdf0e10cSrcweir <dt> <b>openKeys</b> 103cdf0e10cSrcweir </dt> 104cdf0e10cSrcweir <dd> returns a sequence of all subkeys in both registries. 105cdf0e10cSrcweir 106cdf0e10cSrcweir </dd> 107cdf0e10cSrcweir <dt> <b>getKeyNames</b> 108cdf0e10cSrcweir </dt> 109cdf0e10cSrcweir <dd> returns a sequence with the names of all subkeys in both 110cdf0e10cSrcweir registries. 111cdf0e10cSrcweir 112cdf0e10cSrcweir </dd> 113cdf0e10cSrcweir <dt> 114cdf0e10cSrcweir <br> 115cdf0e10cSrcweir <b>Note: all write functions only work on registry1.</b> 116cdf0e10cSrcweir </dt> 117cdf0e10cSrcweir </dl> 118cdf0e10cSrcweir </dt> 119cdf0e10cSrcweir </dl> 120cdf0e10cSrcweir <br> 121cdf0e10cSrcweir How to initialize the registries:<br> 122cdf0e10cSrcweir Use a sequence of <type>XSimpleRegistry</type> with two elements. The first element must be 123cdf0e10cSrcweir the registry which is opened with read/write rights and the second element must be 124cdf0e10cSrcweir the read-only one.<br> 125cdf0e10cSrcweir Two different ways are possible:<br> 126cdf0e10cSrcweir <ul> 127cdf0e10cSrcweir <li> use <method scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</method> to 128cdf0e10cSrcweir create an instance of this service where the value of the any parameter must be the sequence with 129cdf0e10cSrcweir the two open registries. 130cdf0e10cSrcweir <li> use the initialize function of the <type scope="com::sun::star::lang">XInitialization</type> interface where the value of the 131cdf0e10cSrcweir any parameter must be the sequence with the two open registries. 132cdf0e10cSrcweir </ul> 133cdf0e10cSrcweir <br> 134cdf0e10cSrcweir 135cdf0e10cSrcweir 136cdf0e10cSrcweir Guarantees: 137cdf0e10cSrcweir <ul> 138cdf0e10cSrcweir <li>-thread safe</li> 139cdf0e10cSrcweir </ul> 140cdf0e10cSrcweir */ 141cdf0e10cSrcweirpublished service NestedRegistry 142cdf0e10cSrcweir{ 143cdf0e10cSrcweir // DocMerge: empty anyway 144cdf0e10cSrcweir interface com::sun::star::registry::XSimpleRegistry; 145cdf0e10cSrcweir 146cdf0e10cSrcweir // DocMerge: empty anyway 147cdf0e10cSrcweir interface com::sun::star::lang::XInitialization; 148cdf0e10cSrcweir}; 149cdf0e10cSrcweir 150cdf0e10cSrcweir//============================================================================= 151cdf0e10cSrcweir 152cdf0e10cSrcweir}; }; }; }; 153cdf0e10cSrcweir 154cdf0e10cSrcweir/*============================================================================= 155cdf0e10cSrcweir 156cdf0e10cSrcweir=============================================================================*/ 157cdf0e10cSrcweir#endif 158