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