xref: /aoo41x/main/shell/inc/internal/registry.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef REGISTRY_HXX_INCLUDED
29 #define REGISTRY_HXX_INCLUDED
30 
31 //-----------------------------
32 // registry helper functions
33 //-----------------------------
34 
35 #if defined _MSC_VER
36 #pragma warning(push, 1)
37 #endif
38 #include <objbase.h>
39 #if defined _MSC_VER
40 #pragma warning(pop)
41 #endif
42 #include <string>
43 
44 /** Sets a value of the specified registry key, an empty ValueName sets the default
45 	value
46 	Returns true on success
47 */
48 bool SetRegistryKey(HKEY RootKey, const char* KeyName, const char* ValueName, const char* Value);
49 
50 /** Deletes the specified registry key and all of its subkeys
51 	Returns true on success
52 */
53 bool DeleteRegistryKey(HKEY RootKey, const char* KeyName);
54 
55 /** May be used to determine if the specified registry key has subkeys
56 	The function returns true on success else if an error occures false
57 */
58 bool HasSubkeysRegistryKey(HKEY RootKey, const char* KeyName, bool& bResult);
59 
60 /** Converts a GUID to its string representation
61 */
62 std::string ClsidToString(const CLSID& clsid);
63 
64 /** Get the content of a specific key.
65 */
66 bool QueryRegistryKey(HKEY RootKey, const char* KeyName, const char* ValueName, char *pszData, DWORD dwBufLen);
67 
68 
69 #endif
70