/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc ** All rights reserved. ** For any questions to Digia, please use contact form at http://qt.digia.com ** ** This file is part of the Qt Commercial Charts Add-on. ** ** $QT_BEGIN_LICENSE$ ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. ** ** If you have questions regarding the use of this file, please use ** contact form at http://qt.digia.com ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include "qchart.h" #include "qabstractaxis.h" #include "qvalueaxis.h" #include "qbarcategoryaxis.h" #include "declarativechart.h" #include "declarativexypoint.h" #include "declarativelineseries.h" #include "declarativesplineseries.h" #include "declarativeareaseries.h" #include "declarativescatterseries.h" #include "declarativebarseries.h" #include "declarativepieseries.h" #include "qvxymodelmapper.h" #include "qhxymodelmapper.h" #include "qhpiemodelmapper.h" #include "qvpiemodelmapper.h" #include "qhbarmodelmapper.h" #include "qvbarmodelmapper.h" #include QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartQmlPlugin : public QDeclarativeExtensionPlugin { Q_OBJECT public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); // QtCommercial.Chart 1.0 qmlRegisterType(uri, 1, 0, "ChartView"); qmlRegisterType(uri, 1, 0, "XYPoint"); qmlRegisterType(uri, 1, 0, "ScatterSeries"); qmlRegisterType(uri, 1, 0, "LineSeries"); qmlRegisterType(uri, 1, 0, "SplineSeries"); qmlRegisterType(uri, 1, 0, "AreaSeries"); qmlRegisterType(uri, 1, 0, "BarSeries"); qmlRegisterType(uri, 1, 0, "StackedBarSeries"); qmlRegisterType(uri, 1, 0, "PercentBarSeries"); qmlRegisterType(uri, 1, 0, "PieSeries"); qmlRegisterType(uri, 1, 0, "PieSlice"); qmlRegisterType(uri, 1, 0, "BarSet"); qmlRegisterType(uri, 1, 0, "HXYModelMapper"); qmlRegisterType(uri, 1, 0, "VXYModelMapper"); qmlRegisterType(uri, 1, 0, "HPieModelMapper"); qmlRegisterType(uri, 1, 0, "VPieModelMapper"); qmlRegisterType(uri, 1, 0, "HBarModelMapper"); qmlRegisterType(uri, 1, 0, "VBarModelMapper"); qmlRegisterType(uri, 1, 0, "ValuesAxis"); qmlRegisterType(uri, 1, 0, "BarCategoriesAxis"); qmlRegisterUncreatableType(uri, 1, 0, "Legend", QLatin1String("Trying to create uncreatable: Legend.")); qmlRegisterUncreatableType(uri, 1, 0, "XYSeries", QLatin1String("Trying to create uncreatable: XYSeries.")); qmlRegisterUncreatableType(uri, 1, 0, "AbstractItemModel", QLatin1String("Trying to create uncreatable: AbstractItemModel.")); qmlRegisterUncreatableType(uri, 1, 0, "XYModelMapper", QLatin1String("Trying to create uncreatable: XYModelMapper.")); qmlRegisterUncreatableType(uri, 1, 0, "PieModelMapper", QLatin1String("Trying to create uncreatable: PieModelMapper.")); qmlRegisterUncreatableType(uri, 1, 0, "BarModelMapper", QLatin1String("Trying to create uncreatable: BarModelMapper.")); qmlRegisterUncreatableType(uri, 1, 0, "AbstractSeries", QLatin1String("Trying to create uncreatable: AbstractSeries.")); qmlRegisterUncreatableType(uri, 1, 0, "AbstractBarSeries", QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); qmlRegisterUncreatableType(uri, 1, 0, "AbstractAxis", QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); // QtCommercial.Chart 1.1 qmlRegisterType(uri, 1, 1, "ChartView"); qmlRegisterType(uri, 1, 1, "XYPoint"); qmlRegisterType(uri, 1, 1, "ScatterSeries"); qmlRegisterType(uri, 1, 1, "LineSeries"); qmlRegisterType(uri, 1, 1, "SplineSeries"); qmlRegisterType(uri, 1, 1, "AreaSeries"); qmlRegisterType(uri, 1, 1, "BarSeries"); qmlRegisterType(uri, 1, 1, "StackedBarSeries"); qmlRegisterType(uri, 1, 1, "PercentBarSeries"); qmlRegisterType(uri, 1, 1, "HorizontalBarSeries"); qmlRegisterType(uri, 1, 1, "HorizontalStackedBarSeries"); qmlRegisterType(uri, 1, 1, "HorizontalPercentBarSeries"); qmlRegisterType(uri, 1, 1, "PieSeries"); qmlRegisterType(uri, 1, 1, "PieSlice"); qmlRegisterType(uri, 1, 1, "BarSet"); qmlRegisterType(uri, 1, 1, "HXYModelMapper"); qmlRegisterType(uri, 1, 1, "VXYModelMapper"); qmlRegisterType(uri, 1, 1, "HPieModelMapper"); qmlRegisterType(uri, 1, 1, "VPieModelMapper"); qmlRegisterType(uri, 1, 1, "HBarModelMapper"); qmlRegisterType(uri, 1, 1, "VBarModelMapper"); qmlRegisterType(uri, 1, 1, "ValueAxis"); qmlRegisterType(uri, 1, 1, "BarCategoryAxis"); qmlRegisterUncreatableType(uri, 1, 1, "Legend", QLatin1String("Trying to create uncreatable: Legend.")); qmlRegisterUncreatableType(uri, 1, 1, "XYSeries", QLatin1String("Trying to create uncreatable: XYSeries.")); qmlRegisterUncreatableType(uri, 1, 1, "AbstractItemModel", QLatin1String("Trying to create uncreatable: AbstractItemModel.")); qmlRegisterUncreatableType(uri, 1, 1, "XYModelMapper", QLatin1String("Trying to create uncreatable: XYModelMapper.")); qmlRegisterUncreatableType(uri, 1, 1, "PieModelMapper", QLatin1String("Trying to create uncreatable: PieModelMapper.")); qmlRegisterUncreatableType(uri, 1, 1, "BarModelMapper", QLatin1String("Trying to create uncreatable: BarModelMapper.")); qmlRegisterUncreatableType(uri, 1, 1, "AbstractSeries", QLatin1String("Trying to create uncreatable: AbstractSeries.")); qmlRegisterUncreatableType(uri, 1, 1, "AbstractBarSeries", QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); qmlRegisterUncreatableType(uri, 1, 1, "AbstractAxis", QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); } }; #include "plugin.moc" QTCOMMERCIALCHART_END_NAMESPACE QTCOMMERCIALCHART_USE_NAMESPACE Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin))