1*5a5f4a75SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*5a5f4a75SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*5a5f4a75SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*5a5f4a75SAndrew Rist * distributed with this work for additional information 6*5a5f4a75SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*5a5f4a75SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*5a5f4a75SAndrew Rist * "License"); you may not use this file except in compliance 9*5a5f4a75SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*5a5f4a75SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*5a5f4a75SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*5a5f4a75SAndrew Rist * software distributed under the License is distributed on an 15*5a5f4a75SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*5a5f4a75SAndrew Rist * KIND, either express or implied. See the License for the 17*5a5f4a75SAndrew Rist * specific language governing permissions and limitations 18*5a5f4a75SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*5a5f4a75SAndrew Rist *************************************************************/ 21*5a5f4a75SAndrew Rist 22*5a5f4a75SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _KEYIMPL_HXX_ 25cdf0e10cSrcweir #define _KEYIMPL_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <registry/registry.h> 28cdf0e10cSrcweir #include "regimpl.hxx" 29cdf0e10cSrcweir #include <rtl/ustring.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir class ORegKey 32cdf0e10cSrcweir { 33cdf0e10cSrcweir public: 34cdf0e10cSrcweir 35cdf0e10cSrcweir ORegKey(const rtl::OUString& keyName, ORegistry* pReg); 36cdf0e10cSrcweir ~ORegKey(); 37cdf0e10cSrcweir acquire()38cdf0e10cSrcweir sal_uInt32 acquire() 39cdf0e10cSrcweir { return ++m_refCount; } 40cdf0e10cSrcweir release()41cdf0e10cSrcweir sal_uInt32 release() 42cdf0e10cSrcweir { return --m_refCount; } 43cdf0e10cSrcweir 44cdf0e10cSrcweir RegError acquireKey(RegKeyHandle hKey); 45cdf0e10cSrcweir RegError releaseKey(RegKeyHandle hKey); 46cdf0e10cSrcweir 47cdf0e10cSrcweir RegError createKey(const rtl::OUString& keyName, RegKeyHandle* phNewKey); 48cdf0e10cSrcweir 49cdf0e10cSrcweir RegError openKey(const rtl::OUString& keyName, RegKeyHandle* phOpenKey); 50cdf0e10cSrcweir 51cdf0e10cSrcweir RegError openSubKeys(const rtl::OUString& keyName, 52cdf0e10cSrcweir RegKeyHandle** phOpenSubKeys, 53cdf0e10cSrcweir sal_uInt32* pnSubKeys); 54cdf0e10cSrcweir 55cdf0e10cSrcweir RegError getKeyNames(const rtl::OUString& keyName, 56cdf0e10cSrcweir rtl_uString*** pSubKeyNames, 57cdf0e10cSrcweir sal_uInt32* pnSubKeys); 58cdf0e10cSrcweir 59cdf0e10cSrcweir RegError closeKey(RegKeyHandle hKey); 60cdf0e10cSrcweir 61cdf0e10cSrcweir RegError deleteKey(const rtl::OUString& keyName); 62cdf0e10cSrcweir 63cdf0e10cSrcweir RegError getValueInfo(const rtl::OUString& valueName, 64cdf0e10cSrcweir RegValueType* pValueTye, 65cdf0e10cSrcweir sal_uInt32* pValueSize) const; 66cdf0e10cSrcweir 67cdf0e10cSrcweir RegError setValue(const rtl::OUString& valueName, 68cdf0e10cSrcweir RegValueType vType, 69cdf0e10cSrcweir RegValue value, 70cdf0e10cSrcweir sal_uInt32 vSize); 71cdf0e10cSrcweir 72cdf0e10cSrcweir RegError setLongListValue(const rtl::OUString& valueName, 73cdf0e10cSrcweir sal_Int32* pValueList, 74cdf0e10cSrcweir sal_uInt32 len); 75cdf0e10cSrcweir 76cdf0e10cSrcweir RegError setStringListValue(const rtl::OUString& valueName, 77cdf0e10cSrcweir sal_Char** pValueList, 78cdf0e10cSrcweir sal_uInt32 len); 79cdf0e10cSrcweir 80cdf0e10cSrcweir RegError setUnicodeListValue(const rtl::OUString& valueName, 81cdf0e10cSrcweir sal_Unicode** pValueList, 82cdf0e10cSrcweir sal_uInt32 len); 83cdf0e10cSrcweir 84cdf0e10cSrcweir RegError getValue(const rtl::OUString& valueName, RegValue value) const; 85cdf0e10cSrcweir 86cdf0e10cSrcweir RegError getLongListValue(const rtl::OUString& valueName, 87cdf0e10cSrcweir sal_Int32** pValueList, 88cdf0e10cSrcweir sal_uInt32* pLen) const; 89cdf0e10cSrcweir 90cdf0e10cSrcweir RegError getStringListValue(const rtl::OUString& valueName, 91cdf0e10cSrcweir sal_Char*** pValueList, 92cdf0e10cSrcweir sal_uInt32* pLen) const; 93cdf0e10cSrcweir 94cdf0e10cSrcweir RegError getUnicodeListValue(const rtl::OUString& valueName, 95cdf0e10cSrcweir sal_Unicode*** pValueList, 96cdf0e10cSrcweir sal_uInt32* pLen) const; 97cdf0e10cSrcweir 98cdf0e10cSrcweir RegError getKeyType(const rtl::OUString& name, 99cdf0e10cSrcweir RegKeyType* pKeyType) const; 100cdf0e10cSrcweir 101cdf0e10cSrcweir RegError getResolvedKeyName(const rtl::OUString& keyName, 102cdf0e10cSrcweir rtl::OUString& resolvedName); 103cdf0e10cSrcweir isDeleted() const104cdf0e10cSrcweir bool isDeleted() const 105cdf0e10cSrcweir { return m_bDeleted != 0; } 106cdf0e10cSrcweir setDeleted(sal_Bool bKeyDeleted)107cdf0e10cSrcweir void setDeleted (sal_Bool bKeyDeleted) 108cdf0e10cSrcweir { m_bDeleted = bKeyDeleted ? 1 : 0; } 109cdf0e10cSrcweir isModified() const110cdf0e10cSrcweir bool isModified() const 111cdf0e10cSrcweir { return m_bModified != 0; } 112cdf0e10cSrcweir setModified(bool bModified=true)113cdf0e10cSrcweir void setModified (bool bModified = true) 114cdf0e10cSrcweir { m_bModified = bModified ? 1 : 0; } 115cdf0e10cSrcweir isReadOnly() const116cdf0e10cSrcweir sal_Bool isReadOnly() const 117cdf0e10cSrcweir { return m_pRegistry->isReadOnly(); } 118cdf0e10cSrcweir 119cdf0e10cSrcweir sal_uInt32 countSubKeys(); 120cdf0e10cSrcweir getRegistry() const121cdf0e10cSrcweir ORegistry* getRegistry() const 122cdf0e10cSrcweir { return m_pRegistry; } 123cdf0e10cSrcweir getStoreFile() const124cdf0e10cSrcweir const store::OStoreFile& getStoreFile() const 125cdf0e10cSrcweir { return m_pRegistry->getStoreFile(); } 126cdf0e10cSrcweir 127cdf0e10cSrcweir store::OStoreDirectory getStoreDir(); 128cdf0e10cSrcweir getName() const129cdf0e10cSrcweir const rtl::OUString& getName() const 130cdf0e10cSrcweir { return m_name; } 131cdf0e10cSrcweir getRefCount() const132cdf0e10cSrcweir sal_uInt32 getRefCount() const 133cdf0e10cSrcweir { return m_refCount; } 134cdf0e10cSrcweir 135cdf0e10cSrcweir rtl::OUString getFullPath(rtl::OUString const & path) const; 136cdf0e10cSrcweir 137cdf0e10cSrcweir private: 138cdf0e10cSrcweir sal_uInt32 m_refCount; 139cdf0e10cSrcweir rtl::OUString m_name; 140cdf0e10cSrcweir int m_bDeleted:1; 141cdf0e10cSrcweir int m_bModified:1; 142cdf0e10cSrcweir ORegistry* m_pRegistry; 143cdf0e10cSrcweir }; 144cdf0e10cSrcweir 145cdf0e10cSrcweir #endif 146cdf0e10cSrcweir 147cdf0e10cSrcweir 148