Disable viewfinder in settings pages
[harmattan/cameraplus] / lib / qtcamautofocus.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012 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 QT_CAM_AUTO_FOCUS_H
24 #define QT_CAM_AUTO_FOCUS_H
25
26 #include <QObject>
27 #include "qtcamscene.h"
28
29 class QtCamDevice;
30 class QtCamAutoFocusPrivate;
31 class QRectF;
32
33 class QtCamAutoFocus : public QObject {
34   Q_OBJECT
35   Q_PROPERTY(Status status READ status NOTIFY statusChanged);
36   Q_PROPERTY(Status cafStatus READ cafStatus NOTIFY cafStatusChanged);
37   Q_ENUMS(Status);
38
39   friend class QtCamAutoFocusPrivate;
40
41 public:
42   typedef enum {
43     None = 0,
44     Running = 1,
45     Fail = 2,
46     Success = 3,
47   } Status;
48
49   QtCamAutoFocus(QtCamDevice *dev, QObject *parent = 0);
50   ~QtCamAutoFocus();
51
52   Status status();
53   Status cafStatus();
54
55   bool startAutoFocus();
56   bool stopAutoFocus();
57
58   bool canFocus(const QtCamScene::SceneMode& mode);
59
60   void setRegionOfInterest(const QRectF& roi);
61
62 signals:
63   void statusChanged();
64   void cafStatusChanged();
65
66 private:
67   QtCamAutoFocusPrivate *d_ptr;
68 };
69
70 #endif /* QT_CAM_AUTO_FOCUS_H */