Changelog for 0.0.8
[harmattan/cameraplus] / declarative / camera.h
index d34b7ed..76ad878 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
 #ifndef CAMERA_H
 #define CAMERA_H
 
-#include <QDeclarativeItem>
+#include <QObject>
 #include <QVariant>
 #include <QPointer>
 
 class QtCamera;
 class QtCamDevice;
-class QtCamGraphicsViewfinder;
-class Notifications;
+class Sounds;
 class NotificationsContainer;
 class Zoom;
 class Flash;
@@ -45,10 +44,13 @@ class NoiseReduction;
 class FlickerReduction;
 class Focus;
 class AutoFocus;
+class Roi;
 class VideoMute;
 class VideoTorch;
+class CameraConfig;
+class Quirks;
 
-class Camera : public QDeclarativeItem {
+class Camera : public QObject {
   Q_OBJECT
 
   Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
@@ -58,10 +60,7 @@ class Camera : public QDeclarativeItem {
   Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
   Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
   Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
-  Q_PROPERTY(Notifications *notifications READ notifications WRITE setNotifications NOTIFY notificationsChanged);
-
-  Q_PROPERTY(QRectF renderArea READ renderArea NOTIFY renderAreaChanged);
-  Q_PROPERTY(QSizeF videoResolution READ videoResolution NOTIFY videoResolutionChanged);
+  Q_PROPERTY(Sounds *sounds READ sounds WRITE setSounds NOTIFY soundsChanged);
 
   Q_PROPERTY(Zoom *zoom READ zoom NOTIFY zoomChanged);
   Q_PROPERTY(Flash *flash READ flash NOTIFY flashChanged);
@@ -76,11 +75,15 @@ class Camera : public QDeclarativeItem {
   Q_PROPERTY(FlickerReduction *flickerReduction READ flickerReduction NOTIFY flickerReductionChanged);
   Q_PROPERTY(Focus *focus READ focus NOTIFY focusChanged);
   Q_PROPERTY(AutoFocus *autoFocus READ autoFocus NOTIFY autoFocusChanged);
+  Q_PROPERTY(Roi *roi READ roi NOTIFY roiChanged);
 
   Q_PROPERTY(VideoMute *videoMute READ videoMute NOTIFY videoMuteChanged);
   Q_PROPERTY(VideoTorch *videoTorch READ videoTorch NOTIFY videoTorchChanged);
 
-  Q_PROPERTY(bool renderingEnabled READ isRenderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged);
+  Q_PROPERTY(Quirks *quirks READ quirks NOTIFY quirksChanged);
+
+  // TODO: We need a setter here too.
+  Q_PROPERTY(CameraConfig *cameraConfig READ cameraConfig CONSTANT);
 
   Q_ENUMS(CameraMode);
 
@@ -91,11 +94,9 @@ public:
     VideoMode
   } CameraMode;
 
-  Camera(QDeclarativeItem *parent = 0);
+  Camera(QObject *parent = 0);
   ~Camera();
 
-  virtual void componentComplete();
-
   int deviceCount() const;
   Q_INVOKABLE QString deviceName(int index) const;
   Q_INVOKABLE QVariant deviceId(int index) const;
@@ -117,8 +118,8 @@ public:
   QString imageSuffix() const;
   QString videoSuffix() const;
 
-  Notifications *notifications() const;
-  void setNotifications(Notifications *notifications);
+  Sounds *sounds() const;
+  void setSounds(Sounds *sounds);
 
   Zoom *zoom() const;
   Flash *flash() const;
@@ -133,25 +134,25 @@ public:
   FlickerReduction *flickerReduction() const;
   Focus *focus() const;
   AutoFocus *autoFocus() const;
+  Roi *roi() const;
 
   VideoMute *videoMute() const;
   VideoTorch *videoTorch() const;
 
-  QRectF renderArea() const;
-  QSizeF videoResolution() const;
+  Quirks *quirks() const;
 
-  bool isRenderingEnabled() const;
-  void setRenderingEnabled(bool enabled);
+  CameraConfig *cameraConfig() const;
 
 signals:
   void deviceCountChanged();
   void deviceIdChanged();
+  void prepareForDeviceChange();
   void deviceChanged();
   void modeChanged();
   void idleStateChanged();
   void runningStateChanged();
   void error(const QString& message, int code, const QString& debug);
-  void notificationsChanged();
+  void soundsChanged();
   void renderAreaChanged();
   void videoResolutionChanged();
 
@@ -168,13 +169,12 @@ signals:
   void flickerReductionChanged();
   void focusChanged();
   void autoFocusChanged();
+  void roiChanged();
 
   void videoMuteChanged();
   void videoTorchChanged();
   void renderingEnabledChanged();
-
-protected:
-  void geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry);
+  void quirksChanged();
 
 private:
   bool applyMode();
@@ -186,7 +186,6 @@ private:
   QtCamera *m_cam;
   QtCamDevice *m_dev;
   QVariant m_id;
-  QtCamGraphicsViewfinder *m_vf;
   CameraMode m_mode;
   NotificationsContainer *m_notifications;
 
@@ -203,9 +202,12 @@ private:
   FlickerReduction *m_flickerReduction;
   Focus *m_focus;
   AutoFocus *m_autoFocus;
+  Roi *m_roi;
 
   VideoMute *m_videoMute;
   VideoTorch *m_videoTorch;
+  CameraConfig *m_config;
+  Quirks *m_quirks;
 };
 
 #endif /* CAMERA_H */