This repository has been archived by the owner on Oct 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tagging.h
73 lines (53 loc) · 2.45 KB
/
tagging.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef TAGGING_H
#define TAGGING_H
#include <QObject>
#include <QtGlobal>
#include <sys/user.h>
#include "tagdb.h"
class Tagging : public TAGDB
{
Q_OBJECT
public:
static Tagging *getInstance(const QString &app, const QString &version, const QString &uri, const QString &comment = QString());
static Tagging *getInstance();
Q_INVOKABLE QVariantList get(const QString &query);
Q_INVOKABLE bool tagExists(const QString &tag, const bool &strict = false);
/* INSERTIIONS */
Q_INVOKABLE bool tag(const QString &tag, const QString &color=QString(), const QString &comment=QString());
Q_INVOKABLE bool tagUrl(const QString &url, const QString &tag, const QString &color=QString(), const QString &comment=QString());
Q_INVOKABLE bool tagAbstract(const QString &tag, const QString &key, const QString &lot, const QString &color = QString(), const QString &comment=QString());
/* UPDATES */
Q_INVOKABLE bool updateUrlTags(const QString &url, const QStringList &tags);
/* QUERIES */
Q_INVOKABLE QVariantList getUrlsTags(const bool &strict = true);
Q_INVOKABLE QVariantList getAbstractsTags(const bool &strict = true);
Q_INVOKABLE QVariantList getAllTags(const bool &strict = true);
Q_INVOKABLE QVariantList getUrls(const QString &tag, const bool &strict = true);
Q_INVOKABLE QVariantList getUrlTags(const QString &url, const bool &strict = true);
Q_INVOKABLE QVariantList getAbstractTags(const QString &key, const QString &lot, const bool &strict = true);
/* DELETES */
Q_INVOKABLE bool removeUrlTags(const QString &url);
/*STATIC METHODS*/
static QString mac();
static QString device();
static QString id();
private:
Tagging(const QString &app, const QString &version, const QString &uri, const QString &comment = QString(), QObject *parent = nullptr);
~Tagging();
static Tagging* instance;
void setApp(const QString &app, const QString &uri, const QString &version, const QString &comment = QString());
QString application = QString();
QString version = QString();
QString comment = QString();
QString uri = QString();
bool app();
bool user();
protected:
bool abstract(const QString &key, const QString &lot, const QString &comment);
signals:
void urlTagged(const QString &url, const QString &tag);
void abstractTagged(const QString &key, const QString &lot, const QString &tag);
void tagged(const QString &tag);
public slots:
};
#endif // TAGGING_H