Removed setter form
[apps/osp/ImageViewer.git] / inc / IvImageCropForm.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                IvImageCropForm.h
19  * @brief               This is the implementation file for Image Crop.
20  */
21
22 #ifndef _IV_IMAGE_CROP_H_
23 #define _IV_IMAGE_CROP_H_
24
25 #include <FMedia.h>
26 #include <FUi.h>
27 #include "IvFileUpdateEventListener.h"
28
29 using namespace Tizen::Ui;
30
31 enum TouchLocation
32 {
33         INSIDE_CROPBOX = 0,
34         OUTSIDE_CROPBOX,
35         INSIDE_TOP_RECTANGLE,
36         INSIDE_BOTTOM_RECTANGLE,
37         INSIDE_LEFT_RECTANGLE,
38         INSIDE_RIGHT_RECTANGLE,
39         INSIDE_TOP_LEFT_RECTANGLE,
40         INSIDE_TOP_RIGHT_RECTANGLE,
41         INSIDE_BOTTOM_LEFT_RECTANGLE,
42         INSIDE_BOTTOM_RIGHT_RECTANGLE,
43 };
44
45 class ImageViewerPresentationModel;
46
47 class ImageCropForm
48         : public Tizen::Ui::Controls::Form
49         , public::Tizen::Ui::IActionEventListener
50         , public Tizen::Ui::IOrientationEventListener
51         , public Tizen::Ui::ITouchEventListener
52         , public Tizen::Ui::Scenes::ISceneEventListener
53         , public IFileUpdateEventListener
54 {
55 public:
56         ImageCropForm(void);
57
58         ~ImageCropForm(void);
59
60         bool Initialize(void);
61
62         virtual result OnInitializing(void);
63
64         result OnDraw(void);
65         void CheckCurrentPosition(const Tizen::Graphics::Point currentPosition);
66         void SetValue(void);
67
68         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
69
70         virtual void OnOrientationChanged(const Tizen::Ui::Control &source,
71                         Tizen::Ui::OrientationStatus orientationStatus);
72
73         virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo){}
74         virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo){}
75         virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
76         virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
77         virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
78
79         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
80                         const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
81         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
82                         const Tizen::Ui::Scenes::SceneId& nextSceneId);
83
84         virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
85
86 private:
87         static const int IDA_BUTTON_SAVE = 105;
88         static const int IDA_BUTTON_CW_ROTATION = 102;
89         static const int IDA_BUTTON_CCW_ROATTION = 103;
90         static const int IDA_BUTTON_CANCEL = 104;
91
92         Tizen::Graphics::Rectangle __cropBox;
93         Tizen::Base::String __sourceFilePath;
94         Tizen::Base::String __cropMode;
95         Tizen::Graphics::Rectangle __imageBox;
96         Tizen::Media::ImageBuffer __imageBuffer;
97         int __imageHeight;
98         int __imageWidth;
99         bool __isOrientationChanged;
100         Tizen::Graphics::Canvas* __pCanvas;
101         Tizen::Graphics::Bitmap* __pCurrentBitmap;
102         Tizen::Graphics::Bitmap* __pRectangleBitmap;
103         TouchLocation __pointLocation;
104         Tizen::Graphics::Point __touchStart;
105         Tizen::Media::ImageFormat __imageFormat;
106         ImageViewerPresentationModel* __pPresentationModel;
107         int __statusValue;
108         long long __contentId;
109         int __formHeight;
110         int __formWidth;
111 };
112
113 #endif /* _IV_IMAGE_CROP_H_ */