1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the QtOrganizer module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 or version 3 as published by the Free
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** following information to ensure the GNU Lesser General Public License
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25**
26** As a special exception, The Qt Company gives you certain additional
27** rights. These rights are described in The Qt Company LGPL Exception
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29**
30** $QT_END_LICENSE$
31**
32****************************************************************************/
33
34#include <QtQml/qqml.h>
35#include <QtQml/qqmlextensionplugin.h>
36
37#include "qdeclarativeorganizercollection_p.h"
38#include "qdeclarativeorganizeritem_p.h"
39#include "qdeclarativeorganizeritemdetail_p.h"
40#include "qdeclarativeorganizeritemfetchhint_p.h"
41#include "qdeclarativeorganizeritemfilter_p.h"
42#include "qdeclarativeorganizeritemsortorder_p.h"
43#include "qdeclarativeorganizermodel_p.h"
44#include "qdeclarativeorganizerrecurrencerule_p.h"
45
46QT_BEGIN_NAMESPACE
47
48class QOrganizerQmlPlugin : public QQmlExtensionPlugin
49{
50 Q_OBJECT
51 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "organizer.json")
52
53public:
54 void registerTypes(const char *uri)
55 {
56 Q_ASSERT(uri == QStringLiteral("QtOrganizer"));
57
58 int major = 5;
59 int minor = 0;
60
61 qRegisterMetaType<QOrganizerAbstractRequest::State>(typeName: "QOrganizerAbstractRequest::State");
62 qRegisterMetaType<QOrganizerItemId>(typeName: "QOrganizerItemId");
63 qRegisterMetaType<QList<QOrganizerItemId> >(typeName: "QList<QOrganizerItemId>");
64 qRegisterMetaType<QOrganizerCollectionId>(typeName: "QOrganizerCollectionId");
65 qRegisterMetaType<QList<QOrganizerCollectionId> >(typeName: "QList<QOrganizerCollectionId>");
66
67 qmlRegisterType<QDeclarativeOrganizerModel>(uri, versionMajor: major, versionMinor: minor, qmlName: "OrganizerModel");
68 qmlRegisterType<QDeclarativeOrganizerRecurrenceRule>(uri, versionMajor: major, versionMinor: minor, qmlName: "RecurrenceRule");
69 qmlRegisterType<QDeclarativeOrganizerItemFetchHint>(uri, versionMajor: major, versionMinor: minor, qmlName: "FetchHint");
70 qmlRegisterType<QDeclarativeOrganizerItemSortOrder>(uri, versionMajor: major, versionMinor: minor, qmlName: "SortOrder");
71 qmlRegisterType<QDeclarativeOrganizerCollection>(uri, versionMajor: major, versionMinor: minor, qmlName: "Collection");
72
73 //items
74 qmlRegisterType<QDeclarativeOrganizerItem>(uri, versionMajor: major, versionMinor: minor, qmlName: "OrganizerItem");
75 qmlRegisterType<QDeclarativeOrganizerEvent>(uri, versionMajor: major, versionMinor: minor, qmlName: "Event");
76 qmlRegisterType<QDeclarativeOrganizerEventOccurrence>(uri, versionMajor: major, versionMinor: minor, qmlName: "EventOccurrence");
77 qmlRegisterType<QDeclarativeOrganizerJournal>(uri, versionMajor: major, versionMinor: minor, qmlName: "Journal");
78 qmlRegisterType<QDeclarativeOrganizerNote>(uri, versionMajor: major, versionMinor: minor, qmlName: "Note");
79 qmlRegisterType<QDeclarativeOrganizerTodo>(uri, versionMajor: major, versionMinor: minor, qmlName: "Todo");
80 qmlRegisterType<QDeclarativeOrganizerTodoOccurrence>(uri, versionMajor: major, versionMinor: minor, qmlName: "TodoOccurrence");
81
82 //details
83 qmlRegisterType<QDeclarativeOrganizerItemDetail>(uri, versionMajor: major, versionMinor: minor, qmlName: "Detail");
84 qmlRegisterType<QDeclarativeOrganizerEventTime>(uri, versionMajor: major, versionMinor: minor, qmlName: "EventTime");
85 qmlRegisterType<QDeclarativeOrganizerItemComment>(uri, versionMajor: major, versionMinor: minor, qmlName: "Comment");
86 qmlRegisterType<QDeclarativeOrganizerItemDescription>(uri, versionMajor: major, versionMinor: minor, qmlName: "Description");
87 qmlRegisterType<QDeclarativeOrganizerItemDisplayLabel>(uri, versionMajor: major, versionMinor: minor, qmlName: "DisplayLabel");
88 qmlRegisterType<QDeclarativeOrganizerItemGuid>(uri, versionMajor: major, versionMinor: minor, qmlName: "Guid");
89 qmlRegisterType<QDeclarativeOrganizerItemLocation>(uri, versionMajor: major, versionMinor: minor, qmlName: "Location");
90 qmlRegisterType<QDeclarativeOrganizerItemParent>(uri, versionMajor: major, versionMinor: minor, qmlName: "Parent");
91 qmlRegisterType<QDeclarativeOrganizerItemPriority>(uri, versionMajor: major, versionMinor: minor, qmlName: "Priority");
92 qmlRegisterType<QDeclarativeOrganizerItemRecurrence>(uri, versionMajor: major, versionMinor: minor, qmlName: "Recurrence");
93 qmlRegisterType<QDeclarativeOrganizerItemTag>(uri, versionMajor: major, versionMinor: minor, qmlName: "Tag");
94 qmlRegisterType<QDeclarativeOrganizerItemTimestamp>(uri, versionMajor: major, versionMinor: minor, qmlName: "Timestamp");
95 qmlRegisterType<QDeclarativeOrganizerItemType>(uri, versionMajor: major, versionMinor: minor, qmlName: "Type");
96 qmlRegisterType<QDeclarativeOrganizerJournalTime>(uri, versionMajor: major, versionMinor: minor, qmlName: "JournalTime");
97 qmlRegisterType<QDeclarativeOrganizerTodoProgress>(uri, versionMajor: major, versionMinor: minor, qmlName: "TodoProgress");
98 qmlRegisterType<QDeclarativeOrganizerTodoTime>(uri, versionMajor: major, versionMinor: minor, qmlName: "TodoTime");
99 qmlRegisterType<QDeclarativeOrganizerItemExtendedDetail>(uri, versionMajor: major, versionMinor: minor, qmlName: "ExtendedDetail");
100 qmlRegisterType<QDeclarativeOrganizerEventAttendee>(uri, versionMajor: major, versionMinor: minor, qmlName: "EventAttendee");
101 qmlRegisterType<QDeclarativeOrganizerEventRsvp>(uri, versionMajor: major, versionMinor: minor, qmlName: "EventRsvp");
102 qmlRegisterType<QDeclarativeOrganizerItemClassification>(uri, versionMajor: major, versionMinor: minor, qmlName: "Classification");
103 qmlRegisterType<QDeclarativeOrganizerItemVersion>(uri, versionMajor: major, versionMinor: minor, qmlName: "Version");
104
105 qmlRegisterType<QDeclarativeOrganizerItemReminder>(uri, versionMajor: major, versionMinor: minor, qmlName: "Reminder");
106 qmlRegisterType<QDeclarativeOrganizerItemAudibleReminder>(uri, versionMajor: major, versionMinor: minor, qmlName: "AudibleReminder");
107 qmlRegisterType<QDeclarativeOrganizerItemEmailReminder>(uri, versionMajor: major, versionMinor: minor, qmlName: "EmailReminder");
108 qmlRegisterType<QDeclarativeOrganizerItemVisualReminder>(uri, versionMajor: major, versionMinor: minor, qmlName: "VisualReminder");
109
110 //filters
111 qmlRegisterType<QDeclarativeOrganizerItemFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "Filter");
112 qmlRegisterType<QDeclarativeOrganizerItemCollectionFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "CollectionFilter");
113 qmlRegisterType<QDeclarativeOrganizerItemDetailFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "DetailFilter");
114 qmlRegisterType<QDeclarativeOrganizerItemDetailFieldFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "DetailFieldFilter");
115 qmlRegisterType<QDeclarativeOrganizerItemDetailRangeFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "DetailRangeFilter");
116 qmlRegisterType<QDeclarativeOrganizerItemIdFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "IdFilter");
117 qmlRegisterType<QDeclarativeOrganizerItemIntersectionFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "IntersectionFilter");
118 qmlRegisterType<QDeclarativeOrganizerItemUnionFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "UnionFilter");
119 qmlRegisterType<QDeclarativeOrganizerItemInvalidFilter>(uri, versionMajor: major, versionMinor: minor, qmlName: "InvalidFilter");
120 qmlRegisterType<QDeclarativeOrganizerItemCompoundFilter>();
121 }
122};
123
124#include "plugin.moc"
125
126QT_END_NAMESPACE
127

source code of qtpim/src/imports/organizer/plugin.cpp