xref: /haiku/headers/private/interface/Spinner.h (revision dd2a1e350b303b855a50fd64e6cb55618be1ae6a)
1 /*
2  * Copyright 2015 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		John Scipione, jscipione@gmail.com
7  */
8 #ifndef _SPINNER_H
9 #define _SPINNER_H
10 
11 
12 #include <AbstractSpinner.h>
13 
14 
15 class BSpinner : public BAbstractSpinner {
16 public:
17 								BSpinner(BRect frame, const char* name,
18 									const char* label, BMessage* message,
19 									uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
20 									uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
21 								BSpinner(const char* name, const char* label,
22 									BMessage* message,
23 									uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
24 								BSpinner(BMessage* data);
25 	virtual						~BSpinner();
26 
27 	static	BArchivable*		Instantiate(BMessage* data);
28 	virtual	status_t			Archive(BMessage* data, bool deep = true) const;
29 
30 	virtual	void				Increment();
31 	virtual	void				Decrement();
32 
33 	virtual	status_t			GetSupportedSuites(BMessage* message);
34 
35 	virtual	void				AttachedToWindow();
36 
37 	virtual	void				SetEnabled(bool enable);
38 
39 			int32				MinValue() const { return fMinValue; }
40 	virtual	void				SetMinValue(int32 min);
41 
42 			int32				MaxValue() const { return fMaxValue; }
43 	virtual	void				SetMaxValue(int32 max);
44 
45 			void				Range(int32* min, int32* max);
46 	virtual	void				SetRange(int32 min, int32 max);
47 
48 	virtual	void				SetValue(int32 value);
49 	virtual	void				SetValueFromText();
50 
51 private:
52 	// FBC padding
53 	virtual	void				_ReservedSpinner20();
54 	virtual	void				_ReservedSpinner19();
55 	virtual	void				_ReservedSpinner18();
56 	virtual	void				_ReservedSpinner17();
57 	virtual	void				_ReservedSpinner16();
58 	virtual	void				_ReservedSpinner15();
59 	virtual	void				_ReservedSpinner14();
60 	virtual	void				_ReservedSpinner13();
61 	virtual	void				_ReservedSpinner12();
62 	virtual	void				_ReservedSpinner11();
63 	virtual	void				_ReservedSpinner10();
64 	virtual	void				_ReservedSpinner9();
65 	virtual	void				_ReservedSpinner8();
66 	virtual	void				_ReservedSpinner7();
67 	virtual	void				_ReservedSpinner6();
68 	virtual	void				_ReservedSpinner5();
69 	virtual	void				_ReservedSpinner4();
70 	virtual	void				_ReservedSpinner3();
71 	virtual	void				_ReservedSpinner2();
72 	virtual	void				_ReservedSpinner1();
73 
74 private:
75 			void				_InitObject();
76 
77 			int32				fMinValue;
78 			int32				fMaxValue;
79 
80 	// FBC padding
81 			uint32				_reserved[21];
82 };
83 
84 
85 #endif	// _SPINNER_H
86