aboutsummaryrefslogtreecommitdiff
path: root/message.h
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2020-09-12 14:10:13 +0300
committerlink2xt <link2xt@testrun.org>2020-10-03 00:20:03 +0300
commitb8762ddb38dd975b0acb217b793594dfed83a824 (patch)
tree23ccefbba703fed6c07acce82ff72e32ba77c9ba /message.h
downloadkdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.tar.gz
kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.zip
Initial commit
Diffstat (limited to 'message.h')
-rw-r--r--message.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/message.h b/message.h
new file mode 100644
index 0000000..bda3108
--- /dev/null
+++ b/message.h
@@ -0,0 +1,55 @@
+#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)
+
+ 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 ...
+ //hasDeviatingTimestamp
+ //hasLocation
+ //isSent
+ //isStarred
+ //isForwarded
+ bool isInfo();
+ //isIncreation
+ //isSetupmessage
+};