KActivitiesStats 5.109.0
resultwatcher.h
1/*
2 SPDX-FileCopyrightText: 2015, 2016 Ivan Cukic <ivan.cukic(at)kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef KACTIVITIES_STATS_RESULTWATCHER
8#define KACTIVITIES_STATS_RESULTWATCHER
9
10#include <QObject>
11
12#include "query.h"
13#include "resultset.h"
14
15namespace KActivities
16{
17namespace Stats
18{
19class ResultWatcherPrivate;
20
27class KACTIVITIESSTATS_EXPORT ResultWatcher : public QObject
28{
29 Q_OBJECT
30
31public:
32 explicit ResultWatcher(Query query, QObject *parent = nullptr);
33 ~ResultWatcher() override;
34
35Q_SIGNALS:
42 void resultScoreUpdated(const QString &resource, double score, uint lastUpdate, uint firstUpdate);
43
50 void resultRemoved(const QString &resource);
51
55 void resultLinked(const QString &resource);
56
60 void resultUnlinked(const QString &resource);
61
71 void resourceTitleChanged(const QString &resource, const QString &title);
72
82 void resourceMimetypeChanged(const QString &resource, const QString &mimetype);
83
90
91public:
92 void linkToActivity(const QUrl &resource,
93 const Terms::Activity &activity = Terms::Activity(QStringList()),
94 const Terms::Agent &agent = Terms::Agent(QStringList()));
95
96 void unlinkFromActivity(const QUrl &resource,
97 const Terms::Activity &activity = Terms::Activity(QStringList()),
98 const Terms::Agent &agent = Terms::Agent(QStringList()));
99
100private:
101 ResultWatcherPrivate *const d;
102};
103
104} // namespace Stats
105} // namespace KActivities
106
107#endif // KACTIVITIES_STATS_RESULTWATCHER
The activities system tracks resources (documents, contacts, etc.) that the user has used.
Definition query.h:54
A very thin class that sends signals when new resources matching a predefined query are available.
Definition resultwatcher.h:28
void resourceMimetypeChanged(const QString &resource, const QString &mimetype)
Emitted when the mimetype of a resource has been changed.
void resultsInvalidated()
Emitted when the client should forget about all the results it knew about and reload them.
void resultLinked(const QString &resource)
Emitted when a result has been linked to the activity.
void resultUnlinked(const QString &resource)
Emitted when a result has been linked to the activity.
void resultScoreUpdated(const QString &resource, double score, uint lastUpdate, uint firstUpdate)
Emitted when a result has been added or updated.
void resourceTitleChanged(const QString &resource, const QString &title)
Emitted when the title of a resource has been changed.
void resultRemoved(const QString &resource)
Emitted when a result has been added or updated.
Term to filter the resources according the activity in which they were accessed.
Definition terms.h:140
Term to filter the resources according the agent (application) which accessed it.
Definition terms.h:107