6 #include <QDeclarativeItem>
11 class QtCamGraphicsViewfinder;
13 class Camera : public QDeclarativeItem {
16 Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
17 Q_PROPERTY(QVariant deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged);
18 Q_PROPERTY(CameraMode mode READ mode WRITE setMode NOTIFY modeChanged);
19 Q_PROPERTY(bool idle READ isIdle NOTIFY idleStateChanged);
20 Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
21 Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
22 Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
31 Camera(QDeclarativeItem *parent = 0);
34 virtual void componentComplete();
36 int deviceCount() const;
37 Q_INVOKABLE QString deviceName(int index) const;
38 Q_INVOKABLE QVariant deviceId(int index) const;
40 void setDeviceId(const QVariant& id);
41 QVariant deviceId() const;
43 void setMode(const CameraMode& mode);
46 QtCamDevice *device() const;
48 Q_INVOKABLE bool start();
49 Q_INVOKABLE bool stop();
54 QString imageSuffix() const;
55 QString videoSuffix() const;
58 void deviceCountChanged();
59 void deviceIdChanged();
62 void idleStateChanged();
63 void runningStateChanged();
66 void geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry);
74 QtCamGraphicsViewfinder *m_vf;