~zeller-benjamin/qtcreator-plugin-ubuntu/qtc41-beta

« back to all changes in this revision

Viewing changes to src/ubuntu/ubuntumenu.h

  • Committer: Juhapekka Piiroinen
  • Date: 2013-09-04 15:30:00 UTC
  • mto: (23.1.14 binary-plugin)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: juhapekka.piiroinen@canonical.com-20130904153000-r4lhfhrjlwmop277
Added cordova plugin from ubuntu-qtcreator-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef UBUNTUMENU_H
 
20
#define UBUNTUMENU_H
 
21
 
 
22
#include <coreplugin/actionmanager/actionmanager.h>
 
23
 
 
24
 
 
25
#include "ubuntuprocess.h"
 
26
#include "ubuntuconstants.h"
 
27
 
 
28
#include <QObject>
 
29
#include <QString>
 
30
#include <QList>
 
31
#include <QJsonDocument>
 
32
 
 
33
namespace Ubuntu {
 
34
namespace Internal {
 
35
 
 
36
 
 
37
class UbuntuMenu : public QObject
 
38
{
 
39
    Q_OBJECT
 
40
public:
 
41
    explicit UbuntuMenu(QObject *parent = 0);
 
42
 
 
43
    void initialize();
 
44
 
 
45
    void parseMenu(QJsonObject obj, Core::ActionContainer*& parent, const Core::Id &group = Core::Id());
 
46
 
 
47
    QString menuPath(QString fileName);
 
48
    QJsonDocument getMenuJSON();
 
49
 
 
50
public slots:
 
51
    void slotUpdateActions();
 
52
    
 
53
protected slots:
 
54
    void menuItemTriggered();
 
55
    void onStarted(QString);
 
56
    void onMessage(QString);
 
57
    void onError(QString);
 
58
    void onFinished(QString cmd, int code);
 
59
 
 
60
protected:
 
61
    typedef QList<QJsonValue> QJsonValueList;
 
62
 
 
63
    QJsonDocument m_obj;
 
64
    QMap<QString,QJsonValueList> m_commandMap;
 
65
 
 
66
    UbuntuProcess m_ubuntuProcess;
 
67
 
 
68
    QList<QAction*> m_actions;
 
69
 
 
70
};
 
71
 
 
72
 
 
73
} // Internal
 
74
} // Ubuntu
 
75
 
 
76
 
 
77
#endif // UBUNTUMENU_H