f5e3f73a96a47256dcff7692f649a9e9fe8cf64b
[profile/ivi/qtdeclarative.git] / src / qtquick1 / util / qdeclarativeutilmodule.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 **
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
29 **
30 ** Other Usage
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "QtQuick1/private/qdeclarativeutilmodule_p.h"
43 #include "QtQuick1/private/qdeclarativeanimation_p.h"
44 #include "QtQuick1/private/qdeclarativeanimation_p_p.h"
45 #include "QtQuick1/private/qdeclarativebehavior_p.h"
46 #include "QtQuick1/private/qdeclarativebind_p.h"
47 #include "QtQuick1/private/qdeclarativeconnections_p.h"
48 #include "QtQuick1/private/qdeclarativesmoothedanimation_p.h"
49 #include "QtQuick1/private/qdeclarativefontloader_p.h"
50 #include "QtQuick1/private/qdeclarativelistaccessor_p.h"
51 //#include "QtQuick1/private/qdeclarativelistmodel_p.h"
52 #include "QtQuick1/private/qdeclarativeopenmetaobject_p.h"
53 #include "QtQuick1/private/qdeclarativepackage_p.h"
54 #include "QtQuick1/private/qdeclarativepixmapcache_p.h"
55 #include "QtQuick1/private/qdeclarativepropertychanges_p.h"
56 #include "QtQuick1/private/qdeclarativespringanimation_p.h"
57 #include "QtQuick1/private/qdeclarativestategroup_p.h"
58 #include "QtQuick1/private/qdeclarativestateoperations_p.h"
59 #include "QtQuick1/private/qdeclarativestate_p.h"
60 #include "QtQuick1/private/qdeclarativestate_p_p.h"
61 #include "QtQuick1/private/qdeclarativestyledtext_p.h"
62 #include "QtQuick1/private/qdeclarativesystempalette_p.h"
63 #include "QtQuick1/private/qdeclarativetimeline_p_p.h"
64 #include "QtQuick1/private/qdeclarativetimer_p.h"
65 #include "QtQuick1/private/qdeclarativetransitionmanager_p_p.h"
66 #include "QtQuick1/private/qdeclarativetransition_p.h"
67 #include "QtQuick1/private/qdeclarativeapplication_p.h"
68 #include "QtQuick1/qdeclarativeview.h"
69 #include <QtDeclarative/qdeclarativeinfo.h>
70 #include <QtDeclarative/private/qdeclarativetypenotavailable_p.h>
71 #ifndef QT_NO_XMLPATTERNS
72 #include "QtQuick1/private/qdeclarativexmllistmodel_p.h"
73 #endif
74
75 QT_BEGIN_NAMESPACE
76
77 void QDeclarative1UtilModule::defineModule(QDeclarativeQtQuick1Module::Module module)
78 {
79     qmlRegisterType<QDeclarative1Anchors>();
80     qmlRegisterType<QDeclarative1StateOperation>();
81     qmlRegisterType<QDeclarative1AnchorSet>();
82
83     if (module == QDeclarativeQtQuick1Module::QtQuick1) {
84         qmlRegisterUncreatableType<QDeclarative1Application>("QtQuick",1,1,"Application", QDeclarative1Application::tr("Application is an abstract class"));
85
86         qmlRegisterType<QDeclarative1AnchorAnimation>("QtQuick",1,0,"AnchorAnimation");
87         qmlRegisterType<QDeclarative1AnchorChanges>("QtQuick",1,0,"AnchorChanges");
88         qmlRegisterType<QDeclarative1Behavior>("QtQuick",1,0,"Behavior");
89         qmlRegisterType<QDeclarative1Bind>("QtQuick",1,0,"Binding");
90         qmlRegisterType<QDeclarative1ColorAnimation>("QtQuick",1,0,"ColorAnimation");
91         qmlRegisterType<QDeclarative1Connections>("QtQuick",1,0,"Connections");
92         qmlRegisterType<QDeclarative1SmoothedAnimation>("QtQuick",1,0,"SmoothedAnimation");
93         qmlRegisterType<QDeclarative1FontLoader>("QtQuick",1,0,"FontLoader");
94     //    qmlRegisterType<QDeclarative1ListElement>("QtQuick",1,0,"ListElement");
95         qmlRegisterType<QDeclarative1NumberAnimation>("QtQuick",1,0,"NumberAnimation");
96         qmlRegisterType<QDeclarative1Package>("QtQuick",1,0,"Package");
97         qmlRegisterType<QDeclarative1ParallelAnimation>("QtQuick",1,0,"ParallelAnimation");
98         qmlRegisterType<QDeclarative1ParentAnimation>("QtQuick",1,0,"ParentAnimation");
99         qmlRegisterType<QDeclarative1ParentChange>("QtQuick",1,0,"ParentChange");
100         qmlRegisterType<QDeclarative1PauseAnimation>("QtQuick",1,0,"PauseAnimation");
101         qmlRegisterType<QDeclarative1PropertyAction>("QtQuick",1,0,"PropertyAction");
102         qmlRegisterType<QDeclarative1PropertyAnimation>("QtQuick",1,0,"PropertyAnimation");
103         qmlRegisterType<QDeclarative1RotationAnimation>("QtQuick",1,0,"RotationAnimation");
104         qmlRegisterType<QDeclarative1ScriptAction>("QtQuick",1,0,"ScriptAction");
105         qmlRegisterType<QDeclarative1SequentialAnimation>("QtQuick",1,0,"SequentialAnimation");
106         qmlRegisterType<QDeclarative1SpringAnimation>("QtQuick",1,0,"SpringAnimation");
107         qmlRegisterType<QDeclarative1StateChangeScript>("QtQuick",1,0,"StateChangeScript");
108         qmlRegisterType<QDeclarative1StateGroup>("QtQuick",1,0,"StateGroup");
109         qmlRegisterType<QDeclarative1State>("QtQuick",1,0,"State");
110         qmlRegisterType<QDeclarative1SystemPalette>("QtQuick",1,0,"SystemPalette");
111         qmlRegisterType<QDeclarative1Timer>("QtQuick",1,0,"Timer");
112         qmlRegisterType<QDeclarative1Transition>("QtQuick",1,0,"Transition");
113         qmlRegisterType<QDeclarative1Vector3dAnimation>("QtQuick",1,0,"Vector3dAnimation");
114 #ifdef QT_NO_XMLPATTERNS
115         qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlListModel",
116             qApp->translate("QDeclarative1XmlListModel","Qt was built without support for xmlpatterns"));
117         qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlRole",
118             qApp->translate("QDeclarative1XmlListModel","Qt was built without support for xmlpatterns"));
119 #else
120         qmlRegisterType<QDeclarative1XmlListModel>("QtQuick",1,0,"XmlListModel");
121         qmlRegisterType<QDeclarative1XmlListModelRole>("QtQuick",1,0,"XmlRole");
122 #endif
123
124
125         qmlRegisterUncreatableType<QDeclarative1AbstractAnimation>("QtQuick",1,0,"Animation",QDeclarative1AbstractAnimation::tr("Animation is an abstract class"));
126
127     //    qmlRegisterCustomType<QDeclarative1ListModel>("QtQuick",1,0,"ListModel", new QDeclarative1ListModelParser);
128         qmlRegisterCustomType<QDeclarative1PropertyChanges>("QtQuick",1,0,"PropertyChanges", new QDeclarative1PropertyChangesParser);
129         qmlRegisterCustomType<QDeclarative1Connections>("QtQuick",1,0,"Connections", new QDeclarative1ConnectionsParser);
130     } else if (module == QDeclarativeQtQuick1Module::Qt47) {
131         qmlRegisterType<QDeclarative1AnchorAnimation>("Qt",4,7,"AnchorAnimation");
132         qmlRegisterType<QDeclarative1AnchorChanges>("Qt",4,7,"AnchorChanges");
133         qmlRegisterType<QDeclarative1Behavior>("Qt",4,7,"Behavior");
134         qmlRegisterType<QDeclarative1Bind>("Qt",4,7,"Binding");
135         qmlRegisterType<QDeclarative1ColorAnimation>("Qt",4,7,"ColorAnimation");
136         qmlRegisterType<QDeclarative1Connections>("Qt",4,7,"Connections");
137         qmlRegisterType<QDeclarative1SmoothedAnimation>("Qt",4,7,"SmoothedAnimation");
138         qmlRegisterType<QDeclarative1FontLoader>("Qt",4,7,"FontLoader");
139     //    qmlRegisterType<QDeclarative1ListElement>("Qt",4,7,"ListElement");
140         qmlRegisterType<QDeclarative1NumberAnimation>("Qt",4,7,"NumberAnimation");
141         qmlRegisterType<QDeclarative1Package>("Qt",4,7,"Package");
142         qmlRegisterType<QDeclarative1ParallelAnimation>("Qt",4,7,"ParallelAnimation");
143         qmlRegisterType<QDeclarative1ParentAnimation>("Qt",4,7,"ParentAnimation");
144         qmlRegisterType<QDeclarative1ParentChange>("Qt",4,7,"ParentChange");
145         qmlRegisterType<QDeclarative1PauseAnimation>("Qt",4,7,"PauseAnimation");
146         qmlRegisterType<QDeclarative1PropertyAction>("Qt",4,7,"PropertyAction");
147         qmlRegisterType<QDeclarative1PropertyAnimation>("Qt",4,7,"PropertyAnimation");
148         qmlRegisterType<QDeclarative1RotationAnimation>("Qt",4,7,"RotationAnimation");
149         qmlRegisterType<QDeclarative1ScriptAction>("Qt",4,7,"ScriptAction");
150         qmlRegisterType<QDeclarative1SequentialAnimation>("Qt",4,7,"SequentialAnimation");
151         qmlRegisterType<QDeclarative1SpringAnimation>("Qt",4,7,"SpringAnimation");
152         qmlRegisterType<QDeclarative1StateChangeScript>("Qt",4,7,"StateChangeScript");
153         qmlRegisterType<QDeclarative1StateGroup>("Qt",4,7,"StateGroup");
154         qmlRegisterType<QDeclarative1State>("Qt",4,7,"State");
155         qmlRegisterType<QDeclarative1SystemPalette>("Qt",4,7,"SystemPalette");
156         qmlRegisterType<QDeclarative1Timer>("Qt",4,7,"Timer");
157         qmlRegisterType<QDeclarative1Transition>("Qt",4,7,"Transition");
158         qmlRegisterType<QDeclarative1Vector3dAnimation>("Qt",4,7,"Vector3dAnimation");
159 #ifdef QT_NO_XMLPATTERNS
160         qmlRegisterTypeNotAvailable("Qt",4,7,"XmlListModel",
161             qApp->translate("QDeclarative1XmlListModel","Qt was built without support for xmlpatterns"));
162         qmlRegisterTypeNotAvailable("Qt",4,7,"XmlRole",
163             qApp->translate("QDeclarative1XmlListModel","Qt was built without support for xmlpatterns"));
164 #else
165         qmlRegisterType<QDeclarative1XmlListModel>("Qt",4,7,"XmlListModel");
166         qmlRegisterType<QDeclarative1XmlListModelRole>("Qt",4,7,"XmlRole");
167 #endif
168
169         qmlRegisterUncreatableType<QDeclarative1AbstractAnimation>("Qt",4,7,"Animation",QDeclarative1AbstractAnimation::tr("Animation is an abstract class"));
170
171     //    qmlRegisterCustomType<QDeclarative1ListModel>("Qt", 4,7, "ListModel", new QDeclarative1ListModelParser);
172         qmlRegisterCustomType<QDeclarative1PropertyChanges>("Qt", 4, 7, "PropertyChanges", new QDeclarative1PropertyChangesParser);
173         qmlRegisterCustomType<QDeclarative1Connections>("Qt", 4, 7, "Connections", new QDeclarative1ConnectionsParser);
174     }
175 }
176
177 QT_END_NAMESPACE
178