1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VBoxMiniToolBar class declaration & implementation. This is the toolbar shown on fullscreen mode.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxMiniToolBar_h__
|
---|
24 | #define __VBoxMiniToolBar_h__
|
---|
25 |
|
---|
26 | /* VBox includes */
|
---|
27 | #include <VBoxToolBar.h>
|
---|
28 |
|
---|
29 | /* Qt includes */
|
---|
30 | #include <QBasicTimer>
|
---|
31 |
|
---|
32 | class QLabel;
|
---|
33 | class QMenu;
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * The VBoxMiniToolBar class is a toolbar shown inside full screen mode or seamless mode.
|
---|
37 | * It supports auto hiding and animated sliding up/down.
|
---|
38 | */
|
---|
39 | class VBoxMiniToolBar : public VBoxToolBar
|
---|
40 | {
|
---|
41 | Q_OBJECT;
|
---|
42 |
|
---|
43 | public:
|
---|
44 |
|
---|
45 | VBoxMiniToolBar (QList <QMenu*> aMenus);
|
---|
46 |
|
---|
47 | void updateDisplay (bool aShow, bool aSetHideFlag);
|
---|
48 | void setDisplayText (const QString &aText);
|
---|
49 |
|
---|
50 | signals:
|
---|
51 |
|
---|
52 | void exitAction();
|
---|
53 | void closeAction();
|
---|
54 |
|
---|
55 | protected:
|
---|
56 |
|
---|
57 | void resizeEvent (QResizeEvent *aEvent);
|
---|
58 | void mouseMoveEvent (QMouseEvent *aEvent);
|
---|
59 | void timerEvent (QTimerEvent *aEvent);
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 |
|
---|
63 | void togglePushpin (bool aOn);
|
---|
64 |
|
---|
65 | private:
|
---|
66 |
|
---|
67 | QAction *mAutoHideAct;
|
---|
68 | QLabel *mDisplayLabel;
|
---|
69 |
|
---|
70 | QBasicTimer mScrollTimer;
|
---|
71 | QBasicTimer mAutoScrollTimer;
|
---|
72 |
|
---|
73 | int mAutoHideCounter;
|
---|
74 | bool mAutoHide;
|
---|
75 | bool mSlideDown;
|
---|
76 | bool mHideAfterSlide;
|
---|
77 |
|
---|
78 | /* Wether to animate showing/hiding the toolbar */
|
---|
79 | bool mAnimated;
|
---|
80 |
|
---|
81 | /* Interval (in milli seconds) for scrolling the toolbar, default is 20 msec */
|
---|
82 | int mScrollDelay;
|
---|
83 |
|
---|
84 | /* The wait time while the cursor is not over the window after this amount of time (in msec),
|
---|
85 | * the toolbar will auto hide if autohide is on. The default is 100msec. */
|
---|
86 | int mAutoScrollDelay;
|
---|
87 |
|
---|
88 | /* Number of total steps before hiding. If it is 10 then wait 10 (steps) * 100ms (mAutoScrollDelay) = 1000ms delay.
|
---|
89 | * The default is 10. */
|
---|
90 | int mAutoHideTotalCounter;
|
---|
91 | };
|
---|
92 |
|
---|
93 | #endif // __VBoxMiniToolBar_h__
|
---|
94 |
|
---|