1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
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>
48 WRITERSCRIPTINDICATOR
,
49 WRITERSECTIONBOUNDARIES
,
50 WRITERHEADERFOOTERMARK
,
59 CALCPAGEBREAKAUTOMATIC
,
69 CALCPROTECTEDBACKGROUND
,
89 class ColorConfig_Impl
;
90 struct ColorConfigValue
93 bool bIsVisible
; //validity depends on the element type
95 ColorConfigValue() : bIsVisible(false), nColor(0) {}
96 bool operator !=(const ColorConfigValue
& rCmp
) const
97 { return nColor
!= rCmp
.nColor
|| bIsVisible
!= rCmp
.bIsVisible
;}
100 class SVT_DLLPUBLIC ColorConfig final
:
101 public utl::detail::Options
103 friend class ColorConfig_Impl
;
105 static ColorConfig_Impl
* m_pImpl
;
108 virtual ~ColorConfig() override
;
110 // get the configured value - if bSmart is set the default color setting is provided
111 // instead of the automatic color
112 ColorConfigValue
GetColorValue(ColorConfigEntry eEntry
, bool bSmart
= true) const;
113 static Color
GetDefaultColor(ColorConfigEntry eEntry
);
114 const OUString
& GetCurrentSchemeName() const;
117 class SVT_DLLPUBLIC EditableColorConfig
119 std::unique_ptr
<ColorConfig_Impl
> m_pImpl
;
122 EditableColorConfig();
123 ~EditableColorConfig();
125 css::uno::Sequence
< OUString
> GetSchemeNames() const;
126 void DeleteScheme(const OUString
& rScheme
);
127 void AddScheme(const OUString
& rScheme
);
128 void LoadScheme(const OUString
& rScheme
);
129 const OUString
& GetCurrentSchemeName() const;
130 void SetCurrentSchemeName(const OUString
& rScheme
);
132 const ColorConfigValue
& GetColorValue(ColorConfigEntry eEntry
) const;
133 void SetColorValue(ColorConfigEntry eEntry
, const ColorConfigValue
& rValue
);
135 void ClearModified() {m_bModified
= false;}
136 bool IsModified() const {return m_bModified
;}
139 void DisableBroadcast();
140 void EnableBroadcast();
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */