7#ifndef KACTIVITIES_STATS_RESULTSET
8#define KACTIVITIES_STATS_RESULTSET
18class ResultSetPrivate;
19class ResultSet_ResultPrivate;
20class ResultSet_IteratorPrivate;
76 void setResource(QString resource);
77 void setTitle(QString title);
78 void setMimetype(QString mimetype);
79 void setScore(
double score);
80 void setLastUpdate(uint lastUpdate);
81 void setFirstUpdate(uint firstUpdate);
82 void setLinkStatus(LinkStatus linkedStatus);
83 void setLinkedActivities(QStringList activities);
86 ResultSet_ResultPrivate *d;
122 typedef std::random_access_iterator_tag iterator_category;
123 typedef int difference_type;
126 typedef const Result &reference;
127 typedef const Result *pointer;
130 const_iterator(
const const_iterator &source);
131 const_iterator &operator=(
const const_iterator &source);
135 bool isSourceValid()
const;
137 reference operator*()
const;
138 pointer operator->()
const;
141 const_iterator &operator++();
143 const_iterator operator++(
int);
146 const_iterator &operator--();
148 const_iterator operator--(
int);
150 const_iterator operator+(difference_type n)
const;
151 const_iterator &operator+=(difference_type n);
153 const_iterator operator-(difference_type n)
const;
154 const_iterator &operator-=(difference_type n);
156 reference operator[](difference_type n)
const;
158 KACTIVITIESSTATS_EXPORT
friend bool operator==(
const const_iterator &left,
const const_iterator &right);
159 KACTIVITIESSTATS_EXPORT
friend bool operator!=(
const const_iterator &left,
const const_iterator &right);
161 KACTIVITIESSTATS_EXPORT
friend bool operator<(
const const_iterator &left,
const const_iterator &right);
162 KACTIVITIESSTATS_EXPORT
friend bool operator>(
const const_iterator &left,
const const_iterator &right);
164 KACTIVITIESSTATS_EXPORT
friend bool operator<=(
const const_iterator &left,
const const_iterator &right);
165 KACTIVITIESSTATS_EXPORT
friend bool operator>=(
const const_iterator &left,
const const_iterator &right);
167 KACTIVITIESSTATS_EXPORT
friend difference_type operator-(
const const_iterator &left,
const const_iterator &right);
170 const_iterator(
const ResultSet *resultSet,
int currentRow);
174 ResultSet_IteratorPrivate *
const d;
188 const_iterator
end()
const;
200 inline const_iterator
cend()
const
221 friend class ResultSet_IteratorPrivate;
225bool KACTIVITIESSTATS_EXPORT operator==(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
226bool KACTIVITIESSTATS_EXPORT operator!=(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
228bool KACTIVITIESSTATS_EXPORT operator<(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
229bool KACTIVITIESSTATS_EXPORT operator>(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
231bool KACTIVITIESSTATS_EXPORT operator<=(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
232bool KACTIVITIESSTATS_EXPORT operator>=(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
234ResultSet::const_iterator::difference_type KACTIVITIESSTATS_EXPORT operator-(
const ResultSet::const_iterator &left,
const ResultSet::const_iterator &right);
236inline QDebug operator<<(QDebug out,
const ResultSet::Result &result)
238 return out << (result.linkStatus() == ResultSet::Result::Linked ?
"⊤"
239 : result.linkStatus() == ResultSet::Result::NotLinked ?
"⊥"
241 << result.score() << (result.title() != result.resource() ? result.title() : QString()) << result.lastUpdate()
242 << QStringView(result.resource()).right(20);
The activities system tracks resources (documents, contacts, etc.) that the user has used.
Definition query.h:54
Structure containing data of one of the results.
Definition resultset.h:50
uint lastUpdate() const
Timestamp of the last update.
double score() const
The score calculated based on the usage statistics.
QString mimetype() const
Mimetype of the resource, or URL if title is not known.
QUrl url() const
Url representation of a resource based on internal resource, readonly,.
QString title() const
Title of the resource, or URL if title is not known.
uint firstUpdate() const
Timestamp of the first update.
LinkStatus linkStatus() const
Differentiates between linked and non-linked resources in mixed queries.
QStringList linkedActivities() const
Contains the activities this resource is linked to for the queries that care about resource linking.
QString resource() const
String representation of resource (can represent an url or a path)
Class that can query the KActivities usage tracking mechanism for resources.
Definition resultset.h:44
const_iterator cend() const
Alias for end.
Definition resultset.h:200
Result value_type
ResultSet is a container.
Definition resultset.h:93
Result at(int index) const
const_iterator cbegin() const
Alias for begin.
Definition resultset.h:193
const_iterator end() const
const_iterator constBegin() const
Alias for begin.
Definition resultset.h:208
const_iterator begin() const
ResultSet(Query query)
Creates the ResultSet from the specified query.
const_iterator constEnd() const
Alias for end.
Definition resultset.h:215