Corrected video recording resolution for front camera
[harmattan/cameraplus] / src / settings.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 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 primaryImageAspectRatio READ primaryImageAspectRatio WRITE setPrimaryImageAspectRatio NOTIFY primaryImageAspectRatioChanged);
51   Q_PROPERTY(QString primaryImageResolution READ primaryImageResolution WRITE setPrimaryImageResolution NOTIFY primaryImageResolutionChanged);
52   Q_PROPERTY(QString primaryVideoAspectRatio READ primaryVideoAspectRatio WRITE setPrimaryVideoAspectRatio NOTIFY primaryVideoAspectRatioChanged);
53   Q_PROPERTY(QString primaryVideoResolution READ primaryVideoResolution WRITE setPrimaryVideoResolution NOTIFY primaryVideoResolutionChanged);
54   Q_PROPERTY(QString secondaryImageAspectRatio READ secondaryImageAspectRatio WRITE setSecondaryImageAspectRatio NOTIFY secondaryImageAspectRatioChanged);
55   Q_PROPERTY(QString secondaryImageResolution READ secondaryImageResolution WRITE setSecondaryImageResolution NOTIFY secondaryImageResolutionChanged);
56   Q_PROPERTY(QString secondaryVideoAspectRatio READ secondaryVideoAspectRatio WRITE setSecondaryVideoAspectRatio NOTIFY secondaryVideoAspectRatioChanged);
57   Q_PROPERTY(QString secondaryVideoResolution READ secondaryVideoResolution WRITE setSecondaryVideoResolution NOTIFY secondaryVideoResolutionChanged);
58
59   Q_PROPERTY(bool soundEnabled READ isSoundEnabled WRITE setSoundEnabled NOTIFY soundEnabledChanged);
60   Q_PROPERTY(bool videoTorchOn READ isVideoTorchOn WRITE setVideoTorchOn NOTIFY videoTorchOnChanged);
61
62   Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
63   Q_PROPERTY(bool videoMuted READ isVideoMuted WRITE setVideoMuted NOTIFY videoMutedChanged);
64
65   Q_PROPERTY(bool gridEnabled READ isGridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged);
66
67   Q_PROPERTY(bool faceDetectionEnabled READ isFaceDetectionEnabled WRITE setFaceDetectionEnabled NOTIFY faceDetectionEnabledChanged);
68   Q_PROPERTY(bool zoomAsShutter READ isZoomAsShutterEnabled WRITE setZoomAsShutterEnabled NOTIFY zoomAsShutterChanged);
69   Q_PROPERTY(int device READ device WRITE setDevice NOTIFY deviceChanged);
70
71 public:
72   Settings(QObject *parent = 0);
73   ~Settings();
74
75   int mode() const;
76   void setMode(int mode);
77
78   QString creatorName() const;
79   void setCreatorName(const QString& name);
80
81   bool useGps() const;
82   void setUseGps(bool enable);
83
84   bool useGeotags() const;
85   void setUseGeotags(bool enable);
86
87   int imageSceneMode() const;
88   void setImageSceneMode(int mode);
89
90   int imageColorFilter() const;
91   void setImageColorFilter(int filter);
92
93   int imageWhiteBalance() const;
94   void setImageWhiteBalance(int wb);
95
96   qreal imageEvComp() const;
97   void setImageEvComp(qreal ev);
98
99   int videoSceneMode() const;
100   void setVideoSceneMode(int mode);
101
102   int videoColorFilter() const;
103   void setVideoColorFilter(int filter);
104
105   int videoWhiteBalance() const;
106   void setVideoWhiteBalance(int wb);
107
108   qreal videoEvComp() const;
109   void setVideoEvComp(qreal ev);
110
111   int imageFlashMode() const;
112   void setImageFlashMode(int mode);
113
114   int imageIso() const;
115   void setImageIso(int iso);
116
117   bool isSoundEnabled() const;
118   void setSoundEnabled(bool enabled);
119
120   bool isVideoTorchOn() const;
121   void setVideoTorchOn(bool on);
122
123   bool isToolBarShown() const;
124   void setToolBarShown(bool shown);
125
126   bool isVideoMuted() const;
127   void setVideoMuted(bool muted);
128
129   bool isGridEnabled() const;
130   void setGridEnabled(bool enabled);
131
132   bool isFaceDetectionEnabled() const;
133   void setFaceDetectionEnabled(bool enabled);
134
135   bool isZoomAsShutterEnabled();
136   void setZoomAsShutterEnabled(bool enabled);
137
138   int device() const;
139   void setDevice(int device);
140
141   QString primaryImageAspectRatio() const;
142   void setPrimaryImageAspectRatio(const QString& aspectRatio);
143
144   QString primaryImageResolution() const;
145   void setPrimaryImageResolution(const QString& resolution);
146
147   QString primaryVideoAspectRatio() const;
148   void setPrimaryVideoAspectRatio(const QString& aspectRatio);
149
150   QString primaryVideoResolution() const;
151   void setPrimaryVideoResolution(const QString& resolution);
152
153   QString secondaryImageAspectRatio() const;
154   void setSecondaryImageAspectRatio(const QString& aspectRatio);
155
156   QString secondaryImageResolution() const;
157   void setSecondaryImageResolution(const QString& resolution);
158
159   QString secondaryVideoAspectRatio() const;
160   void setSecondaryVideoAspectRatio(const QString& aspectRatio);
161
162   QString secondaryVideoResolution() const;
163   void setSecondaryVideoResolution(const QString& resolution);
164
165 signals:
166   void modeChanged();
167   void creatorNameChanged();
168   void useGpsChanged();
169   void useGeotagsChanged();
170   void imageSceneModeChanged();
171   void imageColorFilterChanged();
172   void imageWhiteBalanceChanged();
173   void imageEvCompChanged();
174   void videoSceneModeChanged();
175   void videoColorFilterChanged();
176   void videoWhiteBalanceChanged();
177   void videoEvCompChanged();
178   void imageFlashModeChanged();
179   void imageIsoChanged();
180   void soundEnabledChanged();
181   void videoTorchOnChanged();
182   void toolBarShownChanged();
183   void videoMutedChanged();
184   void gridEnabledChanged();
185   void faceDetectionEnabledChanged();
186   void zoomAsShutterChanged();
187   void deviceChanged();
188   void primaryImageAspectRatioChanged();
189   void primaryImageResolutionChanged();
190   void primaryVideoAspectRatioChanged();
191   void primaryVideoResolutionChanged();
192   void secondaryImageAspectRatioChanged();
193   void secondaryImageResolutionChanged();
194   void secondaryVideoAspectRatioChanged();
195   void secondaryVideoResolutionChanged();
196
197 private:
198   QSettings *m_settings;
199 };
200
201 #endif /* SETTINGS_H */