59d7421e342ee381dc0860132f039832f0c3f5ac
[harmattan/cameraplus] / lib / qtcamdevice.h
1 // -*- c++ -*-
2
3 #ifndef QT_CAM_DEVICE_H
4 #define QT_CAM_DEVICE_H
5
6 #include <QObject>
7 #include <QVariant>
8
9 class QtCamDevicePrivate;
10 class QtCamConfig;
11 class QtCamViewfinder;
12 class QtCamVideoMode;
13 class QtCamImageMode;
14 class QtCamMode;
15 class QtCamGStreamerMessageListener;
16 class QtCamMetaData;
17
18 class QtCamDevice : public QObject {
19   Q_OBJECT
20
21 public:
22   QtCamDevice(QtCamConfig *config, const QString& name, const QVariant& id, QObject *parent = 0);
23   ~QtCamDevice();
24
25   bool setViewfinder(QtCamViewfinder *viewfinder);
26   bool start();
27   bool stop();
28   bool isRunning();
29   bool isIdle();
30
31   QtCamImageMode *imageMode() const;
32   QtCamVideoMode *videoMode() const;
33
34   QtCamMode *activeMode() const;
35
36   QString name() const;
37   QVariant id() const;
38
39   QtCamConfig *config() const;
40   QtCamGStreamerMessageListener *listener() const;
41
42 signals:
43   void error(const QString& message, int code, const QString& debug);
44   void started();
45   void stopped();
46
47 private:
48   Q_PRIVATE_SLOT(d_ptr, void _d_error(const QString&, int, const QString&))
49   friend class QtCamMetaData;
50   QtCamDevicePrivate *d_ptr;
51 };
52
53 #endif /* QT_CAM_DEVICE_H */