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 18class AlphaSlider; 19class ColorField; 20class ColorPickerPanel; 21class ColorSlider; 22class CurrentColor; 23class Group; 24class SwatchView; 25 26class 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 selected_color_mode fColorPickerMode; 61 BRect fColorPickerFrame; 62}; 63 64#endif // SWATCH_GROUP_H 65