2 * This file is part of CameraPlus.
4 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "imagemode.h"
23 #include "videomode.h"
25 #include "previewprovider.h"
30 #include "videotorch.h"
31 #include "whitebalance.h"
32 #include "colortone.h"
36 #include "noisereduction.h"
37 #include "flickerreduction.h"
39 #include "autofocus.h"
41 #include "videomute.h"
43 #include "imagesettings.h"
44 #include "imageresolutionmodel.h"
45 #include "videosettings.h"
46 #include "videoresolutionmodel.h"
48 #include "cameraconfig.h"
49 #include "videoplayer.h"
50 #include <QtDeclarative>
55 Plugin::Plugin(QObject *parent) :
56 QDeclarativeExtensionPlugin(parent) {
64 void Plugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) {
67 engine->addImageProvider("preview", new PreviewProvider);
70 void Plugin::registerTypes(const char *uri) {
71 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCamera"));
73 qmlRegisterType<Camera>(uri, MAJOR, MINOR, "Camera");
74 qmlRegisterType<ImageMode>(uri, MAJOR, MINOR, "ImageMode");
75 qmlRegisterType<VideoMode>(uri, MAJOR, MINOR, "VideoMode");
77 qmlRegisterUncreatableType<Zoom>(uri, MAJOR, MINOR, "Zoom", QObject::tr("Cannot create separate instance of Zoom"));
78 qmlRegisterUncreatableType<Flash>(uri, MAJOR, MINOR, "Flash", QObject::tr("Cannot create separate instance of Flash"));
79 qmlRegisterUncreatableType<Scene>(uri, MAJOR, MINOR, "Scene", QObject::tr("Cannot create separate instance of Scene"));
80 qmlRegisterUncreatableType<EvComp>(uri, MAJOR, MINOR, "EvComp", QObject::tr("Cannot create separate instance of EvComp"));
81 qmlRegisterUncreatableType<WhiteBalance>(uri, MAJOR, MINOR, "WhiteBalance", QObject::tr("Cannot create separate instance of WhiteBalance"));
82 qmlRegisterUncreatableType<ColorTone>(uri, MAJOR, MINOR, "ColorTone", QObject::tr("Cannot create separate instance of ColorTone"));
83 qmlRegisterUncreatableType<Exposure>(uri, MAJOR, MINOR, "Exposure", QObject::tr("Cannot create separate instance of Exposure"));
84 qmlRegisterUncreatableType<Aperture>(uri, MAJOR, MINOR, "Aperture", QObject::tr("Cannot create separate instance of Iso"));
85 qmlRegisterUncreatableType<Iso>(uri, MAJOR, MINOR, "Iso", QObject::tr("Cannot create separate instance of Iso"));
86 qmlRegisterUncreatableType<NoiseReduction>(uri, MAJOR, MINOR, "NoiseReduction", QObject::tr("Cannot create separate instance of NoiseReduction"));
87 qmlRegisterUncreatableType<FlickerReduction>(uri, MAJOR, MINOR, "FlickerReduction", QObject::tr("Cannot create separate instance of FlickerReduction"));
88 qmlRegisterUncreatableType<Focus>(uri, MAJOR, MINOR, "Focus", QObject::tr("Cannot create separate instance of Focus"));
89 qmlRegisterUncreatableType<AutoFocus>(uri, MAJOR, MINOR, "AutoFocus", QObject::tr("Cannot create separate instance of AutoFocus"));
90 qmlRegisterUncreatableType<Roi>(uri, MAJOR, MINOR, "Roi", QObject::tr("Cannot create separate instance of Roi"));
92 qmlRegisterUncreatableType<VideoMute>(uri, MAJOR, MINOR, "VideoMute", QObject::tr("Cannot create separate instance of VideoMute"));
93 qmlRegisterUncreatableType<VideoTorch>(uri, MAJOR, MINOR, "VideoTorch", QObject::tr("Cannot create separate instance of VideoTorch"));
95 qmlRegisterType<MetaData>(uri, MAJOR, MINOR, "MetaData");
96 qmlRegisterType<ImageSettings>(uri, MAJOR, MINOR, "ImageSettings");
97 qmlRegisterType<VideoSettings>(uri, MAJOR, MINOR, "VideoSettings");
98 qmlRegisterType<Sounds>(uri, MAJOR, MINOR, "Sounds");
100 qmlRegisterUncreatableType<ImageResolutionModel>(uri, MAJOR, MINOR, "ImageResolutionModel",
101 "ImageResolutionModel can be obtained from ImageSettings");
102 qmlRegisterUncreatableType<VideoResolutionModel>(uri, MAJOR, MINOR, "VideoResolutionModel",
103 "VideoResolutionModel can be obtained from VideoSettings");
105 qmlRegisterType<Mode>();
106 qmlRegisterType<CameraConfig>(uri, MAJOR, MINOR, "CameraConfig");
108 qmlRegisterType<VideoPlayer>("QtCameraExtras", MAJOR, MINOR, "VideoPlayer");
111 Q_EXPORT_PLUGIN2(declarativeqtcamera, Plugin);