LibreOffice Module svtools (master) 1
colorcfg.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>
23#include <tools/color.hxx>
24#include <com/sun/star/uno/Sequence.h>
25#include <unotools/options.hxx>
26#include <memory>
27
28
29namespace svtools{
31{
88};
89
90class ColorConfig_Impl;
92{
93
94 bool bIsVisible; //validity depends on the element type
97 bool operator !=(const ColorConfigValue& rCmp) const
98 { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
99};
100
103{
104 friend class ColorConfig_Impl;
105private:
107public:
108 ColorConfig();
109 virtual ~ColorConfig() override;
110
111 // get the configured value - if bSmart is set the default color setting is provided
112 // instead of the automatic color
113 ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart = true) const;
114 static Color GetDefaultColor(ColorConfigEntry eEntry);
115 static const OUString& GetCurrentSchemeName();
116};
117
119{
120 std::unique_ptr<ColorConfig_Impl> m_pImpl;
122public:
125
126 css::uno::Sequence< OUString > GetSchemeNames() const;
127 void DeleteScheme(const OUString& rScheme );
128 void AddScheme(const OUString& rScheme );
129 void LoadScheme(const OUString& rScheme );
130 const OUString& GetCurrentSchemeName() const;
131 void SetCurrentSchemeName(const OUString& rScheme);
132
133 const ColorConfigValue& GetColorValue(ColorConfigEntry eEntry) const;
134 void SetColorValue(ColorConfigEntry eEntry, const ColorConfigValue& rValue);
135 void SetModified();
136 void ClearModified() {m_bModified = false;}
137 bool IsModified() const {return m_bModified;}
138 void Commit();
139
140 void DisableBroadcast();
141 void EnableBroadcast();
142};
143}//namespace svtools
144
145/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static ColorConfig_Impl * m_pImpl
Definition: colorcfg.hxx:106
std::unique_ptr< ColorConfig_Impl > m_pImpl
Definition: colorcfg.hxx:120
ColorConfigEntry
Definition: colorcfg.hxx:31
@ WRITERDIRECTCURSOR
Definition: colorcfg.hxx:47
@ SMARTTAGS
Definition: colorcfg.hxx:42
@ WRITERPAGEBREAKS
Definition: colorcfg.hxx:51
@ CALCPAGEBREAKAUTOMATIC
Definition: colorcfg.hxx:59
@ SHADOWCOLOR
Definition: colorcfg.hxx:43
@ CALCTEXT
Definition: colorcfg.hxx:69
@ DRAWGRID
Definition: colorcfg.hxx:71
@ CALCPAGEBREAK
Definition: colorcfg.hxx:57
@ OBJECTBOUNDARIES
Definition: colorcfg.hxx:35
@ WRITERFIELDSHADINGS
Definition: colorcfg.hxx:45
@ CALCPROTECTEDBACKGROUND
Definition: colorcfg.hxx:70
@ HTMLCOMMENT
Definition: colorcfg.hxx:53
@ SQLCOMMENT
Definition: colorcfg.hxx:86
@ HTMLKEYWORD
Definition: colorcfg.hxx:54
@ CALCGRID
Definition: colorcfg.hxx:56
@ CALCVALUE
Definition: colorcfg.hxx:67
@ SQLOPERATOR
Definition: colorcfg.hxx:83
@ WRITERSCRIPTINDICATOR
Definition: colorcfg.hxx:48
@ LINKSVISITED
Definition: colorcfg.hxx:39
@ FONTCOLOR
Definition: colorcfg.hxx:37
@ ColorConfigEntryCount
Definition: colorcfg.hxx:87
@ CALCDETECTIVEERROR
Definition: colorcfg.hxx:64
@ GRAMMAR
Definition: colorcfg.hxx:41
@ HTMLUNKNOWN
Definition: colorcfg.hxx:55
@ BASICOPERATOR
Definition: colorcfg.hxx:77
@ WRITERTEXTGRID
Definition: colorcfg.hxx:44
@ SQLKEYWORD
Definition: colorcfg.hxx:84
@ SQLNUMBER
Definition: colorcfg.hxx:81
@ CALCCOMMENTS
Definition: colorcfg.hxx:62
@ DOCCOLOR
Definition: colorcfg.hxx:32
@ WRITERIDXSHADINGS
Definition: colorcfg.hxx:46
@ SQLIDENTIFIER
Definition: colorcfg.hxx:80
@ BASICERROR
Definition: colorcfg.hxx:79
@ BASICIDENTIFIER
Definition: colorcfg.hxx:73
@ WRITERHEADERFOOTERMARK
Definition: colorcfg.hxx:50
@ SQLPARAMETER
Definition: colorcfg.hxx:85
@ SQLSTRING
Definition: colorcfg.hxx:82
@ CALCNOTESBACKGROUND
Definition: colorcfg.hxx:66
@ DOCBOUNDARIES
Definition: colorcfg.hxx:33
@ BASICEDITOR
Definition: colorcfg.hxx:72
@ HTMLSGML
Definition: colorcfg.hxx:52
@ APPBACKGROUND
Definition: colorcfg.hxx:34
@ CALCREFERENCE
Definition: colorcfg.hxx:65
@ CALCHIDDENROWCOL
Definition: colorcfg.hxx:60
@ CALCDETECTIVE
Definition: colorcfg.hxx:63
@ BASICSTRING
Definition: colorcfg.hxx:76
@ BASICCOMMENT
Definition: colorcfg.hxx:74
@ TABLEBOUNDARIES
Definition: colorcfg.hxx:36
@ BASICNUMBER
Definition: colorcfg.hxx:75
@ CALCFORMULA
Definition: colorcfg.hxx:68
@ CALCTEXTOVERFLOW
Definition: colorcfg.hxx:61
@ BASICKEYWORD
Definition: colorcfg.hxx:78
@ WRITERSECTIONBOUNDARIES
Definition: colorcfg.hxx:49
@ CALCPAGEBREAKMANUAL
Definition: colorcfg.hxx:58
bool operator!=(const ColorConfigValue &rCmp) const
Definition: colorcfg.hxx:97
#define SVT_DLLPUBLIC
Definition: svtdllapi.h:27
#define SAL_WARN_UNUSED