1 | /* $Id: UIDragAndDropEditor.h 104313 2024-04-12 13:10:30Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIDragAndDropEditor class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-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_settings_editors_UIDragAndDropEditor_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_editors_UIDragAndDropEditor_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIEditor.h"
|
---|
36 |
|
---|
37 | /* COM includes: */
|
---|
38 | #include "KDnDMode.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QComboBox;
|
---|
42 | class QGridLayout;
|
---|
43 | class QLabel;
|
---|
44 |
|
---|
45 | /** UIEditor sub-class used as a drag&drop editor. */
|
---|
46 | class SHARED_LIBRARY_STUFF UIDragAndDropEditor : public UIEditor
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs editor passing @a pParent to the base-class. */
|
---|
53 | UIDragAndDropEditor(QWidget *pParent = 0);
|
---|
54 |
|
---|
55 | /** Defines editor @a enmValue. */
|
---|
56 | void setValue(KDnDMode enmValue);
|
---|
57 | /** Returns editor value. */
|
---|
58 | KDnDMode value() const;
|
---|
59 |
|
---|
60 | /** Returns the vector of supported values. */
|
---|
61 | QVector<KDnDMode> supportedValues() const { return m_supportedValues; }
|
---|
62 |
|
---|
63 | /** Returns minimum layout hint. */
|
---|
64 | int minimumLabelHorizontalHint() const;
|
---|
65 | /** Defines minimum layout @a iIndent. */
|
---|
66 | void setMinimumLayoutIndent(int iIndent);
|
---|
67 |
|
---|
68 | private slots:
|
---|
69 |
|
---|
70 | /** Handles translation event. */
|
---|
71 | virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
|
---|
72 |
|
---|
73 | private:
|
---|
74 |
|
---|
75 | /** Prepares all. */
|
---|
76 | void prepare();
|
---|
77 | /** Populates combo. */
|
---|
78 | void populateCombo();
|
---|
79 |
|
---|
80 | /** Holds the value to be selected. */
|
---|
81 | KDnDMode m_enmValue;
|
---|
82 |
|
---|
83 | /** Holds the vector of supported values. */
|
---|
84 | QVector<KDnDMode> m_supportedValues;
|
---|
85 |
|
---|
86 | /** Holds the main layout instance. */
|
---|
87 | QGridLayout *m_pLayout;
|
---|
88 | /** Holds the label instance. */
|
---|
89 | QLabel *m_pLabel;
|
---|
90 | /** Holds the combo instance. */
|
---|
91 | QComboBox *m_pCombo;
|
---|
92 | };
|
---|
93 |
|
---|
94 | #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIDragAndDropEditor_h */
|
---|