VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxMiniToolBar.h@ 20368

Last change on this file since 20368 was 20200, checked in by vboxsync, 16 years ago

FE/Qt4: 3948: Mini-ToolBar for Full-screen & Seamless modes: re-parenting tool-bar to centralWidget(), fixing different bugs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
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) 2009 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
32class QLabel;
33class 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 */
39class VBoxMiniToolBar : public VBoxToolBar
40{
41 Q_OBJECT;
42
43public:
44
45 enum Alignment
46 {
47 AlignTop,
48 AlignBottom
49 };
50
51 VBoxMiniToolBar (QWidget *aParent, Alignment aAlignment);
52
53 void setIsSeamlessMode (bool aIsSeamless);
54
55 VBoxMiniToolBar& operator<< (QList <QMenu*> aMenus);
56
57 void updateDisplay (bool aShow, bool aSetHideFlag);
58 void setDisplayText (const QString &aText);
59
60signals:
61
62 void exitAction();
63 void closeAction();
64 void geometryUpdated();
65
66protected:
67
68 void mouseMoveEvent (QMouseEvent *aEvent);
69 void timerEvent (QTimerEvent *aEvent);
70 void showEvent (QShowEvent *aEvent);
71
72private slots:
73
74 void togglePushpin (bool aOn);
75
76private:
77
78 void recreateMask();
79 void moveToBase();
80 QPoint mapFromScreen (const QPoint &aPoint);
81
82 QAction *mAutoHideAct;
83 QLabel *mDisplayLabel;
84
85 QBasicTimer mScrollTimer;
86 QBasicTimer mAutoScrollTimer;
87
88 int mAutoHideCounter;
89 bool mAutoHide;
90 bool mSlideToScreen;
91 bool mHideAfterSlide;
92 bool mPolished;
93
94 int mPositionX;
95 int mPositionY;
96
97 bool mIsSeamless;
98
99 /* Lists of used spacers */
100 QList <QWidget*> mMargins;
101 QList <QWidget*> mSpacings;
102 QList <QWidget*> mLabelMargins;
103
104 /* Menu insert position */
105 QAction *mInsertPosition;
106
107 /* Tool-bar alignment */
108 Alignment mAlignment;
109
110 /* Wether to animate showing/hiding the toolbar */
111 bool mAnimated;
112
113 /* Interval (in milli seconds) for scrolling the toolbar, default is 20 msec */
114 int mScrollDelay;
115
116 /* The wait time while the cursor is not over the window after this amount of time (in msec),
117 * the toolbar will auto hide if autohide is on. The default is 100msec. */
118 int mAutoScrollDelay;
119
120 /* Number of total steps before hiding. If it is 10 then wait 10 (steps) * 100ms (mAutoScrollDelay) = 1000ms delay.
121 * The default is 10. */
122 int mAutoHideTotalCounter;
123};
124
125#endif // __VBoxMiniToolBar_h__
126
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette