aboutsummaryrefslogtreecommitdiff
path: root/message.h
blob: f8ab1e902484597eaac0e07c34c7a0da009d7f7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once

#include <QObject>

#include <deltachat.h>

class DcMessage : public QObject {
    Q_OBJECT
    Q_PROPERTY(uint32_t id READ getId CONSTANT)
    Q_PROPERTY(uint32_t fromId READ getFromId CONSTANT)
    Q_PROPERTY(uint32_t chatId READ getChatId CONSTANT)
    Q_PROPERTY(int viewtype READ getViewtype CONSTANT)
    Q_PROPERTY(int state READ getState CONSTANT)
    Q_PROPERTY(QString text READ getText CONSTANT)
    Q_PROPERTY(QString file READ getFile CONSTANT)
    Q_PROPERTY(QString filename READ getFilename CONSTANT)
    Q_PROPERTY(int width READ getWidth CONSTANT)
    Q_PROPERTY(int height READ getHeight CONSTANT)
    Q_PROPERTY(bool isInfo READ isInfo CONSTANT)
    Q_PROPERTY(QString quotedText READ getQuotedText CONSTANT)

    dc_msg_t *m_message{nullptr};
public:
    explicit DcMessage(QObject *parent = nullptr);
    explicit DcMessage(dc_msg_t *msg);
    ~DcMessage();

    Q_INVOKABLE uint32_t getId();
    Q_INVOKABLE uint32_t getFromId();
    Q_INVOKABLE uint32_t getChatId();
    Q_INVOKABLE int getViewtype();
    Q_INVOKABLE int getState();
    //Q_INVOKABLE int64_t getTimestamp();
    //Q_INVOKABLE int64_t getReceivedTimestamp();
    //Q_INVOKABLE int64_t getSortTimestamp();
    Q_INVOKABLE QString getText();
    QString getFile();
    QString getFilename();
    //QString getFilemime();
    //uint64_t getFilebytes();
    int getWidth();
    int getHeight();
    //int getDuration();
    //bool showPadlock();
    //uint32_t getEphemeralTimer();
    //int64_t getEphemeralTimestamp();
    //... getsummary ...
    Q_INVOKABLE QString getOverrideSenderName();
    //hasDeviatingTimestamp
    //hasLocation
    //isSent
    //isStarred
    //isForwarded
    bool isInfo();
    //isIncreation
    //isSetupmessage
    Q_INVOKABLE QString getQuotedText();
};