2
* Copyright (C) 2011 Ivan Cukic <ivan.cukic(at)kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2,
6
* or (at your option) any later version, as published by the Free
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef RECOMMENDATIONSCRIPTENGINE_P_H_
21
#define RECOMMENDATIONSCRIPTENGINE_P_H_
23
#include <QScriptValue>
24
#include <KConfigGroup>
27
#include "RecommendationScriptEngine.h"
34
class RecommendationScriptEngineConfig: public QObject {
38
RecommendationScriptEngineConfig(QObject * parent, KConfigGroup * config);
39
virtual ~RecommendationScriptEngineConfig();
41
Q_INVOKABLE bool BoolValue(const QString & field, bool defaultValue) const;
42
Q_INVOKABLE void SetBoolValue(const QString & field, bool newValue) const;
44
Q_INVOKABLE int IntValue(const QString & field, int defaultValue) const;
45
Q_INVOKABLE void SetIntValue(const QString & field, int newValue) const;
47
Q_INVOKABLE QString StringValue(const QString & field, QString defaultValue) const;
48
Q_INVOKABLE void SetStringValue(const QString & field, QString newValue) const;
50
Q_INVOKABLE QStringList StringListValue(const QString & field, QStringList defaultValue) const;
51
Q_INVOKABLE void SetStringListValue(const QString & field, QStringList newValue) const;
54
KConfigGroup * m_config;
57
class RecommendationScriptEngine::Private {
68
QScriptEngine * engine;
70
QList<RecommendationItem> recommendations;
79
} // namespace Contour
81
#endif // RECOMMENDATIONSCRIPTENGINE_P_H_