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"
26 #include "capability.h"
31 #include "videotorch.h"
32 #include "whitebalance.h"
33 #include "colortone.h"
37 #include "noisereduction.h"
38 #include "flickerreduction.h"
40 #include "autofocus.h"
43 #include "imagesettings.h"
44 #include "imageresolutionmodel.h"
45 #include "videosettings.h"
46 #include "videoresolutionmodel.h"
47 #include "notifications.h"
50 #include <QtDeclarative>
52 #define URI "QtCamera"
56 void Plugin::registerTypes(QDeclarativeEngine *engine) {
57 qmlRegisterType<Camera>(URI, MAJOR, MINOR, "Camera");
58 qmlRegisterType<ImageMode>(URI, MAJOR, MINOR, "ImageMode");
59 qmlRegisterType<VideoMode>(URI, MAJOR, MINOR, "VideoMode");
60 qmlRegisterType<Zoom>(URI, MAJOR, MINOR, "Zoom");
61 qmlRegisterType<Flash>(URI, MAJOR, MINOR, "Flash");
62 qmlRegisterType<Scene>(URI, MAJOR, MINOR, "Scene");
63 qmlRegisterType<EvComp>(URI, MAJOR, MINOR, "EvComp");
64 qmlRegisterType<VideoTorch>(URI, MAJOR, MINOR, "VideoTorch");
65 qmlRegisterType<WhiteBalance>(URI, MAJOR, MINOR, "WhiteBalance");
66 qmlRegisterType<ColorTone>(URI, MAJOR, MINOR, "ColorTone");
67 qmlRegisterType<Exposure>(URI, MAJOR, MINOR, "Exposure");
68 qmlRegisterType<Aperture>(URI, MAJOR, MINOR, "Aperture");
69 qmlRegisterType<Iso>(URI, MAJOR, MINOR, "Iso");
70 qmlRegisterType<NoiseReduction>(URI, MAJOR, MINOR, "NoiseReduction");
71 qmlRegisterType<FlickerReduction>(URI, MAJOR, MINOR, "FlickerReduction");
72 qmlRegisterType<Focus>(URI, MAJOR, MINOR, "Focus");
73 qmlRegisterType<AutoFocus>(URI, MAJOR, MINOR, "AutoFocus");
74 qmlRegisterType<Mute>(URI, MAJOR, MINOR, "Mute");
75 qmlRegisterType<MetaData>(URI, MAJOR, MINOR, "MetaData");
76 qmlRegisterType<ImageSettings>(URI, MAJOR, MINOR, "ImageSettings");
77 qmlRegisterType<VideoSettings>(URI, MAJOR, MINOR, "VideoSettings");
78 qmlRegisterType<Sounds>(URI, MAJOR, MINOR, "Sounds");
79 qmlRegisterInterface<Notifications>("Notifications");
81 qmlRegisterUncreatableType<ImageResolutionModel>(URI, MAJOR, MINOR, "ImageResolutionModel",
82 "ImageResolutionModel can be obtained from ImageSettings");
83 qmlRegisterUncreatableType<VideoResolutionModel>(URI, MAJOR, MINOR, "VideoResolutionModel",
84 "VideoResolutionModel can be obtained from VideoSettings");
86 qmlRegisterType<Mode>();
87 qmlRegisterType<Capability>();
89 engine->addImageProvider("preview", new PreviewProvider);