1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _REGISTRYW9X_HXX_
30 #define _REGISTRYW9X_HXX_
32 #include "registry.hxx"
34 //---------------------------------------
36 //---------------------------------------
38 class RegistryKeyImplWin9x
: public RegistryKeyImpl
42 //############################################
44 //############################################
46 /** The number of sub values of the key at hand
48 @precond IsOpen = true
52 virtual size_t GetSubValueCount() const;
54 /** The number of sub-keys of the key at hand
56 @precond IsOpen = true
60 virtual size_t GetSubKeyCount() const;
62 virtual StringListPtr
GetSubKeyNames() const;
64 virtual StringListPtr
GetSubValueNames() const;
66 /** Get the specified registry value
68 @precond IsOpen = true
70 virtual RegistryValue
GetValue(const std::wstring
& Name
) const;
72 /** Get the specified registry value, return the given
73 default value if value not found
75 @precond IsOpen = true
77 virtual RegistryValue
GetValue(const std::wstring
& Name
, const RegistryValue
& Default
) const;
79 //############################################
81 //############################################
83 /** Open the registry key, has no effect if
84 the key is already open
86 @precond IsOpen = false
88 @throws RegistryWriteAccessDenyException
89 RegistryAccessDenyException
91 virtual void Open(bool Writeable
= true);
93 /** Open the specified sub-key of the registry key
96 @precond IsOpen = true
97 HasSubKey(Name) = true
99 @throws RegistryIOException
100 RegistryKeyNotFoundException
101 RegistryAccessDeniedException
103 virtual RegistryKey
OpenSubKey(const std::wstring
& Name
, bool Writeable
= true);
105 /** Creates a new sub-key below the key at hand
107 @precond IsOpen = true
110 @throws RegistryIOException
111 RegistryWriteAccessDenyException
113 virtual RegistryKey
CreateSubKey(const std::wstring
& Name
);
115 /** Deletes a sub-key below the key at hand, the
116 key must not have sub-keys
118 @precond IsOpen = true
121 @throws RegistryIOException
122 RegistryWriteAccessDenyException
124 virtual void DeleteSubKey(const std::wstring
& Name
);
126 /** Deletes a sub-key below the key at hand with all
129 @precond IsOpen = true
132 @throws RegistryIOException
133 RegistryWriteAccessDenyException
135 virtual void DeleteSubKeyTree(const std::wstring
& Name
);
137 /** Delete the specified value
139 @precond IsOpen = true
141 HasValue(Name) = true
143 @throws RegistryIOException
144 RegistryWriteAccessDeniedException
145 RegistryValueNotFoundException
147 virtual void DeleteValue(const std::wstring
& Name
);
149 /** Set the specified registry value
151 @precond IsOpen = true
154 @throws RegistryIOException
155 RegistryWriteAccessDenyException
157 virtual void SetValue(const RegistryValue
& Value
);
159 //############################################
162 // only possible through WindowsRegistry class
163 //############################################
166 /** Create instance and open the specified Registry key
168 @throws RegistryWriteAccessDenyException
169 RegistryAccessDenyException
170 RegistryKeyNotFoundException
172 RegistryKeyImplWin9x(HKEY RootKey
, const std::wstring
& KeyName
);
174 /** Create instance and open the specified Registry key
176 @throws RegistryWriteAccessDenyException
177 RegistryAccessDenyException
178 RegistryKeyNotFoundException
180 RegistryKeyImplWin9x(HKEY RootKey
);
182 /** Create an instances of the specified Registry key,
183 the key is assumed to be already opened.
185 RegistryKeyImplWin9x(HKEY RootKey
, HKEY SubKey
, const std::wstring
& KeyName
, bool Writeable
= true);
187 // prevent copy/assignment
189 RegistryKeyImplWin9x(const RegistryKeyImplWin9x
&);
190 RegistryKeyImplWin9x
& operator=(const RegistryKeyImplWin9x
&);
192 //######################################
193 // Friend declarations
194 //######################################
196 friend class WindowsRegistry
;
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */