Debian Codegraph @

qml/Lomiri/Action/plugin.cpp

raw
1 /* This file is part of lomiri-action-api
2 * Copyright 2013 Canonical Ltd.
3 *
4 * lomiri-action-api is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * lomiri-action-api is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the 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
17 #include "plugin.h"
18
19 #include <QtQml>
20
21 #include "qml-action.h"
22 #include "qml-preview-action.h"
23 #include "qml-context.h"
24 #include "qml-manager.h"
25
26 #include <lomiri/action/PreviewParameter>
27 #include <lomiri/action/PreviewRangeParameter>
28 #include <lomiri/action/MenuItem>
29
30 void
31 LomiriActionQmlPlugin::registerTypes(const char *uri)
32 {
33 // @uri Lomiri.Action
34
35 qmlRegisterAnonymousType<lomiri::action::Action> (uri, 1);
36 qmlRegisterType<lomiri::action::qml::Action> (uri, 1, 0, "Action");
37 qmlRegisterType<lomiri::action::qml::Action> (uri, 1, 1, "Action");
38 qmlRegisterAnonymousType<lomiri::action::PreviewAction> (uri, 1);
39 qmlRegisterType<lomiri::action::qml::PreviewAction> (uri, 1, 0, "PreviewAction");
40 qmlRegisterType<lomiri::action::qml::PreviewAction> (uri, 1, 1, "PreviewAction");
41
42 qmlRegisterAnonymousType<lomiri::action::PreviewParameter> (uri, 1);
43 qmlRegisterType<lomiri::action::PreviewRangeParameter> (uri, 1, 0, "PreviewRangeParameter");
44 qmlRegisterType<lomiri::action::PreviewRangeParameter> (uri, 1, 1, "PreviewRangeParameter");
45
46 // Don't provide menu item just yet.
47 //qmlRegisterType<lomiri::action::MenuItem> (uri, 1, 0, "MenuItem");
48
49 qmlRegisterAnonymousType<lomiri::action::ActionContext> (uri, 1);
50 qmlRegisterType<lomiri::action::qml::ActionContext> (uri, 1, 0, "ActionContext");
51 qmlRegisterType<lomiri::action::qml::ActionContext> (uri, 1, 1, "ActionContext");
52 qmlRegisterType<lomiri::action::ActionManager> (uri, 1, 0, "");
53 qmlRegisterType<lomiri::action::ActionManager, 1> (uri, 1, 1, "");
54 qmlRegisterType<lomiri::action::qml::ActionManager> (uri, 1, 0, "ActionManager");
55 qmlRegisterType<lomiri::action::qml::ActionManager, 1> (uri, 1, 1, "ActionManager");
56
57 }
58
59 void
60 LomiriActionQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
61 {
62 Q_UNUSED(uri);
63 Q_UNUSED(engine);
64 }