1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_registry_NestedRegistry_idl__
20 #define __com_sun_star_registry_NestedRegistry_idl__
22 #include
<com
/sun
/star
/registry
/XSimpleRegistry.idl
>
23 #include
<com
/sun
/star
/lang
/XInitialization.idl
>
27 module com
{ module sun
{ module star
{ module registry
{
29 /** supports a shared view on two different registries. The registry
30 files will be opened in two different modes, registry1 will be opened with read/write
31 rights and registry2 will be opened read-only.
32 In the context of this service, the functions <code>open</code>, <code>close</code>,
33 and <code>destroy</code> from XSimpleRegistry are not supported and
34 throw an exception if they are used.
36 Functions of XSimpleRegistry:
40 <dd> returns the name of registry1.
45 <dd> checks if registry1 is valid. If the interface is not `NULL`
46 then registry1 should always be valid.
49 <dt> <b>isReadOnly</b>
51 <dd> checks if registry1 has write protection.
55 <dd> merges all information from the specified registry in registry1.
58 <dt> <b>getRootKey</b>
60 <dd> returns a virtual rootkey of both registries.
64 Functions of XRegistryKey:
68 <dd> returns a virtual key which is specified in registy1 or registry2.
73 <dd> deletes the key only if it is present in registry1.
76 <dt> <b>setLongValue, setAsciiValue, setStringValue, setBinaryValue</b>
78 <dd> sets the value at the specified key in registry1.
81 <dt> <b>getLongValue, getAsciiValue, getStringValue, getBinaryValue</b>
83 <dd> returns the value at the specified key in registry1, or if
84 the value is not present in registry1, it will return the value of registry2.
89 <dd> returns a sequence of all subkeys in both registries.
92 <dt> <b>getKeyNames</b>
94 <dd> returns a sequence with the names of all subkeys in both
99 <b>Note: all write functions only work on registry1.</b>
103 How to initialize the registries:<br>
104 Use a sequence of XSimpleRegistry with two elements. The first element must be
105 the registry which is opened with read/write rights and the second element must be
106 the read-only one.<br>
107 Two different ways are possible:<br>
109 <li> use com::sun::star::lang::XMultiServiceFactory::createInstanceWithArguments() to
110 create an instance of this service where the value of the any parameter must be the sequence with
111 the two open registries.
112 <li> use the initialize function of the com::sun::star::lang::XInitialization interface where the value of the
113 any parameter must be the sequence with the two open registries.
120 <li>-thread safe</li>
123 published service NestedRegistry
125 interface com
::sun
::star
::registry
::XSimpleRegistry
;
126 interface com
::sun
::star
::lang
::XInitialization
;
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */