Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / Dragger.h
blobd1416acfbb565cadc8dcaa56b01e2e8297c30bb0
1 /*
2 * Copyright 2006-2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _DRAGGER_H
6 #define _DRAGGER_H
9 #include <Locker.h>
10 #include <List.h>
11 #include <View.h>
13 class BBitmap;
14 class BMessage;
15 class BPopUpMenu;
16 class BShelf;
18 namespace BPrivate {
19 class replicant_data;
20 class ShelfContainerViewFilter;
24 class BDragger : public BView {
25 public:
26 BDragger(BRect frame, BView* target,
27 uint32 resizingMode = B_FOLLOW_NONE,
28 uint32 flags = B_WILL_DRAW);
29 BDragger(BView* target,
30 uint32 flags = B_WILL_DRAW);
31 BDragger(BMessage* data);
32 virtual ~BDragger();
34 static BArchivable* Instantiate(BMessage* data);
35 virtual status_t Archive(BMessage* data,
36 bool deep = true) const;
38 virtual void AttachedToWindow();
39 virtual void DetachedFromWindow();
41 virtual void Draw(BRect updateRect);
42 virtual void MouseDown(BPoint where);
43 virtual void MouseUp(BPoint where);
44 virtual void MouseMoved(BPoint where, uint32 transit,
45 const BMessage* dragMessage);
46 virtual void MessageReceived(BMessage* message);
47 virtual void FrameMoved(BPoint newPosition);
48 virtual void FrameResized(float newWidth, float newHeight);
50 static status_t ShowAllDraggers();
51 static status_t HideAllDraggers();
52 static bool AreDraggersDrawn();
54 virtual BHandler* ResolveSpecifier(BMessage* message,
55 int32 index, BMessage* specifier,
56 int32 form, const char* property);
57 virtual status_t GetSupportedSuites(BMessage* data);
58 virtual status_t Perform(perform_code code, void* data);
60 virtual void ResizeToPreferred();
61 virtual void GetPreferredSize(float* _width,
62 float* _height);
63 virtual void MakeFocus(bool focus = true);
64 virtual void AllAttached();
65 virtual void AllDetached();
67 status_t SetPopUp(BPopUpMenu* contextMenu);
68 BPopUpMenu* PopUp() const;
70 bool InShelf() const;
71 BView* Target() const;
73 virtual BBitmap* DragBitmap(BPoint* offset, drawing_mode* mode);
75 class Private;
77 protected:
78 bool IsVisibilityChanging() const;
80 private:
81 friend class BPrivate::ShelfContainerViewFilter;
82 friend class BPrivate::replicant_data;
83 friend class Private;
84 friend class BShelf;
86 virtual void _ReservedDragger2();
87 virtual void _ReservedDragger3();
88 virtual void _ReservedDragger4();
90 static void _UpdateShowAllDraggers(bool visible);
92 BDragger& operator=(const BDragger& other);
94 void _InitData();
95 void _AddToList();
96 void _RemoveFromList();
97 status_t _DetermineRelationship();
98 status_t _SetViewToDrag(BView* target);
99 void _SetShelf(BShelf* shelf);
100 void _SetZombied(bool state);
101 void _BuildDefaultPopUp();
102 void _ShowPopUp(BView* target, BPoint where);
104 enum relation {
105 TARGET_UNKNOWN,
106 TARGET_IS_CHILD,
107 TARGET_IS_PARENT,
108 TARGET_IS_SIBLING
111 BView* fTarget;
112 relation fRelation;
113 BShelf* fShelf;
114 bool fTransition;
115 bool fIsZombie;
116 char fErrCount;
117 bool fPopUpIsCustom;
118 BBitmap* fBitmap;
119 BPopUpMenu* fPopUp;
120 uint32 _reserved[3];
123 #endif /* _DRAGGER_H */