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 CmCameraForm.cpp
19 * @brief This is the implementation file for CameraForm class.
22 #include "CmCameraApp.h"
23 #include "CmCameraForm.h"
24 #include "CmCameraStarterThread.h"
25 #include "CmCameraPresentationModel.h"
26 #include "CmCameraSettingsPresentationModel.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Base::Runtime;
32 using namespace Tizen::Content;
33 using namespace Tizen::Graphics;
34 using namespace Tizen::Io;
35 using namespace Tizen::Media;
36 using namespace Tizen::System;
37 using namespace Tizen::Telephony;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
42 static const int INDEX_FREE_SPACE_BUFFER_LEN = 10;
43 static const int MAX_CAMERA_EXPOSURE_VALUE = 8;
44 static const int CAMERA_EXPOSURE_VALUE_ZERO = 0;
45 static const int CAMERA_EXPOSURE_VALUE_ONE = 1;
46 static const int SLIDER_RECTVALID_X_POS = 430;
47 static const int CAMERA_EXPOSURE_TIMER_VALUE = 2000;
48 static const int CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE = 3000;
49 static const int CAMERA_GUIDELINE_ENABLE = 1;
50 static const int FLASH_MODE_OFF = 0;
51 static const int FLASH_MODE_ON = 1;
52 static const int FLASH_MODE_AUTO = 2;
53 static const int X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD = 20;
54 static const int Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD = 73;
55 static const int X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD = 73;
56 static const int Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD = 20;
57 static const int X_EXPOSURE_PANEL_SIDER_LANDSCAPE = 40;
58 static const int Y_EXPOSURE_PANEL_SIDER_LANDSCAPE = 190;
59 static const int W_EXPOSURE_PANEL_SIDER_LANDSCAPE = 60;
60 static const int H_EXPOSURE_PANEL_SIDER_LANDSCAPE = 336;
61 static const int X_EXPOSURE_PANEL_SIDER_PORTRAIT = 190;
62 static const int Y_EXPOSURE_PANEL_SIDER_PORTRAIT = 40;
63 static const int W_EXPOSURE_PANEL_SIDER_PORTRAIT = 336;
64 static const int H_EXPOSURE_PANEL_SIDER_PORTRAIT = 60;
65 static const int OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON = 20;
66 static const int FONT_SIZE_SETTING_MENU_ITEM = 34;
67 static const int FONT_SIZE_SETTING_SUB_MENU_ITEM = 34;
68 static const int H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT = 26;
69 static const int H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE = 94;
70 static const int H_SETTING_MENU_PANEL_TITLE = 50;
71 static const int H_SETTING_MENU_ITEM = 65;
72 static const int X_SETTING_MENU_LIST_PORTRAIT = 36;
73 static const int Y_SETTING_MENU_LIST_PORTRAIT = 135;
74 static const int W_SETTING_MENU_LIST_PORTRAIT = 538;
75 static const int H_SETTING_MENU_LIST_PORTRAIT = 380;
76 static const int H_SETTING_MENU_LIST_MARGIN = 200;
77 static const int X_SETTING_MENU_LIST_LANDSCAPE = 38;
78 static const int Y_SETTING_MENU_LIST_LANDSCAPE = 74;
79 static const int Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN = 130;
80 static const int W_SETTING_MENU_LIST_LANDSCAPE = 538;
81 static const int H_SETTING_MENU_LIST_LANDSCAPE = 360;
82 static const int X_SETTING_MENU_CONTESTS = 34;
83 static const int Y_SETTING_MENU_CONTESTS = 0;
84 static const int W_SETTING_MENU_CONTESTS = 280;
85 static const int H_SETTING_MENU_CONTESTS = 65;
86 static const int X_SETTING_MENU_CONTENTS_VALUE = 280;
87 static const int Y_SETTING_MENU_CONTENTS_VALUE = 0;
88 static const int W_SETTING_MENU_CONTENTS_VALUE = 290;
89 static const int H_SETTING_MENU_CONTENTS_VALUE = 65;
90 static const int H_SETTING_SUBMENU_ITEM = 88;
91 static const int X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN = 390;
92 static const int X_WHITE_BALANCE_RADIO_ICON_MARGIN = 376;
93 static const int X_SETTING_SUBMENU_RADIO_ICON = 0;
94 static const int X_SETTING_SUBMENU_RADIO_ICON_MARGIN = 350;
95 static const int Y_SETTING_SUBMENU_RADIO_ICON = 0;
96 static const int W_SETTING_SUBMENU_RADIO_ICON = 84;
97 static const int H_SETTING_SUBMENU_RADIO_ICON = 84;
98 static const int X_SETTING_SUBMENU_ICON_ZERO = 0;
99 static const int X_SETTING_SUBMENU_ICON = 75;
100 static const int X_SETTING_SUBMENU_ICON_MARGIN = 65;
101 static const int Y_SETTING_SUBMENU_ICON = 0;
102 static const int W_SETTING_SUBMENU_ICON = 88;
103 static const int H_SETTING_SUBMENU_ICON = 88;
104 static const int X_SETTING_SUBMENU_2TEXT_ITEM = 75;
105 static const int Y_SETTING_SUBMENU_2TEXT_ITEM = 0;
106 static const int W_SETTING_SUBMENU_2TEXT_ITEM = 320;
107 static const int H_SETTING_SUBMENU_2TEXT_ITEM = 84;
108 static const int X_SETTING_SUBMENU_3TEXT_ITEM = 165;
109 static const int X_FLASH_SETTING_SUBMENU_3TEXT_ITEM = 57;
110 static const int X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN = 70;
111 static const int Y_SETTING_SUBMENU_3TEXT_ITEM = 0;
112 static const int W_SETTING_SUBMENU_3TEXT_ITEM = 250;
113 static const int H_SETTING_SUBMENU_3TEXT_ITEM = 84;
114 static const int X_SUBMENU_PANEL_START_PORTRAIT = 170;
115 static const int X_SUBMENU_PANEL_START_LANDSCAPE = 340;
116 static const int Y_SUBMENU_PANEL_OFFSET_PORTRAIT = 150;
117 static const int X_SUBMENU_TIMER_MODE_PANEL = 340;
118 static const int Y_SUBMENU_TIMER_MODE_PANEL = 120;
119 static const int W_SUBMENU_TIMER_MODE_PANEL = 460;
120 static const int H_SUBMENU_TIMER_MODE_PANEL = 445;
121 static const int X_SUBMENU_TIMER_MODE_LIST = 20;
122 static const int Y_SUBMENU_TIMER_MODE_LIST = 64;
123 static const int W_SUBMENU_TIMER_MODE_LIST = 431;
124 static const int H_SUBMENU_TIMER_MODE_LIST = 420;
125 static const int X_SUBMENU_ISO_MODE_PANEL = 340;
126 static const int Y_SUBMENU_ISO_MODE_PANEL = 205;
127 static const int W_SUBMENU_ISO_MODE_PANEL = 460;
128 static const int X_SUBMENU_ISO_MODE_LIST = 20;
129 static const int Y_SUBMENU_ISO_MODE_LIST = 64;
130 static const int H_SUBMENU_ISO_MODE_PANEL_MARGIN = 88;
131 static const int W_SUBMENU_ISO_MODE_LIST = 431;
132 static const int H_SUBMENU_ISO_MODE_LIST_MARGIN = 90;
133 static const int X_SUBMENU_WB_MODE_PANEL = 340;
134 static const int Y_SUBMENU_WB_MODE_PANEL = 205;
135 static const int W_SUBMENU_WB_MODE_PANEL = 460;
136 static const int H_SUBMENU_WB_MODE_PANEL_MARGIN = 88;
137 static const int X_SUBMENU_WB_MODE_LIST = 20;
138 static const int Y_SUBMENU_WB_MODE_LIST = 64;
139 static const int W_SUBMENU_WB_MODE_LIST = 431;
140 static const int H_SUBMENU_WB_MODE_LIST = 90;
141 static const int W_SUBMENU_WB_MODE_LIST_MARGIN = 90;
142 static const int X_SUBMENU_GUIDELINE_MODE_PANEL = 340;
143 static const int Y_SUBMENU_GUIDELINE_MODE_PANEL = 260;
144 static const int W_SUBMENU_GUIDELINE_MODE_PANEL = 460;
145 static const int H_SUBMENU_GUIDELINE_MODE_PANEL = 265;
146 static const int X_SUBMENU_GUIDELINE_MODE_LIST = 20;
147 static const int Y_SUBMENU_GUIDELINE_MODE_LIST = 64;
148 static const int W_SUBMENU_GUIDELINE_MODE_LIST = 431;
149 static const int H_SUBMENU_GUIDELINE_MODE_LIST = 240;
150 static const int X_SUBMENU_STORAGE_MODE_PANEL = 340;
151 static const int Y_SUBMENU_STORAGE_MODE_PANEL = 320;
152 static const int W_SUBMENU_STORAGE_MODE_PANEL = 460;
153 static const int H_SUBMENU_STORAGE_MODE_PANEL = 265;
154 static const int X_SUBMENU_STORAGE_MODE_LIST = 20;
155 static const int Y_SUBMENU_STORAGE_MODE_LIST = 64;
156 static const int W_SUBMENU_STORAGE_MODE_LIST = 431;
157 static const int H_SUBMENU_STORAGE_MODE_LIST = 240;
158 static const int X_FLASH_MODE_SETTING_LIST_LANDSCAPE = 38;
159 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE = 94;
160 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN = 150;
161 static const int W_FLASH_MODE_SETTING_LIST_LANDSCAPE = 480;
162 static const int H_FLASH_MODE_SETTING_LIST_LANDSCAPE = 350;
163 static const int H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN = 200;
164 static const int X_FLASH_MODE_SETTING_LIST_PORTRAIT = 112;
165 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT = 85;
166 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN = 50;
167 static const int W_FLASH_MODE_SETTING_LIST_PORTRAIT = 480;
168 static const int H_FLASH_MODE_SETTING_LIST_PORTRAIT = 350;
169 static const int H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN = 200;
170 static const int H_FLASH_MODE_TITLE_TOP_MARGIN = 28;
171 static const int X_FLASH_MODE_LIST_START_POS_PORTRAIT = 288;
172 static const int CAMERA_PANEL_SUM_SIZE = 320;
173 static const int PREVIEW_OVERLAY_PANEL_SIZE = 960;
174 static const int PREVIEW_OVERLAY_PANEL_SIZE_MARGIN = 80;
175 static const int X_PREVIEW_OVERLAY_PORTRAIT = 0;
176 static const int Y_PREVIEW_OVERLAY_PORTRAIT = 160;
177 static const int W_PREVIEW_OVERLAY_PORTRAIT = 720;
178 static const int H_PREVIEW_OVERLAY_PORTRAIT = 960;
179 static const int W_FULL_PREVIEW_OVERLAY_PORTRAIT = 720;
180 static const int X_PREVIEW_OVERLAY_LANDSCAPE = 160;
181 static const int Y_PREVIEW_OVERLAY_LANDSCAPE = 0;
182 static const int W_PREVIEW_OVERLAY_LANDSCAPE = 960;
183 static const int H_PREVIEW_OVERLAY_LANDSCAPE = 720;
184 static const int W_FULL_PREVIEW_OVERLAY_LANDSCAPE = 1280;
185 static const int W_THUMBNAIL_SCALE_SIZE = 80;
186 static const int H_THUMBNAIL_SCALE_SIZE = 80;
187 static const int X_THUMBNAIL_BUTTON_IMG = 14;
188 static const int Y_THUMBNAIL_BUTTON_IMG = 14;
189 static const int X_BASE_POS = 0;
190 static const int Y_BASE_POS = 0;
191 static const int BITS_PER_BYTE = 8;
192 static const int BYTE_BUFFER_START_POS = 0;
193 static const int BYTE_ARRAY_START_POS = 0;
194 static const int CAMERA_TIMER_ONE_MILLI_SEC = 1;
195 static const int FRAME_SKIP = 4;
196 static const int REG_DEFAULT_VAULE_ZERO = 0;
197 static const int STORAGE_VALUE_ZERO = 0;
198 static const int STORAGE_DISPLAY_PLACE = 300;
199 static const int DIVIDE_BY_TWO = 2;
200 static const int INDEX_UNIT_TWENTY = 20;
201 static const int INDEX_UNIT_ZERO = 0;
202 static const int INDEX_UNIT_ONE = 1;
203 static const int DEVICE_PORTRAIT = 1;
204 static const int CAMERA_FOCUS_NOT_READY = 0;
205 static const int CAMERA_FOCUS_READY = 1;
206 static const int CAMERA_FOCUS_FAIL = 2;
207 static const int CAMERA_TIMER_LIMIT = 120000;
208 static const int SETTING_TIMER_CAPTURE_0_SEC = 0;
209 static const int SETTING_TIMER_CAPTURE_2_SEC = 1;
210 static const int SETTING_TIMER_CAPTURE_5_SEC = 2;
211 static const int SETTING_TIMER_CAPTURE_10_SEC = 3;
212 static const int SETTING_TIMER_2_SEC_COUNT = 2;
213 static const int SETTING_TIMER_5_SEC_COUNT = 5;
214 static const int SETTING_TIMER_10_SEC_COUNT = 10;
215 static const int CAMERA_CHARGING_TIMER = 1000;
216 static const int PREVIEW_FAIL_TIMER = 1000;
217 static const int CAMERA_TIMER_1_SEC = 1000;
218 static const int CAMERA_TIMER_2_SEC = 2000;
219 static const int CAMERA_TIMER_5_SEC = 5000;
220 static const int CAMERA_TIMER_10_SEC = 10000;
221 static const int SUBMENU_ISO_AUTO = 0;
222 static const int SUBMENU_ISO_100 = 1;
223 static const int SUBMENU_ISO_200 = 2;
224 static const int SUBMENU_ISO_400 = 3;
225 static const int SUBMENU_ISO_800 = 4;
226 static const int SUBMENU_GUIDELINE_OFF = 0;
227 static const int SUBMENU_GUIDELINE_ON = 1;
228 static const int SUBMENU_MODE_OFF = 0;
229 static const int SUBMENU_MODE_ON = 1;
230 static const int SUBMENU_MODE_AUTO = 2;
231 static const int SUBMENU_STORAGE_TYPE_PHONE = 0;
232 static const int SUBMENU_STORAGE_TYPE_MEMORYCARD = 1;
233 static const int SUBMENU_TIMER_COUNT = 4;
234 static const int MAX_ISO_COUNT= 9;
235 static const int SUBMENU_GUIDELINE_COUNT = 2;
236 static const int SUBMENU_STORAGE_TYPE_COUNT = 2;
237 static const int MAX_SUBMENU_CONTENT = 10;
238 static const int DRAW_INITIALIZED = 0;
239 static const int DRAW_MOVED = 1;
240 static const int DRAW_RELEASED = 2;
241 static const int DISABLE_GUIDELINE = 0;
242 static const int EXPOSURE_TIMER_IS_ALIVE = 1;
243 static const int MAX_SETTING_MENU_COUNT = 2;
244 static const int MAX_GENERAL_TAB_SETTING_MENU_COUNT = 5;
245 static const int MAX_FLASH_MENU_COUNT = 3;
246 static const int MAX_WHITE_BALANCE_MENU_COUNT = 5;
247 static const int MENU_COUNT_CLEAR = 0;
248 static const int MENU_MODE_DISABLE = -1;
249 static const int MENU_TWO_ELEMENT = 2;
250 static const int MENU_THREE_ELEMENT = 3;
252 static const int UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN = 2048;
253 static const int MULTIPLY_BY_TEN = 10;
254 static const int NORMAL_MODE_RATIO = 13;
255 static const int PREVIEW_RESOLOTION_WIDTH = 640;
256 static const int PREVIEW_RESOLOTION_HEIGHT = 480;
257 static const int MODE_AUTO = 0;
258 static const int MODE_WHITEBALANCE_INCANDESCENT = 1;
259 static const int MODE_FLUORESCENT = 2;
260 static const int MODE_DAYLIGHT = 3;
261 static const int MODE_CLOUDY = 4;
262 static const int X_INDICATOR_BATTERY_PORTRAIT = 300;
263 static const int Y_INDICATOR_BATTERY_PORTRAIT = 4;
264 static const int X_INDICATOR_BATTERY_LANDSCAPE = 582;
265 static const int Y_INDICATOR_BATTERY_LANDSCAPE = 4;
266 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 10;
267 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 7;
268 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 7;
269 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 55;
270 static const int UNIT_VALUE_ZERO = 0;
271 static const int DISPLAY_WVGA = 1200;
272 static const int SCREEN_OVERLAY_HELP_ENABLE = 1;
273 static const int SCREEN_OVERLAY_HELP_DISABLE = 0;
274 static const int BACK_BUTTON_X_POS = 63;
275 static const int BACK_BUTTON_Y_POS = 63;
276 static const int STRING_BUFFER_SIZE = 32;
277 static const int SUPPORTED_CAMERA_NUM = 1;
279 static const int BRIGHTNESS_DIVIDER_PORTRAIT_MODE = 31;
281 static const wchar_t* IDS_MENU_SETTING_MAIN_MENU_NAME = L"SettingMainMenu";
282 static const wchar_t* IDS_MENU_SETTING_GEN_MAIN_MENU_NAME = L"SettingGenMainMenu";
283 static const wchar_t* IDS_GENERAL_SETTING_SUB_MENU= L"GeneralSettingsSubMenu";
284 static const wchar_t* IDS_CAMERA_SETTING_SUB_MENU= L"CameraSettingsSubMenu";
285 static const wchar_t* IDS_MENU_WB_MENU_NAME = L"WBMenu";
286 static const wchar_t* IDS_WB_BUTTON_NAME = L"WhiteBalanceButton";
287 static const wchar_t* IDS_MENU_FLASH_MENU_NAME = L"FlashMenu";
288 static const wchar_t* IDS_FLASH_BUTTON_NAME = L"FlashButton";
289 static const wchar_t* IDS_THUMBNAIL_PANLE_NAME = L"ThumbnailPanel";
290 static const wchar_t* IDS_CAMERA_INFO_PANEL_NAME = L"CameraInfoPanel";
291 static const wchar_t* IDS_SETTING_UI_PANEL_NAME = L"SettingPanel";
292 static const wchar_t* IDS_ACTION_UI_PANEL_NAME = L"ActionPanel";
293 static const wchar_t* IDS_ACTION_UI_PANEL_CAPTURE_NAME = L"ActionCapture";
294 static const wchar_t* IDS_ACTION_UI_CAMERA_MODE = L"ActionCameraMode";
295 static const wchar_t* IDS_INIT_REG_KEY = L"NONE";
296 static const wchar_t* PHOTO_SIZE_640_480 = L"640X480(4:3)";
297 static const wchar_t* PHOTO_SIZE_1280_720 = L"1280X720(16:9)";
298 static const wchar_t* PHOTO_SIZE_3264_2488 = L"3264X2448(4:3)";
299 static const wchar_t* PHOTO_SIZE_3264_2176 = L"3264X2176(16:9)";
300 static const wchar_t* PHOTO_SIZE_3264_1836 = L"3264X1836(16:9)";
301 static const wchar_t* PHOTO_SIZE_2048_1536 = L"2048X1536(4:3)";
302 static const wchar_t* PHOTO_SIZE_2048_1152 = L"2048X1152(16:9)";
304 CameraForm::CameraForm(void)
305 : __pOverlayPanel(null)
306 , __screenMode(SCREEN_MODE_NORMAL)
307 , __cameraTabMainMenuCount(MENU_MODE_DISABLE)
308 , __cameraTabSubMenuCount(MENU_MODE_DISABLE)
309 , __cameraTabSettingMode(CAMERA_TAB_SUB_MENU_CONTENT_MAX)
310 , __generalTabMainMenuCount(MENU_MODE_DISABLE)
311 , __generalTabSubMenuCount(MENU_MODE_DISABLE)
312 , __generalTabSettingMode(GENERAL_TAB_SUB_MENU_CONTENT_MAX)
313 , __settingWhiteBalance(0)
314 , __settingIsoIndex(0)
315 , __settingTimeInterval(0)
316 , __settingExposure(0)
317 , __primaryCurrentResolutionIndex(0)
318 , __secondaryCurrentResolutionIndex(0)
319 , __isTimerRunning(false)
320 , __previewResolutionWidth(0)
321 , __previewResolutionHeight(0)
322 , __captureResolutionWidth(0)
323 , __captureResolutionHeight(0)
324 , __lowMemoryCapacity(false)
325 , __isMemoryFull(false)
326 , __isLockScreenMode(false)
327 , __resolutionChange(false)
328 , __isToggleCameraDirection(false)
329 , __isOrientationChanged(false)
330 , __isProhibitionTouchEvent(false)
331 , __pSettingPanel(null)
332 , __pActionPanel(null)
333 , __dir(ORIENTATION_STATUS_NONE)
334 , __deviceOrientation(DEVICE_PORTRAIT)
335 , __pSettingLine(null)
336 , __pCameraIconLabel(null)
337 , __pCamcoderIconLabel(null)
338 , __pShutterButton(null)
339 , __pThumbnailButton(null)
340 , __pBatteryState(null)
341 , __pButtonPoint(Point(0, 0))
342 , __pPreviewResolutionList(null)
343 , __pCaptureResolutionList(null)
345 , __pSettingMenuString(null)
346 , __pSettingGeneralMenuString(null)
347 , __pCameraStarterThread(null)
348 , __pCameraSetting(null)
349 , __pGeneralSetting(null)
350 , __pCameraSettingLable(null)
351 , __pGeneralSettingLable(null)
352 , __pFileEventManager(null)
355 , __formStatusFrameDeattivated(false)
357 AppLogDebug("ENTER");
361 CameraForm::~CameraForm(void)
363 AppLogDebug("ENTER");
368 CameraForm::OnInitializing(void)
370 AppLogDebug("ENTER");
371 result r = E_SUCCESS;
372 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
373 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
374 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
375 Point currentPosition;
376 int storageType = STORAGE_TYPE_PHONE;
377 int timerInterval = 0;
378 String filePath = L"";
380 _appControlActionCompleted = false;
381 __formStatusFrameDeattivated = false;
383 SetFormBackEventListener(this);
384 AddOrientationEventListener(*this);
385 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
386 __dir = GetOrientationStatus();
387 __deviceOrientation = __dir;
388 AppLogDebug("__dir = %d && __deviceOrientation = %d", __dir, __deviceOrientation);
390 _pCameraPresentationModel->SetOrientation(__dir);
391 _pCurrentSourceForm = SOURCE_FORM_CAMERA;
394 InitPreviewFailPopupTimer();
395 InitIntervalValueTimer();
396 InitCaptureStartTimer();
397 InitTouchAutoFocusStartTimer();
399 InitChargingCompletedTimer();
401 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
404 storageType = STORAGE_TYPE_PHONE;
407 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
409 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
410 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
411 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
414 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
415 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
417 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
418 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
420 _pCameraInfoPanel = new (std::nothrow) CameraInfoPanel();
421 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
423 if (__dir == ORIENTATION_STATUS_PORTRAIT
424 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
426 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
427 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
428 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
429 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
433 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
434 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
435 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
436 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
439 if (__dir == ORIENTATION_STATUS_PORTRAIT
440 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
442 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
446 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
449 r = _pCameraInfoPanel->Initialize(rect);
450 TryCatch(r == E_SUCCESS, , "_pCameraInfoPanel Initialize fail[%s]", GetErrorMessage(r));
452 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
453 _pCameraInfoPanel->SetDrawMarkerFocus(true);
454 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
455 _pCameraInfoPanel->SetPreviewResolutionSize(REG_DEFAULT_VAULE_ZERO);
456 _pCameraInfoPanel->SetCurrentMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
457 _pCameraInfoPanel->SetStorageType(storageType);
458 _pCameraInfoPanel->SetTimerType(timerInterval);
459 _pCameraInfoPanel->SetDrawIndicator(true);
460 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
461 _pCameraInfoPanel->AddTouchEventListener(*this);
462 _pCameraInfoPanel->SetName(IDS_CAMERA_INFO_PANEL_NAME);
463 AddOrientationEventListener(*_pCameraInfoPanel);
464 AddControl(_pCameraInfoPanel);
465 SetControlAlwaysOnTop(*_pCameraInfoPanel, true);
467 SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
468 InitSettingMenuPanel();
469 InitActionMenuPanel();
470 InitScreenOverlayHelp();
471 CheckBatteryStatus();
475 __pFileEventManager = new (std::nothrow) FileEventManager();
476 r = __pFileEventManager->Construct(*this);
477 TryCatch(r == E_SUCCESS, , "__pFileEventManager Construct fail[%s]", GetErrorMessage(r));
479 filePath = _pCameraPresentationModel->GetfilePath(storageType);
480 AppLogDebug("filePath %ls", filePath.GetPointer());
482 if (File::IsFileExist(filePath))
484 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
485 __pFileEventPath = filePath;
487 AppLogDebug("FileEventManager()::AddPath() fail[%s]", GetErrorMessage(r));
490 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
491 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
497 if (_pCameraInfoPanel)
499 delete _pCameraInfoPanel;
500 _pCameraInfoPanel = null;
503 ShowCameraFailPopup();
505 AppLogDebug("EXIT - CATCH");
510 CameraForm::OnTerminating(void)
512 AppLogDebug("ENTER");
513 result r = E_SUCCESS;
515 _pCameraPresentationModel->KeepScreenOnState(false, true);
517 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
519 if (_pCameraInfoPanel != null)
521 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
524 RemoveAllEventListener();
526 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
528 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
529 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
531 if (__isLockScreenMode)
533 AppLogDebug("OnTerminating KEY_POWER_HOLD");
535 __isLockScreenMode = false;
538 __lowMemoryCapacity = false;
540 __isTimerRunning = false;
542 _pCameraPresentationModel->SetIntervalTimerRun(false);
544 __resolutionChange = false;
546 __isToggleCameraDirection = false;
548 __isOrientationChanged = false;
550 __isProhibitionTouchEvent = false;
552 _pCameraPresentationModel = null;
553 __pCameraStarterThread = null;
555 __formStatusFrameDeattivated = false;
559 if (__pPreviewResolutionList)
561 __pPreviewResolutionList->RemoveAll(true);
562 delete __pPreviewResolutionList;
565 if (__pCaptureResolutionList)
567 __pCaptureResolutionList->RemoveAll(true);
568 delete __pCaptureResolutionList;
573 __pIsoList->RemoveAll(true);
577 if (__pSettingMenuString)
580 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
582 delete [] __pSettingMenuString[idx];
584 delete [] __pSettingMenuString;
587 if (__pSettingGeneralMenuString)
590 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
592 delete [] __pSettingGeneralMenuString[idx];
594 delete [] __pSettingGeneralMenuString;
597 if (__pFileEventManager != null)
599 delete __pFileEventManager;
600 __pFileEventManager = null;
608 CameraForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
610 AppLogDebug("ENTER");
611 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
612 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
613 Rectangle clientRect = GetClientAreaBounds();
614 result r = E_SUCCESS;
616 Dimension previewResolutionDim;
617 Dimension captureResolutionDim;
618 int previewResolutionSize = 0;
620 int storageType = STORAGE_TYPE_PHONE;
621 BufferInfo bufferinfo;
622 bool isRunStartPreviewThread = false;
623 bool isInitCameraStaus = false;
624 bool isCharging = false;
625 BatteryLevel batteryLevel;
627 __isTimerRunning = false;
629 _pCameraPresentationModel->SetIntervalTimerRun(false);
633 StartPreviewFailPopupTimer();
635 _batteryStatus = GetCurrentBatteryState();
636 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
638 StartInitChargingTimer();
640 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
642 _pCameraPresentationModel->KeepScreenOnState(true, false);
644 _pCameraPresentationModel->SetCurrentSourceForm(SOURCE_FORM_CAMERA);
646 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
647 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
651 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
653 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
655 __previewResolutionWidth = previewResolutionDim.width;
656 __previewResolutionHeight = previewResolutionDim.height;
658 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
660 __captureResolutionWidth = captureResolutionDim.width;
661 __captureResolutionHeight = captureResolutionDim.height;
663 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
667 RemoveControl(__pOverlayPanel);
668 __pOverlayPanel = null;
671 AppLogDebug("__screenMode [%d]", __screenMode);
673 r = SetScreenMode(__screenMode, true);
674 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
676 if (__dir == ORIENTATION_STATUS_PORTRAIT
677 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
679 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
680 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
684 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
685 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
688 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
690 _pCameraInfoPanel->SetDrawPopupTimer(false);
692 _pCameraInfoPanel->Invalidate(true);
695 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
696 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
698 if (regVal == DISABLE_GUIDELINE)
709 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
710 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
712 MakeSettingPopupTab(false);
716 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
717 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
719 if (isInitCameraStaus)
721 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
722 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
724 if (isRunStartPreviewThread)
726 r = RunStartPreviewThread();
727 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
729 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
733 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
734 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
736 _pCameraPresentationModel->StartPreview(&bufferinfo);
739 _pCameraPresentationModel->SetContinuousAutoFocus();
741 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
743 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
745 SetCameraSettingsDevice();
748 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
750 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
752 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
753 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
756 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
757 isCharging = _pCameraPresentationModel->IsCharging();
759 AppLogDebug("batteryLevel = %d", batteryLevel);
760 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
762 if (isCharging == false)
768 CheckBatteryStatus();
774 CameraForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
776 AppLogDebug("ENTER");
777 __isTimerRunning = false;
779 _pCameraPresentationModel->SetIntervalTimerRun(false);
781 __resolutionChange = false;
783 __isToggleCameraDirection = false;
785 __isOrientationChanged = false;
787 __isProhibitionTouchEvent = false;
789 OnHelpCloseTimerExpired();
793 MakeSettingPopupTab(false);
799 if (_isUsedTimerCaptured == true)
803 _isUsedTimerCaptured = false;
805 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
807 _pCameraInfoPanel->SetDrawPopupTimer(false);
809 _pCameraInfoPanel->Invalidate(true);
813 if (_pCameraInfoPanel->GetDrawExposure() == true)
815 _pCameraInfoPanel->SetDrawExposure(false);
823 RemoveControl(__pOverlayPanel);
824 __pOverlayPanel = null;
827 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
832 CameraForm::Update(void)
834 AppLogDebug("ENTER");
835 Bitmap* pThumbnailBitmap = null;
836 Bitmap* pRotateBitmap = null;
837 Bitmap* pBitmap = null;
838 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
839 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
840 result r = E_SUCCESS;
842 HideUiActionButton();
844 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
846 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
848 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
850 if (pThumbnailBitmap == null)
852 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
854 _pThumbnailPanel->SetShowState(true);
861 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
863 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
864 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
866 r = pRotateBitmap->Scale(dimScaleSize);
867 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
869 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
870 delete pRotateBitmap;
871 pRotateBitmap = null;
879 AppLogDebug("CameraForm::Update :: Not thummail");
881 _pThumbnailPanel->SetShowState(false);
882 _pThumbnailPanel->Draw();
883 _pThumbnailPanel->Show();
885 __pThumbnailButton->SetShowState(true);
886 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
888 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
889 TryCatch(pBitmap != null, , "pBitmap is null");
891 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
896 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
897 TryCatch(pBitmap != null, , "pBitmap is null");
899 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
904 __pThumbnailButton->Draw();
905 __pThumbnailButton->Show();
915 delete pRotateBitmap;
916 pRotateBitmap = null;
921 CameraForm::OnCapuredPerform(void)
923 AppLogDebug("ENTER");
924 result r = E_SUCCESS;
925 Point currentPosition;
926 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
927 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
928 int guideLineEnable = 0;
929 BufferInfo bufferinfo;
930 Bitmap* pThumbnailBitmap = null;
931 Bitmap* pRotateBitmap = null;
933 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
934 // TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
935 if (pThumbnailBitmap == null)
937 AppLogDebug("OnCapuredPerform::pThumbnailBitmap = null");
939 _pThumbnailPanel->SetShowState(true);
944 if (__dir == ORIENTATION_STATUS_PORTRAIT
945 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
947 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
948 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
952 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
953 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
956 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
957 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
959 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
960 TryCatch(r == E_SUCCESS, , "pRotateBitmap::Scale() fail[%s]", GetErrorMessage(r));
962 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
963 _pThumbnailPanel->SetDrawSliderImg();
965 delete pRotateBitmap;
966 pRotateBitmap = null;
969 if (__formStatusFrameDeattivated)
971 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED after CAMERA_ACTION_EVENT_CAPTURED event");
975 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
976 _pAppTimer->Cancel();
978 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
979 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
981 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
982 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
984 _pCameraPresentationModel->StartPreview(&bufferinfo);
986 _pCameraPresentationModel->SetContinuousAutoFocus();
989 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
990 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
992 if (guideLineEnable == DISABLE_GUIDELINE)
994 r = DrawMarker(false);
998 r = DrawMarker(true);
1000 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
1006 _isUsedTimerCaptured = false;
1010 AppLogDebug("EXIT");
1016 delete pRotateBitmap;
1017 pRotateBitmap = null;
1024 CameraForm::OnCameraActionPerformed(CameraActionEvent event)
1026 AppLogDebug("ENTER");
1027 result r = E_SUCCESS;
1029 AppLogDebug("OnCameraActionPerformed - event %d", event);
1032 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1034 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1035 DrawFocus(CAMERA_FOCUS_READY);
1039 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1041 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1042 DrawFocus(CAMERA_FOCUS_READY);
1044 TryReturnVoid(_pTouchAutoFocusTimer != null, "_pTouchAutoFocusTimer is null");
1045 _pTouchAutoFocusTimer->Cancel();
1047 r = _pTouchAutoFocusTimer->Start(CAMERA_TIMER_2_SEC);
1048 TryReturnVoid(r == E_SUCCESS, "Faled Start Timer[%s]", GetErrorMessage(r));
1052 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1054 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1055 DrawFocus(CAMERA_FOCUS_FAIL);
1059 case CAMERA_ACTION_EVENT_CAMERA_PREVIEWED:
1061 AppLogDebug("CAMERA_ACTION_EVENT_CAMERA_PREVIEWED.");
1065 case CAMERA_ACTION_EVENT_CAPTURED:
1067 AppLogDebug("CAMERA_ACTION_EVENT_CAPTURED");
1068 int requestType = 0;
1069 BufferInfo bufferinfo;
1070 bool isCharging = false;
1071 BatteryLevel batteryLevel;
1073 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1075 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1077 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1079 AppLogDebug("Camera Captured after TerminateApp");
1080 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1081 pCameraApp->SetFrameEnabled(false);
1083 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1084 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1086 _pCameraPresentationModel->StartPreview(&bufferinfo);
1088 __isProhibitionTouchEvent = true;
1091 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1098 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1099 isCharging = _pCameraPresentationModel->IsCharging();
1101 AppLogDebug("batteryLevel = %d", batteryLevel);
1102 AppLogDebug("isCharging = %d", isCharging);
1104 if (isCharging == false)
1106 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1109 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1115 case CAMERA_ACTION_EVENT_ERROR_OCCURRED:
1117 AppLogDebug("CAMERA_ACTION_EVENT_ERROR_OCCURRED.");
1119 result r = E_SUCCESS;
1120 BufferInfo bufferinfo;
1122 if (__pBatteryState != null)
1124 __pBatteryState->SetShowState(true);
1125 __pBatteryState->Draw();
1126 __pBatteryState->Show();
1129 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1131 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1132 _pCameraPresentationModel->StopCamera();
1134 r = _pCameraPresentationModel->InitializeCamera();
1135 TryReturnVoid(r == E_SUCCESS, "InitializeCamera [%s]", GetErrorMessage(r));
1137 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1138 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1140 _pCameraPresentationModel->StartPreview(&bufferinfo);
1141 _pCameraPresentationModel->SetContinuousAutoFocus();
1146 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1148 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1149 bool isEnabled = false;
1150 bool isInitCameraStaus = false;
1151 bool isCharging = false;
1152 BatteryLevel batteryLevel = BATTERY_FULL;
1153 long long int mem = 0;
1155 __formStatusFrameDeattivated = false;
1157 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1158 isEnabled = pCameraApp->IsFrameEnabled();
1160 if (isEnabled == false)
1162 pCameraApp->SetFrameEnabled(true);
1165 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1166 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1168 if (isInitCameraStaus == false)
1170 AppLogDebug("InitCamera is fail");
1175 mem = CmUtility::GetAvailableMemory();
1176 AppLogDebug("Available memory is : %lld", mem);
1178 if (_pCameraPresentationModel->IsCameraPoweredOn())
1180 result r = E_SUCCESS;
1181 BufferInfo bufferinfo;
1182 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED:CameraPoweredOn");
1184 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1186 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1187 _pCameraPresentationModel->StopCamera();
1189 r = _pCameraPresentationModel->InitializeCamera();
1190 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
1192 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1193 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1195 _pCameraPresentationModel->StartPreview(&bufferinfo);
1196 _pCameraPresentationModel->SetContinuousAutoFocus();
1198 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1199 isCharging = _pCameraPresentationModel->IsCharging();
1201 AppLogDebug("batteryLevel = %d", batteryLevel);
1203 if(mem < MIN_MEMORY_NEEDED)
1205 ShowMemoryFullPopup();
1209 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1211 if (isCharging == false)
1213 ShowLowBatteryPopup();
1218 if (CheckCallStatus())
1225 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED");
1227 if (!CheckCallStatus())
1229 GetCameraToForeground();
1232 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1233 isCharging = _pCameraPresentationModel->IsCharging();
1235 AppLogDebug("batteryLevel = %d", batteryLevel);
1236 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1238 if (isCharging == false)
1240 ShowLowBatteryPopup();
1245 CheckBatteryStatus();
1248 HideUiActionButton();
1251 if (_pThumbnailPanel != null)
1253 _pThumbnailPanel->DeleteOldBitmap();
1260 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
1262 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
1263 bool isInitCameraStaus = false;
1265 __formStatusFrameDeattivated = true;
1267 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1268 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1270 if (isInitCameraStaus == false)
1272 AppLogDebug("InitCamera is fail");
1276 MakeSettingPopupTab(false);
1278 HideUiActionButton();
1281 if (_pThumbnailPanel != null)
1283 _pThumbnailPanel->DeleteOldBitmap();
1290 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1292 _pResetPopUp->SetShowState(false);
1295 if (_isUsedTimerCaptured == true)
1299 _isUsedTimerCaptured = false;
1301 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1303 _pCameraInfoPanel->SetDrawPopupTimer(false);
1305 _pCameraInfoPanel->Invalidate(true);
1308 SendCameraToBackground();
1312 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
1314 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
1316 ShowCameraFailPopup();
1320 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
1322 if (CheckCallStatus())
1324 AppLogDebug("Preview Fail And InCall");
1328 if (_pCameraPresentationModel->GetStartPreviewException())
1330 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
1332 ShowCameraFailPopup();
1337 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
1339 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
1340 bool isCharging = false;
1341 BatteryLevel batteryLevel;
1343 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1344 isCharging = _pCameraPresentationModel->IsCharging();
1346 AppLogDebug("batteryLevel = %d", batteryLevel);
1347 AppLogDebug("isCharging = %d", isCharging);
1349 if (isCharging == false)
1351 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1353 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
1355 if ((_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURING
1356 || _pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURED)
1357 && __isTimerRunning == false)
1359 AppLogDebug("CAPTURING or CAPTURED");
1360 ShowLowBatteryPopup();
1366 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1371 CheckBatteryStatus();
1376 CheckBatteryStatus();
1381 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
1383 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
1385 _batteryStatus = GetCurrentBatteryState();
1387 AppLogDebug("_batteryStatus = %d", _batteryStatus);
1389 CheckBatteryStatus();
1393 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
1395 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
1397 int requestType = 0;
1399 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1401 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
1403 AppLogDebug("Camera Captured after TerminateApp()");
1406 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1410 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1414 OnTimerCapturePause();
1425 AppLogDebug("EXIT");
1429 CameraForm::InitSettingMenuPanel(void)
1431 AppLogDebug("ENTER");
1432 result r = E_SUCCESS;
1433 int cameraCount = 0;
1435 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
1436 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
1438 __pSettingPanel->AddTouchEventListener(*this);
1439 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
1441 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
1442 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
1443 _pFlashButton->AddTouchEventListener(*this);
1445 _pFlashButton->SetActionId(IDA_BUTTON_CAMERA_FLASH);
1446 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
1447 _pFlashButton->AddActionEventListener(*this);
1449 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
1450 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
1451 _pSelfShotButton->AddTouchEventListener(*this);
1453 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMERA_SELF);
1454 _pSelfShotButton->AddActionEventListener(*this);
1456 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
1457 TryCatch(_pSettingButton != null, r = E_SYSTEM, "pSettingButton is null");
1458 _pSettingButton->AddTouchEventListener(*this);
1460 _pSettingButton->SetActionId(IDA_BUTTON_CAMERA_SETTING);
1461 _pSettingButton->AddActionEventListener(*this);
1463 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
1464 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
1465 __pSettingLine->AddTouchEventListener(*this);
1467 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
1468 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
1469 _pQuickSettingButton->AddTouchEventListener(*this);
1471 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMERA_QUICK_SETTING);
1472 _pQuickSettingButton->AddActionEventListener(*this);
1474 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
1475 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
1477 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
1478 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
1479 _pWhiteBalanceButton->AddTouchEventListener(*this);
1480 _pWhiteBalanceButton->AddActionEventListener(*this);
1482 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
1483 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
1485 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
1486 _pExposureValueButton->AddTouchEventListener(*this);
1487 _pExposureValueButton->AddActionEventListener(*this);
1489 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
1490 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
1491 _pCloseButton->AddTouchEventListener(*this);
1493 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
1494 _pCloseButton->AddActionEventListener(*this);
1496 r = UpdateUiPanelIcon();
1497 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateSetUiPanelIcon() - fail[%s]", GetErrorMessage(r));
1499 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
1500 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
1501 if (cameraCount > SUPPORTED_CAMERA_NUM)
1503 _pSelfShotButton->SetEnabled(true);
1507 _pSelfShotButton->SetEnabled(false);
1509 AppLogDebug("EXIT");
1513 _pFlashButton = null;
1514 _pSelfShotButton = null;
1515 _pSettingButton = null;
1516 __pSettingLine = null;
1517 _pQuickSettingButton = null;
1518 _pWhiteBalanceButton = null;
1519 _pExposureValueButton = null;
1520 _pCloseButton = null;
1526 CameraForm::OnTouchModeSwitch(void)
1528 AppLogDebug("ENTER");
1529 result r = E_SUCCESS;
1531 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
1533 SceneManager* pSceneManager = SceneManager::GetInstance();
1534 AppAssert(pSceneManager);
1536 AppLogDebug("GoForward to IDSCN_CAMCORDER!!!");
1538 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1539 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
1541 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMCORDER));
1542 TryReturnVoid(r == E_SUCCESS, "SceneManager GoForward[%s]", GetErrorMessage(r));
1546 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
1548 AppLogDebug("EXIT");
1552 CameraForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
1554 AppLogDebug("ENTER");
1555 result r = E_SUCCESS;
1557 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
1558 if (__dir == ORIENTATION_STATUS_PORTRAIT
1559 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1561 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1562 _closeTimerValue = UNIT_VALUE_ZERO;
1564 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1565 _pExposureCloseTimer->Cancel();
1567 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1568 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1572 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1573 _closeTimerValue = UNIT_VALUE_ZERO;
1575 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1576 _pExposureCloseTimer->Cancel();
1578 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1579 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1581 AppLogDebug("EXIT");
1585 CameraForm::OnTouchLaunchImageview(void)
1587 AppLogDebug("ENTER");
1588 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
1589 String fullFileName = L"";
1591 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
1593 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
1595 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
1597 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
1599 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1601 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1603 if (fullFileName == L"")
1605 AppLogDebug("file do not found");
1609 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
1616 AppLogDebug("LaunchImageview");
1617 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1619 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1621 if (fullFileName == L"")
1623 AppLogDebug("file do not found");
1631 AppLogDebug("EXIT");
1635 CameraForm::OnTimerCapturePause(void)
1637 AppLogDebug("ENTER");
1638 if (__isTimerRunning == true)
1640 if (_pPopupTimer != null)
1642 _pPopupTimer->Cancel();
1644 delete _pPopupTimer;
1645 _pPopupTimer = null;
1648 _timeCount = INDEX_UNIT_ZERO;
1650 if (_isUsedTimerCaptured == true)
1652 __isTimerRunning = false;
1654 _pCameraPresentationModel->SetIntervalTimerRun(false);
1656 _isUsedTimerCaptured = false;
1658 if (_pIntervalValueTimer != null)
1660 _pIntervalValueTimer->Cancel();
1662 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
1664 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
1666 _pCameraInfoPanel->Invalidate(true);
1668 _pCameraInfoPanel->SetDrawPopupTimer(false);
1670 _pCameraInfoPanel->Invalidate(true);
1675 AppLogDebug("EXIT");
1679 CameraForm::OnTouchDoHidePopup(void)
1681 AppLogDebug("ENTER");
1682 bool doHidePopup = false;
1684 if (_pListViewCameraTabMainMenu != null)
1686 if (_pListViewCameraTabMainMenu->GetShowState() == true)
1692 if (_pListViewGeneralTabMainMenu != null)
1694 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
1700 if (_pListFlashMainMenu != null)
1702 if (_pListFlashMainMenu->GetShowState() == true)
1708 if (_pListWbMainMenu != null)
1710 if (_pListWbMainMenu->GetShowState() == true)
1716 if (_pListViewCameraTabSubMenu != null)
1718 if (_pListViewCameraTabSubMenu->GetShowState() == true)
1724 if (_pListViewGeneralTabSubMenu != null)
1726 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
1732 if (_pCameraInfoPanel->GetDrawExposure() == true)
1734 doHidePopup = false;
1737 AppLogDebug("EXIT");
1742 CameraForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1744 AppLogDebug("ENTER");
1745 result r = E_SUCCESS;
1746 String controlName = L"";
1748 if (_appControlActionCompleted)
1750 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1754 controlName = source.GetName();
1756 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1758 AppLogDebug("OnTouchPressed return");
1762 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1763 _pAppTimer->Cancel();
1765 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
1766 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
1768 if (_pCameraInfoPanel->GetDrawExposure() == true)
1770 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1771 _pExposureCloseTimer->Cancel();
1773 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1774 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1776 AppLogDebug("EXIT");
1780 CameraForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1782 AppLogDebug("ENTER");
1783 String controlName = source.GetName();
1785 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1787 AppLogDebug("OnTouchLongPressed return");
1791 if ((controlName.Equals(String(IDS_ACTION_UI_PANEL_CAPTURE_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1793 AppLogDebug("OnTouchLongPressed Action");
1794 if (source.Equals(*__pShutterButton) == true)
1796 _pCameraPresentationModel->SetContinuousAutoFocus();
1799 AppLogDebug("EXIT");
1803 CameraForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1805 AppLogDebug("ENTER");
1806 String controlName = L"";
1807 int checkActivePanel = -1;
1808 bool doHidePopup = false;
1810 if (_appControlActionCompleted)
1812 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1815 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
1816 controlName = source.GetName();
1818 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1820 AppLogDebug("OnTouchReleased return");
1824 if (_pCameraInfoPanel->GetDrawExposure() == true)
1826 if (source.Equals(*__pShutterButton) == true)
1828 _closeTimerValue = 0;
1830 if (_pExposureCloseTimer)
1832 _pExposureCloseTimer->Cancel();
1835 _pCameraInfoPanel->SetDrawExposure(false);
1841 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1843 OnTouchDrawExposure(currentPosition);
1848 doHidePopup = OnTouchDoHidePopup();
1849 AppLogDebug("doHidePopup = %d", doHidePopup);
1851 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
1853 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1855 DrawTouchAutoFocus(currentPosition);
1860 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
1861 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
1863 if (_pCameraInfoGeneralSubPanel != null)
1865 if (_pCameraInfoGeneralSubPanel->GetShowState())
1867 checkActivePanel = 0;
1870 if (_pCameraInfoSubPanel != null)
1872 if (_pCameraInfoSubPanel->GetShowState())
1874 checkActivePanel = 1;
1878 if (checkActivePanel != -1)
1880 if (checkActivePanel == 0)
1882 _pCameraInfoGeneralSubPanel->SetShowState(false);
1886 _pCameraInfoSubPanel->SetShowState(false);
1896 if (source.Equals(*__pCameraSettingLable) == true)
1898 CheckCameraSettingLabel();
1901 if (source.Equals(*__pGeneralSettingLable) == true)
1903 CheckGeneralSettingLabel();
1906 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
1907 && _pThumbnailPanel->GetShowState() == true
1908 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1909 && _pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED
1912 if (source.Equals(*_pThumbnailPanel) == true)
1914 AppLogDebug("Touch Thumbnail button");
1915 OnTouchLaunchImageview();
1919 if (_pCameraInfoPanel->GetDrawExposure() == true)
1921 HideExposurePanel();
1923 AppLogDebug("EXIT");
1927 CameraForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1929 AppLogDebug("ENTER");
1930 String controlName = L"";
1931 result r = E_SUCCESS;
1933 if (_appControlActionCompleted)
1935 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1939 controlName = source.GetName();
1941 if ((controlName.Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
1943 OnTouchModeSwitch();
1947 if (_pCameraInfoPanel->GetDrawExposure() == true)
1949 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1951 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
1952 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
1953 _closeTimerValue = 0;
1955 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1956 _pExposureCloseTimer->Cancel();
1959 AppLogDebug("EXIT");
1963 CameraForm::OnAppTimerExpired(void)
1965 AppLogDebug("ENTER");
1966 result r = E_SUCCESS;
1967 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1971 _pCameraPresentationModel->StopCamera();
1973 r = SendAppControlResult(pCameraApp->GetRequestId());
1974 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
1975 AppLogDebug("EXIT");
1979 CameraForm::OnPreviewFailPopupTimerExpired(void)
1981 AppLogDebug("ENTER");
1982 if (CheckCallStatus())
1984 AppLogDebug("Preview Fail And InCall");
1988 ShowCameraFailPopup();
1989 AppLogDebug("EXIT");
1993 CameraForm::OnCaptureStartTimerExpired(void)
1995 AppLogDebug("ENTER");
1996 result r = E_SUCCESS;
1997 int timerInterval = 0;
1999 if (_pCaptureStartTimer)
2001 _pCaptureStartTimer->Cancel();
2004 timerInterval = GetTimerIntervalValue();
2008 _isUsedTimerCaptured = true;
2010 r = SetTimerIntervalValue(timerInterval);
2011 TryReturnVoid(r == E_SUCCESS, "SetTimerIntervalValue() fail[%s]", GetErrorMessage(r));
2015 r = DrawTimerPopup();
2016 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
2017 AppLogDebug("EXIT");
2021 CameraForm::OnTouchAutoFocusTimerExpired(void)
2023 AppLogDebug("ENTER");
2024 _pCameraPresentationModel->SetContinuousAutoFocus();
2026 _pTouchAutoFocusTimer->Cancel();
2027 AppLogDebug("EXIT");
2031 CameraForm::OnPopupTimerExpired(void)
2033 AppLogDebug("ENTER");
2034 if (_pCameraPresentationModel->IsPreviewState() == true)
2038 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
2040 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
2042 _pCameraInfoPanel->Invalidate(true);
2044 AppLogDebug("_timeCount=%d", _timeCount);
2046 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
2051 AppLogDebug("EXIT");
2055 CameraForm::OnIntervalValueTimerExpired(void)
2057 AppLogDebug("ENTER");
2058 result r = E_SUCCESS;
2059 bool focusSupport = false;
2060 int selfPortraitEnable = 0;
2062 if (_isUsedTimerCaptured == true)
2064 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
2066 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
2068 _pCameraInfoPanel->Invalidate(true);
2070 _pCameraInfoPanel->SetDrawPopupTimer(false);
2072 _pCameraInfoPanel->Invalidate(true);
2076 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2077 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
2079 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2081 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
2085 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
2088 if (focusSupport == true && r == E_SUCCESS)
2090 _pCameraInfoPanel->SetDrawMarkerFocus(true);
2092 DrawFocus(CAMERA_FOCUS_NOT_READY);
2096 _pCameraInfoPanel->SetDrawMarkerFocus(false);
2098 _pCameraInfoPanel->Invalidate(true);
2102 _pCameraPresentationModel->Capture();
2104 __isTimerRunning = false;
2106 _pCameraPresentationModel->SetIntervalTimerRun(false);
2108 if (__pBatteryState)
2110 __pBatteryState->SetShowState(true);
2111 __pBatteryState->Draw();
2112 __pBatteryState->Show();
2118 AppLogDebug("EXIT");
2122 CameraForm::OnExposureCloseTimerExpired(void)
2124 AppLogDebug("ENTER");
2127 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
2129 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
2131 if (_pCameraInfoPanel->GetDrawExposure() == true)
2133 _pCameraInfoPanel->SetDrawExposure(false);
2139 _closeTimerValue = 0;
2141 _pExposureCloseTimer->Cancel();
2143 AppLogDebug("EXIT");
2147 CameraForm::OnChargingCompletedTimerExpired(void)
2149 AppLogDebug("ENTER");
2150 Bitmap* pBitmap = null;
2151 result r = E_SUCCESS;
2153 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2155 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2157 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2161 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2166 if (_chargingCount % DIVIDE_BY_TWO)
2168 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
2172 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
2174 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2176 if (_chargingCount >= BATTERY_STATE_20)
2178 _chargingCount = INDEX_UNIT_ZERO;
2182 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2183 __pBatteryState->Invalidate(true);
2185 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2186 AppLogDebug("_chargingCount = %d", _chargingCount);
2187 AppLogDebug("_blinkCount = %d", _blinkCount);
2192 AppLogDebug("EXIT");
2196 AppLogDebug("EXIT - CATCH");
2201 CameraForm::OnChargingTimerExpired(void)
2203 AppLogDebug("ENTER");
2204 Bitmap* pBitmap = null;
2205 result r = E_SUCCESS;
2206 int maxChargingCnt = 0;
2207 int batteryLevel = 0;
2208 Battery::GetCurrentLevelInPercentage(batteryLevel);
2210 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2212 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2214 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2218 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2221 AppLogDebug("batteryLevel = %d", batteryLevel);
2225 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2226 AppLogDebug("_chargingCount = %d", _chargingCount);
2228 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
2230 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
2234 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
2236 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2238 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
2240 AppLogDebug("maxCount = %d", maxChargingCnt);
2242 if (maxChargingCnt >= BATTERY_STATE_20)
2244 _chargingCount = INDEX_UNIT_ZERO;
2247 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2248 __pBatteryState->Invalidate(true);
2253 AppLogDebug("EXIT");
2257 AppLogDebug("EXIT - CATCH");
2262 CameraForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
2264 AppLogDebug("ENTER");
2265 if (timer.Equals(*_pAppTimer))
2267 AppLogDebug("_pAppTimer");
2268 OnAppTimerExpired();
2270 else if (timer.Equals(*_pCaptureStartTimer))
2272 AppLogDebug("_pCaptureStartTimer");
2273 OnCaptureStartTimerExpired();
2275 else if (timer.Equals(*_pTouchAutoFocusTimer))
2277 AppLogDebug("_pTouchAutoFocusTimer");
2278 OnTouchAutoFocusTimerExpired();
2280 else if (timer.Equals(*_pPopupTimer))
2282 AppLogDebug("_pPopupTimer");
2283 OnPopupTimerExpired();
2285 else if (timer.Equals(*_pIntervalValueTimer))
2287 AppLogDebug("_pIntervalValueTimer");
2288 OnIntervalValueTimerExpired();
2289 StartInitChargingTimer();
2291 else if (timer.Equals(*_pHelpCloseTimer))
2293 AppLogDebug("__pHelpCloseTimer");
2294 OnHelpCloseTimerExpired();
2296 else if (timer.Equals(*_pExposureCloseTimer))
2298 AppLogDebug("_pExposureCloseTimer");
2299 OnExposureCloseTimerExpired();
2301 else if (timer.Equals(*_pChargingTimer))
2303 result r = E_SUCCESS;
2304 AppLogDebug("_pChargingTimer");
2305 bool isCharging = false;
2307 _batteryStatus = GetCurrentBatteryState();
2308 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2310 isCharging = _pCameraPresentationModel->IsCharging();
2314 if (_batteryStatus == BATTERY_STATE_20)
2316 _chargingCount = INDEX_UNIT_ZERO;
2318 _blinkCount = INDEX_UNIT_ZERO;
2320 _pChargingTimer->Cancel();
2322 StartInitChargingCompletedTimer();
2326 r = OnChargingTimerExpired();
2331 _chargingCount = INDEX_UNIT_ZERO;
2333 _blinkCount = INDEX_UNIT_ZERO;
2335 _pChargingTimer->Cancel();
2337 if (_batteryStatus == BATTERY_STATE_20)
2339 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
2341 StartInitChargingCompletedTimer();
2345 else if (timer.Equals(*_pChargingCompletedTimer))
2347 result r = E_SUCCESS;
2348 AppLogDebug("__pChargingCompletedTimer");
2349 bool isCharging = false;
2351 isCharging = _pCameraPresentationModel->IsCharging();
2353 _batteryStatus = GetCurrentBatteryState();
2354 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2356 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
2358 if (_blinkCount == INDEX_UNIT_TWENTY)
2360 AppLogDebug("__pChargingCompletedTimer cancel");
2362 _chargingCount = INDEX_UNIT_ZERO;
2364 _blinkCount = INDEX_UNIT_ZERO;
2366 _pChargingCompletedTimer->Cancel();
2368 CheckBatteryStatus();
2372 AppLogDebug("OnChargingCompletedTimerExpired");
2374 r = OnChargingCompletedTimerExpired();
2379 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
2381 _chargingCount = INDEX_UNIT_ZERO;
2383 _blinkCount = INDEX_UNIT_ZERO;
2385 _pChargingCompletedTimer->Cancel();
2387 CheckBatteryStatus();
2390 else if (timer.Equals(*_pPreviewFailPopupTimer))
2392 AppLogDebug("__pPreviewFailPopupTimer");
2393 _pPreviewFailPopupTimer->Cancel();
2395 if (_pCameraPresentationModel->GetStartPreviewException())
2397 OnPreviewFailPopupTimerExpired();
2402 AppLogDebug("Not expire");
2404 AppLogDebug("EXIT");
2408 CameraForm::InitActionMenuPanel(void)
2410 AppLogDebug("ENTER");
2411 result r = E_SUCCESS;
2412 Rectangle rectThumbnailButton;
2413 Rectangle rectAccessibility;
2414 Rectangle clientArea = GetClientAreaBounds();
2416 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
2417 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
2419 __pActionPanel->AddTouchEventListener(*this);
2420 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
2422 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2424 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2425 || __dir == ORIENTATION_STATUS_PORTRAIT)
2427 if (clientArea.height == DISPLAY_WVGA)
2429 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2433 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2438 if (clientArea.width == DISPLAY_WVGA)
2440 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2444 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2448 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
2449 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2450 __pBatteryState->AddTouchEventListener(*this);
2451 __pBatteryState->SetShowState(true);
2453 __pCameraSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
2454 TryCatch(__pCameraSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
2455 __pCameraSetting->SetActionId(IDA_BUTTON_SETTING_CAMERA);
2456 __pCameraSetting->AddActionEventListener(*this);
2457 __pCameraSetting->SetShowState(false);
2459 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
2460 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
2461 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
2462 __pGeneralSetting->AddActionEventListener(*this);
2463 __pGeneralSetting->SetShowState(false);
2465 __pCameraSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
2466 TryCatch(__pCameraSettingLable != null, r = E_SYSTEM, "__pCameraSettingLable is null");
2467 __pCameraSettingLable->AddTouchEventListener(*this);
2468 __pCameraSettingLable->SetShowState(false);
2470 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
2471 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
2472 __pGeneralSettingLable->AddTouchEventListener(*this);
2473 __pGeneralSettingLable->SetShowState(false);
2475 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
2476 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
2477 __pCameraIconLabel->AddTouchEventListener(*this);
2479 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
2480 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
2482 __pSwButton->SetName(IDS_ACTION_UI_CAMERA_MODE);
2483 __pSwButton->AddTouchEventListener(*this);
2484 __pSwButton->AddKeyEventListener(*this);
2486 __pSwButton->GetAccessibilityContainer()->AddAccessibilityListener(*this);
2488 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
2489 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
2490 __pCamcoderIconLabel->AddTouchEventListener(*this);
2492 __pShutterButton = static_cast<Button*>(GetControl(L"IDC_SHUTTER_BUTTON"));
2493 TryCatch(__pShutterButton != null, r = E_SYSTEM, "__pShutterButton is null");
2495 __pShutterButton->SetActionId(IDA_BUTTON_CAMERA_SHUTTER);
2496 __pShutterButton->SetName(IDS_ACTION_UI_PANEL_CAPTURE_NAME);
2497 __pShutterButton->AddActionEventListener(*this);
2498 __pShutterButton->AddTouchEventListener(*this);
2500 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2502 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2503 || __dir == ORIENTATION_STATUS_PORTRAIT)
2505 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
2506 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
2508 rectAccessibility = Rectangle(rectThumbnailButton.x - 25,rectThumbnailButton.y - 22,rectThumbnailButton.width - 7,
2509 rectThumbnailButton.height - 10);
2513 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
2514 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
2517 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
2518 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
2519 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
2521 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
2522 _pThumbnailPanel->AddTouchEventListener(*this);
2523 _pThumbnailPanel->AddKeyEventListener(*this);
2525 //_pThumbnailPanel->SetUpdateListener(this);
2527 AddControl(_pThumbnailPanel);
2528 AddOrientationEventListener(*_pThumbnailPanel);
2530 _pAccessibilityElement = new AccessibilityElement();
2531 r = _pAccessibilityElement->Construct(rectAccessibility, L"Thumbnail Panel");
2532 _pAccessibilityElement->SetLabel(L"Thumbnail Panel");
2534 _pAccessibilityElement->SetBounds(rectAccessibility);
2535 _pThumbnailPanel->GetAccessibilityContainer()->AddElement(*_pAccessibilityElement);
2537 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
2538 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
2539 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMERA_THUMBNAIL);
2540 __pThumbnailButton->AddActionEventListener(*this);
2541 __pThumbnailButton->AddTouchEventListener(*this);
2542 __pThumbnailButton->SetShowState(false);
2544 r = UpdateUiActionPanelIcon();
2545 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() is fail[%s]", GetErrorMessage(r));
2547 AppLogDebug("EXIT");
2551 __pCameraIconLabel = null;
2552 __pCamcoderIconLabel = null;
2553 __pBatteryState = null;
2555 __pShutterButton = null;
2556 __pThumbnailButton = null;
2557 __pCameraSetting = null;
2558 __pGeneralSetting = null;
2559 __pCameraSettingLable = null;
2560 __pGeneralSettingLable = null;
2562 delete _pThumbnailPanel;
2563 _pThumbnailPanel = null;
2569 CameraForm::UpdateUiPanelIcon(void)
2571 AppLogDebug("ENTER");
2572 result r = E_SUCCESS;
2573 Bitmap* pBitmap = null;
2574 Bitmap* pBitmapRotate = null;
2575 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
2578 ImageRotationType rotationType = IMAGE_ROTATION_0;
2580 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2582 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2583 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2585 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2587 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2588 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2590 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2591 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2593 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2594 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2596 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2601 delete pBitmapRotate;
2602 pBitmapRotate = null;
2604 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2605 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2607 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2608 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2610 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2615 delete pBitmapRotate;
2616 pBitmapRotate = null;
2618 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2620 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2622 if (value == true && r == E_SUCCESS)
2624 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2625 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2629 case FLASH_MODE_OFF:
2631 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2632 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2634 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2635 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2637 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2642 delete pBitmapRotate;
2643 pBitmapRotate = null;
2645 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2646 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2648 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2649 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2651 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2656 delete pBitmapRotate;
2657 pBitmapRotate = null;
2663 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2664 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2666 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2667 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2669 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2674 delete pBitmapRotate;
2675 pBitmapRotate = null;
2677 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2678 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2680 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2681 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2683 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2688 delete pBitmapRotate;
2689 pBitmapRotate = null;
2693 case FLASH_MODE_AUTO:
2695 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2696 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2698 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2699 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2701 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2706 delete pBitmapRotate;
2707 pBitmapRotate = null;
2709 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2710 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2712 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2713 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2715 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2720 delete pBitmapRotate;
2721 pBitmapRotate = null;
2731 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2732 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2734 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2735 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2737 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2738 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2740 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2745 delete pBitmapRotate;
2746 pBitmapRotate = null;
2748 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2750 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2752 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2753 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2755 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2760 delete pBitmapRotate;
2761 pBitmapRotate = null;
2765 _pFlashButton->Invalidate(true);
2766 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2768 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2770 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2772 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2774 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2776 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2778 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2779 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2781 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2786 delete pBitmapRotate;
2787 pBitmapRotate = null;
2789 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2791 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2793 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2795 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2797 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2799 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2800 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2802 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2807 delete pBitmapRotate;
2808 pBitmapRotate = null;
2810 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2812 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2816 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2818 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2820 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2821 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2823 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2828 delete pBitmapRotate;
2829 pBitmapRotate = null;
2831 if (__dir == ORIENTATION_STATUS_LANDSCAPE
2832 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
2834 rotationType = IMAGE_ROTATION_270;
2837 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2839 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2840 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2842 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2843 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2845 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2850 delete pBitmapRotate;
2851 pBitmapRotate = null;
2853 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2854 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2856 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2857 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2859 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2864 delete pBitmapRotate;
2865 pBitmapRotate = null;
2867 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2869 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2870 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2872 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2873 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2875 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2880 delete pBitmapRotate;
2881 pBitmapRotate = null;
2883 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2885 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2886 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2888 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2893 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2894 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2896 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2901 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2903 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2905 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2909 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2914 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2915 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2917 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2922 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2923 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2925 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2932 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2933 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2935 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2940 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2941 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2943 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2949 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2951 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2952 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2954 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2956 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2957 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2959 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2964 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2966 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2967 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2969 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2970 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2972 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2973 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2978 delete pBitmapRotate;
2979 pBitmapRotate = null;
2981 AppLogDebug("EXIT");
2985 if (pBitmap != null)
2995 CameraForm::UpdateUiActionPanelIcon(void)
2997 AppLogDebug("ENTER");
2998 result r = E_SUCCESS;
2999 Bitmap* pBitmap = null;
3000 Bitmap* pBitmapRotate = null;
3001 ImageRotationType rotationType = IMAGE_ROTATION_0;
3002 Point ptShutterIcon;
3003 Point ptModeChangeButton;
3004 Rectangle rectThumbnailButton;
3006 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
3008 if (__dir == ORIENTATION_STATUS_PORTRAIT
3009 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3011 rotationType = IMAGE_ROTATION_90;
3012 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD, Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD);
3013 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
3015 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
3016 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
3018 rotationType = IMAGE_ROTATION_0;
3019 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD, Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD);
3020 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
3023 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
3024 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraIconLabel::pBitmap is null");
3026 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
3031 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
3032 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3034 pBitmapRotate = RotationImageN(pBitmap, rotationType);
3035 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
3037 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3038 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3042 delete pBitmapRotate;
3043 pBitmapRotate = null;
3045 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
3046 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3048 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
3052 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
3053 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderIconLabel::pBitmap is null");
3055 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
3060 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3061 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3063 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3064 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3069 delete pBitmapRotate;
3070 pBitmapRotate = null;
3072 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
3073 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3075 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3076 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3081 delete pBitmapRotate;
3082 pBitmapRotate = null;
3084 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3085 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3087 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3088 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3093 delete pBitmapRotate;
3094 pBitmapRotate = null;
3096 if (__dir == ORIENTATION_STATUS_PORTRAIT
3097 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3099 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL);
3100 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3104 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL_LAND);
3105 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3108 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3109 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3111 __pShutterButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3116 delete pBitmapRotate;
3117 pBitmapRotate = null;
3119 if (__dir == ORIENTATION_STATUS_PORTRAIT
3120 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3122 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS);
3123 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3127 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS_LAND);
3128 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3131 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3132 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3134 __pShutterButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3138 delete pBitmapRotate;
3139 pBitmapRotate = null;
3141 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_ICON);
3142 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3144 __pShutterButton->SetNormalBitmap(ptShutterIcon, *pBitmap);
3149 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3150 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3152 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
3157 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
3158 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3160 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
3165 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMERA);
3166 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraSetting::pBitmap is null");
3168 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3169 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CameraSetting::pBitmapRotate is null");
3171 __pCameraSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3172 __pCameraSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3177 delete pBitmapRotate;
3178 pBitmapRotate = null;
3180 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
3181 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
3183 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3184 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
3186 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3187 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3192 delete pBitmapRotate;
3193 pBitmapRotate = null;
3195 AppLogDebug("EXIT");
3199 if (pBitmap != null)
3209 CameraForm::SetTimerIntervalValue(int timerIntervalValue)
3211 AppLogDebug("ENTER");
3212 result r = E_SUCCESS;
3214 AppLogDebug("timerIntervalValue = %d", timerIntervalValue);
3216 switch (timerIntervalValue)
3218 case SETTING_TIMER_CAPTURE_0_SEC:
3223 case SETTING_TIMER_CAPTURE_2_SEC:
3225 _pIntervalValueTimer->Cancel();
3227 r = _pIntervalValueTimer->Start(CAMERA_TIMER_2_SEC);
3228 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3232 case SETTING_TIMER_CAPTURE_5_SEC:
3234 _pIntervalValueTimer->Cancel();
3236 r = _pIntervalValueTimer->Start(CAMERA_TIMER_5_SEC);
3237 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3241 case SETTING_TIMER_CAPTURE_10_SEC:
3243 _pIntervalValueTimer->Cancel();
3245 r = _pIntervalValueTimer->Start(CAMERA_TIMER_10_SEC);
3246 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3252 AppLogDebug("timer Invaild element id");
3257 AppLogDebug("EXIT");
3265 CameraForm::SetExifOrientation(int deviceOrientation)
3267 AppLogDebug("ENTER");
3268 result r = E_SUCCESS;
3270 r = _pCameraPresentationModel->SetExifOrientation(deviceOrientation);
3271 AppLogDebug("SetExifOrientation : deviceOrientation = %d, fail[%s]", deviceOrientation, GetErrorMessage(r));
3272 AppLogDebug("EXIT");
3276 CameraForm::StartCaptured(void)
3278 AppLogDebug("ENTER");
3279 result r = E_SUCCESS;
3280 int timerInterval = 0;
3282 timerInterval = GetTimerIntervalValue();
3284 switch (timerInterval)
3286 case SETTING_TIMER_CAPTURE_0_SEC:
3288 _isUsedTimerCaptured = false;
3290 __isTimerRunning = false;
3292 _pCameraPresentationModel->SetIntervalTimerRun(false);
3294 _pIntervalValueTimer->Cancel();
3296 _pCameraPresentationModel->Capture();
3298 StartInitChargingTimer();
3302 case SETTING_TIMER_CAPTURE_2_SEC:
3304 case SETTING_TIMER_CAPTURE_5_SEC:
3306 case SETTING_TIMER_CAPTURE_10_SEC:
3308 __isTimerRunning = true;
3310 if (__pBatteryState)
3312 __pBatteryState->SetShowState(false);
3313 __pBatteryState->Draw();
3314 __pBatteryState->Show();
3317 _pCameraPresentationModel->SetIntervalTimerRun(true);
3321 if (_pCameraInfoPanel != null)
3323 _pCameraInfoPanel->SetDrawIndicator(false);
3324 _pCameraInfoPanel->Invalidate(true);
3327 if (_isUsedTimerCaptured == false)
3329 _pCaptureStartTimer->Cancel();
3331 if (_pCameraInfoPanel != null)
3333 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3334 _pCameraInfoPanel->Invalidate(true);
3337 r = _pCaptureStartTimer->Start(CAMERA_TIMER_1_SEC);
3338 TryReturnVoid(r == E_SUCCESS, "_pCaptureStartTimer start fail[%s]", GetErrorMessage(r));
3346 AppLogDebug("EXIT");
3350 CameraForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
3352 AppLogDebug("ENTER");
3353 result r = E_SUCCESS;
3354 int selfPortraitEnable = 0;
3355 int guideLineEnable = 0;
3358 case IDA_BUTTON_CAMERA_FLASH:
3360 int selfPortraitEnable = 0;
3361 result r = E_SUCCESS;
3363 bool isCharging = false;
3364 BatteryLevel batteryLevel;
3366 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
3367 isCharging = _pCameraPresentationModel->IsCharging();
3369 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3370 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3372 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3374 AppLogDebug("FLASEH OFF!!!");
3378 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3380 if (value == true && r == E_SUCCESS)
3382 if (batteryLevel == BATTERY_LOW && isCharging == false)
3387 AppResource* pAppResource = null;
3389 pAppResource = Application::GetInstance()->GetAppResource();
3390 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
3392 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
3394 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
3395 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
3396 msgBox.ShowAndWait(result);
3405 AppLogDebug("FLASEH OFF!!!");
3411 case IDA_BUTTON_CAMERA_SELF:
3413 int selfPortraitEnable = 0;
3414 result r = E_SUCCESS;
3416 int cameraCount = 0;
3418 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
3420 AppLogDebug("Camera Preview is not");
3424 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
3425 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
3427 if (cameraCount < SUPPORTED_CAMERA_NUM)
3429 AppLogDebug("The physical direction of the camera is not exit");
3433 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3434 TryReturnVoid(r == E_SUCCESS, "Faled to get value to registry[%s]", GetErrorMessage(r));
3435 MakeSettingPopupTab(false);
3439 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3441 AppLogDebug("PRIMARY -> SECONDARY");
3443 __isToggleCameraDirection = true;
3445 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3446 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3448 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3449 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3451 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
3452 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3455 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3457 AppLogDebug("SECONDARY -> PRIMARY");
3458 int primaryFlashValue = FLASH_MODE_OFF;
3459 __isToggleCameraDirection = true;
3461 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3462 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3464 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3465 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3467 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3468 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3470 if (value == true && r == E_SUCCESS)
3472 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3473 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3477 UpdateUiPanelIcon();
3478 MakePreviewResolutionList(true);
3479 MakeCaptrueResolutionList(true);
3482 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3483 _pFlashButton->Invalidate(true);
3485 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
3486 _pSelfShotButton->Invalidate(true);
3488 __isToggleCameraDirection = false;
3492 case IDA_BUTTON_CAMERA_SETTING:
3494 result r = E_SUCCESS;
3496 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3497 _pAppTimer->Cancel();
3499 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3500 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3502 UpdateUiPanelIcon();
3508 case IDA_BUTTON_CLOSE_SETTING:
3510 result r = E_SUCCESS;
3512 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3513 _pAppTimer->Cancel();
3515 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3516 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3522 case IDA_BUTTON_CAMERA_QUICK_SETTING:
3524 result r = E_SUCCESS;
3526 int selfPortraitEnable = 0;
3528 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3529 _pAppTimer->Cancel();
3531 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3532 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3534 MakeCameraTabSettingPopup();
3536 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3538 if (_pListViewCameraTabMainMenu != null)
3540 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3542 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
3546 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
3549 if (__pCaptureResolutionList != null)
3551 if (!(__pCaptureResolutionList->GetCount()>1) || r != E_SUCCESS)
3553 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
3558 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
3561 if (__pIsoList != null)
3563 if (!(__pIsoList->GetCount()>1))
3565 _pListViewCameraTabMainMenu->SetItemEnabled(1,false);
3570 _pListViewCameraTabMainMenu->SetItemEnabled(1,false);
3577 case IDA_BUTTON_SETTING_CAMERA:
3579 result r = E_SUCCESS;
3581 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3582 _pAppTimer->Cancel();
3584 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3585 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3587 if (_pListViewGeneralTabMainMenu)
3589 _pListViewGeneralTabMainMenu->SetShowState(false);
3592 if (_pListViewGeneralTabSubMenu)
3594 _pListViewGeneralTabSubMenu->SetShowState(false);
3597 MakeCameraTabSettingPopup();
3601 case IDA_BUTTON_SETTING_GENERAL:
3603 result r = E_SUCCESS;
3605 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3606 _pAppTimer->Cancel();
3608 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3609 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3611 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
3613 if (_pListViewCameraTabMainMenu)
3615 _pListViewCameraTabMainMenu->SetShowState(false);
3618 if (_pListViewCameraTabSubMenu)
3620 _pListViewCameraTabSubMenu->SetShowState(false);
3623 MakeGeneralTabSettingPopup();
3627 case IDA_BUTTON_CAMERA_EV:
3629 result r = E_SUCCESS;
3630 bool exposureValue = false;
3631 bool brighnesstValue = false;
3632 int selfPortraitEnable = 0;
3633 int adjustValue = 0;
3635 if (_pCameraInfoPanel->GetDrawExposure() == true)
3637 AppLogDebug("Draw is Exposure status");
3641 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3642 _pAppTimer->Cancel();
3644 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3645 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3647 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3648 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3650 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3651 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3653 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3655 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
3659 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
3662 if (exposureValue == true && r == E_SUCCESS)
3664 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3666 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
3667 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3669 AppLogDebug("adjustValue = %d", adjustValue);
3671 _pCameraPresentationModel->SetExposure(adjustValue);
3673 MakeSettingPopupTab(false);
3677 r = CreateExposureSlider();
3678 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3680 r = DrawExposureSlider();
3681 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3685 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3687 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3691 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3694 if (brighnesstValue == true && r == E_SUCCESS)
3696 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3698 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
3699 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3701 AppLogDebug("adjustValue = %d", adjustValue);
3703 _pCameraPresentationModel->SetBrightness(adjustValue);
3705 MakeSettingPopupTab(false);
3709 r = CreateExposureSlider();
3710 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3712 r = DrawExposureSlider();
3713 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3717 AppLogDebug("Exposure do not support");
3723 case IDA_BUTTON_CAMERA_WB:
3725 result r = E_SUCCESS;
3726 int selfPortraitEnable = 0;
3728 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3729 _pAppTimer->Cancel();
3731 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3732 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3734 if (_pCameraInfoPanel->GetDrawExposure() == true)
3736 _closeTimerValue = 0;
3738 if (_pExposureCloseTimer)
3740 _pExposureCloseTimer->Cancel();
3743 _pCameraInfoPanel->SetDrawExposure(false);
3747 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3748 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3750 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3752 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
3756 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
3761 SetWhiteBalancePopop();
3765 AppLogDebug("WB is not support");
3770 case IDA_BUTTON_CAMERA_BACK:
3772 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
3773 result r = E_SUCCESS;
3775 r = BackButtonPerformed();
3776 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
3783 AppLogDebug("ResetPopup : MSGBOX_RESULT_YES");
3785 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3787 _pResetPopUp->SetShowState(false);
3790 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
3791 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3793 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
3795 r = DrawMarker(false);
3796 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
3798 SetGuideLine(SUBMENU_MODE_OFF);
3801 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3802 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3804 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3806 RestoreDefaultSetting();
3808 r = RestorePrimaryResolution();
3809 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3813 BufferInfo bufferinfo;
3815 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
3817 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3818 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
3820 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3821 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3823 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
3824 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
3826 _pCameraPresentationModel->StartPreview(&bufferinfo);
3828 _pCameraPresentationModel->SetContinuousAutoFocus();
3830 MakePreviewResolutionList(true);
3832 MakeCaptrueResolutionList(true);
3836 RestoreSecondaryResolution();
3837 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3839 RestoreDefaultSetting();
3842 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3843 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
3845 MakeSettingPopupTab(false);
3849 r = UpdateUiPanelIcon();
3850 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
3852 r = SetScreenOverlayHelpTimer();
3853 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
3855 r = DrawScreenOverlayHelp();
3856 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
3858 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3859 _pFlashButton->Invalidate(true);
3866 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3868 _pResetPopUp->SetShowState(false);
3870 MakeSettingPopupTab(false);
3871 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
3876 case IDA_BUTTON_CAMERA_SHUTTER:
3878 MakeSettingPopupTab(false);
3879 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
3888 AppLogDebug("EXIT");
3892 CameraForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
3894 AppLogDebug("ENTER");
3895 if (_appControlActionCompleted)
3897 AppLogDebug("EXIT - App Terminate");
3900 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
3901 AppLogDebug("EXIT");
3905 CameraForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
3907 AppLogDebug("ENTER");
3908 bool isExistThumbnail = false;
3909 Bitmap* pBitmap = null;
3910 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
3912 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3914 if (isExistThumbnail == false)
3916 AppLogDebug("Thumbnail is not found");
3918 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
3920 _pThumbnailPanel->SetShowState(false);
3921 _pThumbnailPanel->Draw();
3922 _pThumbnailPanel->Show();
3924 __pThumbnailButton->SetShowState(true);
3926 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3927 TryReturnVoid(pBitmap != null, "pBitmap is null");
3929 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
3934 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3935 TryReturnVoid(pBitmap != null, "pBitmap is null");
3937 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
3942 __pThumbnailButton->Draw();
3943 __pThumbnailButton->Show();
3950 AppLogDebug("pThumbnailBitmap is not null");
3952 AppLogDebug("EXIT");
3956 CameraForm::Initialize(void)
3958 AppLogDebug("ENTER");
3959 result r = E_SUCCESS;
3961 Construct(L"IDL_CAMERA_FORM");
3963 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
3964 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
3966 AppLogDebug("EXIT");
3974 CameraForm::InitAppTimer(void)
3976 AppLogDebug("ENTER");
3977 _pAppTimer = new (std::nothrow) Timer();
3978 _pAppTimer->Construct(*this);
3979 AppLogDebug("EXIT");
3983 CameraForm::InitChargingTimer(void)
3985 AppLogDebug("ENTER");
3986 _pChargingTimer = new (std::nothrow) Timer();
3987 _pChargingTimer->Construct(*this);
3988 AppLogDebug("EXIT");
3992 CameraForm::InitChargingCompletedTimer(void)
3994 AppLogDebug("ENTER");
3995 _pChargingCompletedTimer = new (std::nothrow) Timer();
3996 _pChargingCompletedTimer->Construct(*this);
3997 AppLogDebug("EXIT");
4001 CameraForm::InitPreviewFailPopupTimer(void)
4003 AppLogDebug("ENTER");
4004 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
4005 _pPreviewFailPopupTimer->Construct(*this);
4006 AppLogDebug("EXIT");
4010 CameraForm::InitIntervalValueTimer(void)
4012 AppLogDebug("ENTER");
4013 _pIntervalValueTimer = new (std::nothrow) Timer();
4014 _pIntervalValueTimer->Construct(*this);
4015 AppLogDebug("EXIT");
4019 CameraForm::InitCaptureStartTimer(void)
4021 AppLogDebug("ENTER");
4022 _pCaptureStartTimer = new (std::nothrow) Timer();
4023 _pCaptureStartTimer->Construct(*this);
4024 AppLogDebug("EXIT");
4028 CameraForm::InitTouchAutoFocusStartTimer(void)
4030 AppLogDebug("ENTER");
4031 _pTouchAutoFocusTimer = new (std::nothrow) Timer();
4032 _pTouchAutoFocusTimer->Construct(*this);
4033 AppLogDebug("EXIT");
4037 CameraForm::StartInitAppTimer(void)
4039 AppLogDebug("ENTER");
4040 result r = E_SUCCESS;
4042 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4044 _pAppTimer->Cancel();
4046 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4047 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4048 AppLogDebug("EXIT");
4052 CameraForm::StartPreviewFailPopupTimer(void)
4054 AppLogDebug("ENTER");
4055 result r = E_SUCCESS;
4057 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4059 _pPreviewFailPopupTimer->Cancel();
4061 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4062 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4063 AppLogDebug("EXIT");
4067 CameraForm::StartInitChargingCompletedTimer(void)
4069 AppLogDebug("ENTER");
4070 result r = E_SUCCESS;
4071 bool isCharging = false;
4073 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4075 isCharging = _pCameraPresentationModel->IsCharging();
4077 _batteryStatus = GetCurrentBatteryState();
4078 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4080 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4082 if (_pChargingCompletedTimer)
4084 _pChargingCompletedTimer->Cancel();
4091 r = DrawBatteryLevelFull();
4092 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4094 AppLogDebug("EXIT");
4097 _chargingCount = INDEX_UNIT_ZERO;
4099 if (_batteryStatus == BATTERY_STATE_20)
4101 if (_pChargingCompletedTimer)
4103 _pChargingCompletedTimer->Cancel();
4105 r = _pChargingCompletedTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4106 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4111 if (_pChargingCompletedTimer)
4113 _pChargingCompletedTimer->Cancel();
4119 CheckBatteryStatus();
4121 AppLogDebug("EXIT");
4125 CameraForm::StartInitChargingTimer(void)
4127 AppLogDebug("ENTER");
4128 result r = E_SUCCESS;
4129 bool isCharging = false;
4131 TryReturnVoid(_pChargingTimer != null, "_pChargingTimer is null");
4133 isCharging = _pCameraPresentationModel->IsCharging();
4135 _chargingCount = INDEX_UNIT_ZERO;
4139 if (_pChargingTimer)
4141 _pChargingTimer->Cancel();
4143 r = _pChargingTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4144 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4149 if (_pChargingTimer)
4151 _pChargingTimer->Cancel();
4154 AppLogDebug("EXIT");
4158 CameraForm::ToggleCameraDirection(int direction)
4160 AppLogDebug("ENTER");
4161 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4162 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4163 result r = E_SUCCESS;
4165 Point currentPosition;
4166 BufferInfo bufferinfo;
4167 bool isInitCameraStaus = false;
4169 if (_pAppTimer != null)
4171 _pAppTimer->Cancel();
4173 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4174 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
4177 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4179 AppLogDebug("FRONT");
4180 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
4182 else if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
4184 AppLogDebug("BACK");
4185 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_BACK);
4187 TryCatch(r == E_SUCCESS, , "__pCamcorderPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
4189 dim = _pCameraPresentationModel->GetPreviewResolution();
4190 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
4192 AppLogDebug("__screenMode [%d]", __screenMode);
4194 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4196 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
4200 r = SetScreenMode(__screenMode, true);
4202 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
4204 if (__dir == ORIENTATION_STATUS_PORTRAIT
4205 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4207 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
4208 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
4212 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4213 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4218 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
4219 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
4221 if (isInitCameraStaus)
4223 SetCameraSettingsDevice();
4226 AppLogDebug("EXIT");
4234 CameraForm::MakePreviewResolutionList(bool remakeList = false)
4236 AppLogDebug("ENTER");
4237 Dimension dimResolution;
4238 IList* pTempList = null;
4239 String* pItemString = null;
4241 result r = E_SUCCESS;
4244 Dimension dimension;
4245 Dimension tempDimention(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
4246 int previewResolutionIdx = 0;
4250 if (__pPreviewResolutionList)
4252 __pPreviewResolutionList->RemoveAll(true);
4255 delete __pPreviewResolutionList;
4256 __pPreviewResolutionList = null;
4259 if (__pPreviewResolutionList == null)
4261 __pPreviewResolutionList = new (std::nothrow) ArrayList();
4262 r = __pPreviewResolutionList->Construct();
4263 TryCatch(r == E_SUCCESS, , "__pPreviewResolutionList construct fail[%s]", GetErrorMessage(r));
4265 pTempList = _pCameraPresentationModel->GetPreviewResolutionList();
4266 TryCatch(pTempList != null, , "GetPreviewResolutionList() return null");
4267 tot = pTempList->GetCount();
4270 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4272 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4274 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d", dimResolution.width, dimResolution.height);
4276 pItemString = new (std::nothrow) String(tempString);
4277 TryCatch(pItemString != null, , "pItemString is null");
4279 __pPreviewResolutionList->Add(*pItemString);
4281 AppLogDebug("GetPreviewResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4283 if (dimResolution == tempDimention)
4285 previewResolutionIdx = idx;
4291 AppLogDebug("Not Support CaptureResolution");
4294 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(previewResolutionIdx)));
4297 __previewResolutionWidth = dimResolution.width;
4298 __previewResolutionHeight = dimResolution.height;
4300 AppLogDebug("previewResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4302 AppLogDebug("EXIT");
4306 if (__pPreviewResolutionList)
4308 __pPreviewResolutionList->RemoveAll(true);
4310 delete __pPreviewResolutionList;
4311 __pPreviewResolutionList = null;
4316 CameraForm::MakeCaptrueResolutionList(bool remakeList = false)
4318 AppLogDebug("ENTER");
4319 Dimension dimPreviewResolution;
4320 Dimension dimResolution;
4321 IList* pTempList = null;
4322 String* pItemString = null;
4324 result r = E_SUCCESS;
4327 int resolutionRatio = 0;
4331 if (__pCaptureResolutionList)
4333 __pCaptureResolutionList->RemoveAll(true);
4336 delete __pCaptureResolutionList;
4337 __pCaptureResolutionList = null;
4340 if (__pCaptureResolutionList == null)
4342 __pCaptureResolutionList = new (std::nothrow) ArrayList();
4343 r = __pCaptureResolutionList->Construct();
4344 TryCatch(r == E_SUCCESS, , "__pCaptureResolutionList construct fail[%s]", GetErrorMessage(r));
4346 pTempList = _pCameraPresentationModel->GetCaptureResolutionList();
4347 TryCatch(pTempList != null, , "GetCaptureResolutionList() return null");
4348 tot = pTempList->GetCount();
4351 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4353 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4355 if (dimResolution.width >= __previewResolutionWidth && dimResolution.height >= __previewResolutionHeight)
4357 resolutionRatio = (dimResolution.width * MULTIPLY_BY_TEN) / (dimResolution.height);
4359 if (resolutionRatio > NORMAL_MODE_RATIO)
4361 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(16:9)", dimResolution.width, dimResolution.height);
4365 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(4:3)", dimResolution.width, dimResolution.height);
4368 pItemString = new (std::nothrow) String(tempString);
4369 TryCatch(pItemString != null, , "pItemString is null");
4371 __pCaptureResolutionList->Add(*pItemString);
4373 AppLogDebug("GetCaptureResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4379 AppLogDebug("Not Support CaptureResolution");
4383 AppLogDebug("EXIT");
4387 if (__pCaptureResolutionList)
4389 __pCaptureResolutionList->RemoveAll(true);
4391 delete __pCaptureResolutionList;
4392 __pCaptureResolutionList = null;
4397 CameraForm::MakeIsoList(bool remakeList = false)
4399 AppLogDebug("ENTER");
4400 IList* pTempList = null;
4401 String* pItemString = null;
4403 result r = E_SUCCESS;
4407 const mchar* isoMap[] =
4425 __pIsoList->RemoveAll(true);
4432 if (__pIsoList == null)
4434 __pIsoList = new (std::nothrow) ArrayList();
4435 r = __pIsoList->Construct();
4436 TryCatch(r == E_SUCCESS, , "__pIsoList construct fail[%s]", GetErrorMessage(r));
4438 pTempList = _pCameraPresentationModel->GetIsoList();
4439 TryCatch(pTempList != null, , "GetIsoList() return null");
4440 tot = pTempList->GetCount();
4443 for (idx = 0; idx < tot; idx++)
4445 Tizen::Base::Integer* isoObj = (Tizen::Base::Integer*) pTempList->GetAt(idx);
4447 int isoType = isoObj ? isoObj->ToInt() : -INDEX_UNIT_ONE;
4449 if (isoType > 0 && isoType < MAX_ISO_COUNT)
4451 pItemString = new (std::nothrow) String(isoMap[isoType]);
4452 TryCatch(pItemString != null, , "pItemString is null");
4454 AppLogDebug("ISO return is = %d VALUE = %ls", isoType, pItemString->GetPointer());
4455 __pIsoList->Add(*pItemString);
4459 AppLogDebug("isoType out of range");
4465 AppLogDebug("EXIT");
4471 __pIsoList->RemoveAll(true);
4479 CameraForm::MakeSettingPopupTab(bool isShow)
4481 AppLogDebug("ENTER");
4484 if (__pCameraSetting)
4486 __pCameraSetting->SetShowState(true);
4487 __pCameraSetting->Invalidate(true);
4490 if (__pCameraSettingLable)
4492 __pCameraSettingLable->SetShowState(true);
4493 __pCameraSettingLable->Invalidate(true);
4496 if (__pGeneralSetting)
4498 __pGeneralSetting->SetShowState(true);
4499 __pGeneralSetting->Invalidate(true);
4502 if (__pGeneralSettingLable)
4504 __pGeneralSettingLable->SetShowState(true);
4505 __pGeneralSettingLable->Invalidate(true);
4510 if (__pCameraSetting)
4512 __pCameraSetting->SetShowState(false);
4513 __pCameraSetting->Invalidate(true);
4516 if (__pCameraSettingLable)
4518 __pCameraSettingLable->SetShowState(false);
4519 __pCameraSettingLable->Invalidate(true);
4522 if (__pGeneralSetting)
4524 __pGeneralSetting->SetShowState(false);
4525 __pGeneralSetting->Invalidate(true);
4528 if (__pGeneralSettingLable)
4530 __pGeneralSettingLable->SetShowState(false);
4531 __pGeneralSettingLable->Invalidate(true);
4534 AppLogDebug("EXIT");
4538 CameraForm::MakeCameraTabSettingPopup(void)
4540 AppLogDebug("ENTER");
4541 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4542 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4545 MakePreviewResolutionList(true);
4547 MakeCaptrueResolutionList(false);
4553 _pCameraInfoPanel->SetDrawExposure(false);
4555 if (__dir == ORIENTATION_STATUS_PORTRAIT
4556 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4558 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4559 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN - 1);
4563 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4564 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE- H_SETTING_MENU_LIST_MARGIN);
4567 MakeCameraTabMenuString();
4568 SetCameraTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
4569 MakeSettingPopupTab(true);
4571 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
4572 _pCameraInfoPanel->Invalidate(true);
4573 if (_pListViewCameraTabMainMenu == null)
4575 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
4576 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4578 _pListViewCameraTabMainMenu->SetItemProvider(*this);
4579 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
4580 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
4584 _pListViewCameraTabMainMenu->SetShowState(true);
4585 _pListViewCameraTabMainMenu->SetBounds(rectList);
4587 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
4589 _pListViewCameraTabMainMenu->UpdateList();
4590 AppLogDebug("EXIT");
4594 CameraForm::MakeGeneralTabSettingPopup(void)
4596 AppLogDebug("ENTER");
4597 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4598 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4601 _pCameraInfoPanel->SetDrawExposure(false);
4603 if (__dir == ORIENTATION_STATUS_PORTRAIT
4604 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4606 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4607 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT + 2);
4611 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4612 W_SETTING_MENU_LIST_LANDSCAPE+3, H_SETTING_MENU_LIST_LANDSCAPE + 2);
4615 MakeGeneralTabMenuString();
4616 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
4617 MakeSettingPopupTab(true);
4619 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
4620 _pCameraInfoPanel->Invalidate(true);
4622 if (_pListViewGeneralTabMainMenu == null)
4624 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
4625 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4627 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
4628 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
4629 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
4633 _pListViewGeneralTabMainMenu->SetShowState(true);
4634 _pListViewGeneralTabMainMenu->SetBounds(rectList);
4637 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
4638 _pListViewGeneralTabMainMenu->UpdateList();
4639 AppLogDebug("EXIT");
4643 CameraForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4645 AppLogDebug("ENTER");
4646 AppLogDebug("EXIT");
4650 CameraForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4652 AppLogDebug("ENTER");
4653 result r = E_SUCCESS;
4655 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4657 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4659 _currentSettingsMenuIndex = index;
4660 r = ProcessCameraTabMainListPopup(index);
4661 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4664 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4666 r = ProcessCameraTabSubListPopup(index);
4667 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4669 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4671 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4673 _currentSettingsMenuIndex = index;
4674 r = ProcessGeneraTabMainListPopup(index);
4675 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4678 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4680 r = ProcessGeneraTabSubListPopup(index);
4681 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4683 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4685 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4687 r = ProcessFlashListPopup(index);
4688 UpdateUiPanelIcon();
4689 TryReturnVoid(r == E_SUCCESS, "ProcessMainListPopup() fail[%s]", GetErrorMessage(r));
4692 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4694 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4696 r = SubListPopupWhiteBalanceMode(index);
4697 TryReturnVoid(r == E_SUCCESS, "SubListPopupWhiteBalanceMode() fail[%s]", GetErrorMessage(r));
4703 AppLogDebug("OnListViewItemStateChanged is not make");
4705 AppLogDebug("EXIT");
4709 CameraForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4711 AppLogDebug("ENTER");
4712 AppLogDebug("EXIT");
4716 CameraForm::CreateItem(int index, int itemWidth)
4718 AppLogDebug("ENTER");
4719 CustomItem* pItem = null;
4720 bool createSubMenu = false;
4721 bool createGenSubMenu = false;
4722 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
4723 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
4724 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
4725 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
4726 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
4727 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
4728 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
4729 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
4732 if (_pListViewCameraTabSubMenu)
4734 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4736 createSubMenu = true;
4737 pItem = CreateCameraTabSubMenuItem(index, itemWidth);
4741 AppLogDebug("CreateCameraTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4746 AppLogDebug("EXIT");
4752 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4754 if (createSubMenu == false)
4756 pItem = CreateCameraTabMainMenuItem(index, itemWidth);
4760 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4765 AppLogDebug("EXIT");
4771 if (_pListViewGeneralTabSubMenu)
4773 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4775 createGenSubMenu = true;
4776 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4780 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4785 AppLogDebug("EXIT");
4791 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4793 if (createGenSubMenu == false)
4795 AppLogDebug("CreateGeneralTabMainMenuItem");
4796 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4800 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4805 AppLogDebug("EXIT");
4811 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4813 pItem = CreateFlashMainMenuItem(index, itemWidth);
4817 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListFlashMainMenu");
4822 AppLogDebug("EXIT");
4827 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4829 pItem = CreateWhiteBalanceItem(index, itemWidth);
4833 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListWbMainMenu");
4838 AppLogDebug("EXIT");
4843 AppLogDebug("EXIT");
4848 CameraForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4850 AppLogDebug("ENTER");
4854 AppLogDebug("EXIT");
4859 CameraForm::GetItemCount(void)
4861 AppLogDebug("ENTER");
4862 if (_pListViewCameraTabSubMenu)
4864 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4866 AppLogDebug("EXIT");
4867 return GetCameraTabSettingSubMenuCount();
4871 if (_pListViewCameraTabMainMenu)
4873 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4875 AppLogDebug("EXIT");
4876 return GetCameraTabSettingMainMenuCount();
4880 if (_pListViewGeneralTabSubMenu)
4882 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4884 AppLogDebug("EXIT");
4885 return GetGeneralTabSettingSubMenuCount();
4889 if (_pListViewGeneralTabMainMenu)
4891 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4893 AppLogDebug("EXIT");
4894 return GetGeneralTabSettingMainMenuCount();
4898 if (_pListFlashMainMenu)
4900 AppLogDebug("EXIT");
4901 return GetCameraTabSettingMainMenuCount();
4904 if (_pListWbMainMenu)
4906 AppLogDebug("EXIT");
4907 return GetCameraTabSettingMainMenuCount();
4910 AppLogDebug("EXIT");
4915 CameraForm::GetGeneralTabSettingMainMenuCount(void) const
4917 AppLogDebug("ENTER");
4918 AppLogDebug("EXIT");
4919 return __generalTabMainMenuCount;
4923 CameraForm::SetGeneralTabSettingMainMenuCount(int count)
4925 AppLogDebug("ENTER");
4926 __generalTabMainMenuCount = count;
4927 AppLogDebug("EXIT");
4931 CameraForm::GetGeneralTabSettingSubMenuCount(void) const
4933 AppLogDebug("ENTER");
4934 AppLogDebug("EXIT");
4935 return __generalTabSubMenuCount;
4939 CameraForm::SetGeneralTabSettingSubMenuCount(int count)
4941 AppLogDebug("ENTER");
4942 __generalTabSubMenuCount = count;
4943 AppLogDebug("EXIT");
4946 inline GeneralTabSubMenuContent
4947 CameraForm::GetGeneralTabSettingSubMenuMode(void) const
4949 AppLogDebug("ENTER");
4950 AppLogDebug("EXIT");
4951 return __generalTabSettingMode;
4955 CameraForm::SetSettingGenSubMenuMode(const GeneralTabSubMenuContent mode)
4957 AppLogDebug("ENTER");
4958 AppLogDebug("EXIT");
4959 __generalTabSettingMode = mode;
4963 CameraForm::SetGeneralTabSubMenuListviewState(const int menuCount, const GeneralTabSubMenuContent mode)
4965 AppLogDebug("ENTER");
4966 SetGeneralTabSettingSubMenuCount(menuCount);
4967 SetSettingGenSubMenuMode(mode);
4968 AppLogDebug("EXIT");
4972 CameraForm::GetCameraTabSettingMainMenuCount(void) const
4974 AppLogDebug("ENTER");
4975 AppLogDebug("EXIT");
4976 return __cameraTabMainMenuCount;
4980 CameraForm::SetCameraTabSettingMainMenuCount(int count)
4982 AppLogDebug("ENTER");
4983 __cameraTabMainMenuCount = count;
4984 AppLogDebug("EXIT");
4988 CameraForm::GetCameraTabSettingSubMenuCount(void) const
4990 AppLogDebug("ENTER");
4991 AppLogDebug("EXIT");
4992 return __cameraTabSubMenuCount;
4996 CameraForm::SetCameraTabSettingSubMenuCount(int count)
4998 AppLogDebug("ENTER");
4999 __cameraTabSubMenuCount = count;
5000 AppLogDebug("EXIT");
5003 inline CameraTabSubMenuContent
5004 CameraForm::GetCameraTabSettingSubMenuMode(void) const
5006 AppLogDebug("ENTER");
5007 AppLogDebug("EXIT");
5008 return __cameraTabSettingMode;
5012 CameraForm::SetCameraTabSettingSubMenuMode(const CameraTabSubMenuContent mode)
5014 AppLogDebug("ENTER");
5015 AppLogDebug("EXIT");
5016 __cameraTabSettingMode = mode;
5020 CameraForm::SetCameraTabSubMenuListviewState(const int menuCount, const CameraTabSubMenuContent mode)
5022 AppLogDebug("ENTER");
5023 SetCameraTabSettingSubMenuCount(menuCount);
5024 SetCameraTabSettingSubMenuMode(mode);
5025 AppLogDebug("EXIT");
5029 CameraForm::SetMenuTitle(Canvas* pCanvas, const String& str, const int fntSize)
5031 AppLogDebug("ENTER");
5036 result r = E_SUCCESS;
5037 String listName = L"";
5039 TryCatch(pCanvas != null, r = E_SYSTEM, "pCanvas is null");
5041 if (_pListViewCameraTabSubMenu)
5043 listRect = _pListViewCameraTabSubMenu->GetBounds();
5045 else if (_pListViewCameraTabMainMenu)
5047 listRect = _pListViewCameraTabMainMenu->GetBounds();
5048 listName = _pListViewCameraTabMainMenu->GetName();
5050 else if (_pListFlashMainMenu)
5052 listRect = _pListFlashMainMenu->GetBounds();
5053 listName = _pListFlashMainMenu->GetName();
5055 else if (_pListWbMainMenu)
5057 listRect = _pListWbMainMenu->GetBounds();
5058 listName = _pListWbMainMenu->GetName();
5060 else if (_pListViewGeneralTabSubMenu)
5062 listRect = _pListViewGeneralTabSubMenu->GetBounds();
5064 else if (_pListViewGeneralTabMainMenu)
5066 listRect = _pListViewGeneralTabMainMenu->GetBounds();
5067 listName = _pListViewGeneralTabMainMenu->GetName();
5070 pFnt = new (std::nothrow) Font();
5071 pFnt->Construct(FONT_STYLE_PLAIN, fntSize);
5073 r = pFnt->GetTextExtent(str, str.GetLength(), dim);
5074 TryCatch(pFnt != null, , "pFnt GetTextExtent() fail[%s]", GetErrorMessage(r));
5076 r = pCanvas->SetFont(*pFnt);
5077 TryCatch(pFnt != null, , "pCanvas SetFont() fail[%s]", GetErrorMessage(r));
5079 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
5081 point.x = (listRect.width / DIVIDE_BY_TWO) - (dim.width / DIVIDE_BY_TWO);
5082 point.y = (H_SETTING_MENU_PANEL_TITLE / DIVIDE_BY_TWO) - (dim.height / DIVIDE_BY_TWO);
5084 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5086 if (__dir == ORIENTATION_STATUS_PORTRAIT
5087 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5089 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT;
5091 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
5092 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
5094 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE;
5097 else if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)))
5099 point.y += H_FLASH_MODE_TITLE_TOP_MARGIN;
5101 if (__dir == ORIENTATION_STATUS_PORTRAIT
5102 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5104 point.x += X_FLASH_MODE_LIST_START_POS_PORTRAIT;
5108 r = pCanvas->DrawText(point, str);
5109 TryCatch( r == E_SUCCESS, , "pCanvas DrawText() fail[%s]", GetErrorMessage(r));
5114 AppLogDebug("EXIT");
5125 CameraForm::GetTimerIntervalValue(void) const
5127 AppLogDebug("ENTER");
5128 result r = E_SUCCESS;
5129 int timerInterval = 0;
5131 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
5132 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
5134 AppLogDebug("EXIT");
5135 return timerInterval;
5142 CameraForm::SetGuideLine(int guideLineEnable)
5144 AppLogDebug("ENTER");
5145 result r = E_SUCCESS;
5147 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
5148 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
5149 AppLogDebug("EXIT");
5153 CameraForm::RestoreDefaultSetting(void)
5155 AppLogDebug("ENTER");
5156 result r = E_SUCCESS;
5157 int selfPortraitEnable = 0;
5158 bool exposureValue = false;
5159 bool brighnesstValue = false;
5160 int adjustValue = 0;
5162 r = _pCameraPresentationModel->ResetCameraSettingsRegistry();
5163 TryCatch(r == E_SUCCESS, ,"ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
5165 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5166 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5168 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5170 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5174 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5177 if (exposureValue == true && r == E_SUCCESS)
5179 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5180 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5182 AppLogDebug("adjustValue = %d", adjustValue);
5184 _pCameraPresentationModel->SetExposure(adjustValue);
5188 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5190 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5194 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5197 if (brighnesstValue == true && r == E_SUCCESS)
5199 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5200 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5202 AppLogDebug("adjustValue = %d", adjustValue);
5204 _pCameraPresentationModel->SetBrightness(adjustValue);
5208 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5210 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5214 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5219 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5221 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5225 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5227 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5229 AppLogDebug("adjustValue = %d", adjustValue);
5231 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5234 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5236 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_FLASH_MODE);
5240 r = _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
5241 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5246 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_FLASH_MODE);
5250 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(CAMERA_FLASH_MODE_OFF));
5251 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5255 AppLogDebug("EXIT");
5259 AppLogDebug("EXIT - CATCH");
5264 CameraForm::RestorePrimaryResolution(void)
5266 AppLogDebug("ENTER");
5267 result r = E_SUCCESS;
5268 IList* pList = null;
5269 IList* pCaptureResolutionList = null;
5270 int resolutionCnt = 0;
5271 bool wideMode = false;
5272 int resolutionIndex = 0;
5273 int resolutionRatio = 0;
5274 Dimension resolutionDim;
5275 Dimension captureResolutionDim;
5276 BufferInfo bufferinfo;
5278 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5279 _pAppTimer->Cancel();
5281 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5282 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5284 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5286 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5288 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5290 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5292 if (resolutionRatio > NORMAL_MODE_RATIO)
5296 SetOverlayPanelWideMode(true);
5298 SetOverlayRendererRotation();
5304 SetOverlayPanelNormalMode(true);
5306 SetOverlayRendererRotation();
5309 _pCameraPresentationModel->KeepScreenOnState(true, false);
5311 _pCameraPresentationModel->StopCamera();
5313 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
5314 TryCatch(r == E_SUCCESS, , "SetMode fail[%s]", GetErrorMessage(r));
5316 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5318 resolutionCnt = pList->GetCount();
5320 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5322 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5324 __captureResolutionWidth = captureResolutionDim.width;
5326 __captureResolutionHeight = captureResolutionDim.height;
5328 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5330 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5332 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5333 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
5335 _pCameraPresentationModel->StartPreview(&bufferinfo);
5337 _pCameraPresentationModel->SetContinuousAutoFocus();
5339 if (wideMode == true)
5341 __pOverlayPanel->AddTouchEventListener(*this);
5343 HidePanel(true, true);
5345 __screenMode = SCREEN_MODE_FULL;
5349 __pOverlayPanel->RemoveTouchEventListener(*this);
5351 HidePanel(false, true);
5353 __screenMode = SCREEN_MODE_NORMAL;
5356 AppLogDebug("EXIT");
5360 __screenMode = SCREEN_MODE_NORMAL;
5366 CameraForm::RestoreSecondaryResolution(void)
5368 AppLogDebug("ENTER");
5369 result r = E_SUCCESS;
5370 IList* pList = null;
5371 IList* pCaptureResolutionList = null;
5372 int resolutionCnt = 0;
5373 bool wideMode = false;
5374 int resolutionIndex = 0;
5375 int resolutionRatio = 0;
5376 Dimension resolutionDim;
5377 Dimension captureResolutionDim;
5379 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5380 _pAppTimer->Cancel();
5382 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5383 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5385 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5387 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5389 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5391 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5393 if (resolutionRatio > NORMAL_MODE_RATIO)
5402 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5404 resolutionCnt = pList->GetCount();
5406 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5408 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5410 __captureResolutionWidth = captureResolutionDim.width;
5412 __captureResolutionHeight = captureResolutionDim.height;
5414 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5416 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5418 __secondaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5420 if (wideMode == true)
5422 __pOverlayPanel->AddTouchEventListener(*this);
5424 HidePanel(true, true);
5426 __screenMode = SCREEN_MODE_FULL;
5430 __pOverlayPanel->RemoveTouchEventListener(*this);
5432 HidePanel(false, true);
5434 __screenMode = SCREEN_MODE_NORMAL;
5437 AppLogDebug("EXIT");
5445 CameraForm::DrawMarker(bool useGuidline)
5447 AppLogDebug("ENTER");
5448 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5449 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5450 result r = E_SUCCESS;
5452 if (__dir == ORIENTATION_STATUS_PORTRAIT
5453 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5455 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5456 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5460 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5461 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5466 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5470 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5472 _pCameraInfoPanel->Invalidate(true);
5474 AppLogDebug("EXIT");
5479 CameraForm::DrawFocus(int focusMode)
5481 AppLogDebug("ENTER");
5482 int selfPortraitEnable = 0;
5483 bool focusSupport = false;
5484 result r = E_SUCCESS;
5485 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5486 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5488 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5489 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5491 if (__dir == ORIENTATION_STATUS_PORTRAIT
5492 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5494 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5495 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5499 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5500 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5503 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5505 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5509 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
5512 if (focusSupport == true && r == E_SUCCESS)
5514 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5516 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5517 _pCameraInfoPanel->Invalidate(true);
5521 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5522 _pCameraInfoPanel->Invalidate(true);
5525 AppLogDebug("EXIT");
5533 CameraForm::DrawTimerPopup(void)
5535 AppLogDebug("ENTER");
5536 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5537 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5538 result r = E_SUCCESS;
5540 if (__dir == ORIENTATION_STATUS_PORTRAIT
5541 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5543 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5544 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5548 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5549 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5552 _pCameraInfoPanel->SetDrawPopupTimer(true);
5553 _pCameraInfoPanel->Invalidate(true);
5557 AppLogDebug("EXIT");
5562 CameraForm::SetFlashPopop(void)
5564 AppLogDebug("ENTER");
5565 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5566 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5567 MakeSettingPopupTab(false);
5570 if (__dir == ORIENTATION_STATUS_PORTRAIT
5571 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5573 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5574 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5578 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5579 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5582 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5583 _pCameraInfoPanel->Invalidate(true);
5584 SetCameraTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5586 if (_pListFlashMainMenu == null)
5588 _pListFlashMainMenu = new (std::nothrow) ListView();
5589 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5591 _pListFlashMainMenu->SetItemProvider(*this);
5592 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5593 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5597 _pListFlashMainMenu->SetBounds(rectList);
5598 _pListFlashMainMenu->SetShowState(true);
5600 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5602 _pListFlashMainMenu->UpdateList();
5603 AppLogDebug("EXIT");
5607 CameraForm::SetWhiteBalancePopop(void)
5609 AppLogDebug("ENTER");
5610 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5611 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5612 MakeSettingPopupTab(false);
5615 if (__dir == ORIENTATION_STATUS_PORTRAIT
5616 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5618 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5619 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5623 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5624 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5627 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5628 _pCameraInfoPanel->Invalidate(true);
5629 SetCameraTabSettingMainMenuCount(MAX_WHITE_BALANCE_MENU_COUNT);
5631 if (_pListWbMainMenu == null)
5633 _pListWbMainMenu = new (std::nothrow) ListView();
5634 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5636 _pListWbMainMenu->SetItemProvider(*this);
5637 _pListWbMainMenu->AddListViewItemEventListener(*this);
5638 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5642 _pListWbMainMenu->SetBounds(rectList);
5643 _pListWbMainMenu->SetShowState(true);
5645 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5647 _pListWbMainMenu->UpdateList();
5648 AppLogDebug("EXIT");
5652 CameraForm::ProcessFlashListPopup(int index)
5654 AppLogDebug("ENTER");
5655 Rectangle rectPanel;
5657 String strTitle = L"";
5658 String listName = L"";
5659 Bitmap* pBitmapNormal = null;
5660 Bitmap* pBitmapPress = null;
5661 result r = E_SUCCESS;
5662 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5664 AppLogDebug("Sub Menu (%d)", index);
5667 int selfPortraitEnable = 0;
5669 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5670 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5672 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5673 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5675 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5677 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5679 regVal = SUBMENU_MODE_OFF;
5680 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5681 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5682 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5686 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5688 if (value == true && r == E_SUCCESS)
5690 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5694 case SUBMENU_MODE_OFF:
5696 regVal = SUBMENU_MODE_OFF;
5697 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5698 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5699 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5703 case SUBMENU_MODE_ON:
5705 regVal = SUBMENU_MODE_ON;
5706 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5707 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5708 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5712 case SUBMENU_MODE_AUTO:
5714 regVal = SUBMENU_MODE_AUTO;
5715 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5716 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5717 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5727 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5729 regVal = SUBMENU_MODE_OFF;
5730 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5731 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5732 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5736 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(index));
5737 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5739 _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5741 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5743 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5745 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5746 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5748 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5750 delete pBitmapNormal;
5751 pBitmapNormal = null;
5753 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5754 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5756 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5758 delete pBitmapPress;
5759 pBitmapPress = null;
5765 SetCameraTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5766 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5770 AppLogDebug("EXIT");
5774 AppLogDebug("Catch:");
5779 CameraForm::ProcessCameraTabMainListPopup(int index)
5781 AppLogDebug("ENTER");
5782 Rectangle rectPanel;
5784 String strTitle = L"";
5785 String listName = L"";
5786 bool resetPanel = false;
5787 int subPanelItemCount = 0;
5789 int captureResolutionCount = 0;
5790 result r = E_SUCCESS;
5791 bool drawPopup = true;
5793 listName = _pListViewCameraTabMainMenu->GetName();
5795 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
5796 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
5798 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5800 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5802 _pCameraInfoSubPanel->SetShowState(false);
5803 _pCameraInfoSubPanel->RemoveControl(_pListViewCameraTabSubMenu);
5804 _pListViewCameraTabSubMenu = null;
5805 RemoveControl(_pCameraInfoSubPanel);
5806 _pCameraInfoSubPanel = null;
5808 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5813 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5815 int selfPortraitEnable = 0;
5817 AppLogDebug("Set ISO");
5820 int isoCnt = __pIsoList->GetCount() -1;
5822 subPanelItemCount = isoCnt;
5823 if (subPanelItemCount> 5)
5829 int X_Panel = X_SUBMENU_ISO_MODE_PANEL;
5830 int Y_Panel = Y_SUBMENU_ISO_MODE_PANEL;
5831 int W_Panel = W_SUBMENU_ISO_MODE_PANEL;
5832 int H_Panel = Y_SUBMENU_ISO_MODE_LIST + (isoCnt * H_SUBMENU_ISO_MODE_PANEL_MARGIN);
5834 int X_List = X_SUBMENU_ISO_MODE_LIST;
5835 int Y_List = Y_SUBMENU_ISO_MODE_LIST;
5836 int W_List = W_SUBMENU_ISO_MODE_LIST;
5837 int H_List = (isoCnt * H_SUBMENU_ISO_MODE_LIST_MARGIN);
5839 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel + 20);
5840 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5842 pAppResource->GetString(IDS_CAM_BODY_ISO, strTitle);
5843 SetCameraTabSubMenuListviewState(isoCnt, CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE);
5847 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5848 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5850 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5852 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
5856 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
5861 AppLogDebug("Support ISO");
5865 r = _pCameraPresentationModel->SetValue(ISO_VALUE, REG_DEFAULT_VAULE_ZERO);
5866 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
5873 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5875 if (__pCaptureResolutionList)
5877 captureResolutionCount = __pCaptureResolutionList->GetCount();
5879 subPanelItemCount = captureResolutionCount;
5880 if (subPanelItemCount > 5)
5885 if (captureResolutionCount > 1)
5887 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5888 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL;
5889 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5890 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captureResolutionCount * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5892 int X_List = X_SUBMENU_WB_MODE_LIST;
5893 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5894 int W_List = W_SUBMENU_WB_MODE_LIST;
5895 int H_List = (captureResolutionCount * W_SUBMENU_WB_MODE_LIST_MARGIN);
5897 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5898 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5900 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5901 SetCameraTabSubMenuListviewState(captureResolutionCount, CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE);
5907 AppLogDebug("captrueResolutionCnt count is %d",captureResolutionCount);
5914 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5915 AppLogDebug("Invaild index");
5923 if (__dir == ORIENTATION_STATUS_PORTRAIT
5924 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5926 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5927 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5931 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5935 rectList.height = rectList.height - 40 - (subPanelItemCount-5)*72;
5936 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
5938 rectPanel.height = rectPanel.height - 100;
5941 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
5943 rectPanel.height = rectPanel.height - 198;
5944 rectList.height = rectList.height - 20;
5949 if (_pCameraInfoSubPanel == null)
5951 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5952 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5954 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5955 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5957 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5958 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5959 AddOrientationEventListener(*this);
5960 AddControl(_pCameraInfoSubPanel);
5961 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5964 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5965 _pCameraInfoPanel->Invalidate(true);
5966 _pCameraInfoSubPanel->Invalidate(true);
5968 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5969 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5971 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5972 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5973 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5975 _pListViewCameraTabSubMenu->UpdateList();
5979 AppLogDebug("EXIT");
5983 if (_pCameraInfoSubPanel)
5985 RemoveControl(_pCameraInfoSubPanel);
5986 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5990 delete _pListViewCameraTabSubMenu;
5993 _pCameraInfoSubPanel = null;
5994 _pListViewCameraTabSubMenu = null;
6000 CameraForm::ProcessCameraTabSubListPopup(int index)
6002 AppLogDebug("ENTER");
6003 String strRegKey = IDS_INIT_REG_KEY;
6004 result r = E_SUCCESS;
6005 int selfPortraitEnable = 0;
6006 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
6008 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6009 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6011 idx = GetCameraTabSettingSubMenuMode();
6015 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
6017 r = SubListPopupIsoMode(index);
6018 TryCatch(r == E_SUCCESS, , "SubListPopupIsoMode() fail[%s]", GetErrorMessage(r));
6022 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
6024 r = SubListPopupResolutionMode(index);
6025 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
6033 if (_pListViewCameraTabSubMenu)
6035 if (_pCameraInfoSubPanel != null)
6037 _pCameraInfoSubPanel->SetShowState(false);
6039 _pListViewCameraTabSubMenu->SetShowState(false);
6041 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6042 _pListViewCameraTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6045 _pCameraInfoPanel->Invalidate(true);
6047 AppLogDebug("EXIT");
6057 CameraForm::ProcessGeneraTabMainListPopup(int index)
6059 AppLogDebug("ENTER");
6060 Rectangle rectPanel;
6062 String strTitle = L"";
6063 String listName = L"";
6065 result r = E_SUCCESS;
6066 bool drawPopup = true;
6068 listName = _pListViewGeneralTabMainMenu->GetName();
6070 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
6071 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
6073 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
6075 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
6077 _pCameraInfoGeneralSubPanel->SetShowState(false);
6078 _pCameraInfoGeneralSubPanel->RemoveControl(_pListViewGeneralTabSubMenu);
6079 _pListViewGeneralTabSubMenu = null;
6080 RemoveControl(_pCameraInfoGeneralSubPanel);
6081 _pCameraInfoGeneralSubPanel = null;
6083 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6088 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6090 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
6091 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
6092 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL - 12);
6093 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
6094 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
6095 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
6099 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6101 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
6102 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
6104 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
6105 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL - 8);
6106 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
6107 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
6111 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6113 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
6114 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
6115 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL - 8);
6116 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
6117 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
6118 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
6122 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6126 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
6128 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
6131 if (_pResetPopUp == null)
6133 _pResetPopUp = new (std::nothrow) Popup();
6134 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
6135 _pResetPopUp->SetPropagatedKeyEventListener(this);
6136 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
6141 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
6142 TryCatch(_pYes != null, , "Reset Popup not created!");
6143 _pYes->SetActionId(IDA_BTN_YES);
6144 _pYes->AddActionEventListener(*this);
6145 _pYes->SetShowState(true);
6150 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
6151 TryCatch(_pNo != null, , "Reset Popup not created!");
6152 _pNo->SetActionId(IDA_BTN_NO);
6153 _pNo->AddActionEventListener(*this);
6154 _pNo->SetShowState(true);
6155 _pResetPopUp->Show();
6158 _pResetPopUp->SetShowState(true);
6159 _pResetPopUp->Invalidate(true);
6160 _pResetPopUp->Show();
6164 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6166 result r = E_SUCCESS;
6168 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
6169 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6171 r = SetScreenOverlayHelpTimer();
6172 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6174 r = DrawScreenOverlayHelp();
6175 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6179 MakeSettingPopupTab(false);
6188 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6189 AppLogDebug("Invaild index");
6197 if (__dir == ORIENTATION_STATUS_PORTRAIT
6198 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6200 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
6201 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
6205 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
6208 if (_pCameraInfoGeneralSubPanel == null)
6210 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
6211 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
6213 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
6214 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
6216 if (index == GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
6217 index == GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
6218 index == GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
6220 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
6222 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
6223 AddOrientationEventListener(*this);
6224 AddControl(_pCameraInfoGeneralSubPanel);
6225 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
6228 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
6229 _pCameraInfoPanel->Invalidate(true);
6230 _pCameraInfoGeneralSubPanel->Invalidate(true);
6232 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
6233 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
6235 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
6236 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
6237 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
6239 _pListViewGeneralTabSubMenu->UpdateList();
6243 AppLogDebug("EXIT");
6247 if (_pCameraInfoGeneralSubPanel)
6249 RemoveControl(_pCameraInfoGeneralSubPanel);
6250 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6254 delete _pListViewGeneralTabSubMenu;
6257 _pCameraInfoGeneralSubPanel = null;
6258 _pListViewGeneralTabSubMenu = null;
6260 AppLogDebug("EXIT - CATCH");
6265 CameraForm::ProcessGeneraTabSubListPopup(int index)
6267 AppLogDebug("ENTER");
6268 String strRegKey = IDS_INIT_REG_KEY;
6269 result r = E_SUCCESS;
6270 int selfPortraitEnable = 0;
6271 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6273 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6274 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6276 idx = GetGeneralTabSettingSubMenuMode();
6280 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6282 r = SubListPopupTimerMode(index);
6283 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6287 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6289 r = SubListPopupGuidelineMode(index);
6290 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6294 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6296 SubListPopupStorageTypeMode(index);
6300 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6305 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6314 if (_pListViewGeneralTabSubMenu)
6316 if (_pCameraInfoGeneralSubPanel != null)
6318 _pCameraInfoGeneralSubPanel->SetShowState(false);
6320 _pListViewGeneralTabSubMenu->SetShowState(false);
6322 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6323 _pListViewGeneralTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6326 _pCameraInfoPanel->Invalidate(true);
6327 AppLogDebug("EXIT");
6331 MakeSettingPopupTab(false);
6338 CameraForm::StartPopupTimer(void)
6340 AppLogDebug("ENTER");
6341 result r = E_SUCCESS;
6342 int timerInterval = 0;
6346 _pPopupTimer = new (std::nothrow) Timer();
6348 _pPopupTimer->Construct(*this);
6350 r = _pPopupTimer->StartAsRepeatable(CAMERA_TIMER_1_SEC);
6351 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6353 timerInterval = GetTimerIntervalValue();
6355 switch (timerInterval)
6357 case SETTING_TIMER_CAPTURE_2_SEC:
6359 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6363 case SETTING_TIMER_CAPTURE_5_SEC:
6365 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6369 case SETTING_TIMER_CAPTURE_10_SEC:
6371 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6379 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6380 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6381 _pCameraInfoPanel->Invalidate(true);
6383 AppLogDebug("EXIT");
6387 delete _pPopupTimer;
6388 _pPopupTimer = null;
6394 CameraForm::StopPopupTimer(void)
6396 AppLogDebug("ENTER");
6397 result r = E_SUCCESS;
6398 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6400 r = _pPopupTimer->Cancel();
6402 delete _pPopupTimer;
6403 _pPopupTimer = null;
6405 AppLogDebug("EXIT");
6413 CameraForm::SetCameraSettingsDevice(void)
6415 AppLogDebug("ENTER");
6420 result r = E_SUCCESS;
6421 int selfPortraitEnable = 0;
6422 bool exposureValue = false;
6423 bool brighnesstValue = false;
6424 int updatedIndex = 0;
6426 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6427 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6429 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6431 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6435 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6438 if (exposureValue == true && r == E_SUCCESS)
6440 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6441 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6443 _pCameraPresentationModel->SetExposure(exposure);
6447 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6449 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6453 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6456 if (brighnesstValue == true && r == E_SUCCESS)
6458 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
6459 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
6461 _pCameraPresentationModel->SetBrightness(brightness);
6465 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6467 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
6471 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
6476 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
6477 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
6481 updatedIndex = isoIndex + 2;
6485 updatedIndex = isoIndex + 3;
6487 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
6490 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6492 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
6496 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
6501 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6503 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
6507 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
6510 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6512 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
6514 AppLogDebug("EXIT");
6518 CameraForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
6520 AppLogDebug("ENTER");
6521 Bitmap* pBitmap = null;
6522 ByteBuffer* pSrcByteBuff = null;
6523 ByteBuffer dstByteBuff;
6524 BufferInfo buffInfo;
6525 result r = E_SUCCESS;
6529 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
6531 if (rotationType == IMAGE_ROTATION_0)
6533 pBitmap = new (std::nothrow) Bitmap();
6534 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
6535 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6537 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
6541 dim.width = pSrcBitmap->GetWidth();
6542 dim.height = pSrcBitmap->GetHeight();
6544 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
6546 r = dstByteBuff.Construct(size);
6547 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6549 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
6550 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6552 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
6553 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
6555 dim.width = buffInfo.width;
6556 dim.height = buffInfo.height;
6558 size = buffInfo.pitch * buffInfo.height;
6560 pSrcByteBuff = new (std::nothrow) ByteBuffer();
6561 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
6563 r = pSrcByteBuff->Construct(size);
6564 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6566 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
6567 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6569 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
6570 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
6572 r = pSrcBitmap->Unlock();
6573 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
6575 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
6576 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
6578 if (rotationType == IMAGE_ROTATION_90
6579 || rotationType == IMAGE_ROTATION_270)
6581 dim.width = buffInfo.height;
6582 dim.height = buffInfo.width;
6586 dim.width = buffInfo.width;
6587 dim.height = buffInfo.height;
6590 pBitmap = new (std::nothrow) Bitmap();
6591 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
6592 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6594 delete pSrcByteBuff;
6595 pSrcByteBuff = null;
6597 AppLogDebug("EXIT");
6601 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
6602 if (pSrcByteBuff != null)
6604 delete pSrcByteBuff;
6605 pSrcByteBuff = null;
6608 if (pBitmap != null) //Prevent issue fix.
6616 CameraForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
6618 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
6619 result r = E_SUCCESS;
6620 int adjustEntryValue = 0;
6621 int currentEntryValue = 0;
6623 bool exposureValue = false;
6624 bool brighnesstValue = false;
6625 int selfPortraitEnable = 0;
6626 bool IsSliderAdjustValue = false;
6628 if (__dir == ORIENTATION_STATUS_PORTRAIT
6629 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6631 step = movableValidRect.width / maxEntryValue;
6632 if (currentPosition.x > movableValidRect.x)
6634 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
6636 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6637 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6638 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
6640 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
6645 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6648 IsSliderAdjustValue = true;
6652 IsSliderAdjustValue = false;
6657 step = movableValidRect.height / maxEntryValue;
6658 if (currentPosition.y > movableValidRect.y)
6660 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
6661 IsSliderAdjustValue = true;
6665 IsSliderAdjustValue = false;
6669 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6670 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6672 if (entryName.Equals(String(EXPOSURE_VALUE)))
6674 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6676 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6680 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6683 if (exposureValue == true && r == E_SUCCESS)
6685 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
6686 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6690 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6692 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6696 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6699 if (brighnesstValue == true && r == E_SUCCESS)
6701 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
6702 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6706 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6707 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
6709 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6711 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6715 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6718 if (exposureValue == true && r == E_SUCCESS)
6720 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
6721 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6725 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6727 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6731 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6734 if (brighnesstValue == true && r == E_SUCCESS)
6736 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
6737 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6741 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6743 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6747 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6750 if (exposureValue == true && r == E_SUCCESS)
6752 _pCameraPresentationModel->SetExposure(adjustEntryValue);
6756 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6758 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6762 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6765 if (brighnesstValue == true && r == E_SUCCESS)
6767 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
6771 AppLogDebug("Exposure do not support");
6777 AppLogDebug("EXIT");
6785 CameraForm::CreateExposureSlider(void)
6787 AppLogDebug("ENTER");
6788 result r = E_SUCCESS;
6790 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
6792 _closeTimerValue = 0;
6793 _pExposureCloseTimer = new (std::nothrow) Timer();
6794 _pExposureCloseTimer->Construct(*this);
6796 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
6797 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
6799 _pCameraInfoPanel->SetDrawExposure(true);
6800 _pCameraInfoPanel->Invalidate(true);
6802 AppLogDebug("EXIT");
6806 delete _pExposureCloseTimer;
6807 _pExposureCloseTimer = null;
6813 CameraForm::DrawExposureSlider(void)
6815 AppLogDebug("ENTER");
6816 Point buttonPosition;
6817 result r = E_SUCCESS;
6818 Rectangle rectSlider;
6821 int selfPortraitEnable = 0;
6822 bool exposureValue = false;
6823 bool brighnesstValue = false;
6825 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6826 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6828 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6830 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6834 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6837 if (exposureValue == true && r == E_SUCCESS)
6839 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6840 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6841 AppLogDebug("Exposure value %d", exposure);
6845 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6847 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6851 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6854 if (brighnesstValue == true && r == E_SUCCESS)
6856 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
6857 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6858 AppLogDebug("Exposure value %d", exposure);
6862 if (__dir == ORIENTATION_STATUS_PORTRAIT
6863 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6865 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6866 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6867 step = rectSlider.width / MAX_CAMERA_EXPOSURE_VALUE;
6869 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + rectSlider.x;
6870 buttonPosition.y = rectSlider.y;
6871 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
6875 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6876 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6877 step = rectSlider.height / MAX_CAMERA_EXPOSURE_VALUE;
6879 buttonPosition.x = rectSlider.x;
6880 buttonPosition.y = (step * exposure) + rectSlider.y;
6881 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
6884 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
6885 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6887 AppLogDebug("EXIT");
6895 CameraForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
6897 AppLogDebug("ENTER");
6898 result r = E_SUCCESS;
6899 Point buttonPosition;
6900 Rectangle rectSlider;
6901 float adjustedXvalue = 0;
6902 int adjustedXinInt = 0;
6904 bool IsSliderRectValid = false;
6906 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
6908 if (__dir == ORIENTATION_STATUS_PORTRAIT
6909 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6911 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6912 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6915 case DRAW_INITIALIZED:
6917 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6918 buttonPosition.y = currentPosition.y;
6919 IsSliderRectValid = true;
6925 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6927 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6929 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6930 buttonPosition.y = rectSlider.y;
6931 IsSliderRectValid = true;
6932 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
6934 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6935 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6937 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6938 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6940 if ((adjustedXvalue - adjustedXinInt) != 0)
6942 adjustedXinInt = adjustedXinInt+1;
6945 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
6947 buttonPosition.x = X_EXPOSURE_PANEL_SIDER_PORTRAIT + adjustedXinInt;
6948 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
6949 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6950 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6955 IsSliderRectValid = false;
6962 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6964 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6966 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6967 buttonPosition.y = rectSlider.y;
6968 IsSliderRectValid = true;
6969 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6970 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6975 IsSliderRectValid = false;
6978 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6980 IsSliderRectValid = false;
6991 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6992 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6995 case DRAW_INITIALIZED:
6997 buttonPosition.x = currentPosition.x;
6998 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6999 IsSliderRectValid = true;
7005 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
7007 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
7009 buttonPosition.x = rectSlider.x;
7010 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7011 IsSliderRectValid = true;
7012 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7013 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7018 IsSliderRectValid = false;
7025 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
7027 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
7029 buttonPosition.x = rectSlider.x;
7030 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7031 IsSliderRectValid = true;
7032 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7033 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7038 IsSliderRectValid = false;
7041 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
7043 IsSliderRectValid = false;
7053 if (IsSliderRectValid)
7055 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
7056 _pCameraInfoPanel->Invalidate(true);
7059 AppLogDebug("EXIT");
7067 CameraForm::ShowExposureSlider(void)
7069 AppLogDebug("ENTER");
7070 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7071 bool exposureValue = false;
7072 bool brighnesstValue = false;
7073 result r = E_SUCCESS;
7075 if (_pExposureCloseTimer)
7077 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7078 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7080 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7084 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7086 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7090 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7093 if (exposureValue == true && r == E_SUCCESS)
7095 r = CreateExposureSlider();
7096 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7098 r = DrawExposureSlider();
7099 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7103 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7105 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7109 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7112 if (brighnesstValue == true && r == E_SUCCESS)
7114 r = CreateExposureSlider();
7115 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7117 r = DrawExposureSlider();
7118 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7123 AppLogDebug("EXIT");
7127 CameraForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7129 AppLogDebug("ENTER");
7130 result r = E_SUCCESS;
7131 bool modified = false;
7132 bool isValidRect = false;
7133 Dimension dimRendererSize;
7135 if (__screenMode == SCREEN_MODE_NORMAL)
7137 Dimension dim = Dimension(0, 0);
7138 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7139 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7140 Rectangle clientRect = GetClientAreaBounds();
7141 bool isToCompensated = false;
7143 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7144 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7146 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7148 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7149 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7153 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7154 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7159 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7161 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7162 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7166 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7167 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7171 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7173 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7174 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7176 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7177 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7179 if (modified == true)
7181 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7184 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7185 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7187 if (evaluateBoundsRect.height == rect.height)
7189 isToCompensated = false;
7193 isToCompensated = true;
7198 if (evaluateBoundsRect.width == rect.width)
7200 isToCompensated = false;
7204 isToCompensated = true;
7208 r = __pOverlayPanel->SetBounds(rect);
7209 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7210 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7212 if (isToCompensated == true)
7214 AppLogDebug("isToCompensated = true");
7216 rect = __pOverlayPanel->GetBounds();
7217 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7219 r = __pOverlayPanel->SetBounds(rect);
7220 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7221 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7224 dimRendererSize = __pOverlayPanel->GetSize();
7225 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7226 __pOverlayPanel->SetRenderSize(dimRendererSize);
7230 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7231 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7232 Rectangle clientRect = GetClientAreaBounds();
7233 bool isToCompensated = false;
7235 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7236 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7238 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7240 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7244 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7249 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7251 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7255 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7259 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7261 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7262 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7264 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7265 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7267 if (modified == true)
7269 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7272 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7273 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7275 if (evaluateBoundsRect.height == rect.height)
7277 isToCompensated = false;
7281 isToCompensated = true;
7286 if (evaluateBoundsRect.width == rect.width)
7288 isToCompensated = false;
7292 isToCompensated = true;
7296 r = __pOverlayPanel->SetBounds(rect);
7297 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7298 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7300 if (isToCompensated == true)
7302 AppLogDebug("isToCompensated = true");
7303 rect = __pOverlayPanel->GetBounds();
7304 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7306 r = __pOverlayPanel->SetBounds(rect);
7307 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7308 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7311 dimRendererSize = __pOverlayPanel->GetSize();
7312 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7313 __pOverlayPanel->SetRenderSize(dimRendererSize);
7315 AppLogDebug("EXIT");
7319 CameraForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7321 AppLogDebug("ENTER");
7322 result r = E_SUCCESS;
7323 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7324 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7325 Rectangle clientRect = GetClientAreaBounds();
7326 BufferInfo bufferinfo;
7327 String listName = L"";
7328 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7329 int guideLineEnable = DISABLE_GUIDELINE;
7331 if (_appControlActionCompleted)
7333 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7335 if (__dir != orientationStatus)
7337 __dir = orientationStatus;
7338 __deviceOrientation = orientationStatus;
7343 if (__dir != orientationStatus)
7345 __isOrientationChanged = true;
7347 if (_pAppTimer != null)
7349 _pAppTimer->Cancel();
7351 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
7353 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7354 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7356 SetOverlayPanelOrientationChanged(orientationStatus);
7358 if (__pOverlayPanel)
7360 switch (orientationStatus)
7362 case ORIENTATION_STATUS_PORTRAIT:
7364 AppLogDebug("PORTRAIT");
7365 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7369 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7371 AppLogDebug("PORTRAIT_REVERSE");
7372 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7376 case ORIENTATION_STATUS_LANDSCAPE:
7378 AppLogDebug("LANDSCAPE");
7379 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7383 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7385 AppLogDebug("LANDSCAPE_REVERSE");
7386 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7395 if (__screenMode == SCREEN_MODE_FULL)
7397 HidePanel(true, true);
7400 __dir = orientationStatus;
7401 __deviceOrientation = orientationStatus;
7403 AppLogDebug("__dir = %d", __dir);
7404 _pCameraPresentationModel->SetOrientation(__dir);
7406 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7407 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7409 if (guideLineEnable == DISABLE_GUIDELINE)
7418 UpdateUiPanelIcon();
7419 UpdateUiActionPanelIcon();
7420 OnHelpCloseTimerExpired();
7422 if (__isTimerRunning)
7424 if (_pHelpCloseTimer)
7426 _pHelpCloseTimer->Cancel();
7428 delete _pHelpCloseTimer;
7429 _pHelpCloseTimer = null;
7432 HideScreenOverlayHelp();
7435 if (_pListViewCameraTabMainMenu != null)
7437 listName = _pListViewCameraTabMainMenu->GetName();
7438 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7444 if (_pListViewGeneralTabMainMenu != null)
7446 listName = _pListViewGeneralTabMainMenu->GetName();
7447 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7453 if (_pListFlashMainMenu != null)
7455 listName = _pListFlashMainMenu->GetName();
7457 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME))&& _pListFlashMainMenu->GetShowState() == true)
7463 if (_pListWbMainMenu != null)
7465 listName = _pListWbMainMenu->GetName();
7467 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME))&& _pListWbMainMenu->GetShowState() == true)
7473 if (_pListViewCameraTabSubMenu != null)
7475 if (_pListViewCameraTabSubMenu->GetShowState() == true)
7481 if (_pListViewGeneralTabSubMenu != null)
7483 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
7488 if (_pCameraInfoPanel->GetDrawExposure() == true)
7490 _pCameraInfoPanel->SetDrawExposure(false);
7493 MakeSettingPopupTab(false);
7496 __isOrientationChanged = false;
7498 AppLogDebug("EXIT");
7502 CameraForm::HidePopup(void)
7504 AppLogDebug("ENTER");
7505 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
7507 if (_pListViewCameraTabSubMenu)
7509 if (_pCameraInfoSubPanel != null)
7511 _pCameraInfoSubPanel->SetShowState(false);
7514 _pListViewCameraTabSubMenu->SetShowState(false);
7517 if (_pListViewCameraTabMainMenu)
7519 _pListViewCameraTabMainMenu->SetShowState(false);
7522 if (_pListFlashMainMenu)
7524 _pListFlashMainMenu->SetShowState(false);
7527 if (_pListWbMainMenu)
7529 _pListWbMainMenu->SetShowState(false);
7532 if (_pListViewGeneralTabSubMenu)
7534 if (_pCameraInfoGeneralSubPanel != null)
7536 _pCameraInfoGeneralSubPanel->SetShowState(false);
7538 _pListViewGeneralTabSubMenu->SetShowState(false);
7541 if (_pListViewGeneralTabMainMenu)
7543 _pListViewGeneralTabMainMenu->SetShowState(false);
7546 _pCameraInfoPanel->SetDrawExposure(false);
7547 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7548 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7549 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7550 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7552 if (__isOrientationChanged)
7554 __isOrientationChanged = false;
7555 _pCameraInfoPanel->Invalidate(true);
7559 _pCameraInfoPanel->Draw();
7560 _pCameraInfoPanel->Show();
7562 __resolutionChange = false;
7563 AppLogDebug("EXIT");
7567 CameraForm::CheckStorageInfo(void)
7569 AppLogDebug("ENTER");
7570 result r = E_SUCCESS;
7571 MessageBox messageBox;
7573 String strTemp = L"";
7574 int remainedNum = 0;
7576 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
7577 AppLogDebug("CheckStorageInfo remainedNum = %d", remainedNum);
7579 if (remainedNum == STORAGE_VALUE_ZERO)
7581 if (__lowMemoryCapacity == false)
7583 __lowMemoryCapacity = true;
7584 __isMemoryFull = false;
7585 r = messageBox.Construct(L"", L"Low Memory Left. You may take some photo depending on the subject", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
7587 else if (__lowMemoryCapacity == true)
7589 __isMemoryFull = true;
7590 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
7592 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
7594 r = messageBox.ShowAndWait(result);
7595 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
7599 case MSGBOX_RESULT_OK:
7601 if (__lowMemoryCapacity == true)
7603 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7604 _pCameraInfoPanel->SetStorageTitle(strTemp);
7605 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7606 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7607 _pCameraInfoPanel->Invalidate(true);
7610 if (__isMemoryFull == true)
7612 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7613 _pCameraInfoPanel->SetStorageTitle(strTemp);
7614 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7615 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7616 _pCameraInfoPanel->Invalidate(true);
7624 //r = TerminateApp();
7625 //TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
7629 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
7631 _pCameraInfoPanel->SetStorageTitle(strTemp);
7632 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
7633 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
7634 _pCameraInfoPanel->Invalidate(true);
7637 SetExifOrientation(__deviceOrientation);
7641 AppLogDebug("EXIT");*/
7645 CameraForm::AppControlRequestHideButton(void)
7647 AppLogDebug("ENTER");
7648 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7649 const IMap* pArguments = pApp->GetAppControlArguments();
7650 if (pArguments == null)
7652 AppLogDebug("pAllowSwtich is null");
7653 if (__pCameraIconLabel)
7655 __pCameraIconLabel->SetShowState(true);
7658 if (__pCamcoderIconLabel)
7660 __pCamcoderIconLabel->SetShowState(true);
7665 __pSwButton->SetShowState(true);
7670 AppLogDebug("pAllowSwitch is not null");
7671 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7672 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7674 AppLogDebug("ALLOW_SWITCH_TRUE");
7676 if (__isTimerRunning)
7678 if (__pCameraIconLabel)
7680 __pCameraIconLabel->SetShowState(false);
7683 if (__pCamcoderIconLabel)
7685 __pCamcoderIconLabel->SetShowState(false);
7690 __pSwButton->SetShowState(false);
7695 if (__pCameraIconLabel)
7697 __pCameraIconLabel->SetShowState(true);
7700 if (__pCamcoderIconLabel)
7702 __pCamcoderIconLabel->SetShowState(true);
7707 __pSwButton->SetShowState(true);
7713 AppLogDebug("ALLOW_SWITCH_FALSE");
7714 if (__pCameraIconLabel)
7716 __pCameraIconLabel->SetShowState(false);
7719 if (__pCamcoderIconLabel)
7721 __pCamcoderIconLabel->SetShowState(false);
7726 __pSwButton->SetShowState(false);
7730 AppLogDebug("EXIT");
7734 CameraForm::HideUiActionButton(void)
7736 AppLogDebug("ENTER");
7737 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7739 AppControlRequestHideButton();
7743 if (__pCameraIconLabel)
7745 __pCameraIconLabel->SetShowState(true);
7748 if (__pCamcoderIconLabel)
7750 __pCamcoderIconLabel->SetShowState(true);
7755 __pSwButton->SetShowState(true);
7758 AppLogDebug("EXIT");
7762 CameraForm::HideUiPanel(bool state)
7764 AppLogDebug("ENTER");
7767 _pFlashButton->SetShowState(false);
7768 _pSelfShotButton->SetShowState(false);
7769 _pSettingButton->SetShowState(false);
7770 __pSettingLine->SetShowState(false);
7772 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7774 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7775 const IMap* pArguments = pApp->GetAppControlArguments();
7776 if (pArguments == null)
7778 AppLogDebug("pArguments is null");
7779 if (__pCameraIconLabel)
7781 __pCameraIconLabel->SetShowState(false);
7784 if (__pCamcoderIconLabel)
7786 __pCamcoderIconLabel->SetShowState(false);
7791 __pSwButton->SetShowState(false);
7796 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7797 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7799 if (__isTimerRunning)
7801 if (__pCameraIconLabel)
7803 __pCameraIconLabel->SetShowState(false);
7806 if (__pCamcoderIconLabel)
7808 __pCamcoderIconLabel->SetShowState(false);
7813 __pSwButton->SetShowState(false);
7818 if (__pCameraIconLabel)
7820 __pCameraIconLabel->SetShowState(true);
7823 if (__pCamcoderIconLabel)
7825 __pCamcoderIconLabel->SetShowState(true);
7830 __pSwButton->SetShowState(true);
7836 AppLogDebug("ALLOW_SWITCH_FALSE");
7837 if (__pCameraIconLabel)
7839 __pCameraIconLabel->SetShowState(false);
7842 if (__pCamcoderIconLabel)
7844 __pCamcoderIconLabel->SetShowState(false);
7849 __pSwButton->SetShowState(false);
7856 if (__isTimerRunning)
7858 __pCameraIconLabel->SetShowState(false);
7859 __pCamcoderIconLabel->SetShowState(false);
7860 __pSwButton->SetShowState(false);
7864 __pCameraIconLabel->SetShowState(true);
7865 __pCamcoderIconLabel->SetShowState(true);
7866 __pSwButton->SetShowState(true);
7871 _pQuickSettingButton->SetShowState(false);
7872 _pWhiteBalanceButton->SetShowState(false);
7873 _pExposureValueButton->SetShowState(false);
7874 _pCloseButton->SetShowState(false);
7875 __pShutterButton->SetShowState(false);
7876 __pThumbnailButton->SetShowState(false);
7877 _pThumbnailPanel->SetShowState(false);
7879 if (__screenMode == SCREEN_MODE_NORMAL)
7881 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7882 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7887 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7889 if (__pThumbnailButton)
7891 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
7893 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
7894 SetControlAlwaysOnTop(*__pThumbnailButton, false);
7898 if (_pThumbnailPanel)
7900 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
7902 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
7903 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
7907 _pFlashButton->SetShowState(false);
7908 _pSelfShotButton->SetShowState(true);
7909 _pSettingButton->SetShowState(true);
7910 __pSettingLine->SetShowState(true);
7911 _pQuickSettingButton->SetShowState(false);
7912 _pWhiteBalanceButton->SetShowState(false);
7913 _pExposureValueButton->SetShowState(false);
7914 _pCloseButton->SetShowState(false);
7916 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7918 AppControlRequestHideButton();
7922 __pCameraIconLabel->SetShowState(true);
7923 __pCamcoderIconLabel->SetShowState(true);
7924 __pSwButton->SetShowState(true);
7927 __pShutterButton->SetShowState(true);
7928 __pThumbnailButton->SetShowState(true);
7929 _pThumbnailPanel->SetShowState(true);
7931 if (__screenMode == SCREEN_MODE_NORMAL)
7933 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7934 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7938 if (__screenMode == SCREEN_MODE_FULL)
7947 AppLogDebug("EXIT");
7951 CameraForm::HideUiSettingMenu(void)
7953 AppLogDebug("ENTER");
7954 if (_pCameraInfoPanel)
7956 _pCameraInfoPanel->SetDrawExposure(false);
7957 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7958 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7959 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7960 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7963 if (_pListViewCameraTabSubMenu)
7965 if (_pCameraInfoSubPanel != null)
7967 _pCameraInfoSubPanel->SetShowState(false);
7970 _pListViewCameraTabSubMenu->SetShowState(false);
7973 if (_pListViewCameraTabMainMenu)
7975 _pListViewCameraTabMainMenu->SetShowState(false);
7978 if (_pListFlashMainMenu)
7980 _pListFlashMainMenu->SetShowState(false);
7983 if (_pListWbMainMenu)
7985 _pListWbMainMenu->SetShowState(false);
7988 if (_pListViewGeneralTabSubMenu)
7990 if (_pCameraInfoGeneralSubPanel != null)
7992 _pCameraInfoGeneralSubPanel->SetShowState(false);
7994 _pListViewGeneralTabSubMenu->SetShowState(false);
7997 if (_pListViewGeneralTabMainMenu)
7999 _pListViewGeneralTabMainMenu->SetShowState(false);
8001 AppLogDebug("EXIT");
8005 CameraForm::HideUiQuickMenu(void)
8007 AppLogDebug("ENTER");
8008 if (_pSelfShotButton != null)
8010 _pSelfShotButton->SetShowState(true);
8011 _pSelfShotButton->Invalidate(true);
8014 if (_pSettingButton != null)
8016 _pSettingButton->SetShowState(true);
8017 _pSettingButton->Invalidate(true);
8020 if (__pSettingLine != null)
8022 __pSettingLine->SetShowState(true);
8023 __pSettingLine->Invalidate(true);
8026 if (_pCameraInfoPanel != null)
8028 _pCameraInfoPanel->SetDrawIndicator(true);
8029 _pCameraInfoPanel->Invalidate(true);
8032 if (_pFlashButton != null)
8034 _pFlashButton->SetShowState(false);
8035 _pFlashButton->Invalidate(true);
8038 if (_pQuickSettingButton != null)
8040 _pQuickSettingButton->SetShowState(false);
8041 _pQuickSettingButton->Invalidate(true);
8044 if (_pWhiteBalanceButton != null)
8046 _pWhiteBalanceButton->SetShowState(false);
8047 _pWhiteBalanceButton->Invalidate(true);
8050 if (_pExposureValueButton != null)
8052 _pExposureValueButton->SetShowState(false);
8053 _pExposureValueButton->Invalidate(true);
8056 if (_pCloseButton != null)
8058 _pCloseButton->SetShowState(false);
8059 _pCloseButton->Invalidate(true);
8061 AppLogDebug("EXIT");
8065 CameraForm::ShowUiQuickMenu(void)
8067 AppLogDebug("ENTER");
8068 if (_pCameraInfoPanel != null)
8070 _pCameraInfoPanel->SetDrawIndicator(false);
8071 _pCameraInfoPanel->Invalidate(true);
8074 if (_pSelfShotButton != null)
8076 _pSelfShotButton->SetShowState(false);
8077 _pSelfShotButton->Invalidate(true);
8080 if (_pSettingButton != null)
8082 _pSettingButton->SetShowState(false);
8083 _pSettingButton->Invalidate(true);
8086 if (__pSettingLine != null)
8088 __pSettingLine->SetShowState(false);
8089 __pSettingLine->Invalidate(true);
8092 if (_pFlashButton != null)
8094 _pFlashButton->SetShowState(true);
8095 _pFlashButton->Invalidate(true);
8098 if (_pQuickSettingButton != null)
8100 _pQuickSettingButton->SetShowState(true);
8101 _pQuickSettingButton->Invalidate(true);
8104 if (_pWhiteBalanceButton != null)
8106 _pWhiteBalanceButton->SetShowState(true);
8107 _pWhiteBalanceButton->Invalidate(true);
8110 if (_pExposureValueButton != null)
8112 _pExposureValueButton->SetShowState(true);
8113 _pExposureValueButton->Invalidate(true);
8116 if (_pCloseButton != null)
8118 _pCloseButton->SetShowState(true);
8119 _pCloseButton->Invalidate(true);
8121 AppLogDebug("EXIT");
8125 CameraForm::SetCameraMode(bool isWideMode)
8127 AppLogDebug("ENTER");
8128 result r = E_SUCCESS;
8129 Dimension normalMode(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
8130 Dimension resolutionDim;
8131 Dimension captureResolutionDim;
8132 IList* pList = null;
8133 int previewResolutionSize = 0;
8134 int resolutionCnt = 0;
8135 int resolutionRatio = 0;
8137 int tempResolutionIndex = 0;
8139 int selfPortraitEnable = 0;
8140 BufferInfo bufferinfo;
8142 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
8143 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8145 if (isWideMode == true)
8147 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8151 resolutionCnt = pList->GetCount();
8153 if (resolutionCnt > 0)
8155 for (index = 0; index < resolutionCnt; index++)
8157 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8159 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
8161 if (resolutionRatio > NORMAL_MODE_RATIO)
8168 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(count - INDEX_UNIT_ONE)));
8169 __previewResolutionWidth = resolutionDim.width;
8170 __previewResolutionHeight = resolutionDim.height;
8174 __previewResolutionWidth = PREVIEW_RESOLOTION_WIDTH;
8175 __previewResolutionHeight = PREVIEW_RESOLOTION_HEIGHT;
8178 AppLogDebug("Wide Mode W[%d] x H[%d]", resolutionDim.width, resolutionDim.height);
8180 _pCameraPresentationModel->SetPreviewResolution(resolutionDim);
8184 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8185 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
8187 _pCameraPresentationModel->SetPreviewResolution(normalMode);
8189 __previewResolutionWidth = normalMode.width;
8190 __previewResolutionHeight = normalMode.height;
8192 AppLogDebug("Normal Mode W[%d] x H[%d]", normalMode.width, normalMode.height);
8194 if (__isToggleCameraDirection)
8196 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8198 resolutionCnt = pList->GetCount();
8200 AppLogDebug("pList resolutionCnt = %d", resolutionCnt);
8202 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8204 captureResolutionDim.width = __captureResolutionWidth;
8206 captureResolutionDim.height = __captureResolutionHeight;
8208 if (resolutionCnt > 0)
8210 for (index = 0; index < resolutionCnt; index++)
8212 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8214 if (resolutionDim == captureResolutionDim)
8216 tempResolutionIndex = index;
8218 AppLogDebug("primary captureResolutionDim == W:%d H:%d for index = %d", resolutionDim.width, resolutionDim.height, index);
8222 __primaryCurrentResolutionIndex = resolutionCnt - tempResolutionIndex;
8225 AppLogDebug("__primaryCurrentResolutionIndex = %d", __primaryCurrentResolutionIndex);
8229 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
8230 __captureResolutionWidth = captureResolutionDim.width;
8231 __captureResolutionHeight = captureResolutionDim.height;
8233 AppLogDebug("secondary captureResolutionDim : w->%d x h->%d", captureResolutionDim.width, captureResolutionDim.height);
8238 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8239 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
8241 _pCameraPresentationModel->StartPreview(&bufferinfo);
8243 _pCameraPresentationModel->SetContinuousAutoFocus();
8245 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8247 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8248 AppLogDebug("EXIT");
8252 CameraForm::SetOverlayRendererRotation(void)
8254 AppLogDebug("ENTER");
8255 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8259 case ORIENTATION_STATUS_PORTRAIT:
8261 AppLogDebug("ORIENTATION_STATUS_PORTRAIT");
8262 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8266 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8268 AppLogDebug("ORIENTATION_STATUS_PORTRAIT_REVERSE");
8269 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8273 case ORIENTATION_STATUS_LANDSCAPE:
8275 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE");
8276 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8280 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8282 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE_REVERSE");
8283 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8290 AppLogDebug("EXIT");
8294 CameraForm::CreateOverlayRegion(Rectangle rect)
8296 AppLogDebug("ENTER");
8297 result r = E_SUCCESS;
8299 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8300 r = __pOverlayPanel->Construct(rect);
8301 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8302 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8304 r = AddControl(__pOverlayPanel);
8305 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8306 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8308 __pOverlayPanel->AddTouchEventListener(*this);
8310 AppLogDebug("EXIT");
8314 RemoveControl(__pOverlayPanel);
8315 __pOverlayPanel = null;
8316 AppLogDebug("EXIT - CATCH");
8321 CameraForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8323 AppLogDebug("ENTER");
8324 bool modified = false;
8325 bool isValidRect = false;
8326 Dimension dim = Dimension(0, 0);
8327 bool isToCompensated = false;
8328 Dimension dimRendererSize;
8329 result r = E_SUCCESS;
8331 if (destroyOverlay == true)
8333 if (__pOverlayPanel)
8335 __pOverlayPanel->RemoveTouchEventListener(*this);
8336 RemoveControl(__pOverlayPanel);
8337 __pOverlayPanel = null;
8340 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8341 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8343 if (isWideMode == false)
8345 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8346 r = GetLastResult();
8350 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8351 r = GetLastResult();
8353 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8354 TryReturn(r == E_SUCCESS, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(r));
8356 if (modified == true)
8358 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8361 if (__dir == ORIENTATION_STATUS_PORTRAIT
8362 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8364 if (evaluateBoundsRect.height == rect.height)
8366 isToCompensated = false;
8370 isToCompensated = true;
8375 if (evaluateBoundsRect.width == rect.width)
8377 isToCompensated = false;
8381 isToCompensated = true;
8385 r = CreateOverlayRegion(rect);
8386 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8388 if (isToCompensated == true)
8390 AppLogDebug("isToCompensated = true");
8392 rect = __pOverlayPanel->GetBounds();
8393 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8395 r = __pOverlayPanel->SetBounds(rect);
8396 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8399 dimRendererSize = __pOverlayPanel->GetSize();
8400 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8402 __pOverlayPanel->SetRenderSize(dimRendererSize);
8406 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8408 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8409 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8411 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8412 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8414 if (modified == true)
8416 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8419 if (__dir == ORIENTATION_STATUS_PORTRAIT
8420 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8422 if (evaluateBoundsRect.height == rect.height)
8424 isToCompensated = false;
8428 isToCompensated = true;
8433 if (evaluateBoundsRect.width == rect.width)
8435 isToCompensated = false;
8439 isToCompensated = true;
8443 r = __pOverlayPanel->SetBounds(rect);
8444 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8445 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8447 if (isToCompensated == true)
8449 rect = __pOverlayPanel->GetBounds();
8450 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8452 r = __pOverlayPanel->SetBounds(rect);
8453 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8454 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8457 dimRendererSize = __pOverlayPanel->GetSize();
8458 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8459 __pOverlayPanel->SetRenderSize(dimRendererSize);
8461 AppLogDebug("EXIT");
8465 RemoveControl(__pOverlayPanel);
8466 __pOverlayPanel = null;
8467 AppLogDebug("EXIT - CATCH");
8472 CameraForm::SetOverlayPanelNormalMode(bool isRemoved)
8474 AppLogDebug("ENTER");
8475 result r = E_SUCCESS;
8476 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8477 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8478 Rectangle clientRect = GetClientAreaBounds();
8480 if (__dir == ORIENTATION_STATUS_PORTRAIT
8481 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8483 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8485 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8486 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8490 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8491 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8496 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8498 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8499 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8503 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8504 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8508 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8509 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8510 AppLogDebug("EXIT");
8514 CameraForm::SetOverlayPanelWideMode(bool isRemoved)
8516 AppLogDebug("ENTER");
8517 result r = E_SUCCESS;
8518 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8519 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8520 Rectangle clientRect = GetClientAreaBounds();
8522 if (__dir == ORIENTATION_STATUS_PORTRAIT
8523 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8525 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8527 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8531 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8536 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8538 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8542 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8546 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8547 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8548 AppLogDebug("EXIT");
8552 CameraForm::SetControlAlwaysOnTopPanel(void)
8554 AppLogDebug("ENTER");
8555 if (__pSettingPanel)
8557 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
8559 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
8560 SetControlAlwaysOnTop(*__pSettingPanel, true);
8566 if (IsControlAlwaysOnTop(__pActionPanel) == false)
8568 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
8569 SetControlAlwaysOnTop(*__pActionPanel, true);
8575 if (IsControlAlwaysOnTop(_pFlashButton) == false)
8577 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
8578 SetControlAlwaysOnTop(*_pFlashButton, true);
8582 if (_pSelfShotButton)
8584 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
8586 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8587 SetControlAlwaysOnTop(*_pSelfShotButton, true);
8591 if (_pSettingButton)
8593 if (IsControlAlwaysOnTop(_pSettingButton) == false)
8595 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
8596 SetControlAlwaysOnTop(*_pSettingButton, true);
8602 if (IsControlAlwaysOnTop(__pSettingLine) == false)
8604 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
8605 SetControlAlwaysOnTop(*__pSettingLine, true);
8609 if (__pCameraIconLabel)
8611 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
8613 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8614 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
8618 if (__pCamcoderIconLabel)
8620 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
8622 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
8623 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
8627 if (_pQuickSettingButton)
8629 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
8631 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
8632 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
8636 if (_pWhiteBalanceButton)
8638 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
8640 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
8641 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
8645 if (_pExposureValueButton)
8647 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
8649 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
8650 SetControlAlwaysOnTop(*_pExposureValueButton, true);
8656 if (IsControlAlwaysOnTop(_pCloseButton) == false)
8658 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
8659 SetControlAlwaysOnTop(*_pCloseButton, true);
8663 if (__pBatteryState)
8665 if (IsControlAlwaysOnTop(__pBatteryState) == false)
8667 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
8668 SetControlAlwaysOnTop(*__pBatteryState, true);
8674 if (IsControlAlwaysOnTop(__pSwButton) == false)
8676 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
8677 SetControlAlwaysOnTop(*__pSwButton, true);
8682 if (__pShutterButton)
8684 if (IsControlAlwaysOnTop(__pShutterButton) == false)
8686 AppLogDebug("IsControlAlwaysOnTop __pShutterButton");
8687 SetControlAlwaysOnTop(*__pShutterButton, true);
8691 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
8693 if (__pThumbnailButton)
8695 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
8697 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8698 SetControlAlwaysOnTop(*__pThumbnailButton, false);
8702 if (_pThumbnailPanel)
8704 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
8706 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8707 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
8713 if (__pThumbnailButton)
8715 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
8717 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8718 SetControlAlwaysOnTop(*__pThumbnailButton, true);
8722 if (_pThumbnailPanel)
8724 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
8726 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8727 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
8732 if (_pHelpGoToGallery)
8734 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
8736 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
8737 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
8741 if (_pHelpGoToGalleryText)
8743 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
8745 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
8746 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
8750 if (_pHelpSwitchCamera)
8752 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
8754 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
8755 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
8759 if (_pHelpSwitchCameraText)
8761 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
8763 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
8764 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
8768 if (_pHelpQuickSetting)
8770 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
8772 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
8773 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
8777 if (_pHelpQuickSettingText)
8779 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
8781 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
8782 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
8786 if (_pHelpRecordVideo)
8788 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
8790 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
8791 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
8795 if (_pHelpRecordVideoText)
8797 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
8799 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
8800 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
8806 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
8808 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
8809 SetControlAlwaysOnTop(*_pHelpShutter, true);
8813 if (_pHelpShutterText)
8815 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
8817 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
8818 SetControlAlwaysOnTop(*_pHelpShutterText, true);
8822 if (__pCameraSetting)
8824 if (IsControlAlwaysOnTop(__pCameraSetting) == false)
8826 AppLogDebug("IsControlAlwaysOnTop __pCameraSetting");
8827 SetControlAlwaysOnTop(*__pCameraSetting, true);
8831 if (__pCameraSettingLable)
8833 if (IsControlAlwaysOnTop(__pCameraSettingLable) == false)
8835 AppLogDebug("IsControlAlwaysOnTop __pCameraSettingLable");
8836 SetControlAlwaysOnTop(*__pCameraSettingLable, true);
8840 if (__pGeneralSetting)
8842 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
8844 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
8845 SetControlAlwaysOnTop(*__pGeneralSetting, true);
8849 if (__pGeneralSettingLable)
8851 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
8853 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
8854 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
8857 AppLogDebug("EXIT");
8861 CameraForm::HidePanel(bool isWideMode, bool isInvalidated)
8863 AppLogDebug("ENTER");
8864 result r = E_SUCCESS;
8866 SetControlAlwaysOnTopPanel();
8868 if (isWideMode == true)
8870 AppLogDebug("Wide MODE");
8872 if (__pSettingPanel)
8874 r = __pSettingPanel->SetShowState(false);
8875 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8880 r = __pActionPanel->SetShowState(false);
8881 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8886 AppLogDebug("Normal MODE");
8888 if (__pSettingPanel)
8890 r = __pSettingPanel->SetShowState(true);
8891 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8896 r = __pActionPanel->SetShowState(true);
8897 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8901 if (isInvalidated == true)
8910 AppLogDebug("EXIT");
8914 CameraForm::SetScreenMode(const ScreenMode mode, bool destory)
8916 AppLogDebug("ENTER");
8917 result r = E_SUCCESS;
8919 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8923 case SCREEN_MODE_NORMAL:
8925 if (destory == true)
8927 if (__screenMode != mode)
8929 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8930 _pAppTimer->Cancel();
8932 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8933 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8935 _pCameraPresentationModel->KeepScreenOnState(true, false);
8937 _pCameraPresentationModel->StopCamera();
8941 if (__isToggleCameraDirection || __resolutionChange)
8943 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8944 _pAppTimer->Cancel();
8946 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8947 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8949 _pCameraPresentationModel->KeepScreenOnState(true, false);
8951 _pCameraPresentationModel->StopCamera();
8955 SetOverlayPanelNormalMode(true);
8957 SetOverlayRendererRotation();
8959 if (__screenMode != mode)
8961 SetCameraMode(false);
8965 if (__isToggleCameraDirection || __resolutionChange)
8967 SetCameraMode(false);
8971 __screenMode = SCREEN_MODE_NORMAL;
8975 SetOverlayPanelNormalMode(false);
8977 SetOverlayRendererRotation();
8979 __screenMode = SCREEN_MODE_NORMAL;
8982 if (__pOverlayPanel != null)
8984 __pOverlayPanel->RemoveTouchEventListener(*this);
8987 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8988 HidePanel(false, false);
8992 case SCREEN_MODE_FULL:
8994 if (destory == true)
8996 if (__screenMode != mode)
8998 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8999 _pAppTimer->Cancel();
9001 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9002 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
9004 _pCameraPresentationModel->KeepScreenOnState(true, false);
9006 _pCameraPresentationModel->StopCamera();
9010 if (__isToggleCameraDirection || __resolutionChange)
9012 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
9013 _pAppTimer->Cancel();
9015 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9016 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
9018 _pCameraPresentationModel->KeepScreenOnState(true, false);
9020 _pCameraPresentationModel->StopCamera();
9024 SetOverlayPanelWideMode(true);
9026 SetOverlayRendererRotation();
9028 if (__screenMode != mode)
9030 SetCameraMode(true);
9034 if (__isToggleCameraDirection || __resolutionChange)
9036 SetCameraMode(true);
9040 __screenMode = SCREEN_MODE_FULL;
9044 SetOverlayPanelWideMode(false);
9046 SetOverlayRendererRotation();
9048 __screenMode = SCREEN_MODE_FULL;
9051 if (__pOverlayPanel != null)
9053 __pOverlayPanel->AddTouchEventListener(*this);
9056 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
9057 HidePanel(true, false);
9065 AppLogDebug("EXIT");
9069 _pCameraInfoPanel->SetOverlayPanelMode(SCREEN_MODE_NORMAL);
9070 __screenMode = SCREEN_MODE_NORMAL;
9076 CameraForm::BackButtonPerformed(void)
9078 AppLogDebug("ENTER");
9079 result r = E_SUCCESS;
9081 if (_pHelpGoToGallery->GetShowState() == true)
9083 AppLogDebug("EXIT - Screen Overlay Help");
9084 OnHelpCloseTimerExpired();
9088 if (_pCameraPresentationModel->GetPreviewState() == false)
9090 AppLogDebug("EXIT - StartPreview do not call");
9094 if (_pCameraInfoPanel->GetDrawExposure() == true)
9096 HideExposurePanel();
9100 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9102 r = PressBackButton();
9103 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
9107 if (__isTimerRunning == true)
9109 OnTimerCapturePause();
9115 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
9120 AppLogDebug("EXIT");
9124 AppLogDebug("EXIT - CATCH");
9129 CameraForm::PressBackButton(void)
9131 AppLogDebug("ENTER");
9132 result r = E_SUCCESS;
9134 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9136 AppLogDebug("PressBackButton >> Back to the App");
9138 if (_pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED)
9140 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
9144 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
9147 AppLogDebug("EXIT");
9152 CameraForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
9154 AppLogDebug("ENTER");
9155 result r = E_SUCCESS;
9156 bool focusSupport = false;
9157 int selfPortraitEnable = 0;
9159 if (__isTimerRunning == false)
9161 AppLogDebug("__isTimerRunning:false");
9163 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9164 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9166 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9168 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9172 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9175 if (focusSupport == true && r == E_SUCCESS)
9177 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9178 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9179 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9180 _pCameraInfoPanel->Invalidate(true);
9184 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9185 _pCameraInfoPanel->Invalidate(true);
9187 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
9191 AppLogDebug("__isTimerRunning:true");
9193 AppLogDebug("EXIT");
9197 CameraForm::DoCapture(void)
9199 AppLogDebug("ENTER");
9200 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9202 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9203 _pAppTimer->Cancel();
9207 _timeCount = INDEX_UNIT_ZERO;
9208 _pPopupTimer->Cancel();
9211 if (_pExposureCloseTimer)
9213 _pExposureCloseTimer->Cancel();
9216 if (_pCameraInfoPanel->GetDrawExposure() == true)
9218 _pCameraInfoPanel->SetDrawExposure(false);
9222 if (_pTouchAutoFocusTimer)
9224 _pTouchAutoFocusTimer->Cancel();
9227 if (_pChargingTimer)
9229 _pChargingTimer->Cancel();
9234 _pCameraInfoPanel->CheckAvailableStorageSpace();
9236 AppLogDebug("EXIT");
9240 CameraForm::SetUri(const Tizen::Base::String& uri)
9242 AppLogDebug("ENTER");
9243 AppLogDebug("[URI] %ls", uri.GetPointer());
9244 __uri = String(uri);
9245 AppLogDebug("EXIT");
9249 CameraForm::SetMime(const Tizen::Base::String& mime)
9251 AppLogDebug("ENTER");
9252 AppLogDebug("[MIME] %ls", mime.GetPointer());
9253 __mime = String(mime);
9254 AppLogDebug("EXIT");
9257 const Tizen::Base::String&
9258 CameraForm::GetUri(void) const
9260 AppLogDebug("ENTER");
9261 AppLogDebug("EXIT");
9265 const Tizen::Base::String&
9266 CameraForm::GetMime(void) const
9268 AppLogDebug("ENTER");
9269 AppLogDebug("EXIT");
9274 CameraForm::LaunchImageview(void)
9276 AppLogDebug("ENTER");
9277 result r = E_SUCCESS;
9278 const String* filePath = null;
9279 String listIndex = L"";
9280 String* temp = null;
9286 _timeCount = INDEX_UNIT_ZERO;
9287 _pPopupTimer->Cancel();
9290 if (_pExposureCloseTimer)
9292 _pExposureCloseTimer->Cancel();
9297 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
9298 pExtraData->Construct();
9300 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9301 pArrayList->Construct();
9303 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9304 pContentPathList->Construct();
9306 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9307 if (pContentPathList == null)
9311 AppLogDebug("EXIT - pContentPathList is null");
9315 loopCount = _pCameraPresentationModel->GetContentCount();
9316 for (index = 0; index < loopCount; ++index)
9318 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
9319 AppLogDebug("filePath = %ls", filePath->GetPointer());
9320 pArrayList->Add(new (std::nothrow) String(*filePath));
9323 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
9324 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
9326 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
9327 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
9330 SetMime(MIME_TYPE_VALUE_IMAGE);
9332 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
9333 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
9335 loopCount = pArrayList->GetCount();
9336 for (int i = 0; i < loopCount; ++i)
9338 temp = static_cast<String*>(pArrayList->GetAt(i));
9339 AppLog("print temp(%ls)", temp->GetPointer());
9341 AppLogDebug("EXIT");
9345 CameraForm::InDrawFocus(void)
9347 AppLogDebug("ENTER");
9348 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9349 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9350 Rectangle clientRect = GetClientAreaBounds();
9351 result r = E_SUCCESS;
9352 int selfPortraitEnable = 0;
9353 Point currentPosition;
9354 bool focusSupport = false;
9356 if (__dir == ORIENTATION_STATUS_PORTRAIT
9357 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9359 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9360 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9361 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9362 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9366 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9367 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9368 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9369 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9372 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9373 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9375 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9377 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9381 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9384 if (focusSupport == true && r == E_SUCCESS)
9386 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9387 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9388 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9392 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9393 _pCameraInfoPanel->Draw();
9394 _pCameraInfoPanel->Show();
9396 AppLogDebug("EXIT");
9400 CameraForm::GetCameraToForeground(void)
9402 AppLogDebug("ENTER");
9403 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9404 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9405 Rectangle clientRect = GetClientAreaBounds();
9406 result r = E_SUCCESS;
9407 Dimension previewResolutionDim;
9408 Dimension captureResolutionDim;
9409 int previewResolutionSize = 0;
9410 BufferInfo bufferinfo;
9412 __isLockScreenMode = false;
9414 _pCameraPresentationModel->KeepScreenOnState(true, false);
9416 StartInitAppTimer();
9418 StartPreviewFailPopupTimer();
9420 _batteryStatus = GetCurrentBatteryState();
9421 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9423 StartInitChargingTimer();
9425 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9426 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
9430 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
9431 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9433 __previewResolutionWidth = previewResolutionDim.width;
9434 __previewResolutionHeight = previewResolutionDim.height;
9436 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
9437 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9439 AppLogDebug("__screenMode [%d]", __screenMode);
9441 r = SetScreenMode(__screenMode, false);
9442 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
9444 if (__dir == ORIENTATION_STATUS_PORTRAIT
9445 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9447 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9451 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9456 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9457 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
9459 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9460 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9462 _pCameraPresentationModel->StartPreview(&bufferinfo);
9464 _pCameraPresentationModel->SetContinuousAutoFocus();
9466 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
9468 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
9470 SetCameraSettingsDevice();
9471 AppLogDebug("EXIT");
9475 CameraForm::SendCameraToBackground(void)
9477 AppLogDebug("ENTER");
9478 if (__isTimerRunning == true)
9481 _timeCount = INDEX_UNIT_ZERO;
9482 __isTimerRunning = false;
9483 _pCameraPresentationModel->SetIntervalTimerRun(false);
9484 _isUsedTimerCaptured = false;
9486 if (_pIntervalValueTimer != null)
9488 _pIntervalValueTimer->Cancel();
9491 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9492 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9493 _pCameraInfoPanel->SetDrawPopupTimer(false);
9494 _pCameraInfoPanel->Invalidate(true);
9498 if (_pAppTimer != null)
9500 _pAppTimer->Cancel();
9503 if (_pChargingTimer != null)
9506 _pChargingTimer->Cancel();
9509 if (_pChargingCompletedTimer != null)
9513 _pChargingCompletedTimer->Cancel();
9516 if (_pPreviewFailPopupTimer != null)
9518 _pPreviewFailPopupTimer->Cancel();
9521 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9522 _pCameraInfoPanel->Invalidate(true);
9526 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9527 _pCameraPresentationModel->StopCamera();
9528 _pCameraPresentationModel->KeepScreenOnState(false, true);
9530 AppLogDebug("EXIT");
9534 CameraForm::DrawThumbnail(void)
9536 AppLogDebug("ENTER");
9537 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9539 if (__pThumbnailButton)
9541 __pThumbnailButton->SetShowState(true);
9542 __pThumbnailButton->Draw();
9543 __pThumbnailButton->Show();
9546 if (_pThumbnailPanel)
9548 _pThumbnailPanel->SetShowState(false);
9549 _pThumbnailPanel->Draw();
9550 _pThumbnailPanel->Show();
9555 if (__pThumbnailButton)
9557 __pThumbnailButton->SetShowState(false);
9558 __pThumbnailButton->Draw();
9559 __pThumbnailButton->Show();
9562 if (_pThumbnailPanel)
9564 _pThumbnailPanel->SetShowState(true);
9565 _pThumbnailPanel->Draw();
9566 _pThumbnailPanel->Show();
9569 AppLogDebug("EXIT");
9573 CameraForm::SetCameraErrorOccurred(void)
9575 AppLogDebug("ENTER");
9576 result r = E_SUCCESS;
9577 Point currentPosition;
9578 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9579 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9580 int guideLineEnable = 0;
9581 BufferInfo bufferinfo;
9583 if (__dir == ORIENTATION_STATUS_PORTRAIT
9584 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9586 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9587 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9591 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9592 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9595 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9596 _pAppTimer->Cancel();
9598 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9599 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9601 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9602 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9604 _pCameraPresentationModel->StartPreview(&bufferinfo);
9606 _pCameraPresentationModel->SetContinuousAutoFocus();
9608 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
9609 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9611 if (guideLineEnable == DISABLE_GUIDELINE)
9624 _isUsedTimerCaptured = false;
9625 AppLogDebug("EXIT");
9629 CameraForm::SetScreenOverlayHelpTimer(void)
9631 AppLogDebug("ENTER");
9632 result r = E_SUCCESS;
9633 int overlayHelpEnable = 0;
9635 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9636 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9638 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
9640 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
9642 _pHelpCloseTimer = new (std::nothrow) Timer();
9643 _pHelpCloseTimer->Construct(*this);
9645 r = _pHelpCloseTimer->Start(CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE);
9646 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
9649 AppLogDebug("EXIT");
9653 delete _pHelpCloseTimer;
9654 _pHelpCloseTimer = null;
9656 AppLogDebug("EXIT - CATCH");
9661 CameraForm::DrawScreenOverlayHelp(void)
9663 AppLogDebug("ENTER");
9664 Bitmap* pBitmap = null;
9665 result r = E_SUCCESS;
9666 int overlayHelpEnable = 0;
9667 bool checkAppControlSwitch = false;
9668 //AppResource* pAppResource = null;
9670 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
9671 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
9672 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
9673 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
9674 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
9675 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
9676 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
9677 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
9678 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
9679 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
9681 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9682 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9684 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
9686 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
9688 HideScreenOverlayHelp();
9692 //pAppResource = Application::GetInstance()->GetAppResource();
9693 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
9695 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
9697 _pHelpGoToGallery->SetShowState(true);
9698 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9699 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9700 _pHelpGoToGalleryText->SetShowState(true);
9703 _pHelpSwitchCamera->SetShowState(true);
9704 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9705 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9706 _pHelpSwitchCameraText->SetShowState(true);
9708 _pHelpQuickSetting->SetShowState(true);
9709 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9710 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9711 _pHelpQuickSettingText->SetShowState(true);
9714 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9716 checkAppControlSwitch = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetAppControlSwitch();
9720 checkAppControlSwitch = true;
9723 if (checkAppControlSwitch)
9725 _pHelpRecordVideo->SetShowState(true);
9726 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9727 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9728 _pHelpRecordVideoText->SetShowState(true);
9731 _pHelpShutter->SetShowState(true);
9732 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9733 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9734 _pHelpShutterText->SetShowState(true);
9736 if (__dir == ORIENTATION_STATUS_PORTRAIT
9737 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9739 _pHelpGoToGalleryText->Invalidate(true);
9740 _pHelpSwitchCameraText->Invalidate(true);
9741 _pHelpQuickSettingText->Invalidate(true);
9742 _pHelpRecordVideoText->Invalidate(true);
9743 _pHelpShutterText->Invalidate(true);
9745 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9746 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9748 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9749 _pHelpGoToGallery->Invalidate(true);
9754 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9755 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9757 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9758 _pHelpSwitchCamera->Invalidate(true);
9763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9764 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9766 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9767 _pHelpQuickSetting->Invalidate(true);
9772 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
9773 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9775 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9776 _pHelpRecordVideo->Invalidate(true);
9781 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
9782 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9784 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9785 _pHelpShutter->Invalidate(true);
9790 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
9791 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9798 _pHelpGoToGalleryText->Invalidate(true);
9799 _pHelpSwitchCameraText->Invalidate(true);
9800 _pHelpQuickSettingText->Invalidate(true);
9801 _pHelpRecordVideoText->Invalidate(true);
9802 _pHelpShutterText->Invalidate(true);
9804 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9805 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9807 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9808 _pHelpGoToGallery->Invalidate(true);
9813 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
9814 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9816 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9817 _pHelpSwitchCamera->Invalidate(true);
9822 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9823 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9825 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9826 _pHelpQuickSetting->Invalidate(true);
9831 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9832 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9834 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9835 _pHelpRecordVideo->Invalidate(true);
9840 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9841 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9843 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9844 _pHelpShutter->Invalidate(true);
9849 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9850 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9857 AppLogDebug("EXIT");
9861 AppLogDebug("EXIT - CATCH");
9866 CameraForm::CheckCameraSettingLabel(void)
9868 AppLogDebug("ENTER");
9869 if (__pCameraSettingLable)
9871 result r = E_SUCCESS;
9873 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9874 _pAppTimer->Cancel();
9876 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9877 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9879 if (_pListViewGeneralTabMainMenu)
9881 _pListViewGeneralTabMainMenu->SetShowState(false);
9884 if (_pListViewGeneralTabSubMenu)
9886 _pListViewGeneralTabSubMenu->SetShowState(false);
9889 MakeCameraTabSettingPopup();
9891 AppLogDebug("Exit");
9895 CameraForm::CheckGeneralSettingLabel(void)
9897 AppLogDebug("ENTER");
9898 if(__pGeneralSettingLable)
9900 result r = E_SUCCESS;
9902 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9903 _pAppTimer->Cancel();
9905 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9906 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9908 if (_pListViewCameraTabMainMenu)
9910 _pListViewCameraTabMainMenu->SetShowState(false);
9912 if (_pListViewCameraTabSubMenu)
9914 _pListViewCameraTabSubMenu->SetShowState(false);
9917 MakeGeneralTabSettingPopup();
9919 AppLogDebug("Exit");
9923 CameraForm::DrawBatteryLevelFull(void)
9925 AppLogDebug("ENTER");
9926 Bitmap* pBitmap = null;
9927 result r = E_SUCCESS;
9929 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9931 if (__dir == ORIENTATION_STATUS_PORTRAIT
9932 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9934 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9938 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9941 _batteryStatus = BATTERY_STATE_20;
9943 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
9944 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9946 __pBatteryState->SetBackgroundBitmap(*pBitmap);
9947 __pBatteryState->Invalidate(true);
9952 AppLogDebug("EXIT");
9956 AppLogDebug("EXIT - CATCH");
9961 CameraForm::CheckBatteryStatus(void)
9963 AppLogDebug("ENTER");
9964 Bitmap* pBitmap = null;
9965 result r = E_SUCCESS;
9966 int batteryLevel = 0;
9967 bool isCharging = false;
9969 Battery::IsCharging(isCharging);
9970 Battery::GetCurrentLevelInPercentage(batteryLevel);
9972 AppLogDebug("isCharging = %d", isCharging);
9973 AppLogDebug("batteryLevel = %d", batteryLevel);
9975 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9977 if (__dir == ORIENTATION_STATUS_PORTRAIT
9978 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9980 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9984 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9989 _batteryStatus = GetCurrentBatteryState();
9990 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9992 int currentImage = GetCurrentBatteryImage();
9994 AppLogDebug("currentImage = %d", currentImage);
9996 pBitmap = ResourceManager::GetBitmapN(currentImage);
9998 StartInitChargingTimer();
10002 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
10004 _batteryStatus = BATTERY_STATE_20;
10006 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
10008 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
10010 _batteryStatus = BATTERY_STATE_19;
10012 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
10014 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
10016 _batteryStatus = BATTERY_STATE_18;
10018 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
10020 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
10022 _batteryStatus = BATTERY_STATE_17;
10024 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
10026 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
10028 _batteryStatus = BATTERY_STATE_16;
10030 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
10032 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
10034 _batteryStatus = BATTERY_STATE_15;
10036 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
10038 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
10040 _batteryStatus = BATTERY_STATE_14;
10042 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
10044 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
10046 _batteryStatus = BATTERY_STATE_13;
10048 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
10050 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
10052 _batteryStatus = BATTERY_STATE_12;
10054 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
10056 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
10058 _batteryStatus = BATTERY_STATE_11;
10060 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
10062 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
10064 _batteryStatus = BATTERY_STATE_10;
10066 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
10068 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
10070 _batteryStatus = BATTERY_STATE_9;
10072 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
10074 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
10076 _batteryStatus = BATTERY_STATE_8;
10078 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
10080 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
10082 _batteryStatus = BATTERY_STATE_7;
10084 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
10086 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
10088 _batteryStatus = BATTERY_STATE_6;
10090 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
10092 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
10094 _batteryStatus = BATTERY_STATE_5;
10096 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
10098 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
10100 _batteryStatus = BATTERY_STATE_4;
10102 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
10104 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
10106 _batteryStatus = BATTERY_STATE_3;
10108 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
10110 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
10112 _batteryStatus = BATTERY_STATE_2;
10114 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
10116 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
10118 _batteryStatus = BATTERY_STATE_1;
10120 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
10122 else if (batteryLevel == BATT_LEVEL_VALUE_00)
10124 _batteryStatus = BATTERY_STATE_0;
10126 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
10129 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10131 AppLogDebug("_batteryStatus = %d", _batteryStatus);
10133 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10134 __pBatteryState->Invalidate(true);
10139 AppLogDebug("EXIT");
10143 AppLogDebug("EXIT - CATCH");
10148 CameraForm::CancelTimer(void)
10150 AppLogDebug("ENTER");
10151 if (_pAppTimer != null)
10153 _pAppTimer->Cancel();
10156 if (_pIntervalValueTimer != null)
10158 _pIntervalValueTimer->Cancel();
10161 if (_pCaptureStartTimer != null)
10163 _pCaptureStartTimer->Cancel();
10166 if (_pTouchAutoFocusTimer != null)
10168 _pTouchAutoFocusTimer->Cancel();
10173 _pPopupTimer->Cancel();
10176 if (_pExposureCloseTimer)
10178 _pExposureCloseTimer->Cancel();
10181 if (_pHelpCloseTimer)
10183 _pHelpCloseTimer->Cancel();
10186 if (_pChargingTimer)
10188 _chargingCount = INDEX_UNIT_ZERO;
10190 _pChargingTimer->Cancel();
10193 if (_pChargingCompletedTimer != null)
10195 _chargingCount = 0;
10197 _pChargingCompletedTimer->Cancel();
10200 if (_pPreviewFailPopupTimer != null)
10202 _pPreviewFailPopupTimer->Cancel();
10204 AppLogDebug("EXIT");
10208 CameraForm::MakeCameraTabMenuString(void)
10210 AppLogDebug("ENTER");
10213 result r = E_SUCCESS;
10214 AppResource* pAppResource = null;
10216 if (__pSettingMenuString == null)
10218 pAppResource = Application::GetInstance()->GetAppResource();
10219 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10221 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
10223 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
10225 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10227 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10228 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
10231 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
10232 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
10234 pAppResource->GetString(IDS_CAM_BODY_ISO, tmpString);
10235 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_01] = tmpString;
10236 pAppResource->GetString(IDS_CAM_BODY_AUTO, tmpString);
10237 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_02] = tmpString;
10238 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_03] = IDS_MENU_ISO_50;
10239 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_04] = IDS_MENU_ISO_100;
10240 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_05] = IDS_MENU_ISO_200;
10241 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_06] = IDS_MENU_ISO_400;
10242 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_07] = IDS_MENU_ISO_800;
10244 AppLogDebug("EXIT");
10248 if (__pSettingMenuString)
10250 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10252 if (__pSettingMenuString[idx])
10254 delete [] __pSettingMenuString[idx];
10255 __pSettingMenuString[idx] = null;
10263 delete [] __pSettingMenuString;
10264 __pSettingMenuString = null;
10271 CameraForm::MakeGeneralTabMenuString(void)
10273 AppLogDebug("ENTER");
10276 result r = E_SUCCESS;
10277 AppResource* pAppResource = null;
10279 if (__pSettingGeneralMenuString == null)
10281 pAppResource = Application::GetInstance()->GetAppResource();
10282 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10284 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
10286 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
10288 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10290 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10291 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
10294 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
10295 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
10297 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10298 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
10299 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
10300 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
10301 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
10302 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
10303 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
10304 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
10306 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
10307 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
10308 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10309 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
10310 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
10311 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
10313 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
10314 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
10315 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
10316 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
10317 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
10318 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
10320 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
10321 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
10323 pAppResource->GetString(IDS_MENU_OVERLAY_HELP_VALUE, tmpString);
10324 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
10325 //__pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
10327 AppLogDebug("EXIT");
10331 if (__pSettingGeneralMenuString)
10333 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10335 if (__pSettingGeneralMenuString[idx])
10337 delete [] __pSettingGeneralMenuString[idx];
10338 __pSettingGeneralMenuString[idx] = null;
10346 delete [] __pSettingGeneralMenuString;
10347 __pSettingGeneralMenuString = null;
10354 CameraForm::RunStartPreviewThread(void)
10356 AppLogDebug("ENTER");
10357 result r = E_SUCCESS;
10359 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
10360 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10362 __pCameraStarterThread = CameraStarterThread::GetInstance();
10363 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
10365 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
10366 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10368 r = __pCameraStarterThread->Start();
10369 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10371 AppLogDebug("EXIT");
10375 ShowCameraFailPopup();
10377 AppLogDebug("EXIT - CATCH");
10382 CameraForm::SubListPopupTimerMode(int index)
10384 AppLogDebug("ENTER");
10385 result r = E_SUCCESS;
10388 __settingTimeInterval = index;
10391 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
10392 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10394 _pCameraInfoPanel->SetTimerType(regVal);
10395 _pCameraInfoPanel->Invalidate(true);
10397 AppLogDebug("EXIT");
10401 AppLogDebug("EXIT - CATCH");
10406 CameraForm::SubListPopupIsoMode(int index)
10408 AppLogDebug("ENTER");
10409 result r = E_SUCCESS;
10411 int selfPortraitEnable = 0;
10412 int updatedIndex = 0;
10414 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10415 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10417 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10419 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10423 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10426 if (r == E_SUCCESS)
10430 updatedIndex = index + 2;
10434 updatedIndex = index + 3;
10436 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
10439 __settingIsoIndex = index;
10440 regVal = __settingIsoIndex;
10442 r = _pCameraPresentationModel->SetValue(ISO_VALUE, regVal);
10443 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10445 AppLogDebug("EXIT");
10449 AppLogDebug("EXIT - CATCH");
10454 CameraForm::SubListPopupWhiteBalanceMode(int index)
10456 AppLogDebug("ENTER");
10457 result r = E_SUCCESS;
10459 String strRegKey = IDS_INIT_REG_KEY;
10460 int selfPortraitEnable = 0;
10462 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10463 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10465 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10467 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
10471 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
10474 if (r == E_SUCCESS)
10476 r = _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
10478 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10480 __settingWhiteBalance = index;
10481 regVal = __settingWhiteBalance;
10483 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10485 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
10486 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10490 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
10491 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10494 AppLogDebug("regVal = %d",regVal);
10496 AppLogDebug("EXIT");
10500 AppLogDebug("EXIT - CATCH");
10505 CameraForm::SubListPopupGuidelineMode(int index)
10507 AppLogDebug("ENTER");
10508 int value = SUBMENU_MODE_OFF;
10509 result r = E_SUCCESS;
10511 String strRegKey = IDS_INIT_REG_KEY;
10515 case SUBMENU_MODE_OFF:
10517 AppLogDebug("Setting - Guideline = off");
10518 value = SUBMENU_MODE_OFF;
10520 r = DrawMarker(false);
10521 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10525 case SUBMENU_MODE_ON:
10527 AppLogDebug("Setting - Guideline = on");
10528 value = SUBMENU_MODE_ON;
10530 r = DrawMarker(true);
10531 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10539 SetGuideLine(value);
10542 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
10543 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10545 AppLogDebug("EXIT");
10549 AppLogDebug("EXIT - CATCH");
10554 CameraForm::SubListPopupOverlayHelpMode(int index)
10556 AppLogDebug("ENTER");
10557 int value = SUBMENU_MODE_OFF;
10558 result r = E_SUCCESS;
10560 String strRegKey = IDS_INIT_REG_KEY;
10564 case SUBMENU_MODE_OFF:
10566 value = SUBMENU_MODE_OFF;
10570 case SUBMENU_MODE_ON:
10572 value = SUBMENU_MODE_ON;
10582 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
10583 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10585 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
10587 r = SetScreenOverlayHelpTimer();
10588 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
10590 r = DrawScreenOverlayHelp();
10591 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
10593 AppLogDebug("EXIT");
10597 AppLogDebug("EXIT - CATCH");
10602 CameraForm::SubListPopupResolutionMode(int index)
10604 AppLogDebug("ENTER");
10605 IList* pList = _pCameraPresentationModel->GetCaptureResolutionList();
10606 int resolutionCnt = 0;
10607 BufferInfo bufferinfo;
10608 int resolutionRatio = 0;
10609 result r = E_SUCCESS;
10611 int selfPortraitEnable = 0;
10613 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10617 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
10618 Dimension dimCaptureResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
10620 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10621 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: __captureResolution(W:%d, H:%d)", __captureResolutionWidth, __captureResolutionHeight);
10623 if ((__captureResolutionWidth == dimCaptureResolution.width ) && (__captureResolutionHeight == dimCaptureResolution.height))
10625 AppLogDebug("CAPTURE RESOLUTION Same");
10629 _pCameraPresentationModel->StopPreview();
10631 _pCameraPresentationModel->SetCaptureResolution(dimCaptureResolution);
10633 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10635 r = _pCameraPresentationModel->SetValue(PRIMARY_RESOLUTION_INDEX,index);
10636 AppLogDebug("result is %s",GetErrorMessage(r));
10640 r = _pCameraPresentationModel->SetValue(SECONDARY_RESOLUTION_INDEX,index);
10643 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10645 resolutionRatio = (dimCaptureResolution.width * MULTIPLY_BY_TEN) / (dimCaptureResolution.height);
10647 AppLogDebug("resolutionRatio (W:%d)", resolutionRatio);
10649 __resolutionChange = true;
10651 __captureResolutionWidth = dimCaptureResolution.width;
10653 __captureResolutionHeight = dimCaptureResolution.height;
10655 if (resolutionRatio > NORMAL_MODE_RATIO)
10657 r = SetScreenMode(SCREEN_MODE_FULL, true);
10661 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
10663 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
10665 AppLogDebug("__screenMode [%d]", __screenMode);
10669 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10671 __primaryCurrentResolutionIndex = index;
10672 regVal = __primaryCurrentResolutionIndex;
10676 __secondaryCurrentResolutionIndex = index;
10677 regVal = __secondaryCurrentResolutionIndex;
10679 __resolutionChange = false;
10681 AppLogDebug("EXIT");
10685 AppLogDebug("EXIT - CATCH");
10690 CameraForm::SubListPopupStorageTypeMode(int index)
10692 AppLogDebug("ENTER");
10693 int storage = STORAGE_TYPE_PHONE;
10694 String filePath = L"";
10695 result r = E_SUCCESS;
10699 case SUBMENU_STORAGE_TYPE_PHONE:
10701 AppLogDebug("Setting - Storage type = Phone");
10702 storage = STORAGE_TYPE_PHONE;
10703 SetStorageType(storage);
10707 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
10709 AppLogDebug("Setting - Storage type = card");
10710 storage = STORAGE_TYPE_MEMORYCARD;
10712 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
10714 SetStorageType(storage);
10718 storage = SUBMENU_STORAGE_TYPE_PHONE;
10719 AppLogDebug("Setting - don't draw t-flash icon");
10726 AppLogDebug("Setting - Storage, Invaild element id");
10731 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
10735 _pCameraInfoPanel->SetStorageType(storage);
10736 _pCameraInfoPanel->Invalidate(true);
10738 if (__pFileEventManager == null)
10740 __pFileEventManager = new (std::nothrow) FileEventManager();
10741 r = __pFileEventManager->Construct(*this);
10742 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10745 filePath = _pCameraPresentationModel->GetfilePath(storage);
10746 AppLogDebug("filePath %ls", filePath.GetPointer());
10749 if (File::IsFileExist(__pFileEventPath))
10751 __pFileEventManager->RemovePath(__pFileEventPath);
10754 if (File::IsFileExist(filePath))
10756 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
10757 __pFileEventPath = filePath;
10759 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10760 AppLogDebug("EXIT");
10764 CameraForm::CreateCameraTabMainMenuItem(int index, int itemWidth)
10766 AppLogDebug("ENTER");
10767 CustomItem* pItem = null;
10768 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
10769 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
10771 result r = E_SUCCESS;
10774 int cameraResolutionCount = 0;
10775 int storageType = STORAGE_TYPE_PHONE;
10776 String listName = L"";
10777 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS,
10778 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
10780 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE,
10781 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
10783 int selfPortraitEnable = 0;
10784 String strTmp = L"";
10786 pItem = new (std::nothrow) CustomItem();
10787 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
10789 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
10790 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
10792 elementId = (index * MENU_TWO_ELEMENT);
10794 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10795 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10797 strTmp = __pSettingMenuString[index][0];
10799 if (strTmp.GetLength())
10801 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
10803 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10805 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10807 if (r == E_SUCCESS)
10809 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10810 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10819 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10820 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10823 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10825 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
10827 if (r == E_SUCCESS)
10829 if (__pCaptureResolutionList != null)
10831 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10834 if (cameraResolutionCount > 1)
10836 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10845 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10846 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10851 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
10852 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10857 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10858 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10863 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10865 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10867 if (r == E_SUCCESS && __pIsoList->GetCount()>1)
10869 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10870 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10880 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10881 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10884 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10886 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
10888 if (r == E_SUCCESS)
10890 cameraResolutionCount = 0;
10891 if (__pCaptureResolutionList != null)
10893 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10896 if (cameraResolutionCount > 1)
10898 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10908 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10909 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10914 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
10915 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10920 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10921 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10926 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
10927 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10929 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
10931 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
10932 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10933 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
10936 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10938 if (__pCaptureResolutionList)
10940 int idx = __pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
10943 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10945 AppLogDebug("CAM_SELF_PORTRAIT_MODE_PRIMARY");
10946 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
10949 if (__primaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10951 __primaryCurrentResolutionIndex = __primaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10953 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10957 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10964 AppLogDebug("CAM_SELF_PORTRAIT_MODE_SECONDARY");
10965 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
10967 if (__secondaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10969 __secondaryCurrentResolutionIndex = __secondaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10971 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10975 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10981 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10985 int idx = __pIsoList->GetCount() - INDEX_UNIT_ONE;
10986 if (idx >= INDEX_UNIT_ZERO)
10988 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
10990 if (regVal == INDEX_UNIT_ZERO)
10992 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
10996 strTmp = *(static_cast<String*>(__pIsoList->GetAt(regVal)));
11002 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11007 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11012 if (strTmp.GetLength())
11014 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11016 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11018 if (__pIsoList != null)
11020 if (__pIsoList->GetCount() >1)
11022 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11023 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11027 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11032 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11037 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11042 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11044 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11046 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
11050 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
11053 if (r == E_SUCCESS)
11055 cameraResolutionCount = 0;
11056 if (__pCaptureResolutionList != null)
11058 cameraResolutionCount = __pCaptureResolutionList->GetCount();
11061 if (cameraResolutionCount > 1)
11063 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11067 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11072 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11077 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11080 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11081 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11084 AppLogDebug("EXIT");
11091 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11092 AppLogDebug("EXIT - CATCH");
11097 CameraForm::CreateCameraTabSubMenuItem(int index, int itemWidth)
11099 AppLogDebug("ENTER");
11100 CustomItem* pItem = null;
11101 Bitmap* pBitmap = null;
11102 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11103 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11104 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11105 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11106 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11107 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11108 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11109 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11110 AppResource* pAppResource = null;
11112 result r = E_SUCCESS;
11115 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
11117 pItem = new (std::nothrow) CustomItem();
11118 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11120 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11121 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11123 pAppResource = Application::GetInstance()->GetAppResource();
11124 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11126 idx = GetCameraTabSettingSubMenuMode();
11129 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
11131 ResourceId resId = RESOURCE_ID_ISO_AUTO;
11135 case SUBMENU_ISO_AUTO:
11137 resId = RESOURCE_ID_ISO_AUTO;
11141 case SUBMENU_ISO_100:
11143 resId = RESOURCE_ID_ISO_100;
11147 case SUBMENU_ISO_200:
11149 resId = RESOURCE_ID_ISO_200;
11153 case SUBMENU_ISO_400:
11155 resId = RESOURCE_ID_ISO_400;
11159 case SUBMENU_ISO_800:
11161 resId = RESOURCE_ID_ISO_800;
11169 String arrString[] =
11178 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11179 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11184 if (__pIsoList->GetCount() > index)
11186 if (index == regVal)
11188 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11192 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11195 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11196 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11201 AppLogDebug("ISO index return is = %d", index);
11203 if (index == INDEX_UNIT_ZERO)
11205 pAppResource->GetString(arrString[index], str);
11209 str = *(static_cast<String*>(__pIsoList->GetAt(index)));
11213 pBitmap = ResourceManager::GetBitmapN(resId);
11214 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11216 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11217 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11223 r = pItem->AddElement(rectThreeTextItem, elementId, str, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11224 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11230 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
11232 int selfPortraitEnable = 0;
11234 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11235 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11238 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY )
11240 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
11241 AppLogDebug("resolution index is %d",__primaryCurrentResolutionIndex);
11242 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11246 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
11247 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11250 if (__pCaptureResolutionList)
11253 if (__pCaptureResolutionList->GetCount() > index)
11255 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11257 if (index == __primaryCurrentResolutionIndex)
11259 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11263 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11268 if (index == __secondaryCurrentResolutionIndex)
11270 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11274 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11278 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11279 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11286 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11287 AppLogDebug("str = %ls", str.GetPointer());
11288 if (str.Equals(String(PHOTO_SIZE_3264_2488)))
11290 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11292 else if (str.Equals(String(PHOTO_SIZE_3264_2176)))
11294 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11296 else if (str.Equals(String(PHOTO_SIZE_3264_1836)))
11298 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11300 else if (str.Equals(String(PHOTO_SIZE_2048_1536)))
11302 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11304 else if (str.Equals(String(PHOTO_SIZE_2048_1152)))
11306 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11308 else if (str.Equals(String(PHOTO_SIZE_1280_720)))
11310 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.9M
11312 else if (str.Equals(String(PHOTO_SIZE_640_480)))
11314 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11318 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11320 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11322 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11323 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11328 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11331 r = pItem->AddElement(rectThreeTextItem, elementId, str, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11332 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11342 AppLogDebug("EXIT");
11352 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11353 AppLogDebug("EXIT - CATCH");
11358 CameraForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11360 AppLogDebug("ENTER");
11361 CustomItem* pItem = null;
11362 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11363 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11364 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11365 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11366 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11367 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11368 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11369 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11371 result r = E_SUCCESS;
11374 String listName = L"";
11375 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11376 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11378 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11379 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11380 int selfPortraitEnable = 0;
11381 String strTmp = L"";
11383 String arrRegStringSuppor[] =
11388 OVERLAY_HELP_ENABLE,
11391 pItem = new (std::nothrow) CustomItem();
11392 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11394 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11395 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11397 elementId = (index * MENU_TWO_ELEMENT);
11399 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11400 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11402 strTmp = __pSettingGeneralMenuString[index][0];
11405 if (strTmp.GetLength())
11407 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11408 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11411 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11413 int storageType = STORAGE_TYPE_PHONE;
11415 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11416 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11418 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11420 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11421 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11422 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11425 r = _pCameraPresentationModel->GetValue(arrRegStringSuppor[index], regVal);
11426 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11428 AppLogDebug("Setting Main Menu");
11429 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11430 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11432 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11436 if (strTmp.GetLength())
11438 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11439 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11441 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11442 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11446 AppLogDebug("EXIT");
11453 AppLogDebug("EXIT - CATCH");
11458 CameraForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
11460 AppLogDebug("ENTER");
11461 CustomItem* pItem = null;
11462 Bitmap* pBitmap = null;
11463 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11464 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11465 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11466 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11467 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11468 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11469 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11470 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11471 AppResource* pAppResource = null;
11473 result r = E_SUCCESS;
11477 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
11479 pItem = new (std::nothrow) CustomItem();
11480 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11482 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11483 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11485 pAppResource = Application::GetInstance()->GetAppResource();
11486 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11488 idx = GetGeneralTabSettingSubMenuMode();
11491 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
11493 ResourceId resId = RESOURCE_ID_TIMER_OFF;
11497 case SETTING_TIMER_CAPTURE_0_SEC:
11499 resId = RESOURCE_ID_TIMER_OFF;
11503 case SETTING_TIMER_CAPTURE_2_SEC:
11505 resId = RESOURCE_ID_TIMER_2SEC;
11509 case SETTING_TIMER_CAPTURE_5_SEC:
11511 resId = RESOURCE_ID_TIMER_5SEC;
11515 case SETTING_TIMER_CAPTURE_10_SEC:
11517 resId = RESOURCE_ID_TIMER_10SEC;
11525 String arrString[] =
11528 IDS_CAM_BODY_2_SEC,
11529 IDS_CAM_BODY_5_SEC,
11530 IDS_CAM_BODY_10_SEC,
11533 pAppResource->GetString(arrString[index], tmpString);
11535 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
11536 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11538 if (index == regVal)
11540 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11544 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11546 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11548 elementId = (index * MENU_TWO_ELEMENT);
11550 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11551 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11554 pBitmap = ResourceManager::GetBitmapN(resId);
11556 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11557 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11558 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11563 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11564 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11568 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
11570 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
11574 case SUBMENU_GUIDELINE_OFF:
11576 resId = RESOURCE_ID_GUIDELINE_OFF;
11580 case SUBMENU_GUIDELINE_ON:
11582 resId = RESOURCE_ID_GUIDELINE_ON;
11590 elementId = (index * MENU_TWO_ELEMENT);
11592 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
11593 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11595 if (index == regVal)
11597 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11601 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11603 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11605 if (index == SUBMENU_MODE_OFF)
11607 str = IDS_CAM_BODY_OFF;
11611 str = IDS_CAM_BODY_ON;
11614 pAppResource->GetString(str, tmpString);
11616 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11617 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11624 pBitmap = ResourceManager::GetBitmapN(resId);
11625 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11627 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11628 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11634 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11635 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11639 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
11641 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
11645 case SUBMENU_MODE_OFF:
11647 resId = RESOURCE_ID_STORAGE_PHONE;
11651 case SUBMENU_MODE_ON:
11653 resId = RESOURCE_ID_STORAGE_CARD;
11661 elementId = (index * MENU_TWO_ELEMENT);
11663 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
11664 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11666 if (index == regVal)
11668 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11672 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11674 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11676 if (index == STORAGE_TYPE_PHONE)
11678 str = IDS_CAM_BODY_PHONE;
11682 str = IDS_CAM_OPT_MEMORY_CARD;
11685 pAppResource->GetString(str, tmpString);
11687 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11688 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11694 pBitmap = ResourceManager::GetBitmapN(resId);
11695 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11697 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11698 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11705 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
11707 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
11709 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11713 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11718 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11720 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11724 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
11733 AppLogDebug("EXIT");
11743 AppLogDebug("EXIT - CATCH");
11748 CameraForm::CreateFlashMainMenuItem(int index, int itemWidth)
11750 AppLogDebug("ENTER");
11751 CustomItem* pItem = null;
11752 Bitmap* pBitmap = null;
11753 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11754 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11755 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11756 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11757 String listName = L"";
11758 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11759 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11760 AppResource* pAppResource = null;
11762 result r = E_SUCCESS;
11765 bool value = false;
11766 int selfPortraitEnable = 0;
11768 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11770 String arrString[] =
11777 pItem = new (std::nothrow) CustomItem();
11778 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11780 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11781 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11783 pAppResource = Application::GetInstance()->GetAppResource();
11784 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11786 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11787 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11789 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11791 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11793 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11794 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11796 if (flashMode != FLASH_MODE_OFF)
11798 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11799 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11804 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11806 if (value == true && r == E_SUCCESS)
11808 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11812 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11814 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11815 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11817 if (flashMode != FLASH_MODE_OFF)
11819 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11820 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11825 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11826 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11830 case SUBMENU_MODE_OFF:
11832 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
11836 case SUBMENU_MODE_ON:
11838 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11842 case SUBMENU_MODE_AUTO:
11844 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
11852 pAppResource->GetString(arrString[index], tmpString);
11854 if (index == regVal)
11856 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11860 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11862 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11864 elementId = (index * MENU_TWO_ELEMENT);
11866 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11867 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11873 pBitmap = ResourceManager::GetBitmapN(resId);
11874 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11876 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11877 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11884 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11886 if (value == true && r == E_SUCCESS)
11888 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11889 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11893 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11894 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11897 AppLogDebug("EXIT");
11907 AppLogDebug("EXIT - CATCH");
11912 CameraForm::CreateWhiteBalanceItem(int index, int itemWidth)
11914 AppLogDebug("ENTER");
11915 CustomItem* pItem = null;
11916 Bitmap* pBitmap = null;
11917 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11918 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11919 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11920 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11921 String listName = L"";
11922 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11923 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11925 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11926 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11928 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11929 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11930 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11931 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11932 AppResource* pAppResource = null;
11934 result r = E_SUCCESS;
11937 int selfPortraitEnable = 0;
11938 ResourceId resId = RESOURCE_ID_WB_AWB;
11940 String arrString[] =
11943 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
11944 IDS_CAM_BODY_FLUORESCENT,
11945 IDS_CAM_BODY_DAYLIGHT,
11946 IDS_CAM_BODY_CLOUDY,
11949 pItem = new (std::nothrow) CustomItem();
11950 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11952 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11953 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11955 pAppResource = Application::GetInstance()->GetAppResource();
11956 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11958 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11959 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11961 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11963 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
11964 if (r != E_SUCCESS)
11966 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, REG_DEFAULT_VAULE_ZERO);
11968 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
11969 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11973 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
11974 if (r != E_SUCCESS)
11976 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, REG_DEFAULT_VAULE_ZERO);
11978 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
11979 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11982 AppLogDebug("regVal = %d", regVal);
11988 resId = RESOURCE_ID_WB_AWB;
11992 case MODE_WHITEBALANCE_INCANDESCENT:
11994 resId = RESOURCE_ID_WB_DAYLIGHT;
11998 case MODE_FLUORESCENT:
12000 resId = RESOURCE_ID_WB_CLOUDY;
12004 case MODE_DAYLIGHT:
12006 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12012 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12020 pAppResource->GetString(arrString[index], tmpString);
12022 if (index == regVal)
12024 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12028 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12030 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12032 elementId = (index * MENU_THREE_ELEMENT);
12034 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12035 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12041 pBitmap = ResourceManager::GetBitmapN(resId);
12042 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12044 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12045 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12051 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12052 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12054 AppLogDebug("EXIT");
12064 AppLogDebug("EXIT - CATCH");
12069 CameraForm::UpdatePopUp(void)
12071 bool doHidePopup = false;
12072 MakeSettingPopupTab(false);
12074 doHidePopup = OnTouchDoHidePopup();
12075 AppLogDebug("doHidePopup = %d", doHidePopup);
12083 CameraForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
12085 AppLogDebug("ENTER");
12086 int checkActivePanel=-1;
12088 if (!__isTimerRunning)
12090 if ((_pListViewCameraTabMainMenu!= null && _pListViewCameraTabMainMenu->GetShowState()) ||
12091 (_pListViewGeneralTabMainMenu!= null && _pListViewGeneralTabMainMenu->GetShowState()) )
12093 checkActivePanel = 0;
12096 if (_pListFlashMainMenu != null && _pListFlashMainMenu->GetShowState())
12098 checkActivePanel = 1;
12101 if (_pListWbMainMenu != null && _pListWbMainMenu->GetShowState())
12103 checkActivePanel = 2;
12106 if (_pCameraInfoSubPanel!=null && _pCameraInfoSubPanel->GetShowState())
12108 checkActivePanel = 3;
12111 if (_pCameraInfoGeneralSubPanel!=null && _pCameraInfoGeneralSubPanel->GetShowState())
12113 checkActivePanel = 4;
12116 if (checkActivePanel != -1)
12118 switch (checkActivePanel)
12126 _pCameraInfoSubPanel->SetShowState(false);
12129 _pCameraInfoGeneralSubPanel->SetShowState(false);
12137 BackButtonPerformed();
12140 AppLogDebug("Exit");
12144 CameraForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12146 //Empty Implementation
12150 CameraForm::OnKeyPressed(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12152 //Empty Implementation
12156 CameraForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12158 AppLogDebug("Enter %d", keyCode);
12162 if ((source.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12164 OnTouchModeSwitch();
12169 if ((source.GetName().Equals(String(IDS_THUMBNAIL_PANLE_NAME))))
12171 OnTouchLaunchImageview();
12178 AppLogDebug("Exit");
12182 CameraForm::OnAccessibilityActionPerformed (const Control &control, const AccessibilityElement &element)
12184 AppLogDebug("Enter");
12185 AppLogDebug("control name is %ls",control.GetName().GetPointer());
12187 if ((control.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12189 OnTouchModeSwitch();
12191 AppLogDebug("Exit");
12195 CameraForm::OnAccessibilityFocusIn (const Control &control, const AccessibilityElement &element)
12197 AppLogDebug("Enter");
12198 AppLogDebug("Exit");
12202 CameraForm::OnAccessibilityFocusOut (const Control &control, const AccessibilityElement &element)
12204 AppLogDebug("Enter");
12205 AppLogDebug("Exit");
12209 CameraForm::OnAccessibilityScreenReaderStatusChanged (const Control &control, const AccessibilityElement &element, AccessibilityScreenReaderStatus status)
12211 AppLogDebug("Enter");
12212 AppLogDebug("Exit");
12216 CameraForm::OnKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
12218 AppLogDebug("Enter");
12223 CameraForm::OnKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
12225 AppLogDebug("Enter");
12226 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
12227 KeyCode currentKeyCode = keyEventInfo.GetKeyCode();
12229 switch (currentKeyCode)
12234 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
12236 _pResetPopUp->SetShowState(false);
12248 CameraForm::OnPreviewKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
12250 AppLogDebug("Enter");
12255 CameraForm::OnPreviewKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
12257 AppLogDebug("Enter");
12261 Tizen::Ui::Controls::CustomItem*
12262 CameraForm::GetEnrichedTextCustomItem(int elementId,int itemWidth,const Tizen::Base::String& strTmp)
12264 EnrichedText* pCurrentEnrichedText = null;
12265 TextElement* pCurrentTextElement = null;
12266 CustomItem* pItem = null;
12268 result r = E_SUCCESS;
12270 Rectangle disabledTitle = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS + 10, W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
12272 AppLogDebug("string is %ls",strTmp.GetPointer());
12273 pItem = new (std::nothrow) CustomItem();
12274 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12276 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12277 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12279 pCurrentEnrichedText = new EnrichedText();
12280 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
12282 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
12283 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12285 pCurrentTextElement = new TextElement();
12286 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
12288 r = pCurrentTextElement->Construct(strTmp);
12289 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12291 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
12292 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
12293 pCurrentTextElement->SetFont(currentFont);
12295 pCurrentEnrichedText->Add(*pCurrentTextElement);
12297 r = pItem->AddElement(disabledTitle,elementId, *pCurrentEnrichedText);
12298 AppLogDebug("Add element is %s",GetErrorMessage(r));
12300 pCurrentEnrichedText->RemoveAll(true);
12301 delete pCurrentEnrichedText;
12302 AppLogDebug("Exit");
12311 if (pCurrentEnrichedText != null)
12313 pCurrentEnrichedText->RemoveAll(true);
12314 delete pCurrentEnrichedText;
12317 if (pCurrentTextElement != null)
12319 delete pCurrentTextElement;
12325 CameraForm::AddEnrichTextCustomItem(Tizen::Ui::Controls::CustomItem* pItem, int elementId,int itemWidth,const Tizen::Base::String& strTmp)
12327 Rectangle disabledDescrition = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE + 10,W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
12328 EnrichedText* pCurrentEnrichedText = null;
12329 TextElement* pCurrentTextElement = null;
12331 result r = E_SUCCESS;
12333 AppLogDebug("string is %ls",strTmp.GetPointer());
12335 pCurrentEnrichedText = new EnrichedText();
12336 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
12338 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
12339 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12341 pCurrentTextElement = new TextElement();
12342 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
12344 r = pCurrentTextElement->Construct(strTmp);
12345 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12347 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
12348 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
12349 pCurrentTextElement->SetFont(currentFont);
12350 pCurrentEnrichedText->Add(*pCurrentTextElement);
12352 r = pItem->AddElement(disabledDescrition,elementId, *pCurrentEnrichedText);
12353 pCurrentEnrichedText->RemoveAll(true);
12354 delete pCurrentEnrichedText;
12358 if (pCurrentEnrichedText != null)
12360 pCurrentEnrichedText->RemoveAll(true);
12361 delete pCurrentEnrichedText;
12364 if (pCurrentTextElement != null)
12366 delete pCurrentTextElement;
12372 CameraForm::OnUpdateView()
12374 OnTouchLaunchImageview();