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 .
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 <svl/brdcst.hxx>
27 #include <svl/lstner.hxx>
28 #include <unotools/options.hxx>
30 //-----------------------------------------------------------------------------
49 WRITERSCRIPTINDICATOR
,
50 WRITERSECTIONBOUNDARIES
,
51 WRITERHEADERFOOTERMARK
,
60 CALCPAGEBREAKAUTOMATIC
,
83 class ColorConfig_Impl
;
84 struct ColorConfigValue
87 sal_Bool bIsVisible
; //validity depends on the element type
89 ColorConfigValue() : bIsVisible(sal_False
), nColor(0) {}
90 sal_Bool
operator !=(const ColorConfigValue
& rCmp
) const
91 { return nColor
!= rCmp
.nColor
|| bIsVisible
!= rCmp
.bIsVisible
;}
94 class SVT_DLLPUBLIC ColorConfig
:
95 public utl::detail::Options
97 friend class ColorConfig_Impl
;
99 static ColorConfig_Impl
* m_pImpl
;
102 virtual ~ColorConfig();
104 // get the configured value - if bSmart is set the default color setting is provided
105 // instead of the automatic color
106 ColorConfigValue
GetColorValue(ColorConfigEntry eEntry
, sal_Bool bSmart
= sal_True
)const;
107 static Color
GetDefaultColor(ColorConfigEntry eEntry
);
110 class SVT_DLLPUBLIC EditableColorConfig
112 ColorConfig_Impl
* m_pImpl
;
113 sal_Bool m_bModified
;
115 EditableColorConfig();
116 ~EditableColorConfig();
118 ::com::sun::star::uno::Sequence
< OUString
> GetSchemeNames() const;
119 void DeleteScheme(const OUString
& rScheme
);
120 void AddScheme(const OUString
& rScheme
);
121 sal_Bool
LoadScheme(const OUString
& rScheme
);
122 const OUString
& GetCurrentSchemeName()const;
123 void SetCurrentSchemeName(const OUString
& rScheme
);
125 const ColorConfigValue
& GetColorValue(ColorConfigEntry eEntry
)const;
126 void SetColorValue(ColorConfigEntry eEntry
, const ColorConfigValue
& rValue
);
128 void ClearModified(){m_bModified
= sal_False
;}
129 sal_Bool
IsModified()const{return m_bModified
;}
132 void DisableBroadcast();
133 void EnableBroadcast();
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */