Added ROI an face detection
[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
32 class QtCamAutoFocus : public QObject {
33   Q_OBJECT
34   Q_PROPERTY(Status status READ status NOTIFY statusChanged);
35   Q_PROPERTY(Status cafStatus READ cafStatus NOTIFY cafStatusChanged);
36   Q_ENUMS(Status);
37
38   friend class QtCamAutoFocusPrivate;
39
40 public:
41   typedef enum {
42     None = 0,
43     Running = 1,
44     Fail = 2,
45     Success = 3,
46   } Status;
47
48   QtCamAutoFocus(QtCamDevice *dev, QObject *parent = 0);
49   ~QtCamAutoFocus();
50
51   Status status();
52   Status cafStatus();
53
54   bool startAutoFocus();
55   bool stopAutoFocus();
56
57   bool canFocus(const QtCamScene::SceneMode& mode);
58
59 signals:
60   void statusChanged();
61   void cafStatusChanged();
62
63 private:
64   QtCamAutoFocusPrivate *d_ptr;
65 };
66
67 #endif /* QT_CAM_AUTO_FOCUS_H */