[55401] | 1 | /* $Id: UIEmptyFilePathSelector.h 104358 2024-04-18 05:33:40Z vboxsync $ */
|
---|
[25178] | 2 | /** @file
|
---|
[71901] | 3 | * VBox Qt GUI - UIEmptyFilePathSelector class declaration.
|
---|
[25178] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
[25178] | 8 | *
|
---|
[96407] | 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
|
---|
[25178] | 26 | */
|
---|
| 27 |
|
---|
[76581] | 28 | #ifndef FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h
|
---|
| 29 | #define FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h
|
---|
[76532] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[25178] | 33 |
|
---|
| 34 | /* Qt includes */
|
---|
| 35 | #include <QComboBox>
|
---|
| 36 |
|
---|
| 37 | /* VBox forward declarations */
|
---|
| 38 | class QILabel;
|
---|
| 39 | class QILineEdit;
|
---|
| 40 |
|
---|
| 41 | /* Qt forward declarations */
|
---|
| 42 | class QHBoxLayout;
|
---|
| 43 | class QAction;
|
---|
[73231] | 44 | class QToolButton;
|
---|
[25178] | 45 |
|
---|
| 46 |
|
---|
[104358] | 47 | class UIEmptyFilePathSelector: public QWidget
|
---|
[25178] | 48 | {
|
---|
| 49 | Q_OBJECT;
|
---|
| 50 |
|
---|
| 51 | public:
|
---|
| 52 |
|
---|
| 53 | enum Mode
|
---|
| 54 | {
|
---|
| 55 | Mode_Folder = 0,
|
---|
| 56 | Mode_File_Open,
|
---|
| 57 | Mode_File_Save
|
---|
| 58 | };
|
---|
| 59 |
|
---|
| 60 | enum ButtonPosition
|
---|
| 61 | {
|
---|
| 62 | LeftPosition,
|
---|
| 63 | RightPosition
|
---|
| 64 | };
|
---|
| 65 |
|
---|
[60770] | 66 | UIEmptyFilePathSelector (QWidget *aParent = NULL);
|
---|
[25178] | 67 |
|
---|
[60770] | 68 | void setMode (UIEmptyFilePathSelector::Mode aMode);
|
---|
| 69 | UIEmptyFilePathSelector::Mode mode() const;
|
---|
[25178] | 70 |
|
---|
| 71 | void setButtonPosition (ButtonPosition aPos);
|
---|
| 72 | ButtonPosition buttonPosition() const;
|
---|
| 73 |
|
---|
| 74 | void setEditable (bool aOn);
|
---|
| 75 | bool isEditable() const;
|
---|
| 76 |
|
---|
| 77 | void setChooserVisible (bool aOn);
|
---|
| 78 | bool isChooserVisible() const;
|
---|
| 79 |
|
---|
| 80 | QString path() const;
|
---|
| 81 |
|
---|
| 82 | void setDefaultSaveExt (const QString &aExt);
|
---|
| 83 | QString defaultSaveExt() const;
|
---|
| 84 |
|
---|
| 85 | bool isModified () const { return mIsModified; }
|
---|
| 86 | void resetModified () { mIsModified = false; }
|
---|
| 87 |
|
---|
[45085] | 88 | void setChooseButtonToolTip(const QString &strToolTip);
|
---|
| 89 | QString chooseButtonToolTip() const;
|
---|
[41021] | 90 |
|
---|
[25178] | 91 | void setFileDialogTitle (const QString& aTitle);
|
---|
| 92 | QString fileDialogTitle() const;
|
---|
| 93 |
|
---|
| 94 | void setFileFilters (const QString& aFilters);
|
---|
| 95 | QString fileFilters() const;
|
---|
| 96 |
|
---|
| 97 | void setHomeDir (const QString& aDir);
|
---|
| 98 | QString homeDir() const;
|
---|
| 99 |
|
---|
| 100 | signals:
|
---|
| 101 | void pathChanged (QString);
|
---|
| 102 |
|
---|
| 103 | public slots:
|
---|
| 104 | void setPath (const QString& aPath);
|
---|
| 105 |
|
---|
[104358] | 106 | private slots:
|
---|
[25178] | 107 |
|
---|
[104358] | 108 | void sltRetranslateUI();
|
---|
[25178] | 109 | void choose();
|
---|
| 110 | void textChanged (const QString& aPath);
|
---|
| 111 |
|
---|
| 112 | private:
|
---|
| 113 | /* Private member vars */
|
---|
| 114 | QHBoxLayout *mMainLayout;
|
---|
| 115 | QWidget *mPathWgt;
|
---|
| 116 | QILabel *mLabel;
|
---|
[60770] | 117 | UIEmptyFilePathSelector::Mode mMode;
|
---|
[25178] | 118 | QILineEdit *mLineEdit;
|
---|
[73231] | 119 | QToolButton *mSelectButton;
|
---|
[45085] | 120 | bool m_fButtonToolTipSet;
|
---|
[25178] | 121 | QString mFileDialogTitle;
|
---|
| 122 | QString mFileFilters;
|
---|
| 123 | QString mDefaultSaveExt;
|
---|
| 124 | QString mHomeDir;
|
---|
| 125 | bool mIsModified;
|
---|
| 126 | QString mPath;
|
---|
| 127 | };
|
---|
| 128 |
|
---|
[76581] | 129 | #endif /* !FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h */
|
---|