Added ROI an face detection
[harmattan/cameraplus] / src / settings.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 #ifndef SETTINGS_H
24 #define SETTINGS_H
25
26 #include <QObject>
27
28 class QSettings;
29
30 class Settings : public QObject {
31   Q_OBJECT
32
33   Q_PROPERTY(int mode READ mode WRITE setMode NOTIFY modeChanged);
34   Q_PROPERTY(QString creatorName READ creatorName WRITE setCreatorName NOTIFY creatorNameChanged);
35   Q_PROPERTY(bool useGps READ useGps WRITE setUseGps NOTIFY useGpsChanged);
36   Q_PROPERTY(bool useGeotags READ useGeotags WRITE setUseGeotags NOTIFY useGeotagsChanged);
37   Q_PROPERTY(int imageSceneMode READ imageSceneMode WRITE setImageSceneMode NOTIFY imageSceneModeChanged);
38   Q_PROPERTY(int imageColorFilter READ imageColorFilter WRITE setImageColorFilter NOTIFY imageColorFilterChanged);
39   Q_PROPERTY(int imageWhiteBalance READ imageWhiteBalance WRITE setImageWhiteBalance NOTIFY imageWhiteBalanceChanged);
40   Q_PROPERTY(qreal imageEvComp READ imageEvComp WRITE setImageEvComp NOTIFY imageEvCompChanged);
41
42   Q_PROPERTY(int videoSceneMode READ videoSceneMode WRITE setVideoSceneMode NOTIFY videoSceneModeChanged);
43   Q_PROPERTY(int videoColorFilter READ videoColorFilter WRITE setVideoColorFilter NOTIFY videoColorFilterChanged);
44   Q_PROPERTY(int videoWhiteBalance READ videoWhiteBalance WRITE setVideoWhiteBalance NOTIFY videoWhiteBalanceChanged);
45   Q_PROPERTY(qreal videoEvComp READ videoEvComp WRITE setVideoEvComp NOTIFY videoEvCompChanged);
46
47   Q_PROPERTY(int imageFlashMode READ imageFlashMode WRITE setImageFlashMode NOTIFY imageFlashModeChanged);
48   Q_PROPERTY(int imageIso READ imageIso WRITE setImageIso NOTIFY imageIsoChanged);
49
50   Q_PROPERTY(QString imageAspectRatio READ imageAspectRatio WRITE setImageAspectRatio NOTIFY imageAspectRatioChanged);
51   Q_PROPERTY(QString imageResolution READ imageResolution WRITE setImageResolution NOTIFY imageResolutionChanged);
52
53   Q_PROPERTY(QString videoAspectRatio READ videoAspectRatio WRITE setVideoAspectRatio NOTIFY videoAspectRatioChanged);
54   Q_PROPERTY(QString videoResolution READ videoResolution WRITE setVideoResolution NOTIFY videoResolutionChanged);
55
56   Q_PROPERTY(bool soundEnabled READ isSoundEnabled WRITE setSoundEnabled NOTIFY soundEnabledChanged);
57   Q_PROPERTY(bool videoTorchOn READ isVideoTorchOn WRITE setVideoTorchOn NOTIFY videoTorchOnChanged);
58
59   Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
60   Q_PROPERTY(bool videoMuted READ isVideoMuted WRITE setVideoMuted NOTIFY videoMutedChanged);
61
62   Q_PROPERTY(bool gridEnabled READ isGridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged);
63
64   Q_PROPERTY(bool faceDetectionEnabled READ isFaceDetectionEnabled WRITE setFaceDetectionEnabled NOTIFY faceDetectionEnabledChanged);
65
66 public:
67   Settings(QObject *parent = 0);
68   ~Settings();
69
70   int mode() const;
71   void setMode(int mode);
72
73   QString creatorName() const;
74   void setCreatorName(const QString& name);
75
76   bool useGps() const;
77   void setUseGps(bool enable);
78
79   bool useGeotags() const;
80   void setUseGeotags(bool enable);
81
82   int imageSceneMode() const;
83   void setImageSceneMode(int mode);
84
85   int imageColorFilter() const;
86   void setImageColorFilter(int filter);
87
88   int imageWhiteBalance() const;
89   void setImageWhiteBalance(int wb);
90
91   qreal imageEvComp() const;
92   void setImageEvComp(qreal ev);
93
94   int videoSceneMode() const;
95   void setVideoSceneMode(int mode);
96
97   int videoColorFilter() const;
98   void setVideoColorFilter(int filter);
99
100   int videoWhiteBalance() const;
101   void setVideoWhiteBalance(int wb);
102
103   qreal videoEvComp() const;
104   void setVideoEvComp(qreal ev);
105
106   int imageFlashMode() const;
107   void setImageFlashMode(int mode);
108
109   int imageIso() const;
110   void setImageIso(int iso);
111
112   QString imageAspectRatio() const;
113   void setImageAspectRatio(const QString& aspectRatio);
114
115   QString imageResolution() const;
116   void setImageResolution(const QString& resolution);
117
118   QString videoAspectRatio() const;
119   void setVideoAspectRatio(const QString& aspectRatio);
120
121   QString videoResolution() const;
122   void setVideoResolution(const QString& resolution);
123
124   bool isSoundEnabled() const;
125   void setSoundEnabled(bool enabled);
126
127   bool isVideoTorchOn() const;
128   void setVideoTorchOn(bool on);
129
130   bool isToolBarShown() const;
131   void setToolBarShown(bool shown);
132
133   bool isVideoMuted() const;
134   void setVideoMuted(bool muted);
135
136   bool isGridEnabled() const;
137   void setGridEnabled(bool enabled);
138
139   bool isFaceDetectionEnabled() const;
140   void setFaceDetectionEnabled(bool enabled);
141
142 signals:
143   void modeChanged();
144   void creatorNameChanged();
145   void useGpsChanged();
146   void useGeotagsChanged();
147   void imageSceneModeChanged();
148   void imageColorFilterChanged();
149   void imageWhiteBalanceChanged();
150   void imageEvCompChanged();
151   void videoSceneModeChanged();
152   void videoColorFilterChanged();
153   void videoWhiteBalanceChanged();
154   void videoEvCompChanged();
155   void imageFlashModeChanged();
156   void imageIsoChanged();
157   void imageAspectRatioChanged();
158   void imageResolutionChanged();
159   void videoAspectRatioChanged();
160   void videoResolutionChanged();
161   void soundEnabledChanged();
162   void videoTorchOnChanged();
163   void toolBarShownChanged();
164   void videoMutedChanged();
165   void gridEnabledChanged();
166   void faceDetectionEnabledChanged();
167
168 private:
169   QSettings *m_settings;
170 };
171
172 #endif /* SETTINGS_H */