KActivitiesStats 5.109.0
terms.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_TERMS_H
8#define KACTIVITIES_STATS_TERMS_H
9
10#include <initializer_list>
11
12#include <QDate>
13#include <QString>
14#include <QStringList>
15
16#include "kactivitiesstats_export.h"
17
18namespace KActivities
19{
20namespace Stats
21{
26namespace Terms
27{
32enum KACTIVITIESSTATS_EXPORT Order {
38};
39
43enum KACTIVITIESSTATS_EXPORT Select {
47};
48
54struct KACTIVITIESSTATS_EXPORT Limit {
55 Limit(int value);
56 static Limit all();
57 int value;
58};
59
66struct KACTIVITIESSTATS_EXPORT Offset {
67 Offset(int value);
68 int value;
69};
70
76struct KACTIVITIESSTATS_EXPORT Type {
80 static Type any();
84 static Type files();
88 static Type directories();
89
90 inline Type(std::initializer_list<QString> types)
91 : values(types)
92 {
93 }
94
95 Type(QStringList types);
96 Type(QString type);
97
98 const QStringList values;
99};
100
107struct KACTIVITIESSTATS_EXPORT Agent {
111 static Agent any();
112
116 static Agent global();
117
121 static Agent current();
122
123 inline Agent(std::initializer_list<QString> agents)
124 : values(agents)
125 {
126 }
127
128 Agent(QStringList agents);
129 Agent(QString agent);
130
131 const QStringList values;
132};
133
140struct KACTIVITIESSTATS_EXPORT Activity {
144 static Activity any();
145
149 static Activity global();
150
155
156 inline Activity(std::initializer_list<QString> activities)
157 : values(activities)
158 {
159 }
160
161 Activity(QStringList activities);
162 Activity(QString activity);
163
164 const QStringList values;
165};
166
172struct KACTIVITIESSTATS_EXPORT Url {
176 static Url startsWith(const QString &prefix);
177
181 static Url contains(const QString &infix);
182
186 static Url localFile();
187
191 static Url file();
192
193 inline Url(std::initializer_list<QString> urlPatterns)
194 : values(urlPatterns)
195 {
196 }
197
198 Url(QStringList urlPatterns);
199 Url(QString urlPattern);
200
201 const QStringList values;
202};
203
209struct KACTIVITIESSTATS_EXPORT Date {
210 Date(QDate value);
211 Date(QDate start, QDate end);
212
213 static Date today();
214 static Date yesterday();
215 static Date currentWeek();
216 static Date previousWeek();
217 static Date fromString(QString);
218
219 QDate start, end;
220};
221
222} // namespace Terms
223
224} // namespace Stats
225} // namespace KActivities
226
227KACTIVITIESSTATS_EXPORT
228QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Order &order);
229
230KACTIVITIESSTATS_EXPORT
231QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Select &select);
232
233KACTIVITIESSTATS_EXPORT
234QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Type &type);
235
236KACTIVITIESSTATS_EXPORT
237QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Agent &agent);
238
239KACTIVITIESSTATS_EXPORT
240QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Activity &activity);
241
242KACTIVITIESSTATS_EXPORT
243QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Url &url);
244
245KACTIVITIESSTATS_EXPORT
246QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Limit &limit);
247
248KACTIVITIESSTATS_EXPORT
249QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Offset &offset);
250
251KACTIVITIESSTATS_EXPORT
252QDebug operator<<(QDebug dbg, const KActivities::Stats::Terms::Date &date);
253
254#endif // KACTIVITIES_STATS_TERMS_H
Order
Enumerator specifying the ordering in which the results of the query should be listed.
Definition terms.h:32
@ OrderByUrl
Order by uri, alphabetically.
Definition terms.h:36
@ RecentlyCreatedFirst
Recently created resources first.
Definition terms.h:35
@ OrderByTitle
Order by uri, alphabetically.
Definition terms.h:37
@ HighScoredFirst
Resources with the highest scores first.
Definition terms.h:33
@ RecentlyUsedFirst
Recently used resources first.
Definition terms.h:34
Select
Which resources should be returned.
Definition terms.h:43
@ LinkedResources
Resources linked to an activity, or globally.
Definition terms.h:44
@ AllResources
Combined set of accessed and linked resources.
Definition terms.h:46
@ UsedResources
Resources that have been accessed.
Definition terms.h:45
Term to filter the resources according the activity in which they were accessed.
Definition terms.h:140
static Activity global()
Show resources linked to all activities.
static Activity current()
Show resources linked to all activities.
static Activity any()
Show resources accessed in / linked to any activity.
Term to filter the resources according the agent (application) which accessed it.
Definition terms.h:107
static Agent current()
Show resources accessed/linked by the current application.
static Agent global()
Show resources not tied to a specific agent.
static Agent any()
Show resources accessed/linked by any application.
On which start access date do you want to filter ?
Definition terms.h:209
How many items do you need?
Definition terms.h:54
How many items to skip? This can be specified only if limit is also set to a finite value.
Definition terms.h:66
Term to filter the resources according to their types.
Definition terms.h:76
static Type files()
Show non-directory resources.
static Type directories()
Show directory resources aka folders.
static Type any()
Show resources of any type.
Url filtering.
Definition terms.h:172
static Url file()
Show local files, smb, fish, ftp and sftp.
static Url startsWith(const QString &prefix)
Show only resources that start with the specified prefix.
static Url localFile()
Show local files.
static Url contains(const QString &infix)
Show resources that contain the specified infix.