2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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
8 // http://floralicense.org/license/
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.
18 * @file IvImageCropForm.h
19 * @brief This is the implementation file for Image Crop.
22 #ifndef _IV_IMAGE_CROP_H_
23 #define _IV_IMAGE_CROP_H_
27 #include "IvFileUpdateEventListener.h"
29 using namespace Tizen::Ui;
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,
45 class ImageViewerPresentationModel;
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
60 bool Initialize(void);
62 virtual result OnInitializing(void);
65 void CheckCurrentPosition(const Tizen::Graphics::Point currentPosition);
68 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
70 virtual void OnOrientationChanged(const Tizen::Ui::Control &source,
71 Tizen::Ui::OrientationStatus orientationStatus);
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);
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);
84 virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
87 static const int IDA_BUTTON_SAVE = 105;
88 static const int IDA_BUTTON_CANCEL = 104;
90 Tizen::Graphics::Rectangle __cropBox;
91 Tizen::Base::String __sourceFilePath;
92 Tizen::Base::String __cropMode;
93 Tizen::Graphics::Rectangle __imageBox;
94 Tizen::Media::ImageBuffer __imageBuffer;
97 bool __isOrientationChanged;
98 Tizen::Graphics::Canvas* __pCanvas;
99 Tizen::Graphics::Bitmap* __pCurrentBitmap;
100 Tizen::Graphics::Bitmap* __pRectangleBitmap;
101 TouchLocation __pointLocation;
102 Tizen::Graphics::Point __touchStart;
103 Tizen::Media::ImageFormat __imageFormat;
104 ImageViewerPresentationModel* __pPresentationModel;
106 long long __contentId;
111 #endif /* _IV_IMAGE_CROP_H_ */