Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / Control.h
blob94edfd7f9d111c20df434028e867ccec671a64a6
1 /*
2 * Copyright 2001-2013, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _CONTROL_H
6 #define _CONTROL_H
8 #include <Invoker.h>
9 #include <Message.h> // For convenience
10 #include <View.h>
13 enum {
14 B_CONTROL_OFF = 0,
15 B_CONTROL_ON = 1,
16 B_CONTROL_PARTIALLY_ON = 2
19 class BBitmap;
20 class BWindow;
22 namespace BPrivate {
23 class BIcon;
27 class BControl : public BView, public BInvoker {
28 public:
29 BControl(BRect frame, const char* name,
30 const char* label, BMessage* message,
31 uint32 resizingMode, uint32 flags);
32 BControl(const char* name, const char* label,
33 BMessage* message, uint32 flags);
34 virtual ~BControl();
36 BControl(BMessage* data);
37 static BArchivable* Instantiate(BMessage* data);
38 virtual status_t Archive(BMessage* data, bool deep = true) const;
40 virtual void WindowActivated(bool active);
42 virtual void AttachedToWindow();
43 virtual void DetachedFromWindow();
44 virtual void AllAttached();
45 virtual void AllDetached();
47 virtual void MessageReceived(BMessage* message);
48 virtual void MakeFocus(bool focus = true);
50 virtual void KeyDown(const char* bytes, int32 numBytes);
51 virtual void MouseDown(BPoint where);
52 virtual void MouseUp(BPoint where);
53 virtual void MouseMoved(BPoint where, uint32 code,
54 const BMessage* dragMessage);
56 virtual void SetLabel(const char* string);
57 const char* Label() const;
59 virtual void SetValue(int32 value);
60 int32 Value() const;
62 virtual void SetEnabled(bool enabled);
63 bool IsEnabled() const;
65 virtual void GetPreferredSize(float* _width,
66 float* _height);
67 virtual void ResizeToPreferred();
69 virtual status_t Invoke(BMessage* message = NULL);
70 virtual BHandler* ResolveSpecifier(BMessage* message,
71 int32 index, BMessage* specifier,
72 int32 what, const char* property);
73 virtual status_t GetSupportedSuites(BMessage* message);
75 virtual status_t Perform(perform_code d, void* arg);
77 virtual status_t SetIcon(const BBitmap* bitmap,
78 uint32 flags = 0);
79 status_t SetIconBitmap(const BBitmap* bitmap,
80 uint32 which, uint32 flags = 0);
81 const BBitmap* IconBitmap(uint32 which) const;
83 protected:
84 bool IsFocusChanging() const;
85 bool IsTracking() const;
86 void SetTracking(bool state);
88 void SetValueNoUpdate(int32 value);
90 private:
91 struct IconData;
93 private:
94 virtual void _ReservedControl2();
95 virtual void _ReservedControl3();
96 virtual void _ReservedControl4();
98 BControl& operator=(const BControl&);
100 void InitData(BMessage* data = NULL);
102 private:
103 char* fLabel;
104 int32 fValue;
105 bool fEnabled;
106 bool fFocusChanging;
107 bool fTracking;
108 bool fWantsNav;
109 BPrivate::BIcon* fIcon;
111 #ifdef B_HAIKU_64_BIT
112 uint32 _reserved[2];
113 #else
114 uint32 _reserved[3];
115 #endif
118 #endif // _CONTROL_H