Fix missing includes
[centerim5.git] / cppconsui / ColorPickerPalette.h
blob87cce8e5d899a2c07e81f5243deddd62d9c9d580
1 /*
2 * Copyright (C) 2012 by CenterIM developers
4 * This file is part of CenterIM.
6 * CenterIM is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * CenterIM is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * */
21 /**
22 * @file
23 * ColorPickerPalette class.
25 * @ingroup cppconsui
28 #ifndef __COLORPICKERPALETTE_H__
29 #define __COLORPICKERPALETTE_H__
31 #include "Button.h"
32 #include "Container.h"
34 namespace CppConsUI
37 class ColorPickerPalette
38 : public Container
40 public:
41 enum Flag {
42 FLAG_HIDE_ANSI = 1 << 0,
43 FLAG_HIDE_GRAYSCALE = 1 << 1,
44 FLAG_HIDE_COLORCUBE = 1 << 2
47 ColorPickerPalette(int defaultcolor, int flags = 0);
48 virtual ~ColorPickerPalette() {};
50 /**
51 * Emited signal when a color is selected
53 sigc::signal<void, ColorPickerPalette&, int> signal_color_selected;
55 protected:
56 class ColorPickerPaletteButton
57 : public Button
59 friend class ColorPickerPalette;
61 public:
62 ColorPickerPaletteButton(int color);
63 virtual ~ColorPickerPaletteButton() {};
65 virtual void Draw();
67 protected:
68 int color;
70 private:
71 ColorPickerPaletteButton(const ColorPickerPaletteButton&);
72 ColorPickerPaletteButton& operator=(const ColorPickerPaletteButton&);
75 virtual void OnSelectColor(Button& activator);
77 virtual void AddButton(int x, int y, int color, int defaultcolor);
79 virtual void AddAnsi(int defaultcolor);
80 virtual void AddGrayscale(int defaultcolor);
81 virtual void AddColorCube(int defaultcolor);
83 private:
84 ColorPickerPalette(const ColorPickerPalette&);
85 ColorPickerPalette& operator=(const ColorPickerPalette&);
88 } // namespace CppConsUI
90 #endif // __COLORPICKERPALETTE_H__
92 /* vim: set tabstop=2 shiftwidth=2 textwidth=78 expandtab : */