Reset pipeline manager error and try to start camera device when device gets changed
[harmattan/cameraplus] / declarative / cameraconfig.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 #ifndef CAMERA_CONFIG_H
24 #define CAMERA_CONFIG_H
25
26 #include <QObject>
27 #if defined(QT4)
28 #include <QDeclarativeParserStatus>
29 #elif defined(QT5)
30 #include <QQmlParserStatus>
31 #endif
32
33 class QtCamConfig;
34
35 #if defined(QT4)
36 class CameraConfig : public QObject, public QDeclarativeParserStatus {
37 #elif defined(QT5)
38 class CameraConfig : public QObject, public QQmlParserStatus {
39 #endif
40
41   Q_OBJECT
42
43   Q_PROPERTY(QString configPath READ configPath WRITE setConfigPath NOTIFY configPathChanged);
44
45 public:
46   CameraConfig(QObject *parent = 0);
47   ~CameraConfig();
48
49   QString configPath() const;
50   void setConfigPath(const QString& configPath);
51
52   QtCamConfig *config() const;
53
54   virtual void classBegin();
55   virtual void componentComplete();
56
57 signals:
58   void configPathChanged();
59
60 private:
61   QString m_path;
62   QtCamConfig *m_config;
63 };
64
65 #endif /* CAMERA_CONFIG_H */