1 | /* $Id: UILineTextEdit.h 103977 2024-03-21 02:04:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UILineTextEdit 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_UILineTextEdit_h
|
---|
29 | #define FEQT_INCLUDED_SRC_widgets_UILineTextEdit_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* VBox includes */
|
---|
35 | #include "QIDialog.h"
|
---|
36 | #include "QIWithRetranslateUI.h"
|
---|
37 |
|
---|
38 | /* Qt includes */
|
---|
39 | #include <QPushButton>
|
---|
40 |
|
---|
41 | /* Qt forward declarations */
|
---|
42 | class QTextEdit;
|
---|
43 | class QDialogButtonBox;
|
---|
44 |
|
---|
45 | ////////////////////////////////////////////////////////////////////////////////
|
---|
46 | // UITextEditor
|
---|
47 |
|
---|
48 | class UITextEditor: public QIWithRetranslateUI<QIDialog>
|
---|
49 | {
|
---|
50 | Q_OBJECT;
|
---|
51 |
|
---|
52 | public:
|
---|
53 | UITextEditor(QWidget *pParent = NULL);
|
---|
54 |
|
---|
55 | void setText(const QString& strText);
|
---|
56 | QString text() const;
|
---|
57 |
|
---|
58 | protected:
|
---|
59 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 | void open() RT_OVERRIDE;
|
---|
63 |
|
---|
64 | private:
|
---|
65 | /* Private member vars */
|
---|
66 | QTextEdit *m_pTextEdit;
|
---|
67 | QDialogButtonBox *m_pButtonBox;
|
---|
68 | QPushButton *m_pOpenButton;
|
---|
69 | };
|
---|
70 |
|
---|
71 | ////////////////////////////////////////////////////////////////////////////////
|
---|
72 | // UILineTextEdit
|
---|
73 |
|
---|
74 | class UILineTextEdit: public QIWithRetranslateUI<QPushButton>
|
---|
75 | {
|
---|
76 | Q_OBJECT;
|
---|
77 |
|
---|
78 | signals:
|
---|
79 |
|
---|
80 | /* Notifier: Editing stuff: */
|
---|
81 | void sigFinished(QWidget *pThis);
|
---|
82 |
|
---|
83 | public:
|
---|
84 | UILineTextEdit(QWidget *pParent = NULL);
|
---|
85 |
|
---|
86 | void setText(const QString& strText) { m_strText = strText; }
|
---|
87 | QString text() const { return m_strText; }
|
---|
88 |
|
---|
89 | protected:
|
---|
90 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
91 |
|
---|
92 | private slots:
|
---|
93 | void edit();
|
---|
94 |
|
---|
95 | private:
|
---|
96 | /* Private member vars */
|
---|
97 | QString m_strText;
|
---|
98 | };
|
---|
99 |
|
---|
100 | #endif /* !FEQT_INCLUDED_SRC_widgets_UILineTextEdit_h */
|
---|
101 |
|
---|