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 ICON_OPTIONS_CONTROL_H
10#define ICON_OPTIONS_CONTROL_H
11
12#include <Control.h>
13#include <Invoker.h>
14
15#include <MDividable.h>
16
17class IconButton;
18
19class IconOptionsControl : public MView,
20						   public MDividable,
21						   public BControl {
22 public:
23								IconOptionsControl(const char* name = NULL,
24												   const char* label = NULL,
25												   BMessage* message = NULL,
26												   BHandler* target = NULL);
27								~IconOptionsControl();
28
29	// MView interface
30	virtual	minimax				layoutprefs();
31	virtual	BRect				layout(BRect frame);
32
33	// MDividable interface
34	virtual float				LabelWidth();
35
36	// BControl interface
37	virtual	void				AttachedToWindow();
38	virtual	void				AllAttached();
39	virtual	void				Draw(BRect updateRect);
40	virtual	void				FrameResized(float width, float height);
41
42	virtual	void				SetLabel(const char* label);
43	virtual	void				SetValue(int32 value);
44	virtual	int32				Value() const;
45	virtual	void				SetEnabled(bool enable);
46
47	virtual	void				MessageReceived(BMessage* message);
48
49	// BInvoker interface
50	virtual	status_t			Invoke(BMessage* message = NULL);
51
52	// IconOptionsControl
53			void				AddOption(IconButton* icon);
54
55 private:
56
57			IconButton*			_FindIcon(int32 index) const;
58			void				_TriggerRelayout();
59			void				_LayoutIcons(BRect frame);
60
61			BHandler*			fTargetCache;
62};
63
64#endif // ICON_OPTIONS_CONTROL_H
65