2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #include "svx/sidebar/PopupControl.hxx"
20 #include <svtools/valueset.hxx>
21 #include <boost/function.hpp>
22 #include <svx/SvxColorValueSet.hxx>
30 namespace svx
{ namespace sidebar
{
32 /** The ColorControl uses a ValueSet control for displaying all named
35 class SVX_DLLPUBLIC ColorControl
39 /** Create a new ColorControl object.
41 The resource id for the whole color control.
43 A functor for getting the color which will be returned when the
44 WB_NONEFIELD is used and got selected
46 A functor for setting the color that is selected by the
48 @param pNoColorStringResId
49 Resource id of an optional string for the "no color"
50 string. When a value is given then a
51 field/button is created above the color matrix for
52 selecting "no color" ie. transparent.
53 When zero is given then no such field is created.
57 SfxBindings
* pBindings
,
58 const ResId
& rControlResId
,
59 const ResId
& rValueSetResId
,
60 const ::boost::function
<Color(void)>& rNoColorGetter
,
61 const ::boost::function
<void(String
&,Color
)>& rColorSetter
,
62 FloatingWindow
* pFloatingWindow
,
63 const ResId
* pNoColorStringResId
);
64 virtual ~ColorControl (void);
67 void SetCurColorSelect (
72 SvxColorValueSet maVSColor
;
73 FloatingWindow
* mpFloatingWindow
;
74 const String msNoColorString
;
75 ::boost::function
<Color(void)> maNoColorGetter
;
76 ::boost::function
<void(String
&,Color
)> maColorSetter
;
78 void FillColors (void);
79 DECL_LINK(VSSelectHdl
, void *);
82 } } // end of namespace svx::sidebar