nss: upgrade to release 3.73
[LibreOffice.git] / include / svtools / extcolorcfg.hxx
blob408f8651eefd1ebde83fef51d3cba7b0bfa60b93
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <svtools/svtdllapi.h>
22 #include <rtl/ustring.hxx>
23 #include <svl/SfxBroadcaster.hxx>
24 #include <svl/lstner.hxx>
25 #include <tools/color.hxx>
26 #include <memory>
29 namespace svtools {
31 class ExtendedColorConfig_Impl;
33 class ExtendedColorConfigValue
35 OUString m_sName;
36 OUString m_sDisplayName;
37 Color m_nColor;
38 Color m_nDefaultColor;
39 public:
40 ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){}
41 ExtendedColorConfigValue(const OUString& _sName
42 ,const OUString& _sDisplayName
43 ,Color _nColor
44 ,Color _nDefaultColor)
45 : m_sName(_sName)
46 ,m_sDisplayName(_sDisplayName)
47 ,m_nColor(_nColor)
48 ,m_nDefaultColor(_nDefaultColor)
51 const OUString& getName() const { return m_sName; }
52 const OUString& getDisplayName() const { return m_sDisplayName; }
53 Color getColor() const { return m_nColor; }
54 Color getDefaultColor() const { return m_nDefaultColor; }
56 void setColor(Color _nColor) { m_nColor = _nColor; }
59 class SVT_DLLPUBLIC ExtendedColorConfig final : public SfxBroadcaster, public SfxListener
61 friend class ExtendedColorConfig_Impl;
62 private:
63 static ExtendedColorConfig_Impl* m_pImpl;
64 public:
65 ExtendedColorConfig();
66 virtual ~ExtendedColorConfig() override;
68 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
70 // get the configured value
71 ExtendedColorConfigValue GetColorValue(const OUString& _sComponentName,const OUString& _sName)const;
72 sal_Int32 GetComponentCount() const;
73 OUString GetComponentName(sal_uInt32 _nPos) const;
74 OUString GetComponentDisplayName(const OUString& _sComponentName) const;
75 sal_Int32 GetComponentColorCount(const OUString& _sName) const;
76 ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sComponentName,sal_uInt32 _nPos) const;
79 class SVT_DLLPUBLIC EditableExtendedColorConfig
81 std::unique_ptr<ExtendedColorConfig_Impl> m_pImpl;
82 bool m_bModified;
83 public:
84 EditableExtendedColorConfig();
85 ~EditableExtendedColorConfig();
87 void DeleteScheme(const OUString& rScheme );
88 void AddScheme(const OUString& rScheme );
89 void LoadScheme(const OUString& rScheme );
90 void SetCurrentSchemeName(const OUString& rScheme);
92 sal_Int32 GetComponentCount() const;
93 OUString GetComponentName(sal_uInt32 _nPos) const;
94 sal_Int32 GetComponentColorCount(const OUString& _sName) const;
95 ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sName,sal_uInt32 _nPos) const;
96 void SetColorValue(const OUString& _sComponentName, const ExtendedColorConfigValue& rValue);
97 void SetModified();
98 void ClearModified() {m_bModified = false;}
99 bool IsModified() const {return m_bModified;}
100 void Commit();
102 void DisableBroadcast();
103 void EnableBroadcast();
105 }//namespace svtools
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */