Initial implementation
[harmattan/cameraplus] / lib / qtcamviewfinderrenderer.h
1 // -*- c++ -*-
2
3 #ifndef QT_CAM_VIEWFINDER_RENDERER_H
4 #define QT_CAM_VIEWFINDER_RENDERER_H
5
6 #include <QObject>
7 #include <gst/gst.h>
8
9 class QtCamConfig;
10 class QMetaObject;
11 class QPainter;
12 class QSizeF;
13
14 class QtCamViewfinderRenderer : public QObject {
15   Q_OBJECT
16
17 public:
18   static QtCamViewfinderRenderer *create(QtCamConfig *config, QObject *parent = 0);
19   static int registerRenderer(const QString& key, const QMetaObject& meta);
20
21   virtual ~QtCamViewfinderRenderer();
22
23   virtual void paint(QPainter *painter) = 0;
24   virtual void resize(const QSizeF& size) = 0;
25   virtual void reset() = 0;
26   virtual GstElement *sinkElement() = 0;
27
28 protected:
29   QtCamViewfinderRenderer(QtCamConfig *config, QObject *parent = 0);
30
31 signals:
32   void updateRequested();
33 };
34
35 #define QT_CAM_VIEWFINDER_RENDERER(key, klass) \
36 static int klass_seq = QtCamViewfinderRenderer::registerRenderer(key, klass::staticMetaObject)
37
38 #endif /* QT_CAM_VIEWFINDER_RENDERER_H */