New notification panel.
[situare] / src / situareservice / database.h
1 #ifndef DATABASE_H
2 #define DATABASE_H
3
4 #include <QObject>
5
6 #include <QSqlDatabase>
7 #include <QSqlError>
8 #include <QFile>
9 #include <QStringList>
10
11 #include "coordinates/geocoordinate.h"
12 #include "notification.h"
13
14 class Database : public QObject
15 {
16     Q_OBJECT
17 public:
18     Database(QObject *parent = 0);
19     ~Database();
20
21     bool addTag(qulonglong userId, const QString &tag);
22     QList<Notification*> &getNotifications(qulonglong userId);
23     QStringList getTags(qulonglong userId);
24     QByteArray getInterestingPeople(qulonglong userId,
25                                      const GeoCoordinate &southWestCoordinates,
26                                      const GeoCoordinate &northEastCoordinates);
27
28     bool createNotificationTable();
29     bool createTagTable();
30     bool createUserTagTable();
31     bool createUserTable();
32     bool openDatabase();
33     bool sendMessage(qulonglong senderId, qulonglong receiverId, const QString &message);
34
35 private:
36     QSqlDatabase m_database;
37     QList<Notification*> m_notifications;
38 };
39
40 #endif // DATABASE_H