bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / svtools / colorcfg.hxx
blob381ef70570c4b64b99c02bbede3e8b8525bbeca4
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 #ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
20 #define INCLUDED_SVTOOLS_COLORCFG_HXX
22 #include <svtools/svtdllapi.h>
23 #include <rtl/ustring.hxx>
24 #include <tools/color.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <unotools/options.hxx>
27 #include <memory>
30 namespace svtools{
31 enum ColorConfigEntry
33 DOCCOLOR ,
34 DOCBOUNDARIES ,
35 APPBACKGROUND ,
36 OBJECTBOUNDARIES ,
37 TABLEBOUNDARIES ,
38 FONTCOLOR ,
39 LINKS ,
40 LINKSVISITED ,
41 SPELL ,
42 SMARTTAGS ,
43 SHADOWCOLOR ,
44 WRITERTEXTGRID ,
45 WRITERFIELDSHADINGS ,
46 WRITERIDXSHADINGS ,
47 WRITERDIRECTCURSOR ,
48 WRITERSCRIPTINDICATOR,
49 WRITERSECTIONBOUNDARIES,
50 WRITERHEADERFOOTERMARK,
51 WRITERPAGEBREAKS,
52 HTMLSGML ,
53 HTMLCOMMENT ,
54 HTMLKEYWORD ,
55 HTMLUNKNOWN ,
56 CALCGRID ,
57 CALCPAGEBREAK ,
58 CALCPAGEBREAKMANUAL,
59 CALCPAGEBREAKAUTOMATIC,
60 CALCDETECTIVE ,
61 CALCDETECTIVEERROR ,
62 CALCREFERENCE ,
63 CALCNOTESBACKGROUND ,
64 CALCVALUE,
65 CALCFORMULA,
66 CALCTEXT,
67 CALCPROTECTEDBACKGROUND,
68 DRAWGRID ,
69 BASICIDENTIFIER,
70 BASICCOMMENT ,
71 BASICNUMBER ,
72 BASICSTRING ,
73 BASICOPERATOR ,
74 BASICKEYWORD ,
75 BASICERROR ,
76 SQLIDENTIFIER,
77 SQLNUMBER,
78 SQLSTRING,
79 SQLOPERATOR,
80 SQLKEYWORD,
81 SQLPARAMETER,
82 SQLCOMMENT,
83 ColorConfigEntryCount
86 class ColorConfig_Impl;
87 struct ColorConfigValue
90 bool bIsVisible; //validity depends on the element type
91 ::Color nColor;
92 ColorConfigValue() : bIsVisible(false), nColor(0) {}
93 bool operator !=(const ColorConfigValue& rCmp) const
94 { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
97 class SVT_DLLPUBLIC ColorConfig:
98 public utl::detail::Options
100 friend class ColorConfig_Impl;
101 private:
102 static ColorConfig_Impl* m_pImpl;
103 public:
104 ColorConfig();
105 virtual ~ColorConfig() override;
107 // get the configured value - if bSmart is set the default color setting is provided
108 // instead of the automatic color
109 ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart = true) const;
110 static Color GetDefaultColor(ColorConfigEntry eEntry);
113 class SVT_DLLPUBLIC EditableColorConfig
115 std::unique_ptr<ColorConfig_Impl> m_pImpl;
116 bool m_bModified;
117 public:
118 EditableColorConfig();
119 ~EditableColorConfig();
121 css::uno::Sequence< OUString > GetSchemeNames() const;
122 void DeleteScheme(const OUString& rScheme );
123 void AddScheme(const OUString& rScheme );
124 void LoadScheme(const OUString& rScheme );
125 const OUString& GetCurrentSchemeName() const;
126 void SetCurrentSchemeName(const OUString& rScheme);
128 const ColorConfigValue& GetColorValue(ColorConfigEntry eEntry) const;
129 void SetColorValue(ColorConfigEntry eEntry, const ColorConfigValue& rValue);
130 void SetModified();
131 void ClearModified() {m_bModified = false;}
132 bool IsModified() const {return m_bModified;}
133 void Commit();
135 void DisableBroadcast();
136 void EnableBroadcast();
138 }//namespace svtools
139 #endif
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */