LibreOffice Module svtools (master) 1
extcolorcfg.hxx
Go to the documentation of this file.
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#pragma once
20
21#include <svtools/svtdllapi.h>
22#include <rtl/ustring.hxx>
24#include <svl/lstner.hxx>
25#include <tools/color.hxx>
26#include <memory>
27#include <utility>
28
29
30namespace svtools {
31
32class ExtendedColorConfig_Impl;
33
35{
36 OUString m_sName;
40public:
43 ,OUString _sDisplayName
44 ,Color _nColor
45 ,Color _nDefaultColor)
46 : m_sName(std::move(_sName))
47 ,m_sDisplayName(std::move(_sDisplayName))
48 ,m_nColor(_nColor)
49 ,m_nDefaultColor(_nDefaultColor)
50 {}
51
52 const OUString& getName() const { return m_sName; }
53 const OUString& getDisplayName() const { return m_sDisplayName; }
54 Color getColor() const { return m_nColor; }
56
57 void setColor(Color _nColor) { m_nColor = _nColor; }
58};
59
61{
63private:
65public:
67 virtual ~ExtendedColorConfig() override;
68
69 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
70
71 // get the configured value
72 ExtendedColorConfigValue GetColorValue(const OUString& _sComponentName,const OUString& _sName)const;
73 sal_Int32 GetComponentCount() const;
74 OUString GetComponentName(sal_uInt32 _nPos) const;
75 OUString GetComponentDisplayName(const OUString& _sComponentName) const;
76 sal_Int32 GetComponentColorCount(const OUString& _sName) const;
77 ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sComponentName,sal_uInt32 _nPos) const;
78};
79
81{
82 std::unique_ptr<ExtendedColorConfig_Impl> m_pImpl;
84public:
87
88 void DeleteScheme(const OUString& rScheme );
89 void AddScheme(const OUString& rScheme );
90 void LoadScheme(const OUString& rScheme );
91 void SetCurrentSchemeName(const OUString& rScheme);
92
93 sal_Int32 GetComponentCount() const;
94 OUString GetComponentName(sal_uInt32 _nPos) const;
95 sal_Int32 GetComponentColorCount(const OUString& _sName) const;
96 ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sName,sal_uInt32 _nPos) const;
97 void SetColorValue(const OUString& _sComponentName, const ExtendedColorConfigValue& rValue);
98 void SetModified();
99 void ClearModified() {m_bModified = false;}
100 bool IsModified() const {return m_bModified;}
101 void Commit();
102
103 void DisableBroadcast();
104 void EnableBroadcast();
105};
106}//namespace svtools
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< ExtendedColorConfig_Impl > m_pImpl
Definition: extcolorcfg.hxx:82
const OUString & getDisplayName() const
Definition: extcolorcfg.hxx:53
ExtendedColorConfigValue(OUString _sName, OUString _sDisplayName, Color _nColor, Color _nDefaultColor)
Definition: extcolorcfg.hxx:42
const OUString & getName() const
Definition: extcolorcfg.hxx:52
static ExtendedColorConfig_Impl * m_pImpl
Definition: extcolorcfg.hxx:64
void Notify(SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldRect=nullptr)
#define SVT_DLLPUBLIC
Definition: svtdllapi.h:27