fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svx / sidebar / ColorControl.hxx
blob6f8faf7640ce7c48a00ae3770b2423b4b88b2c63
1 /*
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>
24 class Window;
25 class SfxBindings;
26 class RedId;
27 class FloatingWindow;
30 namespace svx { namespace sidebar {
32 /** The ColorControl uses a ValueSet control for displaying all named
33 colors in a matrix.
35 class SVX_DLLPUBLIC ColorControl
36 : public PopupControl
38 public:
39 /** Create a new ColorControl object.
40 @param rControlResId
41 The resource id for the whole color control.
42 @param rNoColorGetter
43 A functor for getting the color which will be returned when the
44 WB_NONEFIELD is used and got selected
45 @param rColorSetter
46 A functor for setting the color that is selected by the
47 user.
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.
55 ColorControl (
56 Window* pParent,
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);
66 void GetFocus (void);
67 void SetCurColorSelect (
68 const Color aCol,
69 const bool bAvl);
71 private:
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