Tizen 2.1 base
[apps/native/sample/FaceTracker.git] / project / inc / FaceTrackerForm.h
1 //
2 // Tizen C++ SDK
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.tizenopensource.org/license
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #ifndef _FACE_TRACKER_FORM_H_
19 #define _FACE_TRACKER_FORM_H_
20
21 #include <FBase.h>
22 #include <FUi.h>
23 #include <FSystem.h>
24 #include <FUix.h>
25 #include <FMedia.h>
26 #include <FGraphics.h>
27 #include "FaceData.h"
28 #include "FaceThread.h"
29
30 class FaceTrackerForm
31         : public Tizen::Ui::Controls::Form
32         , public Tizen::Ui::Controls::IFormBackEventListener
33         , public Tizen::Media::ICameraEventListener
34 {
35 public:
36         FaceTrackerForm(void);
37         virtual ~FaceTrackerForm(void);
38         bool Initialize(void);
39
40         virtual result OnInitializing(void);
41         virtual result OnTerminating(void);
42         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
43         virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList *pArgs);
44         void StartCamera(void);
45         void StopCamera(void);
46         result CheckBatteryLevel(Tizen::System::BatteryLevel level);
47
48         //Camera EventListner
49         void OnCameraAutoFocused(bool completeCondition);
50         void OnCameraPreviewed( Tizen::Base::ByteBuffer& previewedData, result r);
51         void OnCameraCaptured( Tizen::Base::ByteBuffer& capturedData, result r);
52         void OnCameraErrorOccurred(Tizen::Media::CameraErrorReason r );
53
54 private:
55         Tizen::Graphics::Rectangle __rect;
56         Tizen::Uix::Vision::FaceDetector* __pFaceDetector;
57         Tizen::Uix::Vision::FaceRecognizer* __pFaceRecognizer;
58         FaceData* __pFaceData;
59         Tizen::Uix::Vision::FaceRecognitionInfo* __pFInfoReference;
60         Tizen::Ui::Controls::OverlayRegion* __pOverlayRegion;
61         Tizen::Graphics::BufferInfo __bufferInfo;
62         Tizen::Graphics::Canvas* __pCanvas;
63         Tizen::Ui::Controls::Panel* __pPanel;
64         Tizen::Media::Camera* __pCamera;
65         FaceThread *__pFaceThread;
66         bool __isCameraOn;
67 };
68
69 #endif  //_FACE_TRACKER_FORM_H_