xref: /haiku/src/apps/icon-o-matic/gui/SwatchGroup.h (revision 61b0e9e3149012ccbd48a10dcbc7f83600bb4769)
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 "selected_color_mode.h"
15 
16 #include "Observer.h"
17 
18 class ColorField;
19 class ColorPickerPanel;
20 class ColorSlider;
21 class CurrentColor;
22 class Group;
23 class SwatchView;
24 
25 class SwatchGroup : public BView,
26 					public Observer {
27  public:
28 								SwatchGroup(BRect frame);
29 	virtual						~SwatchGroup();
30 
31 	// Observer interface
32 	virtual	void				ObjectChanged(const Observable* object);
33 
34 	// BView interface
35 	virtual	void				AttachedToWindow();
36 	virtual	void				MessageReceived(BMessage* message);
37 
38 	// SwatchGroup
39 			void				SetCurrentColor(CurrentColor* color);
40 
41  private:
42 			void				_SetColor(rgb_color color);
43 			void				_SetColor(float h, float s, float v);
44 
45 			SwatchView*			fCurrentColorSV;
46 			SwatchView*			fSwatchViews[20];
47 			ColorField*			fColorField;
48 			ColorSlider*		fColorSlider;
49 
50 			Group*				fTopSwatchViews;
51 			Group*				fBottomSwatchViews;
52 
53 			CurrentColor*		fCurrentColor;
54 			bool				fIgnoreNotifications;
55 
56 			ColorPickerPanel*	fColorPickerPanel;
57 			selected_color_mode fColorPickerMode;
58 			BRect				fColorPickerFrame;
59 };
60 
61 #endif // SWATCH_GROUP_H
62