3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.tizenopensource.org/license
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.
18 #ifndef _IMAGE_FLIP_ROTATE_FORM_H_
19 #define _IMAGE_FLIP_ROTATE_FORM_H_
23 #include <FGraphics.h>
25 #include "MultiForm.h"
26 #include "BrowserForm.h"
28 #include "BitmapControl.h"
30 using namespace Osp::Base::Collection;
31 using namespace Osp::App;
33 using namespace Osp::Base;
34 using namespace Osp::Ui;
35 using namespace Osp::Ui::Controls;
37 using namespace Osp::Base::Runtime;
38 using namespace Osp::Graphics;
39 using namespace Osp::Media;
42 class MediaFileBrowser;
44 typedef void (*FormBackFunc)(void* bacParam);
46 class ImageFlipRotateFormParam
49 ImageFlipRotateFormParam(String root, String filter)
51 browserParam.initDir = root;
52 browserParam.filter = filter;
54 BrowserFormParam& GetBrowserFormParam() { return browserParam; }
55 void SetFileName(String fileName)
57 browserParam.fileName = fileName;
59 String& GetFileName() { return browserParam.fileName; }
62 BrowserFormParam browserParam;
64 friend class ImageFlipRotateForm;
67 class ImageFlipRotateForm
71 ImageFlipRotateForm();
72 virtual ~ImageFlipRotateForm();
73 bool Initialize(void);
75 static result TestFunc(ImageFlipRotateFormParam* pParam);
78 virtual result OnActivate(void* activateParam);
80 result OnInitializing(void);
81 void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
83 void OpenFile(String filePath);
85 virtual void OnUserEventReceivedN(RequestId requestId, Osp::Base::Collection::IList* pArgs);
86 void OnFormBackRequested(Osp::Ui::Controls::Form& source);
87 result LoadConfig(int index);
88 result Process(int index);
94 Bitmap* GetBitmapN(ByteBuffer& srcBuf, Dimension dim, MediaPixelFormat pixelFormat);
96 void UpdateLog(result r);
103 CONST_INT(ID_ROTATE);
104 CONST_INT(ID_PROCESS);
105 CONST_INT(ID_RELOAD);
108 Bitmap* __pSrcBitmap;
109 Bitmap* __pFlipBitmap;
110 Bitmap* __pRotateBitmap;
111 ByteBuffer* __pSrcBuffer;
112 ByteBuffer* __pFlipBuffer;
113 ByteBuffer* __pRotateBuffer;
114 EditArea* __pEditAreaLog;
115 Button* __pFlipButton;
116 Button* __pRotateButton;
120 MediaPixelFormat __srcPixel;
121 MediaPixelFormat __dstPixel;
123 float __bytesPerPixel;
124 ImageFlipType __flipType;
125 ImageRotationType __rotateType;
126 BitmapPixelFormat __bmpFormat;
129 BitmapControl* __pFlipBmpCtrl;
130 BitmapControl* __pRotateBmpCtrl;
133 #endif // _IMAGE_FLIP_ROTATE_FORM_H_