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 .
20 #ifndef INCLUDED_SVX_SIDEBAR_COLORCONTROL_HXX
21 #define INCLUDED_SVX_SIDEBAR_COLORCONTROL_HXX
23 #include <svx/sidebar/PopupControl.hxx>
25 #include <svtools/valueset.hxx>
26 #include <boost/function.hpp>
27 #include <svx/SvxColorValueSet.hxx>
35 namespace svx
{ namespace sidebar
{
37 /** The ColorControl uses a ValueSet control for displaying all named
40 class SVX_DLLPUBLIC ColorControl
44 /** Create a new ColorControl object.
46 The resource id for the whole color control.
48 A functor for getting the color which will be returned when the
49 WB_NONEFIELD is used and got selected
51 A functor for setting the color that is selected by the
53 @param pNoColorStringResId
54 Resource id of an optional string for the "no color"
55 string. When a value is given then a
56 field/button is created above the color matrix for
57 selecting "no color" ie. transparent.
58 When zero is given then no such field is created.
62 SfxBindings
* pBindings
,
63 const ResId
& rControlResId
,
64 const ResId
& rValueSetResId
,
65 const ::boost::function
<Color(void)>& rNoColorGetter
,
66 const ::boost::function
<void(OUString
&,Color
)>& rColorSetter
,
67 FloatingWindow
* pFloatingWindow
,
68 const ResId
* pNoColorStringResId
);
69 virtual ~ColorControl (void);
72 void SetCurColorSelect (
77 SvxColorValueSet maVSColor
;
78 FloatingWindow
* mpFloatingWindow
;
79 const OUString msNoColorString
;
80 ::boost::function
<Color(void)> maNoColorGetter
;
81 ::boost::function
<void(OUString
&,Color
)> maColorSetter
;
83 void FillColors (void);
84 DECL_LINK(VSSelectHdl
, void *);
87 } } // end of namespace svx::sidebar
89 #endif // INCLUDED_SVX_SIDEBAR_COLORCONTROL_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */