xref: /haiku/headers/os/interface/CheckBox.h (revision f2ced752a08ff5d2618826bcd3ae3976c9f3e92e)
1 //------------------------------------------------------------------------------
2 //	Copyright (c) 2001-2002, OpenBeOS
3 //
4 //	Permission is hereby granted, free of charge, to any person obtaining a
5 //	copy of this software and associated documentation files (the "Software"),
6 //	to deal in the Software without restriction, including without limitation
7 //	the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 //	and/or sell copies of the Software, and to permit persons to whom the
9 //	Software is furnished to do so, subject to the following conditions:
10 //
11 //	The above copyright notice and this permission notice shall be included in
12 //	all copies or substantial portions of the Software.
13 //
14 //	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 //	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 //	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 //	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 //	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 //	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 //	DEALINGS IN THE SOFTWARE.
21 //
22 //	File Name:		CheckBox.h
23 //	Author:			Marc Flerackers (mflerackers@androme.be)
24 //	Description:	BCheckBox displays an on/off control.
25 //------------------------------------------------------------------------------
26 
27 #ifndef _CHECK_BOX_H
28 #define _CHECK_BOX_H
29 
30 // Standard Includes -----------------------------------------------------------
31 
32 // System Includes -------------------------------------------------------------
33 #include <BeBuild.h>
34 #include <Control.h>
35 // Project Includes ------------------------------------------------------------
36 
37 // Local Includes --------------------------------------------------------------
38 
39 // Local Defines ---------------------------------------------------------------
40 
41 // Globals ---------------------------------------------------------------------
42 
43 
44 // BCheckBox class -------------------------------------------------------------
45 class BCheckBox : public BControl {
46 
47 public:
48 					BCheckBox(BRect frame,
49 							const char *name,
50 							const char *label,
51 							BMessage *message,
52 							uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
53 							uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
54 virtual				~BCheckBox();
55 
56 /* Archiving */
57 					BCheckBox(BMessage *archive);
58 static	BArchivable	*Instantiate(BMessage *archive);
59 virtual	status_t	Archive(BMessage *archive, bool deep = true) const;
60 
61 virtual	void		Draw(BRect updateRect);
62 virtual	void		AttachedToWindow();
63 virtual	void		MouseDown(BPoint point);
64 
65 virtual void		MessageReceived(BMessage *message);
66 virtual void		WindowActivated(bool active);
67 virtual	void		KeyDown(const char *bytes, int32 numBytes);
68 virtual	void		MouseUp(BPoint point);
69 virtual	void		MouseMoved(BPoint point, uint32 transit, const BMessage *message);
70 virtual	void		DetachedFromWindow();
71 virtual	void		SetValue(int32 value);
72 virtual void		GetPreferredSize(float *width, float *height);
73 virtual void		ResizeToPreferred();
74 virtual	status_t	Invoke(BMessage *message = NULL);
75 virtual	void		FrameMoved(BPoint newLocation);
76 virtual	void		FrameResized(float width, float height);
77 
78 virtual BHandler	*ResolveSpecifier(BMessage *message,
79 									int32 index,
80 									BMessage *specifier,
81 									int32 what,
82 									const char *property);
83 virtual status_t	GetSupportedSuites(BMessage *message);
84 
85 virtual void		MakeFocus(bool focused = true);
86 virtual void		AllAttached();
87 virtual void		AllDetached();
88 
89 virtual status_t	Perform(perform_code d, void *arg);
90 
91 private:
92 
93 virtual	void		_ReservedCheckBox1();
94 virtual	void		_ReservedCheckBox2();
95 virtual	void		_ReservedCheckBox3();
96 
97 		BCheckBox	&operator=(const BCheckBox &);
98 
99 		bool		fOutlined;
100 		uint32		_reserved[2];
101 };
102 //------------------------------------------------------------------------------
103 
104 #endif // _CHECK_BOX_H
105 
106 /*
107  * $Log $
108  *
109  * $Id  $
110  *
111  */
112