aboutsummaryrefslogtreecommitdiff
path: root/accounts.h
diff options
context:
space:
mode:
Diffstat (limited to 'accounts.h')
-rw-r--r--accounts.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/accounts.h b/accounts.h
new file mode 100644
index 0000000..20ede38
--- /dev/null
+++ b/accounts.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <QAbstractListModel>
+#include <deltachat.h>
+
+#include "eventemitter.h"
+#include "context.h"
+
+class DcAccounts : public QObject {
+ Q_OBJECT
+
+public:
+ explicit DcAccounts(QObject *parent = nullptr);
+ ~DcAccounts();
+
+ Q_INVOKABLE uint32_t addAccount();
+ Q_INVOKABLE uint32_t importAccount(QString tarfile);
+ Q_INVOKABLE uint32_t migrateAccount(QString dbfile);
+ Q_INVOKABLE bool removeAccount(uint32_t accountId);
+ Q_INVOKABLE QVariantList getAll();
+ Q_INVOKABLE Context *getAccount(uint32_t accountId);
+ Q_INVOKABLE Context *getSelectedAccount();
+ Q_INVOKABLE bool selectAccount(uint32_t accountId);
+ Q_INVOKABLE void startIo();
+ Q_INVOKABLE void stopIo();
+ Q_INVOKABLE void maybeNetwork();
+ Q_INVOKABLE DcAccountsEventEmitter *getEventEmitter();
+
+private:
+ dc_accounts_t *m_accounts{nullptr};
+};