/src/libreoffice/include/unotools/compatibility.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include <sal/config.h> |
23 | | |
24 | | #include <unotools/unotoolsdllapi.h> |
25 | | #include <rtl/ustring.hxx> |
26 | | |
27 | | #include <com/sun/star/uno/Reference.hxx> |
28 | | |
29 | | #include <memory> |
30 | | |
31 | | namespace comphelper |
32 | | { |
33 | | class ConfigurationChanges; |
34 | | }; |
35 | | namespace com::sun::star::beans |
36 | | { |
37 | | class XPropertySet; |
38 | | } |
39 | | namespace com::sun::star::container |
40 | | { |
41 | | class XNameAccess; |
42 | | } |
43 | | |
44 | | class UNOTOOLS_DLLPUBLIC SvtCompatibility |
45 | | { |
46 | | public: |
47 | | // Read access |
48 | | explicit SvtCompatibility(const OUString& itemName); |
49 | | // Write access |
50 | | SvtCompatibility(const std::shared_ptr<comphelper::ConfigurationChanges>& batch, |
51 | | const OUString& itemName); |
52 | | void set(const OUString& option, bool value); |
53 | | bool get(const OUString& option) const; |
54 | | |
55 | | bool getPropertyReadOnly(const OUString& option) const; |
56 | | |
57 | | private: |
58 | | css::uno::Reference<css::container::XNameAccess> root; |
59 | | css::uno::Reference<css::beans::XPropertySet> item; |
60 | | }; |
61 | | |
62 | | class SvtCompatibilityDefault : public SvtCompatibility |
63 | | { |
64 | | public: |
65 | | SvtCompatibilityDefault() |
66 | | : SvtCompatibility(u"_default"_ustr) |
67 | 0 | { |
68 | 0 | } |
69 | | SvtCompatibilityDefault(const std::shared_ptr<comphelper::ConfigurationChanges>& batch) |
70 | | : SvtCompatibility(batch, u"_default"_ustr) |
71 | 0 | { |
72 | 0 | } |
73 | | }; |
74 | | |
75 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |