Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _KEYIMPL_HXX_
21 : : #define _KEYIMPL_HXX_
22 : :
23 : : #include <registry/registry.h>
24 : : #include "regimpl.hxx"
25 : : #include <rtl/ustring.hxx>
26 : :
27 : : class ORegKey
28 : : {
29 : : public:
30 : :
31 : : ORegKey(const rtl::OUString& keyName, ORegistry* pReg);
32 : : ~ORegKey();
33 : :
34 : 2254671 : sal_uInt32 acquire()
35 : 2254671 : { return ++m_refCount; }
36 : :
37 : 2197333 : sal_uInt32 release()
38 : 2197333 : { return --m_refCount; }
39 : :
40 : : RegError releaseKey(RegKeyHandle hKey);
41 : :
42 : : RegError createKey(const rtl::OUString& keyName, RegKeyHandle* phNewKey);
43 : :
44 : : RegError openKey(const rtl::OUString& keyName, RegKeyHandle* phOpenKey);
45 : :
46 : : RegError openSubKeys(const rtl::OUString& keyName,
47 : : RegKeyHandle** phOpenSubKeys,
48 : : sal_uInt32* pnSubKeys);
49 : :
50 : : RegError getKeyNames(const rtl::OUString& keyName,
51 : : rtl_uString*** pSubKeyNames,
52 : : sal_uInt32* pnSubKeys);
53 : :
54 : : RegError closeKey(RegKeyHandle hKey);
55 : :
56 : : RegError deleteKey(const rtl::OUString& keyName);
57 : :
58 : : RegError getValueInfo(const rtl::OUString& valueName,
59 : : RegValueType* pValueTye,
60 : : sal_uInt32* pValueSize) const;
61 : :
62 : : RegError setValue(const rtl::OUString& valueName,
63 : : RegValueType vType,
64 : : RegValue value,
65 : : sal_uInt32 vSize);
66 : :
67 : : RegError setLongListValue(const rtl::OUString& valueName,
68 : : sal_Int32* pValueList,
69 : : sal_uInt32 len);
70 : :
71 : : RegError setStringListValue(const rtl::OUString& valueName,
72 : : sal_Char** pValueList,
73 : : sal_uInt32 len);
74 : :
75 : : RegError setUnicodeListValue(const rtl::OUString& valueName,
76 : : sal_Unicode** pValueList,
77 : : sal_uInt32 len);
78 : :
79 : : RegError getValue(const rtl::OUString& valueName, RegValue value) const;
80 : :
81 : : RegError getLongListValue(const rtl::OUString& valueName,
82 : : sal_Int32** pValueList,
83 : : sal_uInt32* pLen) const;
84 : :
85 : : RegError getStringListValue(const rtl::OUString& valueName,
86 : : sal_Char*** pValueList,
87 : : sal_uInt32* pLen) const;
88 : :
89 : : RegError getUnicodeListValue(const rtl::OUString& valueName,
90 : : sal_Unicode*** pValueList,
91 : : sal_uInt32* pLen) const;
92 : :
93 : : RegError getKeyType(const rtl::OUString& name,
94 : : RegKeyType* pKeyType) const;
95 : :
96 : : RegError getResolvedKeyName(const rtl::OUString& keyName,
97 : : rtl::OUString& resolvedName);
98 : :
99 : 1722258 : bool isDeleted() const
100 : 1722258 : { return m_bDeleted != 0; }
101 : :
102 : 32 : void setDeleted (sal_Bool bKeyDeleted)
103 [ + + ]: 32 : { m_bDeleted = bKeyDeleted ? 1 : 0; }
104 : :
105 : 134697 : bool isModified() const
106 : 134697 : { return m_bModified != 0; }
107 : :
108 : 109635 : void setModified (bool bModified = true)
109 [ + + ]: 109635 : { m_bModified = bModified ? 1 : 0; }
110 : :
111 : 131925 : sal_Bool isReadOnly() const
112 : 131925 : { return m_pRegistry->isReadOnly(); }
113 : :
114 : : sal_uInt32 countSubKeys();
115 : :
116 : 2824429 : ORegistry* getRegistry() const
117 : 2824429 : { return m_pRegistry; }
118 : :
119 : 1571700 : const store::OStoreFile& getStoreFile() const
120 : 1571700 : { return m_pRegistry->getStoreFile(); }
121 : :
122 : : store::OStoreDirectory getStoreDir();
123 : :
124 : 919826 : const rtl::OUString& getName() const
125 : 919826 : { return m_name; }
126 : :
127 : : sal_uInt32 getRefCount() const
128 : : { return m_refCount; }
129 : :
130 : : rtl::OUString getFullPath(rtl::OUString const & path) const;
131 : :
132 : : private:
133 : : sal_uInt32 m_refCount;
134 : : rtl::OUString m_name;
135 : : int m_bDeleted:1;
136 : : int m_bModified:1;
137 : : ORegistry* m_pRegistry;
138 : : };
139 : :
140 : : #endif
141 : :
142 : :
143 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|