1 | /* $Id: QIArrowSplitter.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QIArrowSplitter class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_extensions_QIArrowSplitter_h
|
---|
29 | #define FEQT_INCLUDED_SRC_extensions_QIArrowSplitter_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QWidget>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "QIWithRetranslateUI.h"
|
---|
39 | #include "UILibraryDefs.h"
|
---|
40 |
|
---|
41 | /* Forward declarations: */
|
---|
42 | class QVBoxLayout;
|
---|
43 | class QIArrowButtonSwitch;
|
---|
44 | class QIArrowButtonPress;
|
---|
45 | class QIDetailsBrowser;
|
---|
46 |
|
---|
47 | /* Type definitions: */
|
---|
48 | typedef QPair<QString, QString> QStringPair;
|
---|
49 | typedef QList<QStringPair> QStringPairList;
|
---|
50 |
|
---|
51 | /** QWidget extension
|
---|
52 | * allowing to toggle visibility for any other child widget. */
|
---|
53 | class SHARED_LIBRARY_STUFF QIArrowSplitter : public QIWithRetranslateUI<QWidget>
|
---|
54 | {
|
---|
55 | Q_OBJECT;
|
---|
56 |
|
---|
57 | signals:
|
---|
58 |
|
---|
59 | /** Notifies listeners about size-hint change. */
|
---|
60 | void sigSizeHintChange();
|
---|
61 |
|
---|
62 | public:
|
---|
63 |
|
---|
64 | /** Constructs arrow splitter passing @a pParent to the base-class. */
|
---|
65 | QIArrowSplitter(QWidget *pParent = 0);
|
---|
66 |
|
---|
67 | /** Returns minimum size-hint. */
|
---|
68 | QSize minimumSizeHint() const;
|
---|
69 |
|
---|
70 | /** Defines the @a strName for the switch-button. */
|
---|
71 | void setName(const QString &strName);
|
---|
72 |
|
---|
73 | /** Returns splitter details. */
|
---|
74 | const QStringPairList& details() const { return m_details; }
|
---|
75 | /** Defines splitter @a details. */
|
---|
76 | void setDetails(const QStringPairList &details);
|
---|
77 |
|
---|
78 | public slots:
|
---|
79 |
|
---|
80 | /** Updates size-hints. */
|
---|
81 | void sltUpdateSizeHints();
|
---|
82 |
|
---|
83 | /** Updates navigation-buttons visibility. */
|
---|
84 | void sltUpdateNavigationButtonsVisibility();
|
---|
85 | /** Updates details-browser visibility. */
|
---|
86 | void sltUpdateDetailsBrowserVisibility();
|
---|
87 |
|
---|
88 | /** Navigates through details-list backward. */
|
---|
89 | void sltSwitchDetailsPageBack();
|
---|
90 | /** Navigates through details-list forward. */
|
---|
91 | void sltSwitchDetailsPageNext();
|
---|
92 |
|
---|
93 | protected:
|
---|
94 |
|
---|
95 | /** Handles translation event. */
|
---|
96 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
97 |
|
---|
98 | private:
|
---|
99 |
|
---|
100 | /** Prepares all. */
|
---|
101 | void prepare();
|
---|
102 |
|
---|
103 | /** Updates details. */
|
---|
104 | void updateDetails();
|
---|
105 |
|
---|
106 | /** Holds the main-layout instance. */
|
---|
107 | QVBoxLayout *m_pMainLayout;
|
---|
108 |
|
---|
109 | /** Holds the switch-button instance. */
|
---|
110 | QIArrowButtonSwitch *m_pSwitchButton;
|
---|
111 | /** Holds the back-button instance. */
|
---|
112 | QIArrowButtonPress *m_pBackButton;
|
---|
113 | /** Holds the next-button instance. */
|
---|
114 | QIArrowButtonPress *m_pNextButton;
|
---|
115 |
|
---|
116 | /** Holds the details-browser. */
|
---|
117 | QIDetailsBrowser *m_pDetailsBrowser;
|
---|
118 | /** Holds details-list. */
|
---|
119 | QStringPairList m_details;
|
---|
120 | /** Holds details-list index. */
|
---|
121 | int m_iDetailsIndex;
|
---|
122 | };
|
---|
123 |
|
---|
124 | #endif /* !FEQT_INCLUDED_SRC_extensions_QIArrowSplitter_h */
|
---|