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 24 #ifndef _KEYIMPL_HXX_ 25 #define _KEYIMPL_HXX_ 26 27 #include <registry/registry.h> 28 #include "regimpl.hxx" 29 #include <rtl/ustring.hxx> 30 31 class ORegKey 32 { 33 public: 34 35 ORegKey(const rtl::OUString& keyName, ORegistry* pReg); 36 ~ORegKey(); 37 acquire()38 sal_uInt32 acquire() 39 { return ++m_refCount; } 40 release()41 sal_uInt32 release() 42 { return --m_refCount; } 43 44 RegError acquireKey(RegKeyHandle hKey); 45 RegError releaseKey(RegKeyHandle hKey); 46 47 RegError createKey(const rtl::OUString& keyName, RegKeyHandle* phNewKey); 48 49 RegError openKey(const rtl::OUString& keyName, RegKeyHandle* phOpenKey); 50 51 RegError openSubKeys(const rtl::OUString& keyName, 52 RegKeyHandle** phOpenSubKeys, 53 sal_uInt32* pnSubKeys); 54 55 RegError getKeyNames(const rtl::OUString& keyName, 56 rtl_uString*** pSubKeyNames, 57 sal_uInt32* pnSubKeys); 58 59 RegError closeKey(RegKeyHandle hKey); 60 61 RegError deleteKey(const rtl::OUString& keyName); 62 63 RegError getValueInfo(const rtl::OUString& valueName, 64 RegValueType* pValueTye, 65 sal_uInt32* pValueSize) const; 66 67 RegError setValue(const rtl::OUString& valueName, 68 RegValueType vType, 69 RegValue value, 70 sal_uInt32 vSize); 71 72 RegError setLongListValue(const rtl::OUString& valueName, 73 sal_Int32* pValueList, 74 sal_uInt32 len); 75 76 RegError setStringListValue(const rtl::OUString& valueName, 77 sal_Char** pValueList, 78 sal_uInt32 len); 79 80 RegError setUnicodeListValue(const rtl::OUString& valueName, 81 sal_Unicode** pValueList, 82 sal_uInt32 len); 83 84 RegError getValue(const rtl::OUString& valueName, RegValue value) const; 85 86 RegError getLongListValue(const rtl::OUString& valueName, 87 sal_Int32** pValueList, 88 sal_uInt32* pLen) const; 89 90 RegError getStringListValue(const rtl::OUString& valueName, 91 sal_Char*** pValueList, 92 sal_uInt32* pLen) const; 93 94 RegError getUnicodeListValue(const rtl::OUString& valueName, 95 sal_Unicode*** pValueList, 96 sal_uInt32* pLen) const; 97 98 RegError getKeyType(const rtl::OUString& name, 99 RegKeyType* pKeyType) const; 100 101 RegError getResolvedKeyName(const rtl::OUString& keyName, 102 rtl::OUString& resolvedName); 103 isDeleted() const104 bool isDeleted() const 105 { return m_bDeleted != 0; } 106 setDeleted(sal_Bool bKeyDeleted)107 void setDeleted (sal_Bool bKeyDeleted) 108 { m_bDeleted = bKeyDeleted ? 1 : 0; } 109 isModified() const110 bool isModified() const 111 { return m_bModified != 0; } 112 setModified(bool bModified=true)113 void setModified (bool bModified = true) 114 { m_bModified = bModified ? 1 : 0; } 115 isReadOnly() const116 sal_Bool isReadOnly() const 117 { return m_pRegistry->isReadOnly(); } 118 119 sal_uInt32 countSubKeys(); 120 getRegistry() const121 ORegistry* getRegistry() const 122 { return m_pRegistry; } 123 getStoreFile() const124 const store::OStoreFile& getStoreFile() const 125 { return m_pRegistry->getStoreFile(); } 126 127 store::OStoreDirectory getStoreDir(); 128 getName() const129 const rtl::OUString& getName() const 130 { return m_name; } 131 getRefCount() const132 sal_uInt32 getRefCount() const 133 { return m_refCount; } 134 135 rtl::OUString getFullPath(rtl::OUString const & path) const; 136 137 private: 138 sal_uInt32 m_refCount; 139 rtl::OUString m_name; 140 int m_bDeleted:1; 141 int m_bModified:1; 142 ORegistry* m_pRegistry; 143 }; 144 145 #endif 146 147 148