Added copyright headers and COPYING file.
[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 public:
52   Settings(QObject *parent = 0);
53   ~Settings();
54
55   int mode() const;
56   void setMode(int mode);
57
58   QString creatorName() const;
59   void setCreatorName(const QString& name);
60
61   int postCaptureTimeout() const;
62   void setPostCaptureTimeout(int timeout);
63
64   bool useGps() const;
65   void setUseGps(bool enable);
66
67   bool useGeotags() const;
68   void setUseGeotags(bool enable);
69
70   int imageSceneMode() const;
71   void setImageSceneMode(int mode);
72
73   int imageColorFilter() const;
74   void setImageColorFilter(int filter);
75
76   int imageWhiteBalance() const;
77   void setImageWhiteBalance(int wb);
78
79   qreal imageEvComp() const;
80   void setImageEvComp(qreal ev);
81
82   int videoSceneMode() const;
83   void setVideoSceneMode(int mode);
84
85   int videoColorFilter() const;
86   void setVideoColorFilter(int filter);
87
88   int videoWhiteBalance() const;
89   void setVideoWhiteBalance(int wb);
90
91   qreal videoEvComp() const;
92   void setVideoEvComp(qreal ev);
93
94   int imageFlashMode() const;
95   void setImageFlashMode(int mode);
96
97   int imageIso() const;
98   void setImageIso(int iso);
99
100 signals:
101   void modeChanged();
102   void creatorNameChanged();
103   void postCaptureTimeoutChanged();
104   void useGpsChanged();
105   void useGeotagsChanged();
106   void imageSceneModeChanged();
107   void imageColorFilterChanged();
108   void imageWhiteBalanceChanged();
109   void imageEvCompChanged();
110   void videoSceneModeChanged();
111   void videoColorFilterChanged();
112   void videoWhiteBalanceChanged();
113   void videoEvCompChanged();
114   void imageFlashModeChanged();
115   void imageIsoChanged();
116
117 private:
118   QSettings *m_settings;
119 };
120
121 #endif /* SETTINGS_H */