VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFileTableNavigationWidget.h

Last change on this file was 100324, checked in by vboxsync, 11 months ago

FE/Qt: bugref:6699, bugref:9080. A bit better API for forward/backward action toggle.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
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: */
39class QLineEdit;
40class QStackedWidget;
41class QToolButton;
42class UIFileManagerBreadCrumbs;
43class UIFileManagerHistoryComboBox;
44
45/** UIFileTableNavigationWidget contains a UIFileManagerBreadCrumbs, QComboBox for history and a QToolButton.
46 * basically it is a container for these mentioned widgets. */
47class UIFileTableNavigationWidget : public QWidget
48{
49 Q_OBJECT;
50
51signals:
52
53 void sigPathChanged(const QString &strPath);
54 void sigHistoryListChanged();
55
56public:
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
67protected:
68
69 bool eventFilter(QObject *pObject, QEvent *pEvent) override;
70
71private 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
79private:
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 */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use