Added a floating toolbar to be used instead of the top left buttons.
[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   Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
61
62 public:
63   Settings(QObject *parent = 0);
64   ~Settings();
65
66   int mode() const;
67   void setMode(int mode);
68
69   QString creatorName() const;
70   void setCreatorName(const QString& name);
71
72   int postCaptureTimeout() const;
73   void setPostCaptureTimeout(int timeout);
74
75   bool useGps() const;
76   void setUseGps(bool enable);
77
78   bool useGeotags() const;
79   void setUseGeotags(bool enable);
80
81   int imageSceneMode() const;
82   void setImageSceneMode(int mode);
83
84   int imageColorFilter() const;
85   void setImageColorFilter(int filter);
86
87   int imageWhiteBalance() const;
88   void setImageWhiteBalance(int wb);
89
90   qreal imageEvComp() const;
91   void setImageEvComp(qreal ev);
92
93   int videoSceneMode() const;
94   void setVideoSceneMode(int mode);
95
96   int videoColorFilter() const;
97   void setVideoColorFilter(int filter);
98
99   int videoWhiteBalance() const;
100   void setVideoWhiteBalance(int wb);
101
102   qreal videoEvComp() const;
103   void setVideoEvComp(qreal ev);
104
105   int imageFlashMode() const;
106   void setImageFlashMode(int mode);
107
108   int imageIso() const;
109   void setImageIso(int iso);
110
111   QString imageAspectRatio() const;
112   void setImageAspectRatio(const QString& aspectRatio);
113
114   QString imageResolution() const;
115   void setImageResolution(const QString& resolution);
116
117   QString videoAspectRatio() const;
118   void setVideoAspectRatio(const QString& aspectRatio);
119
120   QString videoResolution() const;
121   void setVideoResolution(const QString& resolution);
122
123   bool isSoundEnabled() const;
124   void setSoundEnabled(bool enabled);
125
126   bool isVideoTorchOn() const;
127   void setVideoTorchOn(bool on);
128
129   bool isToolBarShown() const;
130   void setToolBarShown(bool shown);
131
132 signals:
133   void modeChanged();
134   void creatorNameChanged();
135   void postCaptureTimeoutChanged();
136   void useGpsChanged();
137   void useGeotagsChanged();
138   void imageSceneModeChanged();
139   void imageColorFilterChanged();
140   void imageWhiteBalanceChanged();
141   void imageEvCompChanged();
142   void videoSceneModeChanged();
143   void videoColorFilterChanged();
144   void videoWhiteBalanceChanged();
145   void videoEvCompChanged();
146   void imageFlashModeChanged();
147   void imageIsoChanged();
148   void imageAspectRatioChanged();
149   void imageResolutionChanged();
150   void videoAspectRatioChanged();
151   void videoResolutionChanged();
152   void soundEnabledChanged();
153   void videoTorchOnChanged();
154   void toolBarShownChanged();
155
156 private:
157   QSettings *m_settings;
158 };
159
160 #endif /* SETTINGS_H */