Handle the case when we have different paths for videos and images
[harmattan/cameraplus] / src / settings.h
index c32908e..b08a057 100644 (file)
@@ -3,7 +3,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
 #include <QObject>
 
 class QSettings;
+class DeviceSettings;
 
 class Settings : public QObject {
   Q_OBJECT
@@ -59,6 +60,13 @@ class Settings : public QObject {
   Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
   Q_PROPERTY(bool videoMuted READ isVideoMuted WRITE setVideoMuted NOTIFY videoMutedChanged);
 
+  Q_PROPERTY(bool gridEnabled READ isGridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged);
+
+  Q_PROPERTY(bool faceDetectionEnabled READ isFaceDetectionEnabled WRITE setFaceDetectionEnabled NOTIFY faceDetectionEnabledChanged);
+  Q_PROPERTY(bool zoomAsShutter READ isZoomAsShutterEnabled WRITE setZoomAsShutterEnabled NOTIFY zoomAsShutterChanged);
+  Q_PROPERTY(bool proximityAsShutter READ isProximityAsShutterEnabled WRITE setProximityAsShutterEnabled NOTIFY proximityAsShutterChanged);
+  Q_PROPERTY(int device READ device WRITE setDevice NOTIFY deviceChanged);
+
 public:
   Settings(QObject *parent = 0);
   ~Settings();
@@ -75,52 +83,52 @@ public:
   bool useGeotags() const;
   void setUseGeotags(bool enable);
 
-  int imageSceneMode() const;
+  int imageSceneMode();
   void setImageSceneMode(int mode);
 
-  int imageColorFilter() const;
+  int imageColorFilter();
   void setImageColorFilter(int filter);
 
-  int imageWhiteBalance() const;
+  int imageWhiteBalance();
   void setImageWhiteBalance(int wb);
 
-  qreal imageEvComp() const;
+  qreal imageEvComp();
   void setImageEvComp(qreal ev);
 
-  int videoSceneMode() const;
+  int videoSceneMode();
   void setVideoSceneMode(int mode);
 
-  int videoColorFilter() const;
+  int videoColorFilter();
   void setVideoColorFilter(int filter);
 
-  int videoWhiteBalance() const;
+  int videoWhiteBalance();
   void setVideoWhiteBalance(int wb);
 
-  qreal videoEvComp() const;
+  qreal videoEvComp();
   void setVideoEvComp(qreal ev);
 
-  int imageFlashMode() const;
+  int imageFlashMode();
   void setImageFlashMode(int mode);
 
-  int imageIso() const;
+  int imageIso();
   void setImageIso(int iso);
 
-  QString imageAspectRatio() const;
+  QString imageAspectRatio();
   void setImageAspectRatio(const QString& aspectRatio);
 
-  QString imageResolution() const;
+  QString imageResolution();
   void setImageResolution(const QString& resolution);
 
-  QString videoAspectRatio() const;
+  QString videoAspectRatio();
   void setVideoAspectRatio(const QString& aspectRatio);
 
-  QString videoResolution() const;
+  QString videoResolution();
   void setVideoResolution(const QString& resolution);
 
   bool isSoundEnabled() const;
   void setSoundEnabled(bool enabled);
 
-  bool isVideoTorchOn() const;
+  bool isVideoTorchOn();
   void setVideoTorchOn(bool on);
 
   bool isToolBarShown() const;
@@ -129,6 +137,27 @@ public:
   bool isVideoMuted() const;
   void setVideoMuted(bool muted);
 
+  bool isGridEnabled() const;
+  void setGridEnabled(bool enabled);
+
+  bool isFaceDetectionEnabled() const;
+  void setFaceDetectionEnabled(bool enabled);
+
+  bool isZoomAsShutterEnabled() const;
+  void setZoomAsShutterEnabled(bool enabled);
+
+  bool isProximityAsShutterEnabled() const;
+  void setProximityAsShutterEnabled(bool enabled);
+
+  int device() const;
+  void setDevice(int device);
+
+  QString fileNamingStamp(const QString& id) const;
+  void setFileNamingStamp(const QString& id, const QString& stamp);
+
+  int fileNamingCounter(const QString& id) const;
+  void setFileNamingCounter(const QString& id, int counter);
+
 signals:
   void modeChanged();
   void creatorNameChanged();
@@ -152,9 +181,20 @@ signals:
   void videoTorchOnChanged();
   void toolBarShownChanged();
   void videoMutedChanged();
+  void gridEnabledChanged();
+  void faceDetectionEnabledChanged();
+  void zoomAsShutterChanged();
+  void proximityAsShutterChanged();
+  void deviceAboutToChange();
+  void deviceChanged();
 
 private:
+  DeviceSettings *deviceSettings();
+  QVariant deviceValue(const char *key, const QVariant& defaultValue);
+  void setDeviceValue(const char *key, const QVariant& value);
+
   QSettings *m_settings;
+  DeviceSettings *m_device;
 };
 
 #endif /* SETTINGS_H */