JS8Call-Improved master
Loading...
Searching...
No Matches
Inbox.h
1#ifndef INBOX_H
2#define INBOX_H
3
7
8#include "Message.h"
9#include "vendor/sqlite3/sqlite3.h"
10
11#include <QObject>
12#include <QPair>
13#include <QString>
14#include <QVariant>
15
16class Inbox {
17 public:
18 explicit Inbox(QString path);
19 ~Inbox();
20
21 // Low-Level Interface
22 bool isOpen();
23 bool open();
24 void close();
25 QString error();
26 int count(QString type, QString query, QString match);
27 QList<QPair<int, Message>> values(QString type, QString query,
28 QString match, int offset, int limit);
29 Message value(int key);
30 int append(Message value);
31 bool set(int key, Message value);
32 bool del(int key);
33
34 // High-Level Interface
35 QList<QPair<int, Message>> fetchForCall(const QString& callPattern);
36 int countUnreadFrom(QString from);
37 int countUnreadForCallsign(const QString &callsign);
38 int countGroupUnreadForCallsign(const QString &group_name,
39 const QString &callsign);
40
41 QPair<int, Message> firstUnreadFrom(QString from);
42 int getLookaheadMessageIdForCallsign(const QString &callsign,
43 int afterMsgId);
44
45 QMap<QString, int> getGroupMessageCounts();
46 int getNextGroupMessageIdForCallsign(const QString &group_name,
47 const QString &callsign);
48 int getLookaheadGroupMessageIdForCallsign(const QString &group_name,
49 const QString &callsign,
50 int afterMsgId);
51 bool markGroupMsgDeliveredForCallsign(int msgId, QString callsign);
52
53 signals:
54
55 public slots:
56
57 private:
58 QString path_;
59 sqlite3 *db_;
60};
61
62#endif // INBOX_H
int countUnreadFrom(QString from)
Definition Inbox.cpp:356
bool isOpen()
Definition Inbox.cpp:53
Definition Message.h:16
Definition qpriorityqueue.h:39