KUserFeedback

surveytargetexpressionevaluator.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KUSERFEEDBACK_SURVEYTARGETEXPRESSIONEVALUATOR_H
8#define KUSERFEEDBACK_SURVEYTARGETEXPRESSIONEVALUATOR_H
9
10#include <QHash>
11
12QT_BEGIN_NAMESPACE
13class QString;
14class QVariant;
15QT_END_NAMESPACE
16
17namespace KUserFeedback {
18
19class SurveyTargetExpression;
20
21class SurveyTargetExpressionDataProvider
22{
23public:
24 SurveyTargetExpressionDataProvider();
25 virtual ~SurveyTargetExpressionDataProvider();
26 virtual QVariant sourceData(const QString &sourceName) const = 0;
27
28private:
29 Q_DISABLE_COPY(SurveyTargetExpressionDataProvider)
30};
31
32class SurveyTargetExpressionEvaluator
33{
34public:
35 SurveyTargetExpressionEvaluator();
36 ~SurveyTargetExpressionEvaluator();
37
38 void setDataProvider(const SurveyTargetExpressionDataProvider *provider);
39
40 bool evaluate(SurveyTargetExpression *expression);
41
42private:
43 QVariant value(SurveyTargetExpression *expression);
44 QVariant value(const QString &source);
45
46 const SurveyTargetExpressionDataProvider *m_provider;
47 QHash<QString, QVariant> m_dataCache;
48};
49
50}
51
52#endif // KUSERFEEDBACK_SURVEYTARGETEXPRESSIONEVALUATOR_H
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 Fri Nov 29 2024 11:48:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.