xref: /haiku/headers/os/interface/OptionPopUp.h (revision bab64f65bb775dc23060e276f1f1c4498ab7af6c)
13c5bd344SStefano Ceccherini /*
2*7f9368caSlooncraz  * Copyright 2001-2015, Haiku, Inc. All rights reserved.
389208c77SStephan Aßmus  * Distributed under the terms of the MIT License.
43c5bd344SStefano Ceccherini  */
53c5bd344SStefano Ceccherini #ifndef _OPTION_POP_UP_H
6d734a8ceSbeveloper #define _OPTION_POP_UP_H
7d734a8ceSbeveloper 
897da0e7cSStephan Aßmus 
9d734a8ceSbeveloper #include <OptionControl.h>
10d734a8ceSbeveloper 
11d734a8ceSbeveloper 
12d734a8ceSbeveloper class BMenuField;
1397da0e7cSStephan Aßmus 
1497da0e7cSStephan Aßmus 
153c5bd344SStefano Ceccherini class BOptionPopUp : public BOptionControl {
16d734a8ceSbeveloper public:
1797da0e7cSStephan Aßmus 								BOptionPopUp(BRect frame, const char* name,
1897da0e7cSStephan Aßmus 									const char* label, BMessage* message,
19*7f9368caSlooncraz 									uint32 resizeMask = B_FOLLOW_LEFT_TOP,
20d734a8ceSbeveloper 									uint32 flags = B_WILL_DRAW);
2197da0e7cSStephan Aßmus 								BOptionPopUp(BRect frame, const char* name,
2297da0e7cSStephan Aßmus 									const char* label,  BMessage* message,
2397da0e7cSStephan Aßmus 									bool fixed, uint32 resizeMask
24*7f9368caSlooncraz 										= B_FOLLOW_LEFT_TOP,
25d734a8ceSbeveloper 									uint32 flags = B_WILL_DRAW);
26510fae5fSStefano Ceccherini 								BOptionPopUp(const char* name,
27510fae5fSStefano Ceccherini 									const char* label, BMessage* message,
28510fae5fSStefano Ceccherini 									uint32 flags = B_WILL_DRAW);
29510fae5fSStefano Ceccherini 
3097da0e7cSStephan Aßmus 	virtual						~BOptionPopUp();
31d734a8ceSbeveloper 
32d734a8ceSbeveloper 			BMenuField*			MenuField();
33d734a8ceSbeveloper 
3497da0e7cSStephan Aßmus 	virtual	bool				GetOptionAt(int32 index, const char** _name,
3597da0e7cSStephan Aßmus 									int32* _value);
363c5bd344SStefano Ceccherini 	virtual	void				RemoveOptionAt(int32 index);
37d734a8ceSbeveloper 	virtual	int32				CountOptions() const;
383c5bd344SStefano Ceccherini 	virtual	status_t 			AddOptionAt(const char* name, int32 value,
39d734a8ceSbeveloper 									int32 index);
40d734a8ceSbeveloper 
41d734a8ceSbeveloper 	virtual	void				AllAttached();
423d06e082SAdrien Destugues 	virtual	void				AttachedToWindow();
433c5bd344SStefano Ceccherini 	virtual	void				MessageReceived(BMessage* message);
443c5bd344SStefano Ceccherini 	virtual	void				SetLabel(const char* text);
453c5bd344SStefano Ceccherini 	virtual	void				SetValue(int32 value);
463c5bd344SStefano Ceccherini 	virtual	void				SetEnabled(bool enabled);
4797da0e7cSStephan Aßmus 	virtual	void				GetPreferredSize(float* _width,
4897da0e7cSStephan Aßmus 									float* _height);
49d734a8ceSbeveloper 	virtual	void				ResizeToPreferred();
503c5bd344SStefano Ceccherini 
5197da0e7cSStephan Aßmus 	virtual	int32				SelectedOption(const char** _name = 0,
5297da0e7cSStephan Aßmus 									int32* _value = 0) const;
53d734a8ceSbeveloper private:
5497da0e7cSStephan Aßmus 	// Forbidden and FBC padding
553c5bd344SStefano Ceccherini 								BOptionPopUp();
5697da0e7cSStephan Aßmus 								BOptionPopUp(const BOptionPopUp& other);
5797da0e7cSStephan Aßmus 			BOptionPopUp&		operator=(const BOptionPopUp& other);
58d734a8ceSbeveloper 
593c5bd344SStefano Ceccherini 
60d734a8ceSbeveloper 	virtual	status_t		 	_Reserved_OptionControl_0(void*, ...);
61d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionControl_1(void*, ...);
62d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionControl_2(void*, ...);
63d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionControl_3(void*, ...);
643c5bd344SStefano Ceccherini 
65d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_0(void*, ...);
66d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_1(void*, ...);
67d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_2(void*, ...);
68d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_3(void*, ...);
69d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_4(void*, ...);
70d734a8ceSbeveloper 	virtual	status_t 		 	_Reserved_OptionPopUp_5(void*, ...);
71d734a8ceSbeveloper 	virtual	status_t		 	_Reserved_OptionPopUp_6(void*, ...);
72d734a8ceSbeveloper 	virtual	status_t		 	_Reserved_OptionPopUp_7(void*, ...);
73d734a8ceSbeveloper 
7497da0e7cSStephan Aßmus private:
753c5bd344SStefano Ceccherini 			BMenuField*			fMenuField;
7697da0e7cSStephan Aßmus 
7797da0e7cSStephan Aßmus 			uint32				_reserved[8];
78d734a8ceSbeveloper };
79d734a8ceSbeveloper 
8097da0e7cSStephan Aßmus #endif // _OPTION_POP_UP_H
81