1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_TOOLS_CONFIG_HXX
20 #define INCLUDED_TOOLS_CONFIG_HXX
22 #include <tools/toolsdllapi.h>
23 #include <rtl/ustring.hxx>
25 struct ImplConfigData
;
28 class TOOLS_DLLPUBLIC Config
33 ImplConfigData
* mpData
;
34 ImplGroupData
* mpActGroup
;
35 sal_uIntPtr mnDataUpdateId
;
36 sal_uInt16 mnLockCount
;
39 TOOLS_DLLPRIVATE
bool ImplUpdateConfig() const;
40 TOOLS_DLLPRIVATE ImplGroupData
* ImplGetGroup() const;
43 Config( const OUString
& rFileName
);
46 const OUString
& GetPathName() const { return maFileName
; }
48 void SetGroup(const OString
& rGroup
);
49 const OString
& GetGroup() const { return maGroupName
; }
50 void DeleteGroup(const OString
& rGroup
);
51 OString
GetGroupName(sal_uInt16 nGroup
) const;
52 sal_uInt16
GetGroupCount() const;
53 bool HasGroup(const OString
& rGroup
) const;
55 OString
ReadKey(const OString
& rKey
) const;
56 OString
ReadKey(const OString
& rKey
, const OString
& rDefault
) const;
57 void WriteKey(const OString
& rKey
, const OString
& rValue
);
58 void DeleteKey(const OString
& rKey
);
59 OString
GetKeyName(sal_uInt16 nKey
) const;
60 OString
ReadKey(sal_uInt16 nKey
) const;
61 sal_uInt16
GetKeyCount() const;
63 bool IsLocked() const { return (mnLockCount
!= 0); }
66 void EnablePersistence( bool bPersistence
= true )
67 { mbPersistence
= bPersistence
; }
68 bool IsPersistenceEnabled() const { return mbPersistence
; }
71 Config( const Config
& rConfig
) SAL_DELETED_FUNCTION
;
72 Config
& operator = ( const Config
& rConfig
) SAL_DELETED_FUNCTION
;
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */