VirtualBox

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

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

FE/Qt4: 3948: Mini-ToolBar for Full-screen & Seamless modes - VM Settings / General Page / Advanced Tab - updated with show-hide Mini ToolBar option.

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

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