aboutsummaryrefslogtreecommitdiff
path: root/accounts.h
blob: 20ede38286c2a841cfbafd9a2c92b18475ce2fc8 (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
#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};
};