vfs: check userland buffers before reading them.
[haiku.git] / headers / private / interface / MenuWindow.h
blobeb1b943c9da7bee4e15fdd0af809a54e5612b607
1 /*
2 * Copyright 2001-2009, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Marc Flerackers (mflerackers@androme.be)
7 * Stefano Ceccherini (burton666@libero.it)
8 */
9 #ifndef MENU_WINDOW_H
10 #define MENU_WINDOW_H
13 #include <Window.h>
15 class BMenu;
18 namespace BPrivate {
20 class BMenuFrame;
21 class BMenuScroller;
24 class BMenuWindow : public BWindow {
25 public:
26 BMenuWindow(const char* name);
27 virtual ~BMenuWindow();
29 virtual void DispatchMessage(BMessage* message,
30 BHandler* handler);
32 void AttachMenu(BMenu* menu);
33 void DetachMenu();
35 void AttachScrollers();
36 void DetachScrollers();
38 void SetSmallStep(float step);
39 void GetSteps(float* _smallStep, float* _largeStep) const;
40 bool HasScrollers() const;
41 bool CheckForScrolling(const BPoint& cursor);
42 bool TryScrollBy(const float& step);
43 bool TryScrollTo(const float& where);
45 private:
46 bool _Scroll(const BPoint& cursor);
47 void _ScrollBy(const float& step);
49 BMenu* fMenu;
50 BMenuFrame* fMenuFrame;
51 BMenuScroller* fUpperScroller;
52 BMenuScroller* fLowerScroller;
54 float fScrollStep;
55 float fValue;
56 float fLimit;
59 } // namespace BPrivate
61 #endif // MENU_WINDOW_H