aboutsummaryrefslogtreecommitdiff
path: root/context.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 /context.h
downloadkdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.tar.gz
kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.zip
Initial commit
Diffstat (limited to 'context.h')
-rw-r--r--context.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/context.h b/context.h
new file mode 100644
index 0000000..c9bb8a5
--- /dev/null
+++ b/context.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <QObject>
+#include <QVariant>
+
+#include <deltachat.h>
+
+#include "chatlist.h"
+#include "chat.h"
+#include "message.h"
+#include "contact.h"
+
+class Context : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString blobdir READ getBlobdir CONSTANT)
+
+public:
+ explicit Context(QObject *parent = nullptr);
+ explicit Context(dc_context_t *context);
+ ~Context();
+
+ Q_INVOKABLE void configure();
+ Q_INVOKABLE bool isConfigured() const;
+ Q_INVOKABLE QString getInfo();
+ Q_INVOKABLE DcChatlist *getChatlist();
+ Q_INVOKABLE DcChat *getChat(uint32_t chatId);
+ Q_INVOKABLE QVariantList getMsgIdList(uint32_t chatId);
+ Q_INVOKABLE DcMessage *getMessage(uint32_t msgId);
+ Q_INVOKABLE DcContact *getContact(uint32_t contactId);
+ Q_INVOKABLE uint32_t sendTextMessage(uint32_t chatId, QString textToSend);
+ QString getBlobdir();
+
+private:
+ dc_context_t *m_context{nullptr};
+};