Aperture capability
[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
14 class QtCamMode : public QObject {
15   Q_OBJECT
16
17   Q_PROPERTY(bool canCapture READ canCapture NOTIFY canCaptureChanged);
18   Q_PROPERTY(bool active READ isActive NOTIFY activeChanged);
19
20 public:
21   QtCamMode(QtCamModePrivate *d, const char *mode, const char *done, QObject *parent = 0);
22   virtual ~QtCamMode();
23
24   void deactivate();
25
26   virtual bool canCapture();
27
28   bool isActive();
29
30   virtual void applySettings() = 0;
31
32 public slots:
33   void activate();
34
35 signals:
36   void previewAvailable(const QImage& image, const QString& fileName);
37   void saved(const QString& fileName);
38   void canCaptureChanged();
39   void activeChanged();
40
41 protected:
42   virtual void start() = 0;
43   virtual void stop() = 0;
44
45   // TODO: move this from here
46   void setPreviewSize(const QSize& size);
47
48   // TODO: move this from here
49   void setFileName(const QString& fileName);
50
51   QtCamModePrivate *d_ptr;
52 };
53
54 #endif /* QT_CAM_MODE_H */