2 * This file is part of CameraPlus.
4 * Copyright (C) 2012 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"
40 #include "videomute.h"
42 #include "imagesettings.h"
43 #include "imageresolutionmodel.h"
44 #include "videosettings.h"
45 #include "videoresolutionmodel.h"
46 #include "notifications.h"
49 #include <QtDeclarative>
51 #define URI "QtCamera"
55 void Plugin::registerTypes(QDeclarativeEngine *engine) {
56 qmlRegisterType<Camera>(URI, MAJOR, MINOR, "Camera");
57 qmlRegisterType<ImageMode>(URI, MAJOR, MINOR, "ImageMode");
58 qmlRegisterType<VideoMode>(URI, MAJOR, MINOR, "VideoMode");
60 qmlRegisterUncreatableType<Zoom>(URI, MAJOR, MINOR, "Zoom", QObject::tr("Cannot create separate instance of Zoom"));
61 qmlRegisterUncreatableType<Flash>(URI, MAJOR, MINOR, "Flash", QObject::tr("Cannot create separate instance of Flash"));
62 qmlRegisterUncreatableType<Scene>(URI, MAJOR, MINOR, "Scene", QObject::tr("Cannot create separate instance of Scene"));
63 qmlRegisterUncreatableType<EvComp>(URI, MAJOR, MINOR, "EvComp", QObject::tr("Cannot create separate instance of EvComp"));
64 qmlRegisterUncreatableType<WhiteBalance>(URI, MAJOR, MINOR, "WhiteBalance", QObject::tr("Cannot create separate instance of WhiteBalance"));
65 qmlRegisterUncreatableType<ColorTone>(URI, MAJOR, MINOR, "ColorTone", QObject::tr("Cannot create separate instance of ColorTone"));
66 qmlRegisterUncreatableType<Exposure>(URI, MAJOR, MINOR, "Exposure", QObject::tr("Cannot create separate instance of Exposure"));
67 qmlRegisterUncreatableType<Aperture>(URI, MAJOR, MINOR, "Aperture", QObject::tr("Cannot create separate instance of Iso"));
68 qmlRegisterUncreatableType<Iso>(URI, MAJOR, MINOR, "Iso", QObject::tr("Cannot create separate instance of Iso"));
69 qmlRegisterUncreatableType<NoiseReduction>(URI, MAJOR, MINOR, "NoiseReduction", QObject::tr("Cannot create separate instance of NoiseReduction"));
70 qmlRegisterUncreatableType<FlickerReduction>(URI, MAJOR, MINOR, "FlickerReduction", QObject::tr("Cannot create separate instance of FlickerReduction"));
71 qmlRegisterUncreatableType<Focus>(URI, MAJOR, MINOR, "Focus", QObject::tr("Cannot create separate instance of Focus"));
72 qmlRegisterUncreatableType<AutoFocus>(URI, MAJOR, MINOR, "AutoFocus", QObject::tr("Cannot create separate instance of AutoFocus"));
74 qmlRegisterUncreatableType<VideoMute>(URI, MAJOR, MINOR, "VideoMute", QObject::tr("Cannot create separate instance of VideoMute"));
75 qmlRegisterUncreatableType<VideoTorch>(URI, MAJOR, MINOR, "VideoTorch", QObject::tr("Cannot create separate instance of VideoTorch"));
77 qmlRegisterType<MetaData>(URI, MAJOR, MINOR, "MetaData");
78 qmlRegisterType<ImageSettings>(URI, MAJOR, MINOR, "ImageSettings");
79 qmlRegisterType<VideoSettings>(URI, MAJOR, MINOR, "VideoSettings");
80 qmlRegisterType<Sounds>(URI, MAJOR, MINOR, "Sounds");
81 qmlRegisterInterface<Notifications>("Notifications");
83 qmlRegisterUncreatableType<ImageResolutionModel>(URI, MAJOR, MINOR, "ImageResolutionModel",
84 "ImageResolutionModel can be obtained from ImageSettings");
85 qmlRegisterUncreatableType<VideoResolutionModel>(URI, MAJOR, MINOR, "VideoResolutionModel",
86 "VideoResolutionModel can be obtained from VideoSettings");
88 qmlRegisterType<Mode>();
90 engine->addImageProvider("preview", new PreviewProvider);