X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=declarative%2Fcamera.h;h=76ad87847d25c60ee70a4f9b3c131f42925da271;hb=4c3b8980bafd3d1607ebec45556ef3f49db955b5;hp=d34b7edc2f157926462f639930b895f186544769;hpb=f8861ec5a342457760b9e767ac90e6524917ad87;p=harmattan%2Fcameraplus diff --git a/declarative/camera.h b/declarative/camera.h index d34b7ed..76ad878 100644 --- a/declarative/camera.h +++ b/declarative/camera.h @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,14 +23,13 @@ #ifndef CAMERA_H #define CAMERA_H -#include +#include #include #include 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 */