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//@cond PRIVATE
12
13#include <QDialog>
14
15class KLinkDialogPrivate;
16class QString;
17
18/**
19 @short Dialog to allow user to configure a hyperlink.
20 @author Stephen Kelly
21 @since 4.1
22 @internal
23
24 This class provides a dialog to ask the user for a link target url and
25 text.
26
27 The size of the dialog is automatically saved to and restored from the
28 global KDE config file.
29 */
30class KLinkDialog : public QDialog
31{
32 Q_OBJECT
33public:
34 /**
35 * Create a link dialog.
36 * @param parent Parent widget.
37 */
38 explicit KLinkDialog(QWidget *parent = nullptr);
39
40 /**
41 * Destructor
42 */
43 ~KLinkDialog() override;
44
45 /**
46 * Returns the link text shown in the dialog
47 * @param linkText The initial text
48 */
49 void setLinkText(const QString &linkText);
50
51 /**
52 * Sets the target link url shown in the dialog
53 * @param 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 * @return The link text
60 */
61 QString linkText() const;
62
63 /**
64 * Returns the target link url entered by the user.
65 * @return The link url
66 */
67 QString linkUrl() const;
68
69private Q_SLOTS:
70 void slotTextChanged(const QString &);
71
72private:
73 //@cond PRIVATE
74 KLinkDialogPrivate *const d;
75 //@endcond
76};
77
78//@endcond
79
80#endif
81

source code of ktextwidgets/src/dialogs/klinkdialog_p.h