xref: /haiku/src/apps/icon-o-matic/gui/SwatchGroup.h (revision f333ade30958169ee702db317a8197bebbad52f9)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef SWATCH_GROUP_H
10 #define SWATCH_GROUP_H
11 
12 #include <View.h>
13 
14 #include "SelectedColorMode.h"
15 
16 #include "Observer.h"
17 
18 class AlphaSlider;
19 class ColorField;
20 class ColorPickerPanel;
21 class ColorSlider;
22 class CurrentColor;
23 class Group;
24 class SwatchView;
25 
26 class SwatchGroup : public BView,
27 					public Observer {
28  public:
29 								SwatchGroup(BRect frame);
30 	virtual						~SwatchGroup();
31 
32 	// Observer interface
33 	virtual	void				ObjectChanged(const Observable* object);
34 
35 	// BView interface
36 	virtual	void				AttachedToWindow();
37 	virtual	void				MessageReceived(BMessage* message);
38 
39 	// SwatchGroup
40 			void				SetCurrentColor(CurrentColor* color);
41 
42  private:
43 			void				_SetColor(rgb_color color);
44 			void				_SetColor(float h, float s, float v,
45 										  uint8 a);
46 
47 			SwatchView*			fCurrentColorSV;
48 			SwatchView*			fSwatchViews[20];
49 			ColorField*			fColorField;
50 			ColorSlider*		fColorSlider;
51 			AlphaSlider*		fAlphaSlider;
52 
53 			Group*				fTopSwatchViews;
54 			Group*				fBottomSwatchViews;
55 
56 			CurrentColor*		fCurrentColor;
57 			bool				fIgnoreNotifications;
58 
59 			ColorPickerPanel*	fColorPickerPanel;
60 			SelectedColorMode	fColorPickerMode;
61 			BRect				fColorPickerFrame;
62 };
63 
64 #endif // SWATCH_GROUP_H
65