1 | /* $Id: QIArrowSplitter.h 104358 2024-04-18 05:33:40Z 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 "UILibraryDefs.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QVBoxLayout;
|
---|
42 | class QIArrowButtonSwitch;
|
---|
43 | class QIArrowButtonPress;
|
---|
44 | class QIDetailsBrowser;
|
---|
45 |
|
---|
46 | /* Type definitions: */
|
---|
47 | typedef QPair<QString, QString> QStringPair;
|
---|
48 | typedef QList<QStringPair> QStringPairList;
|
---|
49 |
|
---|
50 | /** QWidget extension
|
---|
51 | * allowing to toggle visibility for any other child widget. */
|
---|
52 | class SHARED_LIBRARY_STUFF QIArrowSplitter : public QWidget
|
---|
53 | {
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | signals:
|
---|
57 |
|
---|
58 | /** Notifies listeners about size-hint change. */
|
---|
59 | void sigSizeHintChange();
|
---|
60 |
|
---|
61 | public:
|
---|
62 |
|
---|
63 | /** Constructs arrow splitter passing @a pParent to the base-class. */
|
---|
64 | QIArrowSplitter(QWidget *pParent = 0);
|
---|
65 |
|
---|
66 | /** Returns minimum size-hint. */
|
---|
67 | QSize minimumSizeHint() const RT_OVERRIDE;
|
---|
68 |
|
---|
69 | /** Defines the @a strName for the switch-button. */
|
---|
70 | void setName(const QString &strName);
|
---|
71 |
|
---|
72 | /** Returns splitter details. */
|
---|
73 | const QStringPairList& details() const { return m_details; }
|
---|
74 | /** Defines splitter @a details. */
|
---|
75 | void setDetails(const QStringPairList &details);
|
---|
76 |
|
---|
77 | public slots:
|
---|
78 |
|
---|
79 | /** Updates size-hints. */
|
---|
80 | void sltUpdateSizeHints();
|
---|
81 |
|
---|
82 | /** Updates navigation-buttons visibility. */
|
---|
83 | void sltUpdateNavigationButtonsVisibility();
|
---|
84 | /** Updates details-browser visibility. */
|
---|
85 | void sltUpdateDetailsBrowserVisibility();
|
---|
86 |
|
---|
87 | /** Navigates through details-list backward. */
|
---|
88 | void sltSwitchDetailsPageBack();
|
---|
89 | /** Navigates through details-list forward. */
|
---|
90 | void sltSwitchDetailsPageNext();
|
---|
91 |
|
---|
92 | private slots:
|
---|
93 |
|
---|
94 | /** Handles translation event. */
|
---|
95 | void sltRetranslateUI();
|
---|
96 |
|
---|
97 | private:
|
---|
98 |
|
---|
99 | /** Prepares all. */
|
---|
100 | void prepare();
|
---|
101 |
|
---|
102 | /** Updates details. */
|
---|
103 | void updateDetails();
|
---|
104 |
|
---|
105 | /** Holds the main-layout instance. */
|
---|
106 | QVBoxLayout *m_pMainLayout;
|
---|
107 |
|
---|
108 | /** Holds the switch-button instance. */
|
---|
109 | QIArrowButtonSwitch *m_pSwitchButton;
|
---|
110 | /** Holds the back-button instance. */
|
---|
111 | QIArrowButtonPress *m_pBackButton;
|
---|
112 | /** Holds the next-button instance. */
|
---|
113 | QIArrowButtonPress *m_pNextButton;
|
---|
114 |
|
---|
115 | /** Holds the details-browser. */
|
---|
116 | QIDetailsBrowser *m_pDetailsBrowser;
|
---|
117 | /** Holds details-list. */
|
---|
118 | QStringPairList m_details;
|
---|
119 | /** Holds details-list index. */
|
---|
120 | int m_iDetailsIndex;
|
---|
121 | };
|
---|
122 |
|
---|
123 | #endif /* !FEQT_INCLUDED_SRC_extensions_QIArrowSplitter_h */
|
---|