| 1 | /* |
| 2 | klinkdialog |
| 3 | SPDX-FileCopyrightText: 2008 Stephen Kelly <steveire@gmail.com> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KLINKDIALOG_H |
| 9 | #define KLINKDIALOG_H |
| 10 | |
| 11 | #include <QDialog> |
| 12 | |
| 13 | class KLinkDialogPrivate; |
| 14 | class QString; |
| 15 | |
| 16 | /*! |
| 17 | \brief Dialog to allow user to configure a hyperlink. |
| 18 | \since 4.1 |
| 19 | \internal |
| 20 | |
| 21 | This class provides a dialog to ask the user for a link target url and |
| 22 | text. |
| 23 | |
| 24 | The size of the dialog is automatically saved to and restored from the |
| 25 | global KDE config file. |
| 26 | */ |
| 27 | class KLinkDialog : public QDialog |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | public: |
| 31 | /*! |
| 32 | * Create a link dialog. |
| 33 | * |
| 34 | * \a parent Parent widget. |
| 35 | */ |
| 36 | explicit KLinkDialog(QWidget *parent = nullptr); |
| 37 | |
| 38 | /*! |
| 39 | * Destructor |
| 40 | */ |
| 41 | ~KLinkDialog() override; |
| 42 | |
| 43 | /*! |
| 44 | * Returns the link text shown in the dialog |
| 45 | * |
| 46 | * \a linkText The initial text |
| 47 | */ |
| 48 | void setLinkText(const QString &linkText); |
| 49 | |
| 50 | /*! |
| 51 | * Sets the target link url shown in the dialog |
| 52 | * |
| 53 | * \a linkUrl The initial link target url |
| 54 | */ |
| 55 | void setLinkUrl(const QString &linkUrl); |
| 56 | |
| 57 | /*! |
| 58 | * Returns the link text entered by the user. |
| 59 | * Returns The link text |
| 60 | */ |
| 61 | QString linkText() const; |
| 62 | |
| 63 | /*! |
| 64 | * Returns the target link url entered by the user. |
| 65 | * Returns The link url |
| 66 | */ |
| 67 | QString linkUrl() const; |
| 68 | |
| 69 | private Q_SLOTS: |
| 70 | void slotTextChanged(const QString &); |
| 71 | |
| 72 | private: |
| 73 | KLinkDialogPrivate *const d; |
| 74 | }; |
| 75 | |
| 76 | #endif |
| 77 | |