#ifndef CAMERA_H
#define CAMERA_H
-#include <QDeclarativeItem>
+#include <QObject>
#include <QVariant>
#include <QPointer>
class QtCamera;
class QtCamDevice;
-class QtCamGraphicsViewfinder;
-class DeclarativeQtCameraNotifications;
+class Sounds;
class NotificationsContainer;
class Zoom;
class Flash;
class VideoTorch;
class CameraConfig;
-class Camera : public QDeclarativeItem {
+class Camera : public QObject {
Q_OBJECT
Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
- Q_PROPERTY(DeclarativeQtCameraNotifications *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);
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);
// TODO: We need a setter here too.
Q_PROPERTY(CameraConfig *cameraConfig READ cameraConfig CONSTANT);
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;
QString imageSuffix() const;
QString videoSuffix() const;
- DeclarativeQtCameraNotifications *notifications() const;
- void setNotifications(DeclarativeQtCameraNotifications *notifications);
+ Sounds *sounds() const;
+ void setSounds(Sounds *sounds);
Zoom *zoom() const;
Flash *flash() const;
VideoMute *videoMute() const;
VideoTorch *videoTorch() const;
- QRectF renderArea() const;
- QSizeF videoResolution() const;
-
- bool isRenderingEnabled() const;
- void setRenderingEnabled(bool enabled);
-
CameraConfig *cameraConfig() const;
signals:
void idleStateChanged();
void runningStateChanged();
void error(const QString& message, int code, const QString& debug);
- void notificationsChanged();
+ void soundsChanged();
void renderAreaChanged();
void videoResolutionChanged();
void videoTorchChanged();
void renderingEnabledChanged();
- void cameraConfigChanged();
-
-protected:
- void geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry);
-
private:
bool applyMode();
bool setDeviceId(const QVariant& deviceId);
QtCamera *m_cam;
QtCamDevice *m_dev;
QVariant m_id;
- QtCamGraphicsViewfinder *m_vf;
CameraMode m_mode;
NotificationsContainer *m_notifications;