2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 2.1.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
19
#ifndef UBUNTUCLICKMANIFEST_H
20
#define UBUNTUCLICKMANIFEST_H
23
#include <QScriptProgram>
24
#include <QScriptEngine>
25
#include <QStringList>
30
class UbuntuClickManifest : public QObject
34
explicit UbuntuClickManifest(QObject *parent = 0);
38
void maintainerChanged();
40
void policyGroupsChanged();
44
void fileNameChanged(QString);
47
void setName(QString name);
50
void setMaintainer(QString maintainer);
53
void setTitle(QString title);
56
void setPolicyGroups(QString appName, QStringList groups);
57
QStringList policyGroups(QString appName);
59
void save() { save(m_fileName); }
60
void save(QString fileName);
61
void load(QString fileName, QString projectName);
67
QString fileName() { return m_fileName; }
68
void setFileName(QString fileName) { m_fileName = fileName; emit fileNameChanged(fileName); }
70
bool isInitialized() { return m_bInitialized; }
71
void nameDashReplaced(){ m_bNameDashReplaced = true; }
74
void callSetFunction(QString functionName, QScriptValueList args);
75
void callSetStringListFunction(QString functionName, QStringList args);
76
void callSetStringFunction(QString functionName, QString args);
77
void callSetFunction(QString functionName, QString arg, QStringList args);
79
QScriptValue callGetFunction(QString functionName, QScriptValueList args);
80
QStringList callGetStringListFunction(QString functionName);
81
QStringList callGetStringListFunction(QString functionName, QString args);
82
QString callGetStringFunction(QString functionName);
84
QScriptValue callFunction(QString functionName, QScriptValueList args);
86
QScriptProgram m_manifestJsApp;
92
QString m_projectName;
95
bool m_bNameDashReplaced;
101
#endif // UBUNTUCLICKMANIFEST_H