1 | /* $Id: UIMenuToolBar.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMenuToolBar class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2017-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIMenuToolBar_h___
|
---|
19 | #define ___UIMenuToolBar_h___
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Qt includes: */
|
---|
25 | #include <QWidget>
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class UIMenuToolBarPrivate;
|
---|
29 |
|
---|
30 |
|
---|
31 | /** QWidget wrapper for UIToolBar extension
|
---|
32 | * holding single drop-down menu of actions. */
|
---|
33 | class UIMenuToolBar : public QWidget
|
---|
34 | {
|
---|
35 | Q_OBJECT;
|
---|
36 |
|
---|
37 | public:
|
---|
38 |
|
---|
39 | /** Menu toolbar alignment types. */
|
---|
40 | enum AlignmentType
|
---|
41 | {
|
---|
42 | AlignmentType_TopLeft,
|
---|
43 | AlignmentType_TopRight,
|
---|
44 | AlignmentType_BottomLeft,
|
---|
45 | AlignmentType_BottomRight,
|
---|
46 | };
|
---|
47 |
|
---|
48 | /** Constructs menu-toolbar wrapper. */
|
---|
49 | UIMenuToolBar(QWidget *pParent = 0);
|
---|
50 |
|
---|
51 | /** Defines toolbar alignment @a enmType. */
|
---|
52 | void setAlignmentType(AlignmentType enmType);
|
---|
53 |
|
---|
54 | /** Defines toolbar icon @a size. */
|
---|
55 | void setIconSize(const QSize &size);
|
---|
56 |
|
---|
57 | /** Defines toolbar menu action. */
|
---|
58 | void setMenuAction(QAction *pAction);
|
---|
59 |
|
---|
60 | /** Defines toolbar tool button @a enmStyle. */
|
---|
61 | void setToolButtonStyle(Qt::ToolButtonStyle enmStyle);
|
---|
62 |
|
---|
63 | /** Returns toolbar widget for passed @a pAction. */
|
---|
64 | QWidget *widgetForAction(QAction *pAction) const;
|
---|
65 |
|
---|
66 | private:
|
---|
67 |
|
---|
68 | /** Prepares all. */
|
---|
69 | void prepare();
|
---|
70 |
|
---|
71 | /** Holds the menu-toolbar instance. */
|
---|
72 | UIMenuToolBarPrivate *m_pToolbar;
|
---|
73 | };
|
---|
74 |
|
---|
75 | #endif /* !___UIMenuToolBar_h___ */
|
---|
76 |
|
---|