1 | /* $Id: UIFileTableNavigationWidget.h 100324 2023-06-28 12:35:20Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIFileTableNavigationWidget class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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_widgets_UIFileTableNavigationWidget_h
|
---|
29 | #define FEQT_INCLUDED_SRC_widgets_UIFileTableNavigationWidget_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 |
|
---|
35 | /* Qt includes: */
|
---|
36 | #include <QWidget>
|
---|
37 |
|
---|
38 | /* Forward declarations: */
|
---|
39 | class QLineEdit;
|
---|
40 | class QStackedWidget;
|
---|
41 | class QToolButton;
|
---|
42 | class UIFileManagerBreadCrumbs;
|
---|
43 | class UIFileManagerHistoryComboBox;
|
---|
44 |
|
---|
45 | /** UIFileTableNavigationWidget contains a UIFileManagerBreadCrumbs, QComboBox for history and a QToolButton.
|
---|
46 | * basically it is a container for these mentioned widgets. */
|
---|
47 | class UIFileTableNavigationWidget : public QWidget
|
---|
48 | {
|
---|
49 | Q_OBJECT;
|
---|
50 |
|
---|
51 | signals:
|
---|
52 |
|
---|
53 | void sigPathChanged(const QString &strPath);
|
---|
54 | void sigHistoryListChanged();
|
---|
55 |
|
---|
56 | public:
|
---|
57 |
|
---|
58 | UIFileTableNavigationWidget(QWidget *pParent = 0);
|
---|
59 | void setPath(const QString &strLocation);
|
---|
60 | void reset();
|
---|
61 | void setPathSeparator(const QChar &separator);
|
---|
62 | bool canGoForward() const;
|
---|
63 | bool canGoBackward() const;
|
---|
64 | void goForwardInHistory();
|
---|
65 | void goBackwardInHistory();
|
---|
66 |
|
---|
67 | protected:
|
---|
68 |
|
---|
69 | bool eventFilter(QObject *pObject, QEvent *pEvent) override;
|
---|
70 |
|
---|
71 | private slots:
|
---|
72 |
|
---|
73 | void sltHandleSwitch();
|
---|
74 | /* Makes sure that we switch to breadcrumbs widget as soon as the combo box popup is hidden. */
|
---|
75 | void sltHandleHidePopup();
|
---|
76 | void sltHandlePathChange(const QString &strPath);
|
---|
77 | void sltAddressLineEdited();
|
---|
78 |
|
---|
79 | private:
|
---|
80 |
|
---|
81 | enum StackedWidgets
|
---|
82 | {
|
---|
83 | StackedWidgets_History = 0,
|
---|
84 | StackedWidgets_BreadCrumbs,
|
---|
85 | StackedWidgets_AddressLine
|
---|
86 | };
|
---|
87 |
|
---|
88 | void prepare();
|
---|
89 |
|
---|
90 | QStackedWidget *m_pContainer;
|
---|
91 | UIFileManagerBreadCrumbs *m_pBreadCrumbs;
|
---|
92 | UIFileManagerHistoryComboBox *m_pHistoryComboBox;
|
---|
93 | QLineEdit *m_pAddressLineEdit;
|
---|
94 | QToolButton *m_pSwitchButton;
|
---|
95 | QChar m_pathSeparator;
|
---|
96 | /* With non-native separators. */
|
---|
97 | QString m_strCurrentPath;
|
---|
98 | };
|
---|
99 |
|
---|
100 |
|
---|
101 | #endif /* !FEQT_INCLUDED_SRC_widgets_UIFileTableNavigationWidget_h */
|
---|