File indexing completed on 2024-06-09 05:18:16

0001 /*  -*- mode: C++ -*-
0002 
0003   SPDX-FileCopyrightText: 2003 Andreas Gungl <a.gungl@gmx.de>
0004   SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0005 
0006   SPDX-License-Identifier: GPL-2.0-only
0007 */
0008 #pragma once
0009 
0010 #include "mailcommon_export.h"
0011 
0012 #include <QDialog>
0013 
0014 namespace MailCommon
0015 {
0016 /**
0017  * @short A dialog to request information about message redirection from the user.
0018  *
0019  * The dialog is used to collect redirect addresses when
0020  * manually redirecting messages. Only Redirect-To is
0021  * supported so far.
0022  *
0023  * @author Andreas Gungl <a.gungl@gmx.de>
0024  */
0025 class MAILCOMMON_EXPORT RedirectDialog : public QDialog
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     /**
0031      * Describes the send mode.
0032      */
0033     enum SendMode { SendNow, SendLater };
0034 
0035     /**
0036      * Creates a new redirect dialog.
0037      *
0038      * @param mode The preferred send mode.
0039      * @param parent The parent widget.
0040      */
0041     explicit RedirectDialog(SendMode mode = SendNow, QWidget *parent = nullptr);
0042 
0043     /**
0044      * Destroys the redirect dialog.
0045      */
0046     ~RedirectDialog() override;
0047 
0048     /**
0049      * Returns the addresses for the redirection.
0050      */
0051     [[nodiscard]] QString to() const;
0052 
0053     /**
0054      * Returns the send mode.
0055      */
0056     [[nodiscard]] SendMode sendMode() const;
0057 
0058     [[nodiscard]] int transportId() const;
0059 
0060     [[nodiscard]] int identity() const;
0061 
0062     [[nodiscard]] QString cc() const;
0063     [[nodiscard]] QString bcc() const;
0064 
0065 protected:
0066     void accept() override;
0067 
0068 private:
0069     //@cond PRIVATE
0070     class RedirectDialogPrivate;
0071     std::unique_ptr<RedirectDialogPrivate> const d;
0072     //@endcond
0073 };
0074 }