KUserFeedback

selectionratiosource.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KUSERFEEDBACK_SELECTIONRATIOSOURCE_H
8#define KUSERFEEDBACK_SELECTIONRATIOSOURCE_H
9
10#include "kuserfeedbackcore_export.h"
11#include "abstractdatasource.h"
12
13QT_BEGIN_NAMESPACE
15QT_END_NAMESPACE
16
17namespace KUserFeedback {
18
19class SelectionRatioSourcePrivate;
20
21/*! Records the time ratio a given entry is selected via a QItemSelectionModel.
22 *
23 * An example use-case would be the usage ratio of a applications
24 * views/modes selected using a model-based view sidebar (such as
25 * used in e.g. Kontact).
26 *
27 * The default telemetry mode for this source is Provider::DetailedUsageStatistics.
28 */
29class KUSERFEEDBACKCORE_EXPORT SelectionRatioSource : public AbstractDataSource
30{
31public:
32 /*! Create a new selection ratio data source.
33 * @param selectionModel The selection to monitor.
34 * @param sampleName This is the name of the database field this data source is
35 * associated with.
36 */
37 explicit SelectionRatioSource(QItemSelectionModel *selectionModel, const QString &sampleName);
38
39 /*! Determine which role to consider for the reported value.
40 * By default this is Qt::DisplayRole.
41 */
42 void setRole(int role);
43
44 QString description() const override;
45 /*! Set human-readable and translated description of the data provided by this source.
46 * @note This must be set before adding this source, sources without description are
47 * discarded.
48 * @param desc The description.
49 */
50 void setDescription(const QString &desc);
51
52 QVariant data() override;
53 void loadImpl(QSettings *settings) override;
54 void storeImpl(QSettings *settings) override;
55 void resetImpl(QSettings *settings) override;
56
57private:
58 Q_DECLARE_PRIVATE(SelectionRatioSource)
59};
60
61}
62
63#endif // KUSERFEEDBACK_SELECTIONRATIOSOURCE_H
Base class for data sources for telemetry data.
Records the time ratio a given entry is selected via a QItemSelectionModel.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.