7#ifndef KACTIVITIES_STATS_RESULTMODEL_H
8#define KACTIVITIES_STATS_RESULTMODEL_H
11#include <QAbstractListModel>
18class QDBusPendingCallWatcher;
26class ResultModelPrivate;
34class KACTIVITIESSTATS_EXPORT
ResultModel :
public QAbstractListModel
40 ResultModel(
Query query,
const QString &clientId, QObject *parent =
nullptr);
44 ResourceRole = Qt::UserRole,
45 TitleRole = Qt::UserRole + 1,
46 ScoreRole = Qt::UserRole + 2,
47 FirstUpdateRole = Qt::UserRole + 3,
48 LastUpdateRole = Qt::UserRole + 4,
49 LinkStatusRole = Qt::UserRole + 5,
50 LinkedActivitiesRole = Qt::UserRole + 6,
51 MimeType = Qt::UserRole + 7,
54 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
55 QVariant data(
const QModelIndex &item,
int role = Qt::DisplayRole)
const override;
56 QHash<int, QByteArray> roleNames()
const override;
58 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
60 void fetchMore(
const QModelIndex &parent)
override;
61 bool canFetchMore(
const QModelIndex &parent)
const override;
63 void linkToActivity(
const QUrl &resource,
67 void unlinkFromActivity(
const QUrl &resource,
116 friend class ResultModelPrivate;
117 ResultModelPrivate *
const d;
The activities system tracks resources (documents, contacts, etc.) that the user has used.
Definition query.h:54
Provides a model which displays the resources matching the specified Query.
Definition resultmodel.h:35
void sortItems(Qt::SortOrder sortOrder)
Sort the items by title.
void forgetResource(const QString &resource)
Removes the specified resource from the history.
void setResultPosition(const QString &resource, int position)
Moves the resource to the specified position.
void forgetResources(const QList< QString > &resources)
Removes specified list of resources from the history.
void forgetAllResources()
Clears the history of all resources that match the current model query.
void forgetResource(int row)
Removes the specified resource from the history.
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