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 .
22 #include "tools/toolsdllapi.h"
23 #include <tools/string.hxx>
25 struct ImplConfigData
;
28 class TOOLS_DLLPUBLIC Config
33 ImplConfigData
* mpData
;
34 ImplGroupData
* mpActGroup
;
35 sal_uIntPtr mnDataUpdateId
;
36 sal_uInt16 mnLockCount
;
37 sal_Bool mbPersistence
;
40 TOOLS_DLLPRIVATE sal_Bool
ImplUpdateConfig() const;
41 TOOLS_DLLPRIVATE ImplGroupData
* ImplGetGroup() const;
44 Config( const OUString
& rFileName
);
47 const OUString
& GetPathName() const { return maFileName
; }
49 void SetGroup(const OString
& rGroup
);
50 const OString
& GetGroup() const { return maGroupName
; }
51 void DeleteGroup(const OString
& rGroup
);
52 OString
GetGroupName(sal_uInt16 nGroup
) const;
53 sal_uInt16
GetGroupCount() const;
54 sal_Bool
HasGroup(const OString
& rGroup
) const;
56 OString
ReadKey(const OString
& rKey
) const;
57 OUString
ReadKey(const OString
& rKey
, rtl_TextEncoding eEncoding
) const;
58 OString
ReadKey(const OString
& rKey
, const OString
& rDefault
) const;
59 void WriteKey(const OString
& rKey
, const OString
& rValue
);
60 void DeleteKey(const OString
& rKey
);
61 OString
GetKeyName(sal_uInt16 nKey
) const;
62 OString
ReadKey(sal_uInt16 nKey
) const;
63 sal_uInt16
GetKeyCount() const;
65 sal_Bool
IsLocked() const { return (mnLockCount
!= 0); }
68 void EnablePersistence( sal_Bool bPersistence
= sal_True
)
69 { mbPersistence
= bPersistence
; }
70 sal_Bool
IsPersistenceEnabled() const { return mbPersistence
; }
73 TOOLS_DLLPRIVATE
Config( const Config
& rConfig
);
74 TOOLS_DLLPRIVATE Config
& operator = ( const Config
& rConfig
);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */