File indexing completed on 2024-11-17 04:40:41

0001 /*
0002     SPDX-FileCopyrightText: 2001 Marc Mutz <mutz@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadi-contact-widgets_export.h"
0010 
0011 #include <QWidget>
0012 
0013 #include <memory>
0014 
0015 class KLineEdit;
0016 
0017 namespace Akonadi
0018 {
0019 class EmailAddressRequesterPrivate;
0020 
0021 /**
0022  * @short A widget to input one or more email addresses.
0023  *
0024  * @author Marc Mutz <mutz@kde.org>
0025  */
0026 class AKONADI_CONTACT_WIDGETS_EXPORT EmailAddressRequester : public QWidget
0027 {
0028     Q_OBJECT
0029 
0030     Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true)
0031 
0032 public:
0033     /**
0034      * Creates a new email address requester.
0035      *
0036      * @param parent The parent widget.
0037      */
0038     explicit EmailAddressRequester(QWidget *parent = nullptr);
0039 
0040     /**
0041      * Destroys the email address requester.
0042      */
0043     ~EmailAddressRequester() override;
0044 
0045     /**
0046      * Clears the text of the email address requester.
0047      */
0048     void clear();
0049 
0050     /**
0051      * Sets the @p text of the email address requester.
0052      */
0053     void setText(const QString &text);
0054 
0055     /**
0056      * Returns the text of the email address requester.
0057      */
0058     [[nodiscard]] QString text() const;
0059 
0060     /**
0061      * Returns the line edit that is used by the email address requester.
0062      */
0063     KLineEdit *lineEdit() const;
0064 
0065 Q_SIGNALS:
0066     /**
0067      * This signal is emitted whenever the text of the email address requester
0068      * has been changed.
0069      */
0070     void textChanged();
0071 
0072 private:
0073     //@cond PRIVATE
0074     std::unique_ptr<EmailAddressRequesterPrivate> const d;
0075     //@endcond
0076 };
0077 }