File indexing completed on 2024-09-29 03:39:27
0001 /* 0002 klinkdialog 0003 SPDX-FileCopyrightText: 2008 Stephen Kelly <steveire@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #ifndef KLINKDIALOG_H 0009 #define KLINKDIALOG_H 0010 0011 //@cond PRIVATE 0012 0013 #include <QDialog> 0014 0015 class KLinkDialogPrivate; 0016 class QString; 0017 0018 /** 0019 @short Dialog to allow user to configure a hyperlink. 0020 @author Stephen Kelly 0021 @since 4.1 0022 @internal 0023 0024 This class provides a dialog to ask the user for a link target url and 0025 text. 0026 0027 The size of the dialog is automatically saved to and restored from the 0028 global KDE config file. 0029 */ 0030 class KLinkDialog : public QDialog 0031 { 0032 Q_OBJECT 0033 public: 0034 /** 0035 * Create a link dialog. 0036 * @param parent Parent widget. 0037 */ 0038 explicit KLinkDialog(QWidget *parent = nullptr); 0039 0040 /** 0041 * Destructor 0042 */ 0043 ~KLinkDialog() override; 0044 0045 /** 0046 * Returns the link text shown in the dialog 0047 * @param linkText The initial text 0048 */ 0049 void setLinkText(const QString &linkText); 0050 0051 /** 0052 * Sets the target link url shown in the dialog 0053 * @param linkUrl The initial link target url 0054 */ 0055 void setLinkUrl(const QString &linkUrl); 0056 0057 /** 0058 * Returns the link text entered by the user. 0059 * @return The link text 0060 */ 0061 QString linkText() const; 0062 0063 /** 0064 * Returns the target link url entered by the user. 0065 * @return The link url 0066 */ 0067 QString linkUrl() const; 0068 0069 private Q_SLOTS: 0070 void slotTextChanged(const QString &); 0071 0072 private: 0073 //@cond PRIVATE 0074 KLinkDialogPrivate *const d; 0075 //@endcond 0076 }; 0077 0078 //@endcond 0079 0080 #endif