4ccafc06cfec21739e45ee6e63892b087de7eed5
[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(int postCaptureTimeout READ postCaptureTimeout WRITE setPostCaptureTimeout NOTIFY postCaptureTimeoutChanged);
36   Q_PROPERTY(bool useGps READ useGps WRITE setUseGps NOTIFY useGpsChanged);
37   Q_PROPERTY(bool useGeotags READ useGeotags WRITE setUseGeotags NOTIFY useGeotagsChanged);
38   Q_PROPERTY(int imageSceneMode READ imageSceneMode WRITE setImageSceneMode NOTIFY imageSceneModeChanged);
39   Q_PROPERTY(int imageColorFilter READ imageColorFilter WRITE setImageColorFilter NOTIFY imageColorFilterChanged);
40   Q_PROPERTY(int imageWhiteBalance READ imageWhiteBalance WRITE setImageWhiteBalance NOTIFY imageWhiteBalanceChanged);
41   Q_PROPERTY(qreal imageEvComp READ imageEvComp WRITE setImageEvComp NOTIFY imageEvCompChanged);
42
43   Q_PROPERTY(int videoSceneMode READ videoSceneMode WRITE setVideoSceneMode NOTIFY videoSceneModeChanged);
44   Q_PROPERTY(int videoColorFilter READ videoColorFilter WRITE setVideoColorFilter NOTIFY videoColorFilterChanged);
45   Q_PROPERTY(int videoWhiteBalance READ videoWhiteBalance WRITE setVideoWhiteBalance NOTIFY videoWhiteBalanceChanged);
46   Q_PROPERTY(qreal videoEvComp READ videoEvComp WRITE setVideoEvComp NOTIFY videoEvCompChanged);
47
48   Q_PROPERTY(int imageFlashMode READ imageFlashMode WRITE setImageFlashMode NOTIFY imageFlashModeChanged);
49   Q_PROPERTY(int imageIso READ imageIso WRITE setImageIso NOTIFY imageIsoChanged);
50
51   Q_PROPERTY(QString imageAspectRatio READ imageAspectRatio WRITE setImageAspectRatio NOTIFY imageAspectRatioChanged);
52   Q_PROPERTY(QString imageResolution READ imageResolution WRITE setImageResolution NOTIFY imageResolutionChanged);
53
54   Q_PROPERTY(QString videoAspectRatio READ videoAspectRatio WRITE setVideoAspectRatio NOTIFY videoAspectRatioChanged);
55   Q_PROPERTY(QString videoResolution READ videoResolution WRITE setVideoResolution NOTIFY videoResolutionChanged);
56
57   Q_PROPERTY(bool soundEnabled READ isSoundEnabled WRITE setSoundEnabled NOTIFY soundEnabledChanged);
58   Q_PROPERTY(bool videoTorchOn READ isVideoTorchOn WRITE setVideoTorchOn NOTIFY videoTorchOnChanged);
59
60 public:
61   Settings(QObject *parent = 0);
62   ~Settings();
63
64   int mode() const;
65   void setMode(int mode);
66
67   QString creatorName() const;
68   void setCreatorName(const QString& name);
69
70   int postCaptureTimeout() const;
71   void setPostCaptureTimeout(int timeout);
72
73   bool useGps() const;
74   void setUseGps(bool enable);
75
76   bool useGeotags() const;
77   void setUseGeotags(bool enable);
78
79   int imageSceneMode() const;
80   void setImageSceneMode(int mode);
81
82   int imageColorFilter() const;
83   void setImageColorFilter(int filter);
84
85   int imageWhiteBalance() const;
86   void setImageWhiteBalance(int wb);
87
88   qreal imageEvComp() const;
89   void setImageEvComp(qreal ev);
90
91   int videoSceneMode() const;
92   void setVideoSceneMode(int mode);
93
94   int videoColorFilter() const;
95   void setVideoColorFilter(int filter);
96
97   int videoWhiteBalance() const;
98   void setVideoWhiteBalance(int wb);
99
100   qreal videoEvComp() const;
101   void setVideoEvComp(qreal ev);
102
103   int imageFlashMode() const;
104   void setImageFlashMode(int mode);
105
106   int imageIso() const;
107   void setImageIso(int iso);
108
109   QString imageAspectRatio() const;
110   void setImageAspectRatio(const QString& aspectRatio);
111
112   QString imageResolution() const;
113   void setImageResolution(const QString& resolution);
114
115   QString videoAspectRatio() const;
116   void setVideoAspectRatio(const QString& aspectRatio);
117
118   QString videoResolution() const;
119   void setVideoResolution(const QString& resolution);
120
121   bool isSoundEnabled() const;
122   void setSoundEnabled(bool enabled);
123
124   bool isVideoTorchOn() const;
125   void setVideoTorchOn(bool on);
126
127 signals:
128   void modeChanged();
129   void creatorNameChanged();
130   void postCaptureTimeoutChanged();
131   void useGpsChanged();
132   void useGeotagsChanged();
133   void imageSceneModeChanged();
134   void imageColorFilterChanged();
135   void imageWhiteBalanceChanged();
136   void imageEvCompChanged();
137   void videoSceneModeChanged();
138   void videoColorFilterChanged();
139   void videoWhiteBalanceChanged();
140   void videoEvCompChanged();
141   void imageFlashModeChanged();
142   void imageIsoChanged();
143   void imageAspectRatioChanged();
144   void imageResolutionChanged();
145   void videoAspectRatioChanged();
146   void videoResolutionChanged();
147   void soundEnabledChanged();
148   void videoTorchOnChanged();
149
150 private:
151   QSettings *m_settings;
152 };
153
154 #endif /* SETTINGS_H */