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