sendlaterdialog.h 1.15 KB
Newer Older
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org>
3

4
   SPDX-License-Identifier: GPL-2.0-or-later
5
6
*/

Laurent Montel's avatar
Laurent Montel committed
7
#pragma once
8
9

#include <QDateTime>
Laurent Montel's avatar
Laurent Montel committed
10
#include <QDialog>
11
12
13
14
15

#include "messagecomposer_export.h"

class QCheckBox;
class QPushButton;
Laurent Montel's avatar
Laurent Montel committed
16
17
namespace Ui
{
18
19
20
class SendLaterWidget;
}

Laurent Montel's avatar
Laurent Montel committed
21
22
namespace MessageComposer
{
23
24
25
26
27
28
29
class SendLaterInfo;

/** Send later dialog. */
class MESSAGECOMPOSER_EXPORT SendLaterDialog : public QDialog
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
30
    enum SendLaterAction { Unknown = 0, SendDeliveryAtTime = 1, Canceled = 2, PutInOutbox = 3 };
31
32

    explicit SendLaterDialog(SendLaterInfo *info, QWidget *parent = nullptr);
Laurent Montel's avatar
Laurent Montel committed
33
    ~SendLaterDialog() override;
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

    SendLaterInfo *info();

    Q_REQUIRED_RESULT SendLaterAction action() const;

private:
    void slotRecurrenceClicked(bool);
    void slotOkClicked();
    void slotDelay(bool delayEnabled);

    void slotDateChanged(const QString &date);
    void load(SendLaterInfo *info);

private:
    QDateTime mSendDateTime;
    SendLaterAction mAction = Unknown;
    QCheckBox *mDelay = nullptr;
Laurent Montel's avatar
Laurent Montel committed
51
    Ui::SendLaterWidget *const mSendLaterWidget;
52
53
54
55
    SendLaterInfo *mInfo = nullptr;
    QPushButton *mOkButton = nullptr;
};
}