Added a setting to use zoom keys for capturing. Still non functional
[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 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   Q_PROPERTY(bool zoomAsShutter READ isZoomAsShutterEnabled WRITE setZoomAsShutterEnabled NOTIFY zoomAsShutterChanged);
66
67 public:
68   Settings(QObject *parent = 0);
69   ~Settings();
70
71   int mode() const;
72   void setMode(int mode);
73
74   QString creatorName() const;
75   void setCreatorName(const QString& name);
76
77   bool useGps() const;
78   void setUseGps(bool enable);
79
80   bool useGeotags() const;
81   void setUseGeotags(bool enable);
82
83   int imageSceneMode() const;
84   void setImageSceneMode(int mode);
85
86   int imageColorFilter() const;
87   void setImageColorFilter(int filter);
88
89   int imageWhiteBalance() const;
90   void setImageWhiteBalance(int wb);
91
92   qreal imageEvComp() const;
93   void setImageEvComp(qreal ev);
94
95   int videoSceneMode() const;
96   void setVideoSceneMode(int mode);
97
98   int videoColorFilter() const;
99   void setVideoColorFilter(int filter);
100
101   int videoWhiteBalance() const;
102   void setVideoWhiteBalance(int wb);
103
104   qreal videoEvComp() const;
105   void setVideoEvComp(qreal ev);
106
107   int imageFlashMode() const;
108   void setImageFlashMode(int mode);
109
110   int imageIso() const;
111   void setImageIso(int iso);
112
113   QString imageAspectRatio() const;
114   void setImageAspectRatio(const QString& aspectRatio);
115
116   QString imageResolution() const;
117   void setImageResolution(const QString& resolution);
118
119   QString videoAspectRatio() const;
120   void setVideoAspectRatio(const QString& aspectRatio);
121
122   QString videoResolution() const;
123   void setVideoResolution(const QString& resolution);
124
125   bool isSoundEnabled() const;
126   void setSoundEnabled(bool enabled);
127
128   bool isVideoTorchOn() const;
129   void setVideoTorchOn(bool on);
130
131   bool isToolBarShown() const;
132   void setToolBarShown(bool shown);
133
134   bool isVideoMuted() const;
135   void setVideoMuted(bool muted);
136
137   bool isGridEnabled() const;
138   void setGridEnabled(bool enabled);
139
140   bool isFaceDetectionEnabled() const;
141   void setFaceDetectionEnabled(bool enabled);
142
143   bool isZoomAsShutterEnabled();
144   void setZoomAsShutterEnabled(bool enabled);
145
146 signals:
147   void modeChanged();
148   void creatorNameChanged();
149   void useGpsChanged();
150   void useGeotagsChanged();
151   void imageSceneModeChanged();
152   void imageColorFilterChanged();
153   void imageWhiteBalanceChanged();
154   void imageEvCompChanged();
155   void videoSceneModeChanged();
156   void videoColorFilterChanged();
157   void videoWhiteBalanceChanged();
158   void videoEvCompChanged();
159   void imageFlashModeChanged();
160   void imageIsoChanged();
161   void imageAspectRatioChanged();
162   void imageResolutionChanged();
163   void videoAspectRatioChanged();
164   void videoResolutionChanged();
165   void soundEnabledChanged();
166   void videoTorchOnChanged();
167   void toolBarShownChanged();
168   void videoMutedChanged();
169   void gridEnabledChanged();
170   void faceDetectionEnabledChanged();
171   void zoomAsShutterChanged();
172
173 private:
174   QSettings *m_settings;
175 };
176
177 #endif /* SETTINGS_H */