aboutsummaryrefslogtreecommitdiff
path: root/dcevent.cpp
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 /dcevent.cpp
downloadkdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.tar.gz
kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.zip
Initial commit
Diffstat (limited to 'dcevent.cpp')
-rw-r--r--dcevent.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/dcevent.cpp b/dcevent.cpp
new file mode 100644
index 0000000..09ad023
--- /dev/null
+++ b/dcevent.cpp
@@ -0,0 +1,49 @@
+#include "dcevent.h"
+
+DcEvent::DcEvent(QObject *parent)
+ : QObject{parent}
+{
+}
+
+DcEvent::DcEvent(dc_event_t *event)
+ : m_event{event}
+{
+}
+
+DcEvent::~DcEvent()
+{
+ dc_event_unref(m_event);
+}
+
+int
+DcEvent::getId()
+{
+ return dc_event_get_id(m_event);
+}
+
+int
+DcEvent::getData1Int()
+{
+ return dc_event_get_data1_int(m_event);
+}
+
+int
+DcEvent::getData2Int()
+{
+ return dc_event_get_data2_int(m_event);
+}
+
+QString
+DcEvent::getData2Str()
+{
+ char *data2 = dc_event_get_data2_str(m_event);
+ QString result{data2};
+ dc_str_unref(data2);
+ return result;
+}
+
+uint32_t
+DcEvent::getAccountId()
+{
+ return dc_event_get_account_id(m_event);
+}