68407c60b4a2950fdd5a0de67e59ea720f7ae071
[harmattan/cameraplus] / lib / qtcammode.h
1 // -*- c++ -*-
2
3 #ifndef QT_CAM_MODE_H
4 #define QT_CAM_MODE_H
5
6 #include <QObject>
7 #include <QPair>
8
9 class QtCamModePrivate;
10 class QtCamDevicePrivate;
11 class QSize;
12 class QImage;
13 class QtCamDevice;
14
15 class QtCamMode : public QObject {
16   Q_OBJECT
17
18   Q_PROPERTY(bool canCapture READ canCapture NOTIFY canCaptureChanged);
19   Q_PROPERTY(bool active READ isActive NOTIFY activeChanged);
20
21 public:
22   QtCamMode(QtCamModePrivate *d, const char *mode, const char *done, QObject *parent = 0);
23   virtual ~QtCamMode();
24
25   void deactivate();
26
27   virtual bool canCapture();
28
29   bool isActive();
30
31   virtual void applySettings() = 0;
32
33   QtCamDevice *device() const;
34
35 public slots:
36   void activate();
37
38 signals:
39   void previewAvailable(const QImage& image, const QString& fileName);
40   void saved(const QString& fileName);
41   void canCaptureChanged();
42   void activeChanged();
43
44 protected:
45   virtual void start() = 0;
46   virtual void stop() = 0;
47
48   // TODO: move this from here
49   void setPreviewSize(const QSize& size);
50
51   // TODO: move this from here
52   void setFileName(const QString& fileName);
53
54   QtCamModePrivate *d_ptr;
55 };
56
57 #endif /* QT_CAM_MODE_H */