1 | /* $Id: UILineTextEdit.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UILineTextEdit class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef __UILineTextEdit_h__
|
---|
19 | #define __UILineTextEdit_h__
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* VBox includes */
|
---|
25 | #include "QIDialog.h"
|
---|
26 | #include "QIWithRetranslateUI.h"
|
---|
27 |
|
---|
28 | /* Qt includes */
|
---|
29 | #include <QPushButton>
|
---|
30 |
|
---|
31 | /* Qt forward declarations */
|
---|
32 | class QTextEdit;
|
---|
33 | class QDialogButtonBox;
|
---|
34 |
|
---|
35 | ////////////////////////////////////////////////////////////////////////////////
|
---|
36 | // UITextEditor
|
---|
37 |
|
---|
38 | class UITextEditor: public QIWithRetranslateUI<QIDialog>
|
---|
39 | {
|
---|
40 | Q_OBJECT;
|
---|
41 |
|
---|
42 | public:
|
---|
43 | UITextEditor(QWidget *pParent = NULL);
|
---|
44 |
|
---|
45 | void setText(const QString& strText);
|
---|
46 | QString text() const;
|
---|
47 |
|
---|
48 | protected:
|
---|
49 | void retranslateUi();
|
---|
50 |
|
---|
51 | private slots:
|
---|
52 | void open();
|
---|
53 |
|
---|
54 | private:
|
---|
55 | /* Private member vars */
|
---|
56 | QTextEdit *m_pTextEdit;
|
---|
57 | QDialogButtonBox *m_pButtonBox;
|
---|
58 | QPushButton *m_pOpenButton;
|
---|
59 | };
|
---|
60 |
|
---|
61 | ////////////////////////////////////////////////////////////////////////////////
|
---|
62 | // UILineTextEdit
|
---|
63 |
|
---|
64 | class UILineTextEdit: public QIWithRetranslateUI<QPushButton>
|
---|
65 | {
|
---|
66 | Q_OBJECT;
|
---|
67 |
|
---|
68 | signals:
|
---|
69 |
|
---|
70 | /* Notifier: Editing stuff: */
|
---|
71 | void sigFinished(QWidget *pThis);
|
---|
72 |
|
---|
73 | public:
|
---|
74 | UILineTextEdit(QWidget *pParent = NULL);
|
---|
75 |
|
---|
76 | void setText(const QString& strText) { m_strText = strText; }
|
---|
77 | QString text() const { return m_strText; }
|
---|
78 |
|
---|
79 | protected:
|
---|
80 | void retranslateUi();
|
---|
81 |
|
---|
82 | private slots:
|
---|
83 | void edit();
|
---|
84 |
|
---|
85 | private:
|
---|
86 | /* Private member vars */
|
---|
87 | QString m_strText;
|
---|
88 | };
|
---|
89 |
|
---|
90 | #endif /* __UILineTextEdit_h__ */
|
---|
91 |
|
---|