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 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
645 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
649 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
651 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
653 __previewResolutionWidth = previewResolutionDim.width;
654 __previewResolutionHeight = previewResolutionDim.height;
656 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
658 __captureResolutionWidth = captureResolutionDim.width;
659 __captureResolutionHeight = captureResolutionDim.height;
661 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
665 RemoveControl(__pOverlayPanel);
666 __pOverlayPanel = null;
669 AppLogDebug("__screenMode [%d]", __screenMode);
671 r = SetScreenMode(__screenMode, true);
672 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
674 if (__dir == ORIENTATION_STATUS_PORTRAIT
675 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
677 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
678 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
682 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
683 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
686 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
688 _pCameraInfoPanel->SetDrawPopupTimer(false);
690 _pCameraInfoPanel->Invalidate(true);
693 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
694 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
696 if (regVal == DISABLE_GUIDELINE)
707 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
708 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
710 MakeSettingPopupTab(false);
714 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
715 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
717 if (isInitCameraStaus)
719 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
720 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
722 if (isRunStartPreviewThread)
724 r = RunStartPreviewThread();
725 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
727 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
731 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
732 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
734 _pCameraPresentationModel->StartPreview(&bufferinfo);
737 _pCameraPresentationModel->SetContinuousAutoFocus();
739 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
741 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
743 SetCameraSettingsDevice();
746 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
748 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
750 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
751 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
754 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
755 isCharging = _pCameraPresentationModel->IsCharging();
757 AppLogDebug("batteryLevel = %d", batteryLevel);
758 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
760 if (isCharging == false)
766 CheckBatteryStatus();
772 CameraForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
774 AppLogDebug("ENTER");
775 __isTimerRunning = false;
777 _pCameraPresentationModel->SetIntervalTimerRun(false);
779 __resolutionChange = false;
781 __isToggleCameraDirection = false;
783 __isOrientationChanged = false;
785 __isProhibitionTouchEvent = false;
787 OnHelpCloseTimerExpired();
791 MakeSettingPopupTab(false);
797 if (_isUsedTimerCaptured == true)
801 _isUsedTimerCaptured = false;
803 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
805 _pCameraInfoPanel->SetDrawPopupTimer(false);
807 _pCameraInfoPanel->Invalidate(true);
811 if (_pCameraInfoPanel->GetDrawExposure() == true)
813 _pCameraInfoPanel->SetDrawExposure(false);
821 RemoveControl(__pOverlayPanel);
822 __pOverlayPanel = null;
825 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
830 CameraForm::Update(void)
832 AppLogDebug("ENTER");
833 Bitmap* pThumbnailBitmap = null;
834 Bitmap* pRotateBitmap = null;
835 Bitmap* pBitmap = null;
836 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
837 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
838 result r = E_SUCCESS;
840 HideUiActionButton();
842 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
844 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
846 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
848 if (pThumbnailBitmap == null)
850 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
852 _pThumbnailPanel->SetShowState(true);
859 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
861 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
862 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
864 r = pRotateBitmap->Scale(dimScaleSize);
865 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
867 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
868 delete pRotateBitmap;
869 pRotateBitmap = null;
877 AppLogDebug("CameraForm::Update :: Not thummail");
879 _pThumbnailPanel->SetShowState(false);
880 _pThumbnailPanel->Draw();
881 _pThumbnailPanel->Show();
883 __pThumbnailButton->SetShowState(true);
884 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
886 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
887 TryCatch(pBitmap != null, , "pBitmap is null");
889 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
894 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
895 TryCatch(pBitmap != null, , "pBitmap is null");
897 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
902 __pThumbnailButton->Draw();
903 __pThumbnailButton->Show();
913 delete pRotateBitmap;
914 pRotateBitmap = null;
919 CameraForm::OnCapuredPerform(void)
921 AppLogDebug("ENTER");
922 result r = E_SUCCESS;
923 Point currentPosition;
924 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
925 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
926 int guideLineEnable = 0;
927 BufferInfo bufferinfo;
928 Bitmap* pThumbnailBitmap = null;
929 Bitmap* pRotateBitmap = null;
931 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
932 // TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
933 if (pThumbnailBitmap == null)
935 AppLogDebug("OnCapuredPerform::pThumbnailBitmap = null");
937 _pThumbnailPanel->SetShowState(true);
942 if (__dir == ORIENTATION_STATUS_PORTRAIT
943 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
945 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
946 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
950 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
951 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
954 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
955 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
957 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
958 TryCatch(r == E_SUCCESS, , "pRotateBitmap::Scale() fail[%s]", GetErrorMessage(r));
960 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
961 _pThumbnailPanel->SetDrawSliderImg();
963 delete pRotateBitmap;
964 pRotateBitmap = null;
967 if (__formStatusFrameDeattivated)
969 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED after CAMERA_ACTION_EVENT_CAPTURED event");
973 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
974 _pAppTimer->Cancel();
976 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
977 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
979 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
980 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
982 _pCameraPresentationModel->StartPreview(&bufferinfo);
984 _pCameraPresentationModel->SetContinuousAutoFocus();
987 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
988 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
990 if (guideLineEnable == DISABLE_GUIDELINE)
992 r = DrawMarker(false);
996 r = DrawMarker(true);
998 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
1004 _isUsedTimerCaptured = false;
1008 AppLogDebug("EXIT");
1014 delete pRotateBitmap;
1015 pRotateBitmap = null;
1022 CameraForm::OnCameraActionPerformed(CameraActionEvent event)
1024 AppLogDebug("ENTER");
1025 result r = E_SUCCESS;
1027 AppLogDebug("OnCameraActionPerformed - event %d", event);
1030 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1032 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1033 DrawFocus(CAMERA_FOCUS_READY);
1037 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1039 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1040 DrawFocus(CAMERA_FOCUS_READY);
1042 TryReturnVoid(_pTouchAutoFocusTimer != null, "_pTouchAutoFocusTimer is null");
1043 _pTouchAutoFocusTimer->Cancel();
1045 r = _pTouchAutoFocusTimer->Start(CAMERA_TIMER_2_SEC);
1046 TryReturnVoid(r == E_SUCCESS, "Faled Start Timer[%s]", GetErrorMessage(r));
1050 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1052 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1053 DrawFocus(CAMERA_FOCUS_FAIL);
1057 case CAMERA_ACTION_EVENT_CAMERA_PREVIEWED:
1059 AppLogDebug("CAMERA_ACTION_EVENT_CAMERA_PREVIEWED.");
1063 case CAMERA_ACTION_EVENT_CAPTURED:
1065 AppLogDebug("CAMERA_ACTION_EVENT_CAPTURED");
1066 int requestType = 0;
1067 BufferInfo bufferinfo;
1068 bool isCharging = false;
1069 BatteryLevel batteryLevel;
1071 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1073 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1075 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1077 AppLogDebug("Camera Captured after TerminateApp");
1078 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1079 pCameraApp->SetFrameEnabled(false);
1081 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1082 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1084 _pCameraPresentationModel->StartPreview(&bufferinfo);
1086 __isProhibitionTouchEvent = true;
1089 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1096 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1097 isCharging = _pCameraPresentationModel->IsCharging();
1099 AppLogDebug("batteryLevel = %d", batteryLevel);
1100 AppLogDebug("isCharging = %d", isCharging);
1102 if (isCharging == false)
1104 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1107 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1113 case CAMERA_ACTION_EVENT_ERROR_OCCURRED:
1115 AppLogDebug("CAMERA_ACTION_EVENT_ERROR_OCCURRED.");
1117 result r = E_SUCCESS;
1118 BufferInfo bufferinfo;
1120 if (__pBatteryState != null)
1122 __pBatteryState->SetShowState(true);
1123 __pBatteryState->Draw();
1124 __pBatteryState->Show();
1127 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1129 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1130 _pCameraPresentationModel->StopCamera();
1132 r = _pCameraPresentationModel->InitializeCamera();
1133 TryReturnVoid(r == E_SUCCESS, "InitializeCamera [%s]", GetErrorMessage(r));
1135 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1136 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1138 _pCameraPresentationModel->StartPreview(&bufferinfo);
1139 _pCameraPresentationModel->SetContinuousAutoFocus();
1144 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1146 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1147 bool isEnabled = false;
1148 bool isInitCameraStaus = false;
1149 bool isCharging = false;
1150 BatteryLevel batteryLevel = BATTERY_FULL;
1153 __formStatusFrameDeattivated = false;
1155 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1156 isEnabled = pCameraApp->IsFrameEnabled();
1158 if (isEnabled == false)
1160 pCameraApp->SetFrameEnabled(true);
1163 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1164 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1166 if (isInitCameraStaus == false)
1168 AppLogDebug("InitCamera is fail");
1172 if (_pCameraPresentationModel->IsCameraPoweredOn())
1174 result r = E_SUCCESS;
1175 BufferInfo bufferinfo;
1176 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED:CameraPoweredOn");
1178 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1180 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1181 _pCameraPresentationModel->StopCamera();
1183 r = _pCameraPresentationModel->InitializeCamera();
1184 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
1186 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1187 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1189 _pCameraPresentationModel->StartPreview(&bufferinfo);
1190 _pCameraPresentationModel->SetContinuousAutoFocus();
1192 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1193 isCharging = _pCameraPresentationModel->IsCharging();
1195 AppLogDebug("batteryLevel = %d", batteryLevel);
1197 if(mem < MIN_MEMORY_NEEDED)
1199 ShowMemoryFullPopup();
1203 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1205 if (isCharging == false)
1207 ShowLowBatteryPopup();
1212 if (CheckCallStatus())
1219 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED");
1221 if (!CheckCallStatus())
1223 GetCameraToForeground();
1226 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1227 isCharging = _pCameraPresentationModel->IsCharging();
1229 AppLogDebug("batteryLevel = %d", batteryLevel);
1230 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1232 if (isCharging == false)
1234 ShowLowBatteryPopup();
1239 CheckBatteryStatus();
1242 HideUiActionButton();
1245 if (_pThumbnailPanel != null)
1247 _pThumbnailPanel->DeleteOldBitmap();
1254 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
1256 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
1257 bool isInitCameraStaus = false;
1259 __formStatusFrameDeattivated = true;
1261 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1262 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1264 if (isInitCameraStaus == false)
1266 AppLogDebug("InitCamera is fail");
1270 MakeSettingPopupTab(false);
1272 HideUiActionButton();
1275 if (_pThumbnailPanel != null)
1277 _pThumbnailPanel->DeleteOldBitmap();
1284 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1286 _pResetPopUp->SetShowState(false);
1289 if (_isUsedTimerCaptured == true)
1293 _isUsedTimerCaptured = false;
1295 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1297 _pCameraInfoPanel->SetDrawPopupTimer(false);
1299 _pCameraInfoPanel->Invalidate(true);
1302 SendCameraToBackground();
1306 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
1308 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
1310 ShowCameraFailPopup();
1314 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
1316 if (CheckCallStatus())
1318 AppLogDebug("Preview Fail And InCall");
1322 if (_pCameraPresentationModel->GetStartPreviewException())
1324 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
1326 ShowCameraFailPopup();
1331 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
1333 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
1334 bool isCharging = false;
1335 BatteryLevel batteryLevel;
1337 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1338 isCharging = _pCameraPresentationModel->IsCharging();
1340 AppLogDebug("batteryLevel = %d", batteryLevel);
1341 AppLogDebug("isCharging = %d", isCharging);
1343 if (isCharging == false)
1345 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1347 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
1349 if ((_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURING
1350 || _pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURED)
1351 && __isTimerRunning == false)
1353 AppLogDebug("CAPTURING or CAPTURED");
1354 ShowLowBatteryPopup();
1360 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1365 CheckBatteryStatus();
1370 CheckBatteryStatus();
1375 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
1377 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
1379 _batteryStatus = GetCurrentBatteryState();
1381 AppLogDebug("_batteryStatus = %d", _batteryStatus);
1383 CheckBatteryStatus();
1387 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
1389 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
1391 int requestType = 0;
1393 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1395 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
1397 AppLogDebug("Camera Captured after TerminateApp()");
1400 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1404 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1408 OnTimerCapturePause();
1417 AppLogDebug("EXIT");
1421 CameraForm::InitSettingMenuPanel(void)
1423 AppLogDebug("ENTER");
1424 result r = E_SUCCESS;
1425 int cameraCount = 0;
1427 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
1428 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
1430 __pSettingPanel->AddTouchEventListener(*this);
1431 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
1433 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
1434 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
1435 _pFlashButton->AddTouchEventListener(*this);
1437 _pFlashButton->SetActionId(IDA_BUTTON_CAMERA_FLASH);
1438 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
1439 _pFlashButton->AddActionEventListener(*this);
1441 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
1442 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
1443 _pSelfShotButton->AddTouchEventListener(*this);
1445 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMERA_SELF);
1446 _pSelfShotButton->AddActionEventListener(*this);
1448 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
1449 TryCatch(_pSettingButton != null, r = E_SYSTEM, "pSettingButton is null");
1450 _pSettingButton->AddTouchEventListener(*this);
1452 _pSettingButton->SetActionId(IDA_BUTTON_CAMERA_SETTING);
1453 _pSettingButton->AddActionEventListener(*this);
1455 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
1456 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
1457 __pSettingLine->AddTouchEventListener(*this);
1459 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
1460 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
1461 _pQuickSettingButton->AddTouchEventListener(*this);
1463 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMERA_QUICK_SETTING);
1464 _pQuickSettingButton->AddActionEventListener(*this);
1466 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
1467 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
1469 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
1470 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
1471 _pWhiteBalanceButton->AddTouchEventListener(*this);
1472 _pWhiteBalanceButton->AddActionEventListener(*this);
1474 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
1475 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
1477 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
1478 _pExposureValueButton->AddTouchEventListener(*this);
1479 _pExposureValueButton->AddActionEventListener(*this);
1481 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
1482 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
1483 _pCloseButton->AddTouchEventListener(*this);
1485 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
1486 _pCloseButton->AddActionEventListener(*this);
1488 r = UpdateUiPanelIcon();
1489 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateSetUiPanelIcon() - fail[%s]", GetErrorMessage(r));
1491 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
1492 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
1493 if (cameraCount > SUPPORTED_CAMERA_NUM)
1495 _pSelfShotButton->SetEnabled(true);
1499 _pSelfShotButton->SetEnabled(false);
1501 AppLogDebug("EXIT");
1505 _pFlashButton = null;
1506 _pSelfShotButton = null;
1507 _pSettingButton = null;
1508 __pSettingLine = null;
1509 _pQuickSettingButton = null;
1510 _pWhiteBalanceButton = null;
1511 _pExposureValueButton = null;
1512 _pCloseButton = null;
1518 CameraForm::OnTouchModeSwitch(void)
1520 AppLogDebug("ENTER");
1521 result r = E_SUCCESS;
1523 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
1525 SceneManager* pSceneManager = SceneManager::GetInstance();
1526 AppAssert(pSceneManager);
1528 AppLogDebug("GoForward to IDSCN_CAMCORDER!!!");
1530 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1531 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
1533 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMCORDER));
1534 TryReturnVoid(r == E_SUCCESS, "SceneManager GoForward[%s]", GetErrorMessage(r));
1538 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
1540 AppLogDebug("EXIT");
1544 CameraForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
1546 AppLogDebug("ENTER");
1547 result r = E_SUCCESS;
1549 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
1550 if (__dir == ORIENTATION_STATUS_PORTRAIT
1551 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1553 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1554 _closeTimerValue = UNIT_VALUE_ZERO;
1556 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1557 _pExposureCloseTimer->Cancel();
1559 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1560 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1564 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1565 _closeTimerValue = UNIT_VALUE_ZERO;
1567 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1568 _pExposureCloseTimer->Cancel();
1570 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1571 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1573 AppLogDebug("EXIT");
1577 CameraForm::OnTouchLaunchImageview(void)
1579 AppLogDebug("ENTER");
1580 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
1581 String fullFileName = L"";
1583 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
1585 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
1587 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
1589 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
1591 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1593 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1595 if (fullFileName == L"")
1597 AppLogDebug("file do not found");
1601 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
1608 AppLogDebug("LaunchImageview");
1609 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1611 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1613 if (fullFileName == L"")
1615 AppLogDebug("file do not found");
1623 AppLogDebug("EXIT");
1627 CameraForm::OnTimerCapturePause(void)
1629 AppLogDebug("ENTER");
1630 if (__isTimerRunning == true)
1632 if (_pPopupTimer != null)
1634 _pPopupTimer->Cancel();
1636 delete _pPopupTimer;
1637 _pPopupTimer = null;
1640 _timeCount = INDEX_UNIT_ZERO;
1642 if (_isUsedTimerCaptured == true)
1644 __isTimerRunning = false;
1646 _pCameraPresentationModel->SetIntervalTimerRun(false);
1648 _isUsedTimerCaptured = false;
1650 if (_pIntervalValueTimer != null)
1652 _pIntervalValueTimer->Cancel();
1654 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
1656 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
1658 _pCameraInfoPanel->Invalidate(true);
1660 _pCameraInfoPanel->SetDrawPopupTimer(false);
1662 _pCameraInfoPanel->Invalidate(true);
1667 AppLogDebug("EXIT");
1671 CameraForm::OnTouchDoHidePopup(void)
1673 AppLogDebug("ENTER");
1674 bool doHidePopup = false;
1676 if (_pListViewCameraTabMainMenu != null)
1678 if (_pListViewCameraTabMainMenu->GetShowState() == true)
1684 if (_pListViewGeneralTabMainMenu != null)
1686 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
1692 if (_pListFlashMainMenu != null)
1694 if (_pListFlashMainMenu->GetShowState() == true)
1700 if (_pListWbMainMenu != null)
1702 if (_pListWbMainMenu->GetShowState() == true)
1708 if (_pListViewCameraTabSubMenu != null)
1710 if (_pListViewCameraTabSubMenu->GetShowState() == true)
1716 if (_pListViewGeneralTabSubMenu != null)
1718 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
1724 if (_pCameraInfoPanel->GetDrawExposure() == true)
1726 doHidePopup = false;
1729 AppLogDebug("EXIT");
1734 CameraForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1736 AppLogDebug("ENTER");
1737 result r = E_SUCCESS;
1738 String controlName = L"";
1740 if (_appControlActionCompleted)
1742 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1746 controlName = source.GetName();
1748 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1750 AppLogDebug("OnTouchPressed return");
1754 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1755 _pAppTimer->Cancel();
1757 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
1758 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
1760 if (_pCameraInfoPanel->GetDrawExposure() == true)
1762 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1763 _pExposureCloseTimer->Cancel();
1765 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1766 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1768 AppLogDebug("EXIT");
1772 CameraForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1774 AppLogDebug("ENTER");
1775 String controlName = source.GetName();
1777 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1779 AppLogDebug("OnTouchLongPressed return");
1783 if ((controlName.Equals(String(IDS_ACTION_UI_PANEL_CAPTURE_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1785 AppLogDebug("OnTouchLongPressed Action");
1786 if (source.Equals(*__pShutterButton) == true)
1788 _pCameraPresentationModel->SetContinuousAutoFocus();
1791 AppLogDebug("EXIT");
1795 CameraForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1797 AppLogDebug("ENTER");
1798 String controlName = L"";
1799 int checkActivePanel = -1;
1800 bool doHidePopup = false;
1802 if (_appControlActionCompleted)
1804 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1807 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
1808 controlName = source.GetName();
1810 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1812 AppLogDebug("OnTouchReleased return");
1816 if (_pCameraInfoPanel->GetDrawExposure() == true)
1818 if (source.Equals(*__pShutterButton) == true)
1820 _closeTimerValue = 0;
1822 if (_pExposureCloseTimer)
1824 _pExposureCloseTimer->Cancel();
1827 _pCameraInfoPanel->SetDrawExposure(false);
1833 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1835 OnTouchDrawExposure(currentPosition);
1840 doHidePopup = OnTouchDoHidePopup();
1841 AppLogDebug("doHidePopup = %d", doHidePopup);
1843 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
1845 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1847 DrawTouchAutoFocus(currentPosition);
1852 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
1853 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
1855 if (_pCameraInfoGeneralSubPanel != null)
1857 if (_pCameraInfoGeneralSubPanel->GetShowState())
1859 checkActivePanel = 0;
1862 if (_pCameraInfoSubPanel != null)
1864 if (_pCameraInfoSubPanel->GetShowState())
1866 checkActivePanel = 1;
1870 if (checkActivePanel != -1)
1872 if (checkActivePanel == 0)
1874 _pCameraInfoGeneralSubPanel->SetShowState(false);
1878 _pCameraInfoSubPanel->SetShowState(false);
1888 if (source.Equals(*__pCameraSettingLable) == true)
1890 CheckCameraSettingLabel();
1893 if (source.Equals(*__pGeneralSettingLable) == true)
1895 CheckGeneralSettingLabel();
1898 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
1899 && _pThumbnailPanel->GetShowState() == true
1900 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1901 && _pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED
1904 if (source.Equals(*_pThumbnailPanel) == true)
1906 AppLogDebug("Touch Thumbnail button");
1907 OnTouchLaunchImageview();
1910 AppLogDebug("EXIT");
1914 CameraForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1916 AppLogDebug("ENTER");
1917 String controlName = L"";
1918 result r = E_SUCCESS;
1920 if (_appControlActionCompleted)
1922 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1926 controlName = source.GetName();
1928 if ((controlName.Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
1930 OnTouchModeSwitch();
1934 if (_pCameraInfoPanel->GetDrawExposure() == true)
1936 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1938 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
1939 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
1940 _closeTimerValue = 0;
1942 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1943 _pExposureCloseTimer->Cancel();
1946 AppLogDebug("EXIT");
1950 CameraForm::OnAppTimerExpired(void)
1952 AppLogDebug("ENTER");
1953 result r = E_SUCCESS;
1954 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1958 _pCameraPresentationModel->StopCamera();
1960 r = SendAppControlResult(pCameraApp->GetRequestId());
1961 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
1962 AppLogDebug("EXIT");
1966 CameraForm::OnPreviewFailPopupTimerExpired(void)
1968 AppLogDebug("ENTER");
1969 if (CheckCallStatus())
1971 AppLogDebug("Preview Fail And InCall");
1975 ShowCameraFailPopup();
1976 AppLogDebug("EXIT");
1980 CameraForm::OnCaptureStartTimerExpired(void)
1982 AppLogDebug("ENTER");
1983 result r = E_SUCCESS;
1984 int timerInterval = 0;
1986 if (_pCaptureStartTimer)
1988 _pCaptureStartTimer->Cancel();
1991 timerInterval = GetTimerIntervalValue();
1995 _isUsedTimerCaptured = true;
1997 r = SetTimerIntervalValue(timerInterval);
1998 TryReturnVoid(r == E_SUCCESS, "SetTimerIntervalValue() fail[%s]", GetErrorMessage(r));
2002 r = DrawTimerPopup();
2003 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
2004 AppLogDebug("EXIT");
2008 CameraForm::OnTouchAutoFocusTimerExpired(void)
2010 AppLogDebug("ENTER");
2011 _pCameraPresentationModel->SetContinuousAutoFocus();
2013 _pTouchAutoFocusTimer->Cancel();
2014 AppLogDebug("EXIT");
2018 CameraForm::OnPopupTimerExpired(void)
2020 AppLogDebug("ENTER");
2021 if (_pCameraPresentationModel->IsPreviewState() == true)
2025 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
2027 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
2029 _pCameraInfoPanel->Invalidate(true);
2031 AppLogDebug("_timeCount=%d", _timeCount);
2033 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
2038 AppLogDebug("EXIT");
2042 CameraForm::OnIntervalValueTimerExpired(void)
2044 AppLogDebug("ENTER");
2045 result r = E_SUCCESS;
2046 bool focusSupport = false;
2047 int selfPortraitEnable = 0;
2049 if (_isUsedTimerCaptured == true)
2051 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
2053 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
2055 _pCameraInfoPanel->Invalidate(true);
2057 _pCameraInfoPanel->SetDrawPopupTimer(false);
2059 _pCameraInfoPanel->Invalidate(true);
2063 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2064 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
2066 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2068 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
2072 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
2075 if (focusSupport == true && r == E_SUCCESS)
2077 _pCameraInfoPanel->SetDrawMarkerFocus(true);
2079 DrawFocus(CAMERA_FOCUS_NOT_READY);
2083 _pCameraInfoPanel->SetDrawMarkerFocus(false);
2085 _pCameraInfoPanel->Invalidate(true);
2089 _pCameraPresentationModel->Capture();
2091 __isTimerRunning = false;
2093 _pCameraPresentationModel->SetIntervalTimerRun(false);
2095 if (__pBatteryState)
2097 __pBatteryState->SetShowState(true);
2098 __pBatteryState->Draw();
2099 __pBatteryState->Show();
2105 AppLogDebug("EXIT");
2109 CameraForm::OnExposureCloseTimerExpired(void)
2111 AppLogDebug("ENTER");
2114 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
2116 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
2118 if (_pCameraInfoPanel->GetDrawExposure() == true)
2120 _pCameraInfoPanel->SetDrawExposure(false);
2126 _closeTimerValue = 0;
2128 _pExposureCloseTimer->Cancel();
2130 AppLogDebug("EXIT");
2134 CameraForm::OnChargingCompletedTimerExpired(void)
2136 AppLogDebug("ENTER");
2137 Bitmap* pBitmap = null;
2138 result r = E_SUCCESS;
2140 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2142 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2144 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2148 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2153 if (_chargingCount % DIVIDE_BY_TWO)
2155 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
2159 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
2161 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2163 if (_chargingCount >= BATTERY_STATE_20)
2165 _chargingCount = INDEX_UNIT_ZERO;
2169 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2170 __pBatteryState->Invalidate(true);
2172 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2173 AppLogDebug("_chargingCount = %d", _chargingCount);
2174 AppLogDebug("_blinkCount = %d", _blinkCount);
2179 AppLogDebug("EXIT");
2183 AppLogDebug("EXIT - CATCH");
2188 CameraForm::OnChargingTimerExpired(void)
2190 AppLogDebug("ENTER");
2191 Bitmap* pBitmap = null;
2192 result r = E_SUCCESS;
2193 int maxChargingCnt = 0;
2194 int batteryLevel = 0;
2195 Battery::GetCurrentLevelInPercentage(batteryLevel);
2197 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2199 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2201 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2205 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2208 AppLogDebug("batteryLevel = %d", batteryLevel);
2212 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2213 AppLogDebug("_chargingCount = %d", _chargingCount);
2215 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
2217 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
2221 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
2223 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2225 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
2227 AppLogDebug("maxCount = %d", maxChargingCnt);
2229 if (maxChargingCnt >= BATTERY_STATE_20)
2231 _chargingCount = INDEX_UNIT_ZERO;
2234 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2235 __pBatteryState->Invalidate(true);
2240 AppLogDebug("EXIT");
2244 AppLogDebug("EXIT - CATCH");
2249 CameraForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
2251 AppLogDebug("ENTER");
2252 if (timer.Equals(*_pAppTimer))
2254 AppLogDebug("_pAppTimer");
2255 OnAppTimerExpired();
2257 else if (timer.Equals(*_pCaptureStartTimer))
2259 AppLogDebug("_pCaptureStartTimer");
2260 OnCaptureStartTimerExpired();
2262 else if (timer.Equals(*_pTouchAutoFocusTimer))
2264 AppLogDebug("_pTouchAutoFocusTimer");
2265 OnTouchAutoFocusTimerExpired();
2267 else if (timer.Equals(*_pPopupTimer))
2269 AppLogDebug("_pPopupTimer");
2270 OnPopupTimerExpired();
2272 else if (timer.Equals(*_pIntervalValueTimer))
2274 AppLogDebug("_pIntervalValueTimer");
2275 OnIntervalValueTimerExpired();
2276 StartInitChargingTimer();
2278 else if (timer.Equals(*_pHelpCloseTimer))
2280 AppLogDebug("__pHelpCloseTimer");
2281 OnHelpCloseTimerExpired();
2283 else if (timer.Equals(*_pExposureCloseTimer))
2285 AppLogDebug("_pExposureCloseTimer");
2286 OnExposureCloseTimerExpired();
2288 else if (timer.Equals(*_pChargingTimer))
2290 result r = E_SUCCESS;
2291 AppLogDebug("_pChargingTimer");
2292 bool isCharging = false;
2294 _batteryStatus = GetCurrentBatteryState();
2295 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2297 isCharging = _pCameraPresentationModel->IsCharging();
2301 if (_batteryStatus == BATTERY_STATE_20)
2303 _chargingCount = INDEX_UNIT_ZERO;
2305 _blinkCount = INDEX_UNIT_ZERO;
2307 _pChargingTimer->Cancel();
2309 StartInitChargingCompletedTimer();
2313 r = OnChargingTimerExpired();
2318 _chargingCount = INDEX_UNIT_ZERO;
2320 _blinkCount = INDEX_UNIT_ZERO;
2322 _pChargingTimer->Cancel();
2324 if (_batteryStatus == BATTERY_STATE_20)
2326 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
2328 StartInitChargingCompletedTimer();
2332 else if (timer.Equals(*_pChargingCompletedTimer))
2334 result r = E_SUCCESS;
2335 AppLogDebug("__pChargingCompletedTimer");
2336 bool isCharging = false;
2338 isCharging = _pCameraPresentationModel->IsCharging();
2340 _batteryStatus = GetCurrentBatteryState();
2341 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2343 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
2345 if (_blinkCount == INDEX_UNIT_TWENTY)
2347 AppLogDebug("__pChargingCompletedTimer cancel");
2349 _chargingCount = INDEX_UNIT_ZERO;
2351 _blinkCount = INDEX_UNIT_ZERO;
2353 _pChargingCompletedTimer->Cancel();
2355 CheckBatteryStatus();
2359 AppLogDebug("OnChargingCompletedTimerExpired");
2361 r = OnChargingCompletedTimerExpired();
2366 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
2368 _chargingCount = INDEX_UNIT_ZERO;
2370 _blinkCount = INDEX_UNIT_ZERO;
2372 _pChargingCompletedTimer->Cancel();
2374 CheckBatteryStatus();
2377 else if (timer.Equals(*_pPreviewFailPopupTimer))
2379 AppLogDebug("__pPreviewFailPopupTimer");
2380 _pPreviewFailPopupTimer->Cancel();
2382 if (_pCameraPresentationModel->GetStartPreviewException())
2384 OnPreviewFailPopupTimerExpired();
2389 AppLogDebug("Not expire");
2391 AppLogDebug("EXIT");
2395 CameraForm::InitActionMenuPanel(void)
2397 AppLogDebug("ENTER");
2398 result r = E_SUCCESS;
2399 Rectangle rectThumbnailButton;
2400 Rectangle clientArea = GetClientAreaBounds();
2402 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
2403 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
2405 __pActionPanel->AddTouchEventListener(*this);
2406 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
2408 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2410 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2411 || __dir == ORIENTATION_STATUS_PORTRAIT)
2413 if (clientArea.height == DISPLAY_WVGA)
2415 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2419 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2424 if (clientArea.width == DISPLAY_WVGA)
2426 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2430 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2434 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
2435 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2436 __pBatteryState->AddTouchEventListener(*this);
2437 __pBatteryState->SetShowState(true);
2439 __pCameraSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
2440 TryCatch(__pCameraSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
2441 __pCameraSetting->SetActionId(IDA_BUTTON_SETTING_CAMERA);
2442 __pCameraSetting->AddActionEventListener(*this);
2443 __pCameraSetting->SetShowState(false);
2445 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
2446 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
2447 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
2448 __pGeneralSetting->AddActionEventListener(*this);
2449 __pGeneralSetting->SetShowState(false);
2451 __pCameraSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
2452 TryCatch(__pCameraSettingLable != null, r = E_SYSTEM, "__pCameraSettingLable is null");
2453 __pCameraSettingLable->AddTouchEventListener(*this);
2454 __pCameraSettingLable->SetShowState(false);
2456 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
2457 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
2458 __pGeneralSettingLable->AddTouchEventListener(*this);
2459 __pGeneralSettingLable->SetShowState(false);
2461 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
2462 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
2463 __pCameraIconLabel->AddTouchEventListener(*this);
2465 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
2466 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
2468 __pSwButton->SetName(IDS_ACTION_UI_CAMERA_MODE);
2469 __pSwButton->AddTouchEventListener(*this);
2470 __pSwButton->AddKeyEventListener(*this);
2472 __pSwButton->GetAccessibilityContainer()->AddAccessibilityListener(*this);
2474 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
2475 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
2476 __pCamcoderIconLabel->AddTouchEventListener(*this);
2478 __pShutterButton = static_cast<Button*>(GetControl(L"IDC_SHUTTER_BUTTON"));
2479 TryCatch(__pShutterButton != null, r = E_SYSTEM, "__pShutterButton is null");
2481 __pShutterButton->SetActionId(IDA_BUTTON_CAMERA_SHUTTER);
2482 __pShutterButton->SetName(IDS_ACTION_UI_PANEL_CAPTURE_NAME);
2483 __pShutterButton->AddActionEventListener(*this);
2484 __pShutterButton->AddTouchEventListener(*this);
2486 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2488 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2489 || __dir == ORIENTATION_STATUS_PORTRAIT)
2491 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
2492 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
2496 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
2497 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
2500 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
2501 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
2502 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
2504 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
2505 _pThumbnailPanel->AddTouchEventListener(*this);
2506 AddControl(_pThumbnailPanel);
2507 AddOrientationEventListener(*_pThumbnailPanel);
2509 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
2510 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
2511 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMERA_THUMBNAIL);
2512 __pThumbnailButton->AddActionEventListener(*this);
2513 __pThumbnailButton->AddTouchEventListener(*this);
2514 __pThumbnailButton->SetShowState(false);
2516 r = UpdateUiActionPanelIcon();
2517 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() is fail[%s]", GetErrorMessage(r));
2519 AppLogDebug("EXIT");
2523 __pCameraIconLabel = null;
2524 __pCamcoderIconLabel = null;
2525 __pBatteryState = null;
2527 __pShutterButton = null;
2528 __pThumbnailButton = null;
2529 __pCameraSetting = null;
2530 __pGeneralSetting = null;
2531 __pCameraSettingLable = null;
2532 __pGeneralSettingLable = null;
2534 delete _pThumbnailPanel;
2535 _pThumbnailPanel = null;
2541 CameraForm::UpdateUiPanelIcon(void)
2543 AppLogDebug("ENTER");
2544 result r = E_SUCCESS;
2545 Bitmap* pBitmap = null;
2546 Bitmap* pBitmapRotate = null;
2547 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
2550 ImageRotationType rotationType = IMAGE_ROTATION_0;
2552 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2554 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2555 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2557 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2559 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2560 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2562 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2563 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2565 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2566 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2568 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2573 delete pBitmapRotate;
2574 pBitmapRotate = null;
2576 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2577 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2579 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2580 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2582 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2587 delete pBitmapRotate;
2588 pBitmapRotate = null;
2590 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2592 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2594 if (value == true && r == E_SUCCESS)
2596 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2597 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2601 case FLASH_MODE_OFF:
2603 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2604 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2606 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2607 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2609 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2614 delete pBitmapRotate;
2615 pBitmapRotate = null;
2617 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2618 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2620 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2621 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2623 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2628 delete pBitmapRotate;
2629 pBitmapRotate = null;
2635 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2636 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2638 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2639 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2641 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2646 delete pBitmapRotate;
2647 pBitmapRotate = null;
2649 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2650 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2652 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2653 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2655 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2660 delete pBitmapRotate;
2661 pBitmapRotate = null;
2665 case FLASH_MODE_AUTO:
2667 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2668 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2670 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2671 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2673 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2678 delete pBitmapRotate;
2679 pBitmapRotate = null;
2681 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2682 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2684 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2685 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2687 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2692 delete pBitmapRotate;
2693 pBitmapRotate = null;
2703 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2704 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2706 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2707 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2709 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2710 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2712 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2717 delete pBitmapRotate;
2718 pBitmapRotate = null;
2720 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2722 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2724 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2725 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2727 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2732 delete pBitmapRotate;
2733 pBitmapRotate = null;
2737 _pFlashButton->Invalidate(true);
2738 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2740 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2742 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2744 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2746 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2748 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2750 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2751 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2753 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2758 delete pBitmapRotate;
2759 pBitmapRotate = null;
2761 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2765 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2767 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2769 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2771 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2772 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2774 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2779 delete pBitmapRotate;
2780 pBitmapRotate = null;
2782 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2784 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2788 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2790 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2792 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2793 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2795 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2800 delete pBitmapRotate;
2801 pBitmapRotate = null;
2803 if (__dir == ORIENTATION_STATUS_LANDSCAPE
2804 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
2806 rotationType = IMAGE_ROTATION_270;
2809 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2811 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2812 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2814 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2815 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2817 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2822 delete pBitmapRotate;
2823 pBitmapRotate = null;
2825 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2826 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2828 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2829 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2831 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2836 delete pBitmapRotate;
2837 pBitmapRotate = null;
2839 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2841 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2842 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2844 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2845 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2847 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2852 delete pBitmapRotate;
2853 pBitmapRotate = null;
2855 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2857 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2858 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2860 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2865 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2866 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2868 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2873 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2875 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2877 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2881 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2886 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2887 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2889 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2894 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2895 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2897 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2904 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2905 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2907 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2912 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2913 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2915 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2921 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2923 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2924 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2926 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2928 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2929 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2931 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2936 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2938 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2939 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2941 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2942 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2944 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2945 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2950 delete pBitmapRotate;
2951 pBitmapRotate = null;
2953 AppLogDebug("EXIT");
2957 if (pBitmap != null)
2967 CameraForm::UpdateUiActionPanelIcon(void)
2969 AppLogDebug("ENTER");
2970 result r = E_SUCCESS;
2971 Bitmap* pBitmap = null;
2972 Bitmap* pBitmapRotate = null;
2973 ImageRotationType rotationType = IMAGE_ROTATION_0;
2974 Point ptShutterIcon;
2975 Point ptModeChangeButton;
2976 Rectangle rectThumbnailButton;
2978 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2980 if (__dir == ORIENTATION_STATUS_PORTRAIT
2981 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2983 rotationType = IMAGE_ROTATION_90;
2984 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD, Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD);
2985 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
2987 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
2988 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
2990 rotationType = IMAGE_ROTATION_0;
2991 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD, Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD);
2992 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
2995 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
2996 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraIconLabel::pBitmap is null");
2998 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
3003 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
3004 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3006 pBitmapRotate = RotationImageN(pBitmap, rotationType);
3007 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
3009 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3010 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3014 delete pBitmapRotate;
3015 pBitmapRotate = null;
3017 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
3018 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3020 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
3024 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
3025 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderIconLabel::pBitmap is null");
3027 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
3032 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3033 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3035 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3036 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3041 delete pBitmapRotate;
3042 pBitmapRotate = null;
3044 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
3045 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3047 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3048 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3053 delete pBitmapRotate;
3054 pBitmapRotate = null;
3056 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3057 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3059 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3060 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3065 delete pBitmapRotate;
3066 pBitmapRotate = null;
3068 if (__dir == ORIENTATION_STATUS_PORTRAIT
3069 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3071 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL);
3072 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3076 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL_LAND);
3077 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3080 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3081 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3083 __pShutterButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3088 delete pBitmapRotate;
3089 pBitmapRotate = null;
3091 if (__dir == ORIENTATION_STATUS_PORTRAIT
3092 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3094 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS);
3095 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3099 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS_LAND);
3100 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3103 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3104 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3106 __pShutterButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3110 delete pBitmapRotate;
3111 pBitmapRotate = null;
3113 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_ICON);
3114 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3116 __pShutterButton->SetNormalBitmap(ptShutterIcon, *pBitmap);
3121 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3122 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3124 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
3129 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
3130 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3132 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
3137 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMERA);
3138 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraSetting::pBitmap is null");
3140 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3141 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CameraSetting::pBitmapRotate is null");
3143 __pCameraSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3144 __pCameraSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3149 delete pBitmapRotate;
3150 pBitmapRotate = null;
3152 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
3153 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
3155 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3156 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
3158 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3159 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3164 delete pBitmapRotate;
3165 pBitmapRotate = null;
3167 AppLogDebug("EXIT");
3171 if (pBitmap != null)
3181 CameraForm::SetTimerIntervalValue(int timerIntervalValue)
3183 AppLogDebug("ENTER");
3184 result r = E_SUCCESS;
3186 AppLogDebug("timerIntervalValue = %d", timerIntervalValue);
3188 switch (timerIntervalValue)
3190 case SETTING_TIMER_CAPTURE_0_SEC:
3195 case SETTING_TIMER_CAPTURE_2_SEC:
3197 _pIntervalValueTimer->Cancel();
3199 r = _pIntervalValueTimer->Start(CAMERA_TIMER_2_SEC);
3200 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3204 case SETTING_TIMER_CAPTURE_5_SEC:
3206 _pIntervalValueTimer->Cancel();
3208 r = _pIntervalValueTimer->Start(CAMERA_TIMER_5_SEC);
3209 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3213 case SETTING_TIMER_CAPTURE_10_SEC:
3215 _pIntervalValueTimer->Cancel();
3217 r = _pIntervalValueTimer->Start(CAMERA_TIMER_10_SEC);
3218 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3224 AppLogDebug("timer Invaild element id");
3229 AppLogDebug("EXIT");
3237 CameraForm::SetExifOrientation(int deviceOrientation)
3239 AppLogDebug("ENTER");
3240 result r = E_SUCCESS;
3242 r = _pCameraPresentationModel->SetExifOrientation(deviceOrientation);
3243 AppLogDebug("SetExifOrientation : deviceOrientation = %d, fail[%s]", deviceOrientation, GetErrorMessage(r));
3244 AppLogDebug("EXIT");
3248 CameraForm::StartCaptured(void)
3250 AppLogDebug("ENTER");
3251 result r = E_SUCCESS;
3252 int timerInterval = 0;
3254 timerInterval = GetTimerIntervalValue();
3256 switch (timerInterval)
3258 case SETTING_TIMER_CAPTURE_0_SEC:
3260 _isUsedTimerCaptured = false;
3262 __isTimerRunning = false;
3264 _pCameraPresentationModel->SetIntervalTimerRun(false);
3266 _pIntervalValueTimer->Cancel();
3268 _pCameraPresentationModel->Capture();
3270 StartInitChargingTimer();
3274 case SETTING_TIMER_CAPTURE_2_SEC:
3276 case SETTING_TIMER_CAPTURE_5_SEC:
3278 case SETTING_TIMER_CAPTURE_10_SEC:
3280 __isTimerRunning = true;
3282 if (__pBatteryState)
3284 __pBatteryState->SetShowState(false);
3285 __pBatteryState->Draw();
3286 __pBatteryState->Show();
3289 _pCameraPresentationModel->SetIntervalTimerRun(true);
3293 if (_pCameraInfoPanel != null)
3295 _pCameraInfoPanel->SetDrawIndicator(false);
3296 _pCameraInfoPanel->Invalidate(true);
3299 if (_isUsedTimerCaptured == false)
3301 _pCaptureStartTimer->Cancel();
3303 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3305 _pCameraInfoPanel->Invalidate(true);
3307 r = _pCaptureStartTimer->Start(CAMERA_TIMER_1_SEC);
3308 TryReturnVoid(r == E_SUCCESS, "_pCaptureStartTimer start fail[%s]", GetErrorMessage(r));
3316 AppLogDebug("EXIT");
3320 CameraForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
3322 AppLogDebug("ENTER");
3323 result r = E_SUCCESS;
3324 int selfPortraitEnable = 0;
3325 int guideLineEnable = 0;
3328 case IDA_BUTTON_CAMERA_FLASH:
3330 int selfPortraitEnable = 0;
3331 result r = E_SUCCESS;
3333 bool isCharging = false;
3334 BatteryLevel batteryLevel;
3336 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
3337 isCharging = _pCameraPresentationModel->IsCharging();
3339 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3340 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3342 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3344 AppLogDebug("FLASEH OFF!!!");
3348 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3350 if (value == true && r == E_SUCCESS)
3352 if (batteryLevel == BATTERY_LOW && isCharging == false)
3357 AppResource* pAppResource = null;
3359 pAppResource = Application::GetInstance()->GetAppResource();
3360 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
3362 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
3364 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
3365 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
3366 msgBox.ShowAndWait(result);
3375 AppLogDebug("FLASEH OFF!!!");
3381 case IDA_BUTTON_CAMERA_SELF:
3383 int selfPortraitEnable = 0;
3384 result r = E_SUCCESS;
3386 int cameraCount = 0;
3388 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
3390 AppLogDebug("Camera Preview is not");
3394 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
3395 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
3397 if (cameraCount < SUPPORTED_CAMERA_NUM)
3399 AppLogDebug("The physical direction of the camera is not exit");
3403 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3404 TryReturnVoid(r == E_SUCCESS, "Faled to get value to registry[%s]", GetErrorMessage(r));
3405 MakeSettingPopupTab(false);
3409 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3411 AppLogDebug("PRIMARY -> SECONDARY");
3413 __isToggleCameraDirection = true;
3415 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3416 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3418 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3419 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3421 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
3422 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3425 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3427 AppLogDebug("SECONDARY -> PRIMARY");
3428 int primaryFlashValue = FLASH_MODE_OFF;
3429 __isToggleCameraDirection = true;
3431 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3432 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3434 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3435 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3437 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3438 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3440 if (value == true && r == E_SUCCESS)
3442 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3443 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3447 UpdateUiPanelIcon();
3448 MakePreviewResolutionList(true);
3449 MakeCaptrueResolutionList(true);
3452 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3453 _pFlashButton->Invalidate(true);
3455 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
3456 _pSelfShotButton->Invalidate(true);
3458 __isToggleCameraDirection = false;
3462 case IDA_BUTTON_CAMERA_SETTING:
3464 result r = E_SUCCESS;
3466 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3467 _pAppTimer->Cancel();
3469 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3470 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3472 UpdateUiPanelIcon();
3478 case IDA_BUTTON_CLOSE_SETTING:
3480 result r = E_SUCCESS;
3482 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3483 _pAppTimer->Cancel();
3485 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3486 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3492 case IDA_BUTTON_CAMERA_QUICK_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 MakeCameraTabSettingPopup();
3506 case IDA_BUTTON_SETTING_CAMERA:
3508 result r = E_SUCCESS;
3510 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3511 _pAppTimer->Cancel();
3513 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3514 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3516 if (_pListViewGeneralTabMainMenu)
3518 _pListViewGeneralTabMainMenu->SetShowState(false);
3521 if (_pListViewGeneralTabSubMenu)
3523 _pListViewGeneralTabSubMenu->SetShowState(false);
3526 MakeCameraTabSettingPopup();
3530 case IDA_BUTTON_SETTING_GENERAL:
3532 result r = E_SUCCESS;
3534 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3535 _pAppTimer->Cancel();
3537 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3538 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3540 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
3542 if (_pListViewCameraTabMainMenu)
3544 _pListViewCameraTabMainMenu->SetShowState(false);
3547 if (_pListViewCameraTabSubMenu)
3549 _pListViewCameraTabSubMenu->SetShowState(false);
3552 MakeGeneralTabSettingPopup();
3556 case IDA_BUTTON_CAMERA_EV:
3558 result r = E_SUCCESS;
3559 bool exposureValue = false;
3560 bool brighnesstValue = false;
3561 int selfPortraitEnable = 0;
3562 int adjustValue = 0;
3564 if (_pCameraInfoPanel->GetDrawExposure() == true)
3566 AppLogDebug("Draw is Exposure status");
3570 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3571 _pAppTimer->Cancel();
3573 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3574 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3576 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3577 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3579 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3580 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3582 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3584 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
3588 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
3591 if (exposureValue == true && r == E_SUCCESS)
3593 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3595 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
3596 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3598 AppLogDebug("adjustValue = %d", adjustValue);
3600 _pCameraPresentationModel->SetExposure(adjustValue);
3602 MakeSettingPopupTab(false);
3606 r = CreateExposureSlider();
3607 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3609 r = DrawExposureSlider();
3610 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3614 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3616 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3620 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3623 if (brighnesstValue == true && r == E_SUCCESS)
3625 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3627 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
3628 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3630 AppLogDebug("adjustValue = %d", adjustValue);
3632 _pCameraPresentationModel->SetBrightness(adjustValue);
3634 MakeSettingPopupTab(false);
3638 r = CreateExposureSlider();
3639 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3641 r = DrawExposureSlider();
3642 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3646 AppLogDebug("Exposure do not support");
3652 case IDA_BUTTON_CAMERA_WB:
3654 result r = E_SUCCESS;
3655 int selfPortraitEnable = 0;
3657 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3658 _pAppTimer->Cancel();
3660 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3661 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3663 if (_pCameraInfoPanel->GetDrawExposure() == true)
3665 _closeTimerValue = 0;
3667 if (_pExposureCloseTimer)
3669 _pExposureCloseTimer->Cancel();
3672 _pCameraInfoPanel->SetDrawExposure(false);
3676 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3677 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3679 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3681 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
3685 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
3690 SetWhiteBalancePopop();
3694 AppLogDebug("WB is not support");
3699 case IDA_BUTTON_CAMERA_BACK:
3701 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
3702 result r = E_SUCCESS;
3704 r = BackButtonPerformed();
3705 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
3712 AppLogDebug("ResetPopup : MSGBOX_RESULT_YES");
3714 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3716 _pResetPopUp->SetShowState(false);
3719 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
3720 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3722 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
3724 r = DrawMarker(false);
3725 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
3727 SetGuideLine(SUBMENU_MODE_OFF);
3730 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3731 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3733 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3735 RestoreDefaultSetting();
3737 r = RestorePrimaryResolution();
3738 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3742 BufferInfo bufferinfo;
3744 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
3746 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3747 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
3749 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3750 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3752 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
3753 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
3755 _pCameraPresentationModel->StartPreview(&bufferinfo);
3757 _pCameraPresentationModel->SetContinuousAutoFocus();
3759 MakePreviewResolutionList(true);
3761 MakeCaptrueResolutionList(true);
3765 RestoreSecondaryResolution();
3766 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3768 RestoreDefaultSetting();
3771 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3772 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
3774 MakeSettingPopupTab(false);
3778 r = UpdateUiPanelIcon();
3779 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
3781 r = SetScreenOverlayHelpTimer();
3782 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
3784 r = DrawScreenOverlayHelp();
3785 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
3787 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3788 _pFlashButton->Invalidate(true);
3795 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3797 _pResetPopUp->SetShowState(false);
3799 MakeSettingPopupTab(false);
3800 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
3805 case IDA_BUTTON_CAMERA_SHUTTER:
3807 MakeSettingPopupTab(false);
3808 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
3817 AppLogDebug("EXIT");
3821 CameraForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
3823 AppLogDebug("ENTER");
3824 if (_appControlActionCompleted)
3826 AppLogDebug("EXIT - App Terminate");
3829 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
3830 AppLogDebug("EXIT");
3834 CameraForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
3836 AppLogDebug("ENTER");
3837 bool isExistThumbnail = false;
3838 Bitmap* pBitmap = null;
3839 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
3841 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3843 if (isExistThumbnail == false)
3845 AppLogDebug("Thumbnail is not found");
3847 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
3849 _pThumbnailPanel->SetShowState(false);
3850 _pThumbnailPanel->Draw();
3851 _pThumbnailPanel->Show();
3853 __pThumbnailButton->SetShowState(true);
3855 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3856 TryReturnVoid(pBitmap != null, "pBitmap is null");
3858 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
3863 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3864 TryReturnVoid(pBitmap != null, "pBitmap is null");
3866 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
3871 __pThumbnailButton->Draw();
3872 __pThumbnailButton->Show();
3879 AppLogDebug("pThumbnailBitmap is not null");
3881 AppLogDebug("EXIT");
3885 CameraForm::Initialize(void)
3887 AppLogDebug("ENTER");
3888 result r = E_SUCCESS;
3890 Construct(L"IDL_CAMERA_FORM");
3892 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
3893 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
3895 AppLogDebug("EXIT");
3903 CameraForm::InitAppTimer(void)
3905 AppLogDebug("ENTER");
3906 _pAppTimer = new (std::nothrow) Timer();
3907 _pAppTimer->Construct(*this);
3908 AppLogDebug("EXIT");
3912 CameraForm::InitChargingTimer(void)
3914 AppLogDebug("ENTER");
3915 _pChargingTimer = new (std::nothrow) Timer();
3916 _pChargingTimer->Construct(*this);
3917 AppLogDebug("EXIT");
3921 CameraForm::InitChargingCompletedTimer(void)
3923 AppLogDebug("ENTER");
3924 _pChargingCompletedTimer = new (std::nothrow) Timer();
3925 _pChargingCompletedTimer->Construct(*this);
3926 AppLogDebug("EXIT");
3930 CameraForm::InitPreviewFailPopupTimer(void)
3932 AppLogDebug("ENTER");
3933 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
3934 _pPreviewFailPopupTimer->Construct(*this);
3935 AppLogDebug("EXIT");
3939 CameraForm::InitIntervalValueTimer(void)
3941 AppLogDebug("ENTER");
3942 _pIntervalValueTimer = new (std::nothrow) Timer();
3943 _pIntervalValueTimer->Construct(*this);
3944 AppLogDebug("EXIT");
3948 CameraForm::InitCaptureStartTimer(void)
3950 AppLogDebug("ENTER");
3951 _pCaptureStartTimer = new (std::nothrow) Timer();
3952 _pCaptureStartTimer->Construct(*this);
3953 AppLogDebug("EXIT");
3957 CameraForm::InitTouchAutoFocusStartTimer(void)
3959 AppLogDebug("ENTER");
3960 _pTouchAutoFocusTimer = new (std::nothrow) Timer();
3961 _pTouchAutoFocusTimer->Construct(*this);
3962 AppLogDebug("EXIT");
3966 CameraForm::StartInitAppTimer(void)
3968 AppLogDebug("ENTER");
3969 result r = E_SUCCESS;
3971 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3973 _pAppTimer->Cancel();
3975 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3976 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
3977 AppLogDebug("EXIT");
3981 CameraForm::StartPreviewFailPopupTimer(void)
3983 AppLogDebug("ENTER");
3984 result r = E_SUCCESS;
3986 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
3988 _pPreviewFailPopupTimer->Cancel();
3990 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
3991 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
3992 AppLogDebug("EXIT");
3996 CameraForm::StartInitChargingCompletedTimer(void)
3998 AppLogDebug("ENTER");
3999 result r = E_SUCCESS;
4000 bool isCharging = false;
4002 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4004 isCharging = _pCameraPresentationModel->IsCharging();
4006 _batteryStatus = GetCurrentBatteryState();
4007 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4009 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4011 if (_pChargingCompletedTimer)
4013 _pChargingCompletedTimer->Cancel();
4020 r = DrawBatteryLevelFull();
4021 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4023 AppLogDebug("EXIT");
4026 _chargingCount = INDEX_UNIT_ZERO;
4028 if (_batteryStatus == BATTERY_STATE_20)
4030 if (_pChargingCompletedTimer)
4032 _pChargingCompletedTimer->Cancel();
4034 r = _pChargingCompletedTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4035 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4040 if (_pChargingCompletedTimer)
4042 _pChargingCompletedTimer->Cancel();
4048 CheckBatteryStatus();
4050 AppLogDebug("EXIT");
4054 CameraForm::StartInitChargingTimer(void)
4056 AppLogDebug("ENTER");
4057 result r = E_SUCCESS;
4058 bool isCharging = false;
4060 TryReturnVoid(_pChargingTimer != null, "_pChargingTimer is null");
4062 isCharging = _pCameraPresentationModel->IsCharging();
4064 _chargingCount = INDEX_UNIT_ZERO;
4068 if (_pChargingTimer)
4070 _pChargingTimer->Cancel();
4072 r = _pChargingTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4073 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4078 if (_pChargingTimer)
4080 _pChargingTimer->Cancel();
4083 AppLogDebug("EXIT");
4087 CameraForm::ToggleCameraDirection(int direction)
4089 AppLogDebug("ENTER");
4090 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4091 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4092 result r = E_SUCCESS;
4094 Point currentPosition;
4095 BufferInfo bufferinfo;
4096 bool isInitCameraStaus = false;
4098 if (_pAppTimer != null)
4100 _pAppTimer->Cancel();
4102 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4103 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
4106 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4108 AppLogDebug("FRONT");
4109 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
4111 else if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
4113 AppLogDebug("BACK");
4114 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_BACK);
4116 TryCatch(r == E_SUCCESS, , "__pCamcorderPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
4118 dim = _pCameraPresentationModel->GetPreviewResolution();
4119 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
4121 AppLogDebug("__screenMode [%d]", __screenMode);
4123 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4125 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
4129 r = SetScreenMode(__screenMode, true);
4131 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
4133 if (__dir == ORIENTATION_STATUS_PORTRAIT
4134 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4136 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
4137 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
4141 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4142 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4147 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
4148 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
4150 if (isInitCameraStaus)
4152 SetCameraSettingsDevice();
4155 AppLogDebug("EXIT");
4163 CameraForm::MakePreviewResolutionList(bool remakeList = false)
4165 AppLogDebug("ENTER");
4166 Dimension dimResolution;
4167 IList* pTempList = null;
4168 String* pItemString = null;
4170 result r = E_SUCCESS;
4173 Dimension dimension;
4174 Dimension tempDimention(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
4175 int previewResolutionIdx = 0;
4179 if (__pPreviewResolutionList)
4181 __pPreviewResolutionList->RemoveAll(true);
4184 delete __pPreviewResolutionList;
4185 __pPreviewResolutionList = null;
4188 if (__pPreviewResolutionList == null)
4190 __pPreviewResolutionList = new (std::nothrow) ArrayList();
4191 r = __pPreviewResolutionList->Construct();
4192 TryCatch(r == E_SUCCESS, , "__pPreviewResolutionList construct fail[%s]", GetErrorMessage(r));
4194 pTempList = _pCameraPresentationModel->GetPreviewResolutionList();
4195 TryCatch(pTempList != null, , "GetPreviewResolutionList() return null");
4196 tot = pTempList->GetCount();
4199 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4201 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4203 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d", dimResolution.width, dimResolution.height);
4205 pItemString = new (std::nothrow) String(tempString);
4206 TryCatch(pItemString != null, , "pItemString is null");
4208 __pPreviewResolutionList->Add(*pItemString);
4210 AppLogDebug("GetPreviewResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4212 if (dimResolution == tempDimention)
4214 previewResolutionIdx = idx;
4220 AppLogDebug("Not Support CaptureResolution");
4223 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(previewResolutionIdx)));
4226 __previewResolutionWidth = dimResolution.width;
4227 __previewResolutionHeight = dimResolution.height;
4229 AppLogDebug("previewResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4231 AppLogDebug("EXIT");
4235 if (__pPreviewResolutionList)
4237 __pPreviewResolutionList->RemoveAll(true);
4239 delete __pPreviewResolutionList;
4240 __pPreviewResolutionList = null;
4245 CameraForm::MakeCaptrueResolutionList(bool remakeList = false)
4247 AppLogDebug("ENTER");
4248 Dimension dimPreviewResolution;
4249 Dimension dimResolution;
4250 IList* pTempList = null;
4251 String* pItemString = null;
4253 result r = E_SUCCESS;
4256 int resolutionRatio = 0;
4260 if (__pCaptureResolutionList)
4262 __pCaptureResolutionList->RemoveAll(true);
4265 delete __pCaptureResolutionList;
4266 __pCaptureResolutionList = null;
4269 if (__pCaptureResolutionList == null)
4271 __pCaptureResolutionList = new (std::nothrow) ArrayList();
4272 r = __pCaptureResolutionList->Construct();
4273 TryCatch(r == E_SUCCESS, , "__pCaptureResolutionList construct fail[%s]", GetErrorMessage(r));
4275 pTempList = _pCameraPresentationModel->GetCaptureResolutionList();
4276 TryCatch(pTempList != null, , "GetCaptureResolutionList() return null");
4277 tot = pTempList->GetCount();
4280 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4282 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4284 if (dimResolution.width >= __previewResolutionWidth && dimResolution.height >= __previewResolutionHeight)
4286 resolutionRatio = (dimResolution.width * MULTIPLY_BY_TEN) / (dimResolution.height);
4288 if (resolutionRatio > NORMAL_MODE_RATIO)
4290 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(16:9)", dimResolution.width, dimResolution.height);
4294 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(4:3)", dimResolution.width, dimResolution.height);
4297 pItemString = new (std::nothrow) String(tempString);
4298 TryCatch(pItemString != null, , "pItemString is null");
4300 __pCaptureResolutionList->Add(*pItemString);
4302 AppLogDebug("GetCaptureResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4308 AppLogDebug("Not Support CaptureResolution");
4312 AppLogDebug("EXIT");
4316 if (__pCaptureResolutionList)
4318 __pCaptureResolutionList->RemoveAll(true);
4320 delete __pCaptureResolutionList;
4321 __pCaptureResolutionList = null;
4326 CameraForm::MakeIsoList(bool remakeList = false)
4328 AppLogDebug("ENTER");
4329 IList* pTempList = null;
4330 String* pItemString = null;
4332 result r = E_SUCCESS;
4336 const mchar* isoMap[] =
4354 __pIsoList->RemoveAll(true);
4361 if (__pIsoList == null)
4363 __pIsoList = new (std::nothrow) ArrayList();
4364 r = __pIsoList->Construct();
4365 TryCatch(r == E_SUCCESS, , "__pIsoList construct fail[%s]", GetErrorMessage(r));
4367 pTempList = _pCameraPresentationModel->GetIsoList();
4368 TryCatch(pTempList != null, , "GetIsoList() return null");
4369 tot = pTempList->GetCount();
4372 for (idx = 0; idx < tot; idx++)
4374 Tizen::Base::Integer* isoObj = (Tizen::Base::Integer*) pTempList->GetAt(idx);
4376 int isoType = isoObj ? isoObj->ToInt() : -INDEX_UNIT_ONE;
4378 if (isoType > 0 && isoType < MAX_ISO_COUNT)
4380 pItemString = new (std::nothrow) String(isoMap[isoType]);
4381 TryCatch(pItemString != null, , "pItemString is null");
4383 AppLogDebug("ISO return is = %d VALUE = %ls", isoType, pItemString->GetPointer());
4384 __pIsoList->Add(*pItemString);
4388 AppLogDebug("isoType out of range");
4394 AppLogDebug("EXIT");
4400 __pIsoList->RemoveAll(true);
4411 CameraForm::MakeSettingPopupTab(bool isShow)
4413 AppLogDebug("ENTER");
4416 if (__pCameraSetting)
4418 __pCameraSetting->SetShowState(true);
4419 __pCameraSetting->Invalidate(true);
4422 if (__pCameraSettingLable)
4424 __pCameraSettingLable->SetShowState(true);
4425 __pCameraSettingLable->Invalidate(true);
4428 if (__pGeneralSetting)
4430 __pGeneralSetting->SetShowState(true);
4431 __pGeneralSetting->Invalidate(true);
4434 if (__pGeneralSettingLable)
4436 __pGeneralSettingLable->SetShowState(true);
4437 __pGeneralSettingLable->Invalidate(true);
4442 if (__pCameraSetting)
4444 __pCameraSetting->SetShowState(false);
4445 __pCameraSetting->Invalidate(true);
4448 if (__pCameraSettingLable)
4450 __pCameraSettingLable->SetShowState(false);
4451 __pCameraSettingLable->Invalidate(true);
4454 if (__pGeneralSetting)
4456 __pGeneralSetting->SetShowState(false);
4457 __pGeneralSetting->Invalidate(true);
4460 if (__pGeneralSettingLable)
4462 __pGeneralSettingLable->SetShowState(false);
4463 __pGeneralSettingLable->Invalidate(true);
4466 AppLogDebug("EXIT");
4470 CameraForm::MakeCameraTabSettingPopup(void)
4472 AppLogDebug("ENTER");
4473 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4474 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4477 MakePreviewResolutionList(true);
4479 MakeCaptrueResolutionList(false);
4485 _pCameraInfoPanel->SetDrawExposure(false);
4487 if (__dir == ORIENTATION_STATUS_PORTRAIT
4488 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4490 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4491 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN);
4495 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4496 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE- H_SETTING_MENU_LIST_MARGIN);
4499 MakeCameraTabMenuString();
4500 SetCameraTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
4501 MakeSettingPopupTab(true);
4503 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
4504 _pCameraInfoPanel->Invalidate(true);
4505 if (_pListViewCameraTabMainMenu == null)
4507 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
4508 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4510 _pListViewCameraTabMainMenu->SetItemProvider(*this);
4511 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
4512 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
4516 _pListViewCameraTabMainMenu->SetShowState(true);
4517 _pListViewCameraTabMainMenu->SetBounds(rectList);
4519 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
4521 _pListViewCameraTabMainMenu->UpdateList();
4522 AppLogDebug("EXIT");
4526 CameraForm::MakeGeneralTabSettingPopup(void)
4528 AppLogDebug("ENTER");
4529 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4530 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4533 _pCameraInfoPanel->SetDrawExposure(false);
4535 if (__dir == ORIENTATION_STATUS_PORTRAIT
4536 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4538 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4539 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT);
4543 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4544 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4547 MakeGeneralTabMenuString();
4548 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
4549 MakeSettingPopupTab(true);
4551 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
4552 _pCameraInfoPanel->Invalidate(true);
4554 if (_pListViewGeneralTabMainMenu == null)
4556 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
4557 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4559 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
4560 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
4561 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
4565 _pListViewGeneralTabMainMenu->SetShowState(true);
4566 _pListViewGeneralTabMainMenu->SetBounds(rectList);
4569 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
4570 _pListViewGeneralTabMainMenu->UpdateList();
4571 AppLogDebug("EXIT");
4575 CameraForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4577 AppLogDebug("ENTER");
4578 AppLogDebug("EXIT");
4582 CameraForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4584 AppLogDebug("ENTER");
4585 result r = E_SUCCESS;
4587 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4589 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4591 _currentSettingsMenuIndex = index;
4592 r = ProcessCameraTabMainListPopup(index);
4593 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4596 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4598 r = ProcessCameraTabSubListPopup(index);
4599 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4601 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4603 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4605 _currentSettingsMenuIndex = index;
4606 r = ProcessGeneraTabMainListPopup(index);
4607 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4610 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4612 r = ProcessGeneraTabSubListPopup(index);
4613 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4615 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4617 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4619 r = ProcessFlashListPopup(index);
4620 UpdateUiPanelIcon();
4621 TryReturnVoid(r == E_SUCCESS, "ProcessMainListPopup() fail[%s]", GetErrorMessage(r));
4624 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4626 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4628 r = SubListPopupWhiteBalanceMode(index);
4629 TryReturnVoid(r == E_SUCCESS, "SubListPopupWhiteBalanceMode() fail[%s]", GetErrorMessage(r));
4635 AppLogDebug("OnListViewItemStateChanged is not make");
4637 AppLogDebug("EXIT");
4641 CameraForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4643 AppLogDebug("ENTER");
4644 AppLogDebug("EXIT");
4648 CameraForm::CreateItem(int index, int itemWidth)
4650 AppLogDebug("ENTER");
4651 CustomItem* pItem = null;
4652 bool createSubMenu = false;
4653 bool createGenSubMenu = false;
4654 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
4655 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
4656 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
4657 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
4658 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
4659 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
4660 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
4661 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
4664 if (_pListViewCameraTabSubMenu)
4666 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4668 createSubMenu = true;
4669 pItem = CreateCameraTabSubMenuItem(index, itemWidth);
4673 AppLogDebug("CreateCameraTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4678 AppLogDebug("EXIT");
4684 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4686 if (createSubMenu == false)
4688 pItem = CreateCameraTabMainMenuItem(index, itemWidth);
4692 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4697 AppLogDebug("EXIT");
4703 if (_pListViewGeneralTabSubMenu)
4705 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4707 createGenSubMenu = true;
4708 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4712 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4717 AppLogDebug("EXIT");
4723 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4725 if (createGenSubMenu == false)
4727 AppLogDebug("CreateGeneralTabMainMenuItem");
4728 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4732 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4737 AppLogDebug("EXIT");
4743 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4745 pItem = CreateFlashMainMenuItem(index, itemWidth);
4749 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListFlashMainMenu");
4754 AppLogDebug("EXIT");
4759 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4761 pItem = CreateWhiteBalanceItem(index, itemWidth);
4765 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListWbMainMenu");
4770 AppLogDebug("EXIT");
4775 AppLogDebug("EXIT");
4780 CameraForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4782 AppLogDebug("ENTER");
4786 AppLogDebug("EXIT");
4791 CameraForm::GetItemCount(void)
4793 AppLogDebug("ENTER");
4794 if (_pListViewCameraTabSubMenu)
4796 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4798 AppLogDebug("EXIT");
4799 return GetCameraTabSettingSubMenuCount();
4803 if (_pListViewCameraTabMainMenu)
4805 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4807 AppLogDebug("EXIT");
4808 return GetCameraTabSettingMainMenuCount();
4812 if (_pListViewGeneralTabSubMenu)
4814 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4816 AppLogDebug("EXIT");
4817 return GetGeneralTabSettingSubMenuCount();
4821 if (_pListViewGeneralTabMainMenu)
4823 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4825 AppLogDebug("EXIT");
4826 return GetGeneralTabSettingMainMenuCount();
4830 if (_pListFlashMainMenu)
4832 AppLogDebug("EXIT");
4833 return GetCameraTabSettingMainMenuCount();
4836 if (_pListWbMainMenu)
4838 AppLogDebug("EXIT");
4839 return GetCameraTabSettingMainMenuCount();
4842 AppLogDebug("EXIT");
4847 CameraForm::GetGeneralTabSettingMainMenuCount(void) const
4849 AppLogDebug("ENTER");
4850 AppLogDebug("EXIT");
4851 return __generalTabMainMenuCount;
4855 CameraForm::SetGeneralTabSettingMainMenuCount(int count)
4857 AppLogDebug("ENTER");
4858 __generalTabMainMenuCount = count;
4859 AppLogDebug("EXIT");
4863 CameraForm::GetGeneralTabSettingSubMenuCount(void) const
4865 AppLogDebug("ENTER");
4866 AppLogDebug("EXIT");
4867 return __generalTabSubMenuCount;
4871 CameraForm::SetGeneralTabSettingSubMenuCount(int count)
4873 AppLogDebug("ENTER");
4874 __generalTabSubMenuCount = count;
4875 AppLogDebug("EXIT");
4878 inline GeneralTabSubMenuContent
4879 CameraForm::GetGeneralTabSettingSubMenuMode(void) const
4881 AppLogDebug("ENTER");
4882 AppLogDebug("EXIT");
4883 return __generalTabSettingMode;
4887 CameraForm::SetSettingGenSubMenuMode(const GeneralTabSubMenuContent mode)
4889 AppLogDebug("ENTER");
4890 AppLogDebug("EXIT");
4891 __generalTabSettingMode = mode;
4895 CameraForm::SetGeneralTabSubMenuListviewState(const int menuCount, const GeneralTabSubMenuContent mode)
4897 AppLogDebug("ENTER");
4898 SetGeneralTabSettingSubMenuCount(menuCount);
4899 SetSettingGenSubMenuMode(mode);
4900 AppLogDebug("EXIT");
4904 CameraForm::GetCameraTabSettingMainMenuCount(void) const
4906 AppLogDebug("ENTER");
4907 AppLogDebug("EXIT");
4908 return __cameraTabMainMenuCount;
4912 CameraForm::SetCameraTabSettingMainMenuCount(int count)
4914 AppLogDebug("ENTER");
4915 __cameraTabMainMenuCount = count;
4916 AppLogDebug("EXIT");
4920 CameraForm::GetCameraTabSettingSubMenuCount(void) const
4922 AppLogDebug("ENTER");
4923 AppLogDebug("EXIT");
4924 return __cameraTabSubMenuCount;
4928 CameraForm::SetCameraTabSettingSubMenuCount(int count)
4930 AppLogDebug("ENTER");
4931 __cameraTabSubMenuCount = count;
4932 AppLogDebug("EXIT");
4935 inline CameraTabSubMenuContent
4936 CameraForm::GetCameraTabSettingSubMenuMode(void) const
4938 AppLogDebug("ENTER");
4939 AppLogDebug("EXIT");
4940 return __cameraTabSettingMode;
4944 CameraForm::SetCameraTabSettingSubMenuMode(const CameraTabSubMenuContent mode)
4946 AppLogDebug("ENTER");
4947 AppLogDebug("EXIT");
4948 __cameraTabSettingMode = mode;
4952 CameraForm::SetCameraTabSubMenuListviewState(const int menuCount, const CameraTabSubMenuContent mode)
4954 AppLogDebug("ENTER");
4955 SetCameraTabSettingSubMenuCount(menuCount);
4956 SetCameraTabSettingSubMenuMode(mode);
4957 AppLogDebug("EXIT");
4961 CameraForm::SetMenuTitle(Canvas* pCanvas, const String& str, const int fntSize)
4963 AppLogDebug("ENTER");
4968 result r = E_SUCCESS;
4969 String listName = L"";
4971 TryCatch(pCanvas != null, r = E_SYSTEM, "pCanvas is null");
4973 if (_pListViewCameraTabSubMenu)
4975 listRect = _pListViewCameraTabSubMenu->GetBounds();
4977 else if (_pListViewCameraTabMainMenu)
4979 listRect = _pListViewCameraTabMainMenu->GetBounds();
4980 listName = _pListViewCameraTabMainMenu->GetName();
4982 else if (_pListFlashMainMenu)
4984 listRect = _pListFlashMainMenu->GetBounds();
4985 listName = _pListFlashMainMenu->GetName();
4987 else if (_pListWbMainMenu)
4989 listRect = _pListWbMainMenu->GetBounds();
4990 listName = _pListWbMainMenu->GetName();
4992 else if (_pListViewGeneralTabSubMenu)
4994 listRect = _pListViewGeneralTabSubMenu->GetBounds();
4996 else if (_pListViewGeneralTabMainMenu)
4998 listRect = _pListViewGeneralTabMainMenu->GetBounds();
4999 listName = _pListViewGeneralTabMainMenu->GetName();
5002 pFnt = new (std::nothrow) Font();
5003 pFnt->Construct(FONT_STYLE_PLAIN, fntSize);
5005 r = pFnt->GetTextExtent(str, str.GetLength(), dim);
5006 TryCatch(pFnt != null, , "pFnt GetTextExtent() fail[%s]", GetErrorMessage(r));
5008 r = pCanvas->SetFont(*pFnt);
5009 TryCatch(pFnt != null, , "pCanvas SetFont() fail[%s]", GetErrorMessage(r));
5011 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
5013 point.x = (listRect.width / DIVIDE_BY_TWO) - (dim.width / DIVIDE_BY_TWO);
5014 point.y = (H_SETTING_MENU_PANEL_TITLE / DIVIDE_BY_TWO) - (dim.height / DIVIDE_BY_TWO);
5016 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5018 if (__dir == ORIENTATION_STATUS_PORTRAIT
5019 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5021 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT;
5023 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
5024 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
5026 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE;
5029 else if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)))
5031 point.y += H_FLASH_MODE_TITLE_TOP_MARGIN;
5033 if (__dir == ORIENTATION_STATUS_PORTRAIT
5034 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5036 point.x += X_FLASH_MODE_LIST_START_POS_PORTRAIT;
5040 r = pCanvas->DrawText(point, str);
5041 TryCatch( r == E_SUCCESS, , "pCanvas DrawText() fail[%s]", GetErrorMessage(r));
5046 AppLogDebug("EXIT");
5057 CameraForm::GetTimerIntervalValue(void) const
5059 AppLogDebug("ENTER");
5060 result r = E_SUCCESS;
5061 int timerInterval = 0;
5063 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
5064 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
5066 AppLogDebug("EXIT");
5067 return timerInterval;
5074 CameraForm::SetGuideLine(int guideLineEnable)
5076 AppLogDebug("ENTER");
5077 result r = E_SUCCESS;
5079 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
5080 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
5081 AppLogDebug("EXIT");
5085 CameraForm::RestoreDefaultSetting(void)
5087 AppLogDebug("ENTER");
5088 result r = E_SUCCESS;
5089 int selfPortraitEnable = 0;
5090 bool exposureValue = false;
5091 bool brighnesstValue = false;
5092 int adjustValue = 0;
5094 r = _pCameraPresentationModel->ResetCameraSettingsRegistry();
5095 TryCatch(r == E_SUCCESS, ,"ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
5097 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5098 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5100 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5102 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5106 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5109 if (exposureValue == true && r == E_SUCCESS)
5111 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5112 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5114 AppLogDebug("adjustValue = %d", adjustValue);
5116 _pCameraPresentationModel->SetExposure(adjustValue);
5120 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5122 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5126 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5129 if (brighnesstValue == true && r == E_SUCCESS)
5131 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5132 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5134 AppLogDebug("adjustValue = %d", adjustValue);
5136 _pCameraPresentationModel->SetBrightness(adjustValue);
5140 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5142 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5146 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5151 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5153 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5157 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5159 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5161 AppLogDebug("adjustValue = %d", adjustValue);
5163 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5166 AppLogDebug("EXIT");
5170 AppLogDebug("EXIT - CATCH");
5175 CameraForm::RestorePrimaryResolution(void)
5177 AppLogDebug("ENTER");
5178 result r = E_SUCCESS;
5179 IList* pList = null;
5180 IList* pCaptureResolutionList = null;
5181 int resolutionCnt = 0;
5182 bool wideMode = false;
5183 int resolutionIndex = 0;
5184 int resolutionRatio = 0;
5185 Dimension resolutionDim;
5186 Dimension captureResolutionDim;
5187 BufferInfo bufferinfo;
5189 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5190 _pAppTimer->Cancel();
5192 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5193 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5195 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5197 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5199 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5201 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5203 if (resolutionRatio > NORMAL_MODE_RATIO)
5207 SetOverlayPanelWideMode(true);
5209 SetOverlayRendererRotation();
5215 SetOverlayPanelNormalMode(true);
5217 SetOverlayRendererRotation();
5220 _pCameraPresentationModel->KeepScreenOnState(true, false);
5222 _pCameraPresentationModel->StopCamera();
5224 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
5225 TryCatch(r == E_SUCCESS, , "SetMode fail[%s]", GetErrorMessage(r));
5227 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5229 resolutionCnt = pList->GetCount();
5231 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5233 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5235 __captureResolutionWidth = captureResolutionDim.width;
5237 __captureResolutionHeight = captureResolutionDim.height;
5239 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5241 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5243 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5244 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
5246 _pCameraPresentationModel->StartPreview(&bufferinfo);
5248 _pCameraPresentationModel->SetContinuousAutoFocus();
5250 if (wideMode == true)
5252 __pOverlayPanel->AddTouchEventListener(*this);
5254 HidePanel(true, true);
5256 __screenMode = SCREEN_MODE_FULL;
5260 __pOverlayPanel->RemoveTouchEventListener(*this);
5262 HidePanel(false, true);
5264 __screenMode = SCREEN_MODE_NORMAL;
5267 AppLogDebug("EXIT");
5271 __screenMode = SCREEN_MODE_NORMAL;
5277 CameraForm::RestoreSecondaryResolution(void)
5279 AppLogDebug("ENTER");
5280 result r = E_SUCCESS;
5281 IList* pList = null;
5282 IList* pCaptureResolutionList = null;
5283 int resolutionCnt = 0;
5284 bool wideMode = false;
5285 int resolutionIndex = 0;
5286 int resolutionRatio = 0;
5287 Dimension resolutionDim;
5288 Dimension captureResolutionDim;
5290 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5291 _pAppTimer->Cancel();
5293 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5294 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5296 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5298 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5300 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5302 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5304 if (resolutionRatio > NORMAL_MODE_RATIO)
5313 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5315 resolutionCnt = pList->GetCount();
5317 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5319 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5321 __captureResolutionWidth = captureResolutionDim.width;
5323 __captureResolutionHeight = captureResolutionDim.height;
5325 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5327 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5329 __secondaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5331 if (wideMode == true)
5333 __pOverlayPanel->AddTouchEventListener(*this);
5335 HidePanel(true, true);
5337 __screenMode = SCREEN_MODE_FULL;
5341 __pOverlayPanel->RemoveTouchEventListener(*this);
5343 HidePanel(false, true);
5345 __screenMode = SCREEN_MODE_NORMAL;
5348 AppLogDebug("EXIT");
5356 CameraForm::DrawMarker(bool useGuidline)
5358 AppLogDebug("ENTER");
5359 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5360 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5361 result r = E_SUCCESS;
5363 if (__dir == ORIENTATION_STATUS_PORTRAIT
5364 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5366 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5367 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5371 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5372 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5377 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5381 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5383 _pCameraInfoPanel->Invalidate(true);
5385 AppLogDebug("EXIT");
5390 CameraForm::DrawFocus(int focusMode)
5392 AppLogDebug("ENTER");
5393 int selfPortraitEnable = 0;
5394 bool focusSupport = false;
5395 result r = E_SUCCESS;
5396 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5397 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5399 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5400 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5402 if (__dir == ORIENTATION_STATUS_PORTRAIT
5403 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5405 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5406 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5410 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5411 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5414 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5416 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5420 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
5423 if (focusSupport == true && r == E_SUCCESS)
5425 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5427 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5428 _pCameraInfoPanel->Invalidate(true);
5432 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5433 _pCameraInfoPanel->Invalidate(true);
5436 AppLogDebug("EXIT");
5444 CameraForm::DrawTimerPopup(void)
5446 AppLogDebug("ENTER");
5447 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5448 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5449 result r = E_SUCCESS;
5451 if (__dir == ORIENTATION_STATUS_PORTRAIT
5452 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5454 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5455 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5459 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5460 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5463 _pCameraInfoPanel->SetDrawPopupTimer(true);
5464 _pCameraInfoPanel->Invalidate(true);
5468 AppLogDebug("EXIT");
5473 CameraForm::SetFlashPopop(void)
5475 AppLogDebug("ENTER");
5476 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5477 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5478 MakeSettingPopupTab(false);
5481 if (__dir == ORIENTATION_STATUS_PORTRAIT
5482 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5484 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5485 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5489 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5490 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5493 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5494 _pCameraInfoPanel->Invalidate(true);
5495 SetCameraTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5497 if (_pListFlashMainMenu == null)
5499 _pListFlashMainMenu = new (std::nothrow) ListView();
5500 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5502 _pListFlashMainMenu->SetItemProvider(*this);
5503 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5504 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5508 _pListFlashMainMenu->SetBounds(rectList);
5509 _pListFlashMainMenu->SetShowState(true);
5511 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5513 _pListFlashMainMenu->UpdateList();
5514 AppLogDebug("EXIT");
5518 CameraForm::SetWhiteBalancePopop(void)
5520 AppLogDebug("ENTER");
5521 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5522 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5523 MakeSettingPopupTab(false);
5526 if (__dir == ORIENTATION_STATUS_PORTRAIT
5527 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5529 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5530 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5534 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5535 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5538 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5539 _pCameraInfoPanel->Invalidate(true);
5540 SetCameraTabSettingMainMenuCount(MAX_WHITE_BALANCE_MENU_COUNT);
5542 if (_pListWbMainMenu == null)
5544 _pListWbMainMenu = new (std::nothrow) ListView();
5545 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5547 _pListWbMainMenu->SetItemProvider(*this);
5548 _pListWbMainMenu->AddListViewItemEventListener(*this);
5549 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5553 _pListWbMainMenu->SetBounds(rectList);
5554 _pListWbMainMenu->SetShowState(true);
5556 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5558 _pListWbMainMenu->UpdateList();
5559 AppLogDebug("EXIT");
5563 CameraForm::ProcessFlashListPopup(int index)
5565 AppLogDebug("ENTER");
5566 Rectangle rectPanel;
5568 String strTitle = L"";
5569 String listName = L"";
5570 Bitmap* pBitmapNormal = null;
5571 Bitmap* pBitmapPress = null;
5572 result r = E_SUCCESS;
5573 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5575 AppLogDebug("Sub Menu (%d)", index);
5578 int selfPortraitEnable = 0;
5580 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5581 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5583 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5584 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5586 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5588 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5590 regVal = SUBMENU_MODE_OFF;
5591 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5592 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5593 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5597 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5599 if (value == true && r == E_SUCCESS)
5601 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5605 case SUBMENU_MODE_OFF:
5607 regVal = SUBMENU_MODE_OFF;
5608 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5609 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5610 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5614 case SUBMENU_MODE_ON:
5616 regVal = SUBMENU_MODE_ON;
5617 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5618 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5619 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5623 case SUBMENU_MODE_AUTO:
5625 regVal = SUBMENU_MODE_AUTO;
5626 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5627 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5628 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5638 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5640 regVal = SUBMENU_MODE_OFF;
5641 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5642 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5643 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5647 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(index));
5648 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5650 _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5652 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5654 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5656 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5657 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5659 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5661 delete pBitmapNormal;
5662 pBitmapNormal = null;
5664 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5665 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5667 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5669 delete pBitmapPress;
5670 pBitmapPress = null;
5676 SetCameraTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5677 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5681 AppLogDebug("EXIT");
5685 AppLogDebug("Catch:");
5690 CameraForm::ProcessCameraTabMainListPopup(int index)
5692 AppLogDebug("ENTER");
5693 Rectangle rectPanel;
5695 String strTitle = L"";
5696 String listName = L"";
5697 bool resetPanel = false;
5698 int subPanelItemCount = 0;
5700 int captureResolutionCount = 0;
5701 result r = E_SUCCESS;
5702 bool drawPopup = true;
5704 listName = _pListViewCameraTabMainMenu->GetName();
5706 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
5707 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
5709 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5711 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5713 _pCameraInfoSubPanel->SetShowState(false);
5714 _pCameraInfoSubPanel->RemoveControl(_pListViewCameraTabSubMenu);
5715 _pListViewCameraTabSubMenu = null;
5716 RemoveControl(_pCameraInfoSubPanel);
5717 _pCameraInfoSubPanel = null;
5719 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5724 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5726 int selfPortraitEnable = 0;
5728 AppLogDebug("Set ISO");
5731 int isoCnt = __pIsoList->GetCount() -1;
5733 subPanelItemCount = isoCnt;
5734 if (subPanelItemCount> 5)
5740 int X_Panel = X_SUBMENU_ISO_MODE_PANEL;
5741 int Y_Panel = Y_SUBMENU_ISO_MODE_PANEL;
5742 int W_Panel = W_SUBMENU_ISO_MODE_PANEL;
5743 int H_Panel = Y_SUBMENU_ISO_MODE_LIST + (isoCnt * H_SUBMENU_ISO_MODE_PANEL_MARGIN);
5745 int X_List = X_SUBMENU_ISO_MODE_LIST;
5746 int Y_List = Y_SUBMENU_ISO_MODE_LIST;
5747 int W_List = W_SUBMENU_ISO_MODE_LIST;
5748 int H_List = (isoCnt * H_SUBMENU_ISO_MODE_LIST_MARGIN);
5750 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel + 20);
5751 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5753 pAppResource->GetString(IDS_CAM_BODY_ISO, strTitle);
5754 SetCameraTabSubMenuListviewState(isoCnt, CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE);
5758 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5759 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5761 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5763 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
5767 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
5772 AppLogDebug("Support ISO");
5776 r = _pCameraPresentationModel->SetValue(ISO_VALUE, REG_DEFAULT_VAULE_ZERO);
5777 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
5784 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5786 if (__pCaptureResolutionList)
5788 captureResolutionCount = __pCaptureResolutionList->GetCount();
5790 subPanelItemCount = captureResolutionCount;
5791 if (subPanelItemCount > 5)
5796 if (captureResolutionCount > 1)
5798 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5799 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL;
5800 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5801 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captureResolutionCount * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5803 int X_List = X_SUBMENU_WB_MODE_LIST;
5804 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5805 int W_List = W_SUBMENU_WB_MODE_LIST;
5806 int H_List = (captureResolutionCount * W_SUBMENU_WB_MODE_LIST_MARGIN);
5808 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5809 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5811 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5812 SetCameraTabSubMenuListviewState(captureResolutionCount, CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE);
5818 AppLogDebug("captrueResolutionCnt count is %d",captureResolutionCount);
5825 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5826 AppLogDebug("Invaild index");
5834 if (__dir == ORIENTATION_STATUS_PORTRAIT
5835 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5837 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5838 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5842 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5846 rectList.height = rectList.height - 40 - (subPanelItemCount-5)*72;
5847 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
5849 rectPanel.height = rectPanel.height - 100;
5852 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
5854 rectPanel.height = rectPanel.height - 198;
5855 rectList.height = rectList.height - 20;
5860 if (_pCameraInfoSubPanel == null)
5862 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5863 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5865 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5866 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5868 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5869 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5870 AddOrientationEventListener(*this);
5871 AddControl(_pCameraInfoSubPanel);
5872 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5875 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5876 _pCameraInfoPanel->Invalidate(true);
5877 _pCameraInfoSubPanel->Invalidate(true);
5879 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5880 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5882 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5883 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5884 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5886 _pListViewCameraTabSubMenu->UpdateList();
5890 AppLogDebug("EXIT");
5894 if (_pCameraInfoSubPanel)
5896 RemoveControl(_pCameraInfoSubPanel);
5897 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5901 delete _pListViewCameraTabSubMenu;
5904 _pCameraInfoSubPanel = null;
5905 _pListViewCameraTabSubMenu = null;
5911 CameraForm::ProcessCameraTabSubListPopup(int index)
5913 AppLogDebug("ENTER");
5914 String strRegKey = IDS_INIT_REG_KEY;
5915 result r = E_SUCCESS;
5916 int selfPortraitEnable = 0;
5917 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
5919 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5920 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5922 idx = GetCameraTabSettingSubMenuMode();
5926 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5928 r = SubListPopupIsoMode(index);
5929 TryCatch(r == E_SUCCESS, , "SubListPopupIsoMode() fail[%s]", GetErrorMessage(r));
5933 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5935 r = SubListPopupResolutionMode(index);
5936 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
5944 if (_pListViewCameraTabSubMenu)
5946 if (_pCameraInfoSubPanel != null)
5948 _pCameraInfoSubPanel->SetShowState(false);
5950 _pListViewCameraTabSubMenu->SetShowState(false);
5952 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
5953 _pListViewCameraTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
5956 _pCameraInfoPanel->Invalidate(true);
5958 AppLogDebug("EXIT");
5968 CameraForm::ProcessGeneraTabMainListPopup(int index)
5970 AppLogDebug("ENTER");
5971 Rectangle rectPanel;
5973 String strTitle = L"";
5974 String listName = L"";
5976 result r = E_SUCCESS;
5977 bool drawPopup = true;
5979 listName = _pListViewGeneralTabMainMenu->GetName();
5981 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
5982 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
5984 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
5986 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
5988 _pCameraInfoGeneralSubPanel->SetShowState(false);
5989 _pCameraInfoGeneralSubPanel->RemoveControl(_pListViewGeneralTabSubMenu);
5990 _pListViewGeneralTabSubMenu = null;
5991 RemoveControl(_pCameraInfoGeneralSubPanel);
5992 _pCameraInfoGeneralSubPanel = null;
5994 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5999 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6001 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
6002 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
6003 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL);
6004 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
6005 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
6006 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
6010 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6012 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
6013 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
6015 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
6016 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL);
6017 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
6018 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
6022 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6024 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
6025 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
6026 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL);
6027 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
6028 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
6029 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
6033 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6037 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
6039 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
6042 if (_pResetPopUp == null)
6044 _pResetPopUp = new (std::nothrow) Popup();
6045 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
6046 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
6051 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
6052 TryCatch(_pYes != null, , "Reset Popup not created!");
6053 _pYes->SetActionId(IDA_BTN_YES);
6054 _pYes->AddActionEventListener(*this);
6055 _pYes->SetShowState(true);
6060 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
6061 TryCatch(_pNo != null, , "Reset Popup not created!");
6062 _pNo->SetActionId(IDA_BTN_NO);
6063 _pNo->AddActionEventListener(*this);
6064 _pNo->SetShowState(true);
6065 _pResetPopUp->Show();
6068 _pResetPopUp->SetShowState(true);
6069 _pResetPopUp->Invalidate(true);
6070 _pResetPopUp->Show();
6074 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6076 result r = E_SUCCESS;
6078 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
6079 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6081 r = SetScreenOverlayHelpTimer();
6082 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6084 r = DrawScreenOverlayHelp();
6085 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6089 MakeSettingPopupTab(false);
6098 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6099 AppLogDebug("Invaild index");
6107 if (__dir == ORIENTATION_STATUS_PORTRAIT
6108 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6110 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
6111 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
6115 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
6118 if (_pCameraInfoGeneralSubPanel == null)
6120 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
6121 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
6123 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
6124 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
6126 if (index == GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
6127 index == GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
6128 index == GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
6130 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
6132 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
6133 AddOrientationEventListener(*this);
6134 AddControl(_pCameraInfoGeneralSubPanel);
6135 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
6138 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
6139 _pCameraInfoPanel->Invalidate(true);
6140 _pCameraInfoGeneralSubPanel->Invalidate(true);
6142 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
6143 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
6145 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
6146 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
6147 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
6149 _pListViewGeneralTabSubMenu->UpdateList();
6153 AppLogDebug("EXIT");
6157 if (_pCameraInfoGeneralSubPanel)
6159 RemoveControl(_pCameraInfoGeneralSubPanel);
6160 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6164 delete _pListViewGeneralTabSubMenu;
6167 _pCameraInfoGeneralSubPanel = null;
6168 _pListViewGeneralTabSubMenu = null;
6170 AppLogDebug("EXIT - CATCH");
6175 CameraForm::ProcessGeneraTabSubListPopup(int index)
6177 AppLogDebug("ENTER");
6178 String strRegKey = IDS_INIT_REG_KEY;
6179 result r = E_SUCCESS;
6180 int selfPortraitEnable = 0;
6181 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6183 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6184 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6186 idx = GetGeneralTabSettingSubMenuMode();
6190 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6192 r = SubListPopupTimerMode(index);
6193 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6197 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6199 r = SubListPopupGuidelineMode(index);
6200 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6204 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6206 SubListPopupStorageTypeMode(index);
6210 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6215 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6224 if (_pListViewGeneralTabSubMenu)
6226 if (_pCameraInfoGeneralSubPanel != null)
6228 _pCameraInfoGeneralSubPanel->SetShowState(false);
6230 _pListViewGeneralTabSubMenu->SetShowState(false);
6232 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6233 _pListViewGeneralTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6236 _pCameraInfoPanel->Invalidate(true);
6237 AppLogDebug("EXIT");
6241 MakeSettingPopupTab(false);
6248 CameraForm::StartPopupTimer(void)
6250 AppLogDebug("ENTER");
6251 result r = E_SUCCESS;
6252 int timerInterval = 0;
6256 _pPopupTimer = new (std::nothrow) Timer();
6258 _pPopupTimer->Construct(*this);
6260 r = _pPopupTimer->StartAsRepeatable(CAMERA_TIMER_1_SEC);
6261 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6263 timerInterval = GetTimerIntervalValue();
6265 switch (timerInterval)
6267 case SETTING_TIMER_CAPTURE_2_SEC:
6269 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6273 case SETTING_TIMER_CAPTURE_5_SEC:
6275 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6279 case SETTING_TIMER_CAPTURE_10_SEC:
6281 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6289 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6290 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6291 _pCameraInfoPanel->Invalidate(true);
6293 AppLogDebug("EXIT");
6297 delete _pPopupTimer;
6298 _pPopupTimer = null;
6304 CameraForm::StopPopupTimer(void)
6306 AppLogDebug("ENTER");
6307 result r = E_SUCCESS;
6308 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6310 r = _pPopupTimer->Cancel();
6312 delete _pPopupTimer;
6313 _pPopupTimer = null;
6315 AppLogDebug("EXIT");
6323 CameraForm::SetCameraSettingsDevice(void)
6325 AppLogDebug("ENTER");
6330 result r = E_SUCCESS;
6331 int selfPortraitEnable = 0;
6332 bool exposureValue = false;
6333 bool brighnesstValue = false;
6334 int updatedIndex = 0;
6336 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6337 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6339 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6341 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6345 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6348 if (exposureValue == true && r == E_SUCCESS)
6350 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6351 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6353 _pCameraPresentationModel->SetExposure(exposure);
6357 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6359 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6363 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6366 if (brighnesstValue == true && r == E_SUCCESS)
6368 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
6369 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
6371 _pCameraPresentationModel->SetBrightness(brightness);
6375 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6377 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
6381 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
6386 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
6387 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
6391 updatedIndex = isoIndex + 2;
6395 updatedIndex = isoIndex + 3;
6397 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
6400 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6402 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
6406 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
6411 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6413 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
6417 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
6420 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6422 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
6424 AppLogDebug("EXIT");
6428 CameraForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
6430 AppLogDebug("ENTER");
6431 Bitmap* pBitmap = null;
6432 ByteBuffer* pSrcByteBuff = null;
6433 ByteBuffer dstByteBuff;
6434 BufferInfo buffInfo;
6435 result r = E_SUCCESS;
6439 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
6441 if (rotationType == IMAGE_ROTATION_0)
6443 pBitmap = new (std::nothrow) Bitmap();
6444 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
6445 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6447 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
6451 dim.width = pSrcBitmap->GetWidth();
6452 dim.height = pSrcBitmap->GetHeight();
6454 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
6456 r = dstByteBuff.Construct(size);
6457 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6459 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
6460 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6462 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
6463 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
6465 dim.width = buffInfo.width;
6466 dim.height = buffInfo.height;
6468 size = buffInfo.pitch * buffInfo.height;
6470 pSrcByteBuff = new (std::nothrow) ByteBuffer();
6471 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
6473 r = pSrcByteBuff->Construct(size);
6474 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6476 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
6477 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6479 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
6480 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
6482 r = pSrcBitmap->Unlock();
6483 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
6485 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
6486 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
6488 if (rotationType == IMAGE_ROTATION_90
6489 || rotationType == IMAGE_ROTATION_270)
6491 dim.width = buffInfo.height;
6492 dim.height = buffInfo.width;
6496 dim.width = buffInfo.width;
6497 dim.height = buffInfo.height;
6500 pBitmap = new (std::nothrow) Bitmap();
6501 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
6502 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6504 delete pSrcByteBuff;
6505 pSrcByteBuff = null;
6507 AppLogDebug("EXIT");
6511 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
6512 if (pSrcByteBuff != null)
6514 delete pSrcByteBuff;
6515 pSrcByteBuff = null;
6518 if (pBitmap != null) //Prevent issue fix.
6526 CameraForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
6528 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
6529 result r = E_SUCCESS;
6530 int adjustEntryValue = 0;
6531 int currentEntryValue = 0;
6533 bool exposureValue = false;
6534 bool brighnesstValue = false;
6535 int selfPortraitEnable = 0;
6536 bool IsSliderAdjustValue = false;
6538 if (__dir == ORIENTATION_STATUS_PORTRAIT
6539 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6541 step = movableValidRect.width / maxEntryValue;
6542 if (currentPosition.x > movableValidRect.x)
6544 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
6546 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6547 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6548 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
6550 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
6555 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6558 IsSliderAdjustValue = true;
6562 IsSliderAdjustValue = false;
6567 step = movableValidRect.height / maxEntryValue;
6568 if (currentPosition.y > movableValidRect.y)
6570 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
6571 IsSliderAdjustValue = true;
6575 IsSliderAdjustValue = false;
6579 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6580 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6582 if (entryName.Equals(String(EXPOSURE_VALUE)))
6584 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6586 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6590 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6593 if (exposureValue == true && r == E_SUCCESS)
6595 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
6596 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6600 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6602 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6606 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6609 if (brighnesstValue == true && r == E_SUCCESS)
6611 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
6612 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6616 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6617 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
6619 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6621 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6625 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6628 if (exposureValue == true && r == E_SUCCESS)
6630 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
6631 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6635 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6637 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6641 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6644 if (brighnesstValue == true && r == E_SUCCESS)
6646 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
6647 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6651 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6653 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6657 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6660 if (exposureValue == true && r == E_SUCCESS)
6662 _pCameraPresentationModel->SetExposure(adjustEntryValue);
6666 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6668 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6672 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6675 if (brighnesstValue == true && r == E_SUCCESS)
6677 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
6681 AppLogDebug("Exposure do not support");
6687 AppLogDebug("EXIT");
6695 CameraForm::CreateExposureSlider(void)
6697 AppLogDebug("ENTER");
6698 result r = E_SUCCESS;
6700 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
6702 _closeTimerValue = 0;
6703 _pExposureCloseTimer = new (std::nothrow) Timer();
6704 _pExposureCloseTimer->Construct(*this);
6706 _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
6707 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
6709 _pCameraInfoPanel->SetDrawExposure(true);
6710 _pCameraInfoPanel->Invalidate(true);
6712 AppLogDebug("EXIT");
6716 delete _pExposureCloseTimer;
6717 _pExposureCloseTimer = null;
6723 CameraForm::DrawExposureSlider(void)
6725 AppLogDebug("ENTER");
6726 Point buttonPosition;
6727 result r = E_SUCCESS;
6728 Rectangle rectSlider;
6731 int selfPortraitEnable = 0;
6732 bool exposureValue = false;
6733 bool brighnesstValue = false;
6735 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6736 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6738 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6740 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6744 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6747 if (exposureValue == true && r == E_SUCCESS)
6749 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6750 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6751 AppLogDebug("Exposure value %d", exposure);
6755 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6757 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6761 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6764 if (brighnesstValue == true && r == E_SUCCESS)
6766 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
6767 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6768 AppLogDebug("Exposure value %d", exposure);
6772 if (__dir == ORIENTATION_STATUS_PORTRAIT
6773 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6775 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6776 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6777 step = rectSlider.width / MAX_CAMERA_EXPOSURE_VALUE;
6779 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + rectSlider.x;
6780 buttonPosition.y = rectSlider.y;
6781 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
6785 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6786 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6787 step = rectSlider.height / MAX_CAMERA_EXPOSURE_VALUE;
6789 buttonPosition.x = rectSlider.x;
6790 buttonPosition.y = (step * exposure) + rectSlider.y;
6791 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
6794 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
6795 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6797 AppLogDebug("EXIT");
6805 CameraForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
6807 AppLogDebug("ENTER");
6808 result r = E_SUCCESS;
6809 Point buttonPosition;
6810 Rectangle rectSlider;
6811 float adjustedXvalue = 0;
6812 int adjustedXinInt = 0;
6814 bool IsSliderRectValid = false;
6816 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
6818 if (__dir == ORIENTATION_STATUS_PORTRAIT
6819 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6821 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6822 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6825 case DRAW_INITIALIZED:
6827 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6828 buttonPosition.y = currentPosition.y;
6829 IsSliderRectValid = true;
6835 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6837 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6839 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6840 buttonPosition.y = rectSlider.y;
6841 IsSliderRectValid = true;
6842 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
6844 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6845 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6847 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6848 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6850 if ((adjustedXvalue - adjustedXinInt) != 0)
6852 adjustedXinInt = adjustedXinInt+1;
6855 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
6857 buttonPosition.x = X_EXPOSURE_PANEL_SIDER_PORTRAIT + adjustedXinInt;
6858 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
6859 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6860 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6865 IsSliderRectValid = false;
6872 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6874 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6876 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6877 buttonPosition.y = rectSlider.y;
6878 IsSliderRectValid = true;
6879 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6880 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6885 IsSliderRectValid = false;
6888 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6890 IsSliderRectValid = false;
6901 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6902 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6905 case DRAW_INITIALIZED:
6907 buttonPosition.x = currentPosition.x;
6908 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6909 IsSliderRectValid = true;
6915 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6917 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6919 buttonPosition.x = rectSlider.x;
6920 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6921 IsSliderRectValid = true;
6922 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6923 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6928 IsSliderRectValid = false;
6935 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6937 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6939 buttonPosition.x = rectSlider.x;
6940 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6941 IsSliderRectValid = true;
6942 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6943 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6948 IsSliderRectValid = false;
6951 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6953 IsSliderRectValid = false;
6963 if (IsSliderRectValid)
6965 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
6966 _pCameraInfoPanel->Invalidate(true);
6969 AppLogDebug("EXIT");
6977 CameraForm::ShowExposureSlider(void)
6979 AppLogDebug("ENTER");
6980 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
6981 bool exposureValue = false;
6982 bool brighnesstValue = false;
6983 result r = E_SUCCESS;
6985 if (_pExposureCloseTimer)
6987 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6988 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6990 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
6994 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6996 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7000 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7003 if (exposureValue == true && r == E_SUCCESS)
7005 r = CreateExposureSlider();
7006 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7008 r = DrawExposureSlider();
7009 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7013 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7015 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7019 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7022 if (brighnesstValue == true && r == E_SUCCESS)
7024 r = CreateExposureSlider();
7025 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7027 r = DrawExposureSlider();
7028 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7033 AppLogDebug("EXIT");
7037 CameraForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7039 AppLogDebug("ENTER");
7040 result r = E_SUCCESS;
7041 bool modified = false;
7042 bool isValidRect = false;
7043 Dimension dimRendererSize;
7045 if (__screenMode == SCREEN_MODE_NORMAL)
7047 Dimension dim = Dimension(0, 0);
7048 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7049 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7050 Rectangle clientRect = GetClientAreaBounds();
7051 bool isToCompensated = false;
7053 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7054 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7056 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7058 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7059 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7063 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7064 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7069 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7071 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7072 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7076 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7077 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7081 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7083 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7084 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7086 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7087 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7089 if (modified == true)
7091 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7094 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7095 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7097 if (evaluateBoundsRect.height == rect.height)
7099 isToCompensated = false;
7103 isToCompensated = true;
7108 if (evaluateBoundsRect.width == rect.width)
7110 isToCompensated = false;
7114 isToCompensated = true;
7118 r = __pOverlayPanel->SetBounds(rect);
7119 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7120 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7122 if (isToCompensated == true)
7124 AppLogDebug("isToCompensated = true");
7126 rect = __pOverlayPanel->GetBounds();
7127 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7129 r = __pOverlayPanel->SetBounds(rect);
7130 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7131 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7134 dimRendererSize = __pOverlayPanel->GetSize();
7135 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7136 __pOverlayPanel->SetRenderSize(dimRendererSize);
7140 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7141 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7142 Rectangle clientRect = GetClientAreaBounds();
7143 bool isToCompensated = false;
7145 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7146 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7148 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7150 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7154 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7159 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7161 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7165 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7169 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7171 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7172 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7174 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7175 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7177 if (modified == true)
7179 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7182 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7183 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7185 if (evaluateBoundsRect.height == rect.height)
7187 isToCompensated = false;
7191 isToCompensated = true;
7196 if (evaluateBoundsRect.width == rect.width)
7198 isToCompensated = false;
7202 isToCompensated = true;
7206 r = __pOverlayPanel->SetBounds(rect);
7207 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7208 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7210 if (isToCompensated == true)
7212 AppLogDebug("isToCompensated = true");
7213 rect = __pOverlayPanel->GetBounds();
7214 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7216 r = __pOverlayPanel->SetBounds(rect);
7217 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7218 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7221 dimRendererSize = __pOverlayPanel->GetSize();
7222 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7223 __pOverlayPanel->SetRenderSize(dimRendererSize);
7225 AppLogDebug("EXIT");
7229 CameraForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7231 AppLogDebug("ENTER");
7232 result r = E_SUCCESS;
7233 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7234 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7235 Rectangle clientRect = GetClientAreaBounds();
7236 BufferInfo bufferinfo;
7237 String listName = L"";
7238 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7239 int guideLineEnable = DISABLE_GUIDELINE;
7241 if (_appControlActionCompleted)
7243 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7245 if (__dir != orientationStatus)
7247 __dir = orientationStatus;
7248 __deviceOrientation = orientationStatus;
7253 if (__dir != orientationStatus)
7255 __isOrientationChanged = true;
7257 if (_pAppTimer != null)
7259 _pAppTimer->Cancel();
7261 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
7263 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7264 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7266 SetOverlayPanelOrientationChanged(orientationStatus);
7268 if (__pOverlayPanel)
7270 switch (orientationStatus)
7272 case ORIENTATION_STATUS_PORTRAIT:
7274 AppLogDebug("PORTRAIT");
7275 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7279 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7281 AppLogDebug("PORTRAIT_REVERSE");
7282 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7286 case ORIENTATION_STATUS_LANDSCAPE:
7288 AppLogDebug("LANDSCAPE");
7289 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7293 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7295 AppLogDebug("LANDSCAPE_REVERSE");
7296 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7305 if (__screenMode == SCREEN_MODE_FULL)
7307 HidePanel(true, true);
7310 __dir = orientationStatus;
7311 __deviceOrientation = orientationStatus;
7313 AppLogDebug("__dir = %d", __dir);
7314 _pCameraPresentationModel->SetOrientation(__dir);
7316 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7317 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7319 if (guideLineEnable == DISABLE_GUIDELINE)
7328 UpdateUiPanelIcon();
7329 UpdateUiActionPanelIcon();
7330 OnHelpCloseTimerExpired();
7332 if (__isTimerRunning)
7334 if (_pHelpCloseTimer)
7336 _pHelpCloseTimer->Cancel();
7338 delete _pHelpCloseTimer;
7339 _pHelpCloseTimer = null;
7342 HideScreenOverlayHelp();
7345 if (_pListViewCameraTabMainMenu != null)
7347 listName = _pListViewCameraTabMainMenu->GetName();
7348 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7354 if (_pListViewGeneralTabMainMenu != null)
7356 listName = _pListViewGeneralTabMainMenu->GetName();
7357 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7363 if (_pListFlashMainMenu != null)
7365 listName = _pListFlashMainMenu->GetName();
7367 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME))&& _pListFlashMainMenu->GetShowState() == true)
7373 if (_pListWbMainMenu != null)
7375 listName = _pListWbMainMenu->GetName();
7377 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME))&& _pListWbMainMenu->GetShowState() == true)
7383 if (_pListViewCameraTabSubMenu != null)
7385 if (_pListViewCameraTabSubMenu->GetShowState() == true)
7391 if (_pListViewGeneralTabSubMenu != null)
7393 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
7399 ShowExposureSlider();
7401 MakeSettingPopupTab(false);
7404 __isOrientationChanged = false;
7406 AppLogDebug("EXIT");
7410 CameraForm::HidePopup(void)
7412 AppLogDebug("ENTER");
7413 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
7415 if (_pListViewCameraTabSubMenu)
7417 if (_pCameraInfoSubPanel != null)
7419 _pCameraInfoSubPanel->SetShowState(false);
7422 _pListViewCameraTabSubMenu->SetShowState(false);
7425 if (_pListViewCameraTabMainMenu)
7427 _pListViewCameraTabMainMenu->SetShowState(false);
7430 if (_pListFlashMainMenu)
7432 _pListFlashMainMenu->SetShowState(false);
7435 if (_pListWbMainMenu)
7437 _pListWbMainMenu->SetShowState(false);
7440 if (_pListViewGeneralTabSubMenu)
7442 if (_pCameraInfoGeneralSubPanel != null)
7444 _pCameraInfoGeneralSubPanel->SetShowState(false);
7446 _pListViewGeneralTabSubMenu->SetShowState(false);
7449 if (_pListViewGeneralTabMainMenu)
7451 _pListViewGeneralTabMainMenu->SetShowState(false);
7454 _pCameraInfoPanel->SetDrawExposure(false);
7455 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7456 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7457 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7458 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7460 if (__isOrientationChanged)
7462 __isOrientationChanged = false;
7463 _pCameraInfoPanel->Invalidate(true);
7467 _pCameraInfoPanel->Draw();
7468 _pCameraInfoPanel->Show();
7470 __resolutionChange = false;
7471 AppLogDebug("EXIT");
7475 CameraForm::CheckStorageInfo(void)
7477 AppLogDebug("ENTER");
7478 result r = E_SUCCESS;
7479 MessageBox messageBox;
7481 String strTemp = L"";
7482 int remainedNum = 0;
7484 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
7485 AppLogDebug("CheckStorageInfo remainedNum = %d", remainedNum);
7487 if (remainedNum == STORAGE_VALUE_ZERO)
7489 if (__lowMemoryCapacity == false)
7491 __lowMemoryCapacity = true;
7492 __isMemoryFull = false;
7493 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);
7495 else if (__lowMemoryCapacity == true)
7497 __isMemoryFull = true;
7498 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
7500 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
7502 r = messageBox.ShowAndWait(result);
7503 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
7507 case MSGBOX_RESULT_OK:
7509 if (__lowMemoryCapacity == true)
7511 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7512 _pCameraInfoPanel->SetStorageTitle(strTemp);
7513 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7514 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7515 _pCameraInfoPanel->Invalidate(true);
7518 if (__isMemoryFull == true)
7520 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7521 _pCameraInfoPanel->SetStorageTitle(strTemp);
7522 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7523 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7524 _pCameraInfoPanel->Invalidate(true);
7532 //r = TerminateApp();
7533 //TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
7537 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
7539 _pCameraInfoPanel->SetStorageTitle(strTemp);
7540 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
7541 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
7542 _pCameraInfoPanel->Invalidate(true);
7545 SetExifOrientation(__deviceOrientation);
7549 AppLogDebug("EXIT");*/
7553 CameraForm::AppControlRequestHideButton(void)
7555 AppLogDebug("ENTER");
7556 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7557 const IMap* pArguments = pApp->GetAppControlArguments();
7558 if (pArguments == null)
7560 AppLogDebug("pAllowSwtich is null");
7561 if (__pCameraIconLabel)
7563 __pCameraIconLabel->SetShowState(true);
7566 if (__pCamcoderIconLabel)
7568 __pCamcoderIconLabel->SetShowState(true);
7573 __pSwButton->SetShowState(true);
7578 AppLogDebug("pAllowSwitch is not null");
7579 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7580 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7582 AppLogDebug("ALLOW_SWITCH_TRUE");
7584 if (__isTimerRunning)
7586 if (__pCameraIconLabel)
7588 __pCameraIconLabel->SetShowState(false);
7591 if (__pCamcoderIconLabel)
7593 __pCamcoderIconLabel->SetShowState(false);
7598 __pSwButton->SetShowState(false);
7603 if (__pCameraIconLabel)
7605 __pCameraIconLabel->SetShowState(true);
7608 if (__pCamcoderIconLabel)
7610 __pCamcoderIconLabel->SetShowState(true);
7615 __pSwButton->SetShowState(true);
7621 AppLogDebug("ALLOW_SWITCH_FALSE");
7622 if (__pCameraIconLabel)
7624 __pCameraIconLabel->SetShowState(false);
7627 if (__pCamcoderIconLabel)
7629 __pCamcoderIconLabel->SetShowState(false);
7634 __pSwButton->SetShowState(false);
7638 AppLogDebug("EXIT");
7642 CameraForm::HideUiActionButton(void)
7644 AppLogDebug("ENTER");
7645 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7647 AppControlRequestHideButton();
7651 if (__pCameraIconLabel)
7653 __pCameraIconLabel->SetShowState(true);
7656 if (__pCamcoderIconLabel)
7658 __pCamcoderIconLabel->SetShowState(true);
7663 __pSwButton->SetShowState(true);
7666 AppLogDebug("EXIT");
7670 CameraForm::HideUiPanel(bool state)
7672 AppLogDebug("ENTER");
7675 _pFlashButton->SetShowState(false);
7676 _pSelfShotButton->SetShowState(false);
7677 _pSettingButton->SetShowState(false);
7678 __pSettingLine->SetShowState(false);
7680 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7682 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7683 const IMap* pArguments = pApp->GetAppControlArguments();
7684 if (pArguments == null)
7686 AppLogDebug("pArguments is null");
7687 if (__pCameraIconLabel)
7689 __pCameraIconLabel->SetShowState(false);
7692 if (__pCamcoderIconLabel)
7694 __pCamcoderIconLabel->SetShowState(false);
7699 __pSwButton->SetShowState(false);
7704 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7705 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7707 if (__isTimerRunning)
7709 if (__pCameraIconLabel)
7711 __pCameraIconLabel->SetShowState(false);
7714 if (__pCamcoderIconLabel)
7716 __pCamcoderIconLabel->SetShowState(false);
7721 __pSwButton->SetShowState(false);
7726 if (__pCameraIconLabel)
7728 __pCameraIconLabel->SetShowState(true);
7731 if (__pCamcoderIconLabel)
7733 __pCamcoderIconLabel->SetShowState(true);
7738 __pSwButton->SetShowState(true);
7744 AppLogDebug("ALLOW_SWITCH_FALSE");
7745 if (__pCameraIconLabel)
7747 __pCameraIconLabel->SetShowState(false);
7750 if (__pCamcoderIconLabel)
7752 __pCamcoderIconLabel->SetShowState(false);
7757 __pSwButton->SetShowState(false);
7764 if (__isTimerRunning)
7766 __pCameraIconLabel->SetShowState(false);
7767 __pCamcoderIconLabel->SetShowState(false);
7768 __pSwButton->SetShowState(false);
7772 __pCameraIconLabel->SetShowState(true);
7773 __pCamcoderIconLabel->SetShowState(true);
7774 __pSwButton->SetShowState(true);
7779 _pQuickSettingButton->SetShowState(false);
7780 _pWhiteBalanceButton->SetShowState(false);
7781 _pExposureValueButton->SetShowState(false);
7782 _pCloseButton->SetShowState(false);
7783 __pShutterButton->SetShowState(false);
7784 __pThumbnailButton->SetShowState(false);
7785 _pThumbnailPanel->SetShowState(false);
7787 if (__screenMode == SCREEN_MODE_NORMAL)
7789 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7790 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7795 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7797 if (__pThumbnailButton)
7799 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
7801 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
7802 SetControlAlwaysOnTop(*__pThumbnailButton, false);
7806 if (_pThumbnailPanel)
7808 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
7810 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
7811 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
7815 _pFlashButton->SetShowState(false);
7816 _pSelfShotButton->SetShowState(true);
7817 _pSettingButton->SetShowState(true);
7818 __pSettingLine->SetShowState(true);
7819 _pQuickSettingButton->SetShowState(false);
7820 _pWhiteBalanceButton->SetShowState(false);
7821 _pExposureValueButton->SetShowState(false);
7822 _pCloseButton->SetShowState(false);
7824 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7826 AppControlRequestHideButton();
7830 __pCameraIconLabel->SetShowState(true);
7831 __pCamcoderIconLabel->SetShowState(true);
7832 __pSwButton->SetShowState(true);
7835 __pShutterButton->SetShowState(true);
7836 __pThumbnailButton->SetShowState(true);
7837 _pThumbnailPanel->SetShowState(true);
7839 if (__screenMode == SCREEN_MODE_NORMAL)
7841 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7842 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7846 if (__screenMode == SCREEN_MODE_FULL)
7855 AppLogDebug("EXIT");
7859 CameraForm::HideUiSettingMenu(void)
7861 AppLogDebug("ENTER");
7862 if (_pCameraInfoPanel)
7864 _pCameraInfoPanel->SetDrawExposure(false);
7865 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7866 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7867 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7868 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7871 if (_pListViewCameraTabSubMenu)
7873 if (_pCameraInfoSubPanel != null)
7875 _pCameraInfoSubPanel->SetShowState(false);
7878 _pListViewCameraTabSubMenu->SetShowState(false);
7881 if (_pListViewCameraTabMainMenu)
7883 _pListViewCameraTabMainMenu->SetShowState(false);
7886 if (_pListFlashMainMenu)
7888 _pListFlashMainMenu->SetShowState(false);
7891 if (_pListWbMainMenu)
7893 _pListWbMainMenu->SetShowState(false);
7896 if (_pListViewGeneralTabSubMenu)
7898 if (_pCameraInfoGeneralSubPanel != null)
7900 _pCameraInfoGeneralSubPanel->SetShowState(false);
7902 _pListViewGeneralTabSubMenu->SetShowState(false);
7905 if (_pListViewGeneralTabMainMenu)
7907 _pListViewGeneralTabMainMenu->SetShowState(false);
7909 AppLogDebug("EXIT");
7913 CameraForm::HideUiQuickMenu(void)
7915 AppLogDebug("ENTER");
7916 if (_pSelfShotButton != null)
7918 _pSelfShotButton->SetShowState(true);
7919 _pSelfShotButton->Invalidate(true);
7922 if (_pSettingButton != null)
7924 _pSettingButton->SetShowState(true);
7925 _pSettingButton->Invalidate(true);
7928 if (__pSettingLine != null)
7930 __pSettingLine->SetShowState(true);
7931 __pSettingLine->Invalidate(true);
7934 if (_pCameraInfoPanel != null)
7936 _pCameraInfoPanel->SetDrawIndicator(true);
7937 _pCameraInfoPanel->Invalidate(true);
7940 if (_pFlashButton != null)
7942 _pFlashButton->SetShowState(false);
7943 _pFlashButton->Invalidate(true);
7946 if (_pQuickSettingButton != null)
7948 _pQuickSettingButton->SetShowState(false);
7949 _pQuickSettingButton->Invalidate(true);
7952 if (_pWhiteBalanceButton != null)
7954 _pWhiteBalanceButton->SetShowState(false);
7955 _pWhiteBalanceButton->Invalidate(true);
7958 if (_pExposureValueButton != null)
7960 _pExposureValueButton->SetShowState(false);
7961 _pExposureValueButton->Invalidate(true);
7964 if (_pCloseButton != null)
7966 _pCloseButton->SetShowState(false);
7967 _pCloseButton->Invalidate(true);
7969 AppLogDebug("EXIT");
7973 CameraForm::ShowUiQuickMenu(void)
7975 AppLogDebug("ENTER");
7976 if (_pCameraInfoPanel != null)
7978 _pCameraInfoPanel->SetDrawIndicator(false);
7979 _pCameraInfoPanel->Invalidate(true);
7982 if (_pSelfShotButton != null)
7984 _pSelfShotButton->SetShowState(false);
7985 _pSelfShotButton->Invalidate(true);
7988 if (_pSettingButton != null)
7990 _pSettingButton->SetShowState(false);
7991 _pSettingButton->Invalidate(true);
7994 if (__pSettingLine != null)
7996 __pSettingLine->SetShowState(false);
7997 __pSettingLine->Invalidate(true);
8000 if (_pFlashButton != null)
8002 _pFlashButton->SetShowState(true);
8003 _pFlashButton->Invalidate(true);
8006 if (_pQuickSettingButton != null)
8008 _pQuickSettingButton->SetShowState(true);
8009 _pQuickSettingButton->Invalidate(true);
8012 if (_pWhiteBalanceButton != null)
8014 _pWhiteBalanceButton->SetShowState(true);
8015 _pWhiteBalanceButton->Invalidate(true);
8018 if (_pExposureValueButton != null)
8020 _pExposureValueButton->SetShowState(true);
8021 _pExposureValueButton->Invalidate(true);
8024 if (_pCloseButton != null)
8026 _pCloseButton->SetShowState(true);
8027 _pCloseButton->Invalidate(true);
8029 AppLogDebug("EXIT");
8033 CameraForm::SetCameraMode(bool isWideMode)
8035 AppLogDebug("ENTER");
8036 result r = E_SUCCESS;
8037 Dimension normalMode(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
8038 Dimension resolutionDim;
8039 Dimension captureResolutionDim;
8040 IList* pList = null;
8041 int previewResolutionSize = 0;
8042 int resolutionCnt = 0;
8043 int resolutionRatio = 0;
8045 int tempResolutionIndex = 0;
8047 int selfPortraitEnable = 0;
8048 BufferInfo bufferinfo;
8050 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
8051 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8053 if (isWideMode == true)
8055 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8059 resolutionCnt = pList->GetCount();
8061 if (resolutionCnt > 0)
8063 for (index = 0; index < resolutionCnt; index++)
8065 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8067 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
8069 if (resolutionRatio > NORMAL_MODE_RATIO)
8076 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(count - INDEX_UNIT_ONE)));
8077 __previewResolutionWidth = resolutionDim.width;
8078 __previewResolutionHeight = resolutionDim.height;
8082 __previewResolutionWidth = PREVIEW_RESOLOTION_WIDTH;
8083 __previewResolutionHeight = PREVIEW_RESOLOTION_HEIGHT;
8086 AppLogDebug("Wide Mode W[%d] x H[%d]", resolutionDim.width, resolutionDim.height);
8088 _pCameraPresentationModel->SetPreviewResolution(resolutionDim);
8092 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8093 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
8095 _pCameraPresentationModel->SetPreviewResolution(normalMode);
8097 __previewResolutionWidth = normalMode.width;
8098 __previewResolutionHeight = normalMode.height;
8100 AppLogDebug("Normal Mode W[%d] x H[%d]", normalMode.width, normalMode.height);
8102 if (__isToggleCameraDirection)
8104 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8106 resolutionCnt = pList->GetCount();
8108 AppLogDebug("pList resolutionCnt = %d", resolutionCnt);
8110 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8112 captureResolutionDim.width = __captureResolutionWidth;
8114 captureResolutionDim.height = __captureResolutionHeight;
8116 if (resolutionCnt > 0)
8118 for (index = 0; index < resolutionCnt; index++)
8120 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8122 if (resolutionDim == captureResolutionDim)
8124 tempResolutionIndex = index;
8126 AppLogDebug("primary captureResolutionDim == W:%d H:%d for index = %d", resolutionDim.width, resolutionDim.height, index);
8130 __primaryCurrentResolutionIndex = resolutionCnt - tempResolutionIndex;
8133 AppLogDebug("__primaryCurrentResolutionIndex = %d", __primaryCurrentResolutionIndex);
8137 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
8138 __captureResolutionWidth = captureResolutionDim.width;
8139 __captureResolutionHeight = captureResolutionDim.height;
8141 AppLogDebug("secondary captureResolutionDim : w->%d x h->%d", captureResolutionDim.width, captureResolutionDim.height);
8146 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8147 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
8149 _pCameraPresentationModel->StartPreview(&bufferinfo);
8151 _pCameraPresentationModel->SetContinuousAutoFocus();
8153 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8155 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8156 AppLogDebug("EXIT");
8160 CameraForm::SetOverlayRendererRotation(void)
8162 AppLogDebug("ENTER");
8163 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8167 case ORIENTATION_STATUS_PORTRAIT:
8169 AppLogDebug("ORIENTATION_STATUS_PORTRAIT");
8170 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8174 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8176 AppLogDebug("ORIENTATION_STATUS_PORTRAIT_REVERSE");
8177 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8181 case ORIENTATION_STATUS_LANDSCAPE:
8183 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE");
8184 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8188 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8190 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE_REVERSE");
8191 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8198 AppLogDebug("EXIT");
8202 CameraForm::CreateOverlayRegion(Rectangle rect)
8204 AppLogDebug("ENTER");
8205 result r = E_SUCCESS;
8207 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8208 r = __pOverlayPanel->Construct(rect);
8209 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8210 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8212 r = AddControl(__pOverlayPanel);
8213 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8214 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8216 __pOverlayPanel->AddTouchEventListener(*this);
8218 AppLogDebug("EXIT");
8222 RemoveControl(__pOverlayPanel);
8223 __pOverlayPanel = null;
8224 AppLogDebug("EXIT - CATCH");
8229 CameraForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8231 AppLogDebug("ENTER");
8232 bool modified = false;
8233 bool isValidRect = false;
8234 Dimension dim = Dimension(0, 0);
8235 bool isToCompensated = false;
8236 Dimension dimRendererSize;
8237 result r = E_SUCCESS;
8239 if (destroyOverlay == true)
8241 if (__pOverlayPanel)
8243 __pOverlayPanel->RemoveTouchEventListener(*this);
8244 RemoveControl(__pOverlayPanel);
8245 __pOverlayPanel = null;
8248 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8249 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8251 if (isWideMode == false)
8253 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8254 r = GetLastResult();
8258 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8259 r = GetLastResult();
8261 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8262 TryReturn(r == E_SUCCESS, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(r));
8264 if (modified == true)
8266 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8269 if (__dir == ORIENTATION_STATUS_PORTRAIT
8270 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8272 if (evaluateBoundsRect.height == rect.height)
8274 isToCompensated = false;
8278 isToCompensated = true;
8283 if (evaluateBoundsRect.width == rect.width)
8285 isToCompensated = false;
8289 isToCompensated = true;
8293 r = CreateOverlayRegion(rect);
8294 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8296 if (isToCompensated == true)
8298 AppLogDebug("isToCompensated = true");
8300 rect = __pOverlayPanel->GetBounds();
8301 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8303 r = __pOverlayPanel->SetBounds(rect);
8304 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8307 dimRendererSize = __pOverlayPanel->GetSize();
8308 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8310 __pOverlayPanel->SetRenderSize(dimRendererSize);
8314 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8316 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8317 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8319 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8320 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8322 if (modified == true)
8324 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8327 if (__dir == ORIENTATION_STATUS_PORTRAIT
8328 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8330 if (evaluateBoundsRect.height == rect.height)
8332 isToCompensated = false;
8336 isToCompensated = true;
8341 if (evaluateBoundsRect.width == rect.width)
8343 isToCompensated = false;
8347 isToCompensated = true;
8351 r = __pOverlayPanel->SetBounds(rect);
8352 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8353 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8355 if (isToCompensated == true)
8357 rect = __pOverlayPanel->GetBounds();
8358 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8360 r = __pOverlayPanel->SetBounds(rect);
8361 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8362 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8365 dimRendererSize = __pOverlayPanel->GetSize();
8366 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8367 __pOverlayPanel->SetRenderSize(dimRendererSize);
8369 AppLogDebug("EXIT");
8373 RemoveControl(__pOverlayPanel);
8374 __pOverlayPanel = null;
8375 AppLogDebug("EXIT - CATCH");
8380 CameraForm::SetOverlayPanelNormalMode(bool isRemoved)
8382 AppLogDebug("ENTER");
8383 result r = E_SUCCESS;
8384 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8385 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8386 Rectangle clientRect = GetClientAreaBounds();
8388 if (__dir == ORIENTATION_STATUS_PORTRAIT
8389 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8391 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8393 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8394 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8398 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8399 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8404 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8406 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8407 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8411 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8412 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8416 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8417 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8418 AppLogDebug("EXIT");
8422 CameraForm::SetOverlayPanelWideMode(bool isRemoved)
8424 AppLogDebug("ENTER");
8425 result r = E_SUCCESS;
8426 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8427 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8428 Rectangle clientRect = GetClientAreaBounds();
8430 if (__dir == ORIENTATION_STATUS_PORTRAIT
8431 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8433 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8435 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8439 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8444 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8446 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8450 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8454 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8455 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8456 AppLogDebug("EXIT");
8460 CameraForm::SetControlAlwaysOnTopPanel(void)
8462 AppLogDebug("ENTER");
8463 if (__pSettingPanel)
8465 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
8467 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
8468 SetControlAlwaysOnTop(*__pSettingPanel, true);
8474 if (IsControlAlwaysOnTop(__pActionPanel) == false)
8476 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
8477 SetControlAlwaysOnTop(*__pActionPanel, true);
8483 if (IsControlAlwaysOnTop(_pFlashButton) == false)
8485 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
8486 SetControlAlwaysOnTop(*_pFlashButton, true);
8490 if (_pSelfShotButton)
8492 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
8494 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8495 SetControlAlwaysOnTop(*_pSelfShotButton, true);
8499 if (_pSettingButton)
8501 if (IsControlAlwaysOnTop(_pSettingButton) == false)
8503 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
8504 SetControlAlwaysOnTop(*_pSettingButton, true);
8510 if (IsControlAlwaysOnTop(__pSettingLine) == false)
8512 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
8513 SetControlAlwaysOnTop(*__pSettingLine, true);
8517 if (__pCameraIconLabel)
8519 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
8521 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8522 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
8526 if (__pCamcoderIconLabel)
8528 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
8530 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
8531 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
8535 if (_pQuickSettingButton)
8537 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
8539 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
8540 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
8544 if (_pWhiteBalanceButton)
8546 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
8548 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
8549 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
8553 if (_pExposureValueButton)
8555 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
8557 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
8558 SetControlAlwaysOnTop(*_pExposureValueButton, true);
8564 if (IsControlAlwaysOnTop(_pCloseButton) == false)
8566 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
8567 SetControlAlwaysOnTop(*_pCloseButton, true);
8571 if (__pBatteryState)
8573 if (IsControlAlwaysOnTop(__pBatteryState) == false)
8575 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
8576 SetControlAlwaysOnTop(*__pBatteryState, true);
8582 if (IsControlAlwaysOnTop(__pSwButton) == false)
8584 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
8585 SetControlAlwaysOnTop(*__pSwButton, true);
8590 if (__pShutterButton)
8592 if (IsControlAlwaysOnTop(__pShutterButton) == false)
8594 AppLogDebug("IsControlAlwaysOnTop __pShutterButton");
8595 SetControlAlwaysOnTop(*__pShutterButton, true);
8599 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
8601 if (__pThumbnailButton)
8603 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
8605 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8606 SetControlAlwaysOnTop(*__pThumbnailButton, false);
8610 if (_pThumbnailPanel)
8612 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
8614 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8615 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
8621 if (__pThumbnailButton)
8623 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
8625 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8626 SetControlAlwaysOnTop(*__pThumbnailButton, true);
8630 if (_pThumbnailPanel)
8632 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
8634 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8635 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
8640 if (_pHelpGoToGallery)
8642 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
8644 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
8645 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
8649 if (_pHelpGoToGalleryText)
8651 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
8653 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
8654 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
8658 if (_pHelpSwitchCamera)
8660 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
8662 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
8663 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
8667 if (_pHelpSwitchCameraText)
8669 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
8671 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
8672 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
8676 if (_pHelpQuickSetting)
8678 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
8680 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
8681 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
8685 if (_pHelpQuickSettingText)
8687 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
8689 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
8690 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
8694 if (_pHelpRecordVideo)
8696 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
8698 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
8699 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
8703 if (_pHelpRecordVideoText)
8705 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
8707 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
8708 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
8714 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
8716 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
8717 SetControlAlwaysOnTop(*_pHelpShutter, true);
8721 if (_pHelpShutterText)
8723 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
8725 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
8726 SetControlAlwaysOnTop(*_pHelpShutterText, true);
8730 if (__pCameraSetting)
8732 if (IsControlAlwaysOnTop(__pCameraSetting) == false)
8734 AppLogDebug("IsControlAlwaysOnTop __pCameraSetting");
8735 SetControlAlwaysOnTop(*__pCameraSetting, true);
8739 if (__pCameraSettingLable)
8741 if (IsControlAlwaysOnTop(__pCameraSettingLable) == false)
8743 AppLogDebug("IsControlAlwaysOnTop __pCameraSettingLable");
8744 SetControlAlwaysOnTop(*__pCameraSettingLable, true);
8748 if (__pGeneralSetting)
8750 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
8752 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
8753 SetControlAlwaysOnTop(*__pGeneralSetting, true);
8757 if (__pGeneralSettingLable)
8759 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
8761 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
8762 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
8765 AppLogDebug("EXIT");
8769 CameraForm::HidePanel(bool isWideMode, bool isInvalidated)
8771 AppLogDebug("ENTER");
8772 result r = E_SUCCESS;
8774 SetControlAlwaysOnTopPanel();
8776 if (isWideMode == true)
8778 AppLogDebug("Wide MODE");
8780 if (__pSettingPanel)
8782 r = __pSettingPanel->SetShowState(false);
8783 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8788 r = __pActionPanel->SetShowState(false);
8789 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8794 AppLogDebug("Normal MODE");
8796 if (__pSettingPanel)
8798 r = __pSettingPanel->SetShowState(true);
8799 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8804 r = __pActionPanel->SetShowState(true);
8805 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8809 if (isInvalidated == true)
8818 AppLogDebug("EXIT");
8822 CameraForm::SetScreenMode(const ScreenMode mode, bool destory)
8824 AppLogDebug("ENTER");
8825 result r = E_SUCCESS;
8827 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8831 case SCREEN_MODE_NORMAL:
8833 if (destory == true)
8835 if (__screenMode != mode)
8837 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8838 _pAppTimer->Cancel();
8840 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8841 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8843 _pCameraPresentationModel->KeepScreenOnState(true, false);
8845 _pCameraPresentationModel->StopCamera();
8849 if (__isToggleCameraDirection || __resolutionChange)
8851 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8852 _pAppTimer->Cancel();
8854 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8855 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8857 _pCameraPresentationModel->KeepScreenOnState(true, false);
8859 _pCameraPresentationModel->StopCamera();
8863 SetOverlayPanelNormalMode(true);
8865 SetOverlayRendererRotation();
8867 if (__screenMode != mode)
8869 SetCameraMode(false);
8873 if (__isToggleCameraDirection || __resolutionChange)
8875 SetCameraMode(false);
8879 __screenMode = SCREEN_MODE_NORMAL;
8883 SetOverlayPanelNormalMode(false);
8885 SetOverlayRendererRotation();
8887 __screenMode = SCREEN_MODE_NORMAL;
8890 if (__pOverlayPanel != null)
8892 __pOverlayPanel->RemoveTouchEventListener(*this);
8895 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8896 HidePanel(false, false);
8900 case SCREEN_MODE_FULL:
8902 if (destory == true)
8904 if (__screenMode != mode)
8906 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8907 _pAppTimer->Cancel();
8909 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8910 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8912 _pCameraPresentationModel->KeepScreenOnState(true, false);
8914 _pCameraPresentationModel->StopCamera();
8918 if (__isToggleCameraDirection || __resolutionChange)
8920 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8921 _pAppTimer->Cancel();
8923 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8924 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8926 _pCameraPresentationModel->KeepScreenOnState(true, false);
8928 _pCameraPresentationModel->StopCamera();
8932 SetOverlayPanelWideMode(true);
8934 SetOverlayRendererRotation();
8936 if (__screenMode != mode)
8938 SetCameraMode(true);
8942 if (__isToggleCameraDirection || __resolutionChange)
8944 SetCameraMode(true);
8948 __screenMode = SCREEN_MODE_FULL;
8952 SetOverlayPanelWideMode(false);
8954 SetOverlayRendererRotation();
8956 __screenMode = SCREEN_MODE_FULL;
8959 if (__pOverlayPanel != null)
8961 __pOverlayPanel->AddTouchEventListener(*this);
8964 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8965 HidePanel(true, false);
8973 AppLogDebug("EXIT");
8977 _pCameraInfoPanel->SetOverlayPanelMode(SCREEN_MODE_NORMAL);
8978 __screenMode = SCREEN_MODE_NORMAL;
8984 CameraForm::BackButtonPerformed(void)
8986 AppLogDebug("ENTER");
8987 result r = E_SUCCESS;
8989 if (_pHelpGoToGallery->GetShowState() == true)
8991 AppLogDebug("EXIT - Screen Overlay Help");
8992 OnHelpCloseTimerExpired();
8996 if (_pCameraPresentationModel->GetPreviewState() == false)
8998 AppLogDebug("EXIT - StartPreview do not call");
9002 if (_pCameraInfoPanel->GetDrawExposure() == true)
9004 _closeTimerValue = 0;
9006 if (_pExposureCloseTimer)
9008 _pExposureCloseTimer->Cancel();
9011 _pCameraInfoPanel->SetDrawExposure(false);
9016 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9018 r = PressBackButton();
9019 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
9023 if (__isTimerRunning == true)
9025 OnTimerCapturePause();
9031 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
9036 AppLogDebug("EXIT");
9040 AppLogDebug("EXIT - CATCH");
9045 CameraForm::PressBackButton(void)
9047 AppLogDebug("ENTER");
9048 result r = E_SUCCESS;
9050 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9052 AppLogDebug("PressBackButton >> Back to the App");
9054 if (_pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED)
9056 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
9060 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
9063 AppLogDebug("EXIT");
9068 CameraForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
9070 AppLogDebug("ENTER");
9071 result r = E_SUCCESS;
9072 bool focusSupport = false;
9073 int selfPortraitEnable = 0;
9075 if (__isTimerRunning == false)
9077 AppLogDebug("__isTimerRunning:false");
9079 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9080 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9082 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9084 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9088 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9091 if (focusSupport == true && r == E_SUCCESS)
9093 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9094 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9095 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9096 _pCameraInfoPanel->Invalidate(true);
9100 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9101 _pCameraInfoPanel->Invalidate(true);
9103 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
9107 AppLogDebug("__isTimerRunning:true");
9109 AppLogDebug("EXIT");
9113 CameraForm::DoCapture(void)
9115 AppLogDebug("ENTER");
9116 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9118 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9119 _pAppTimer->Cancel();
9123 _timeCount = INDEX_UNIT_ZERO;
9124 _pPopupTimer->Cancel();
9127 if (_pExposureCloseTimer)
9129 _pExposureCloseTimer->Cancel();
9132 if (_pCameraInfoPanel->GetDrawExposure() == true)
9134 _pCameraInfoPanel->SetDrawExposure(false);
9138 if (_pTouchAutoFocusTimer)
9140 _pTouchAutoFocusTimer->Cancel();
9143 if (_pChargingTimer)
9145 _pChargingTimer->Cancel();
9150 _pCameraInfoPanel->CheckAvailableStorageSpace();
9152 AppLogDebug("EXIT");
9156 CameraForm::SetUri(const Tizen::Base::String& uri)
9158 AppLogDebug("ENTER");
9159 AppLogDebug("[URI] %ls", uri.GetPointer());
9160 __uri = String(uri);
9161 AppLogDebug("EXIT");
9165 CameraForm::SetMime(const Tizen::Base::String& mime)
9167 AppLogDebug("ENTER");
9168 AppLogDebug("[MIME] %ls", mime.GetPointer());
9169 __mime = String(mime);
9170 AppLogDebug("EXIT");
9173 const Tizen::Base::String&
9174 CameraForm::GetUri(void) const
9176 AppLogDebug("ENTER");
9177 AppLogDebug("EXIT");
9181 const Tizen::Base::String&
9182 CameraForm::GetMime(void) const
9184 AppLogDebug("ENTER");
9185 AppLogDebug("EXIT");
9190 CameraForm::LaunchImageview(void)
9192 AppLogDebug("ENTER");
9193 result r = E_SUCCESS;
9194 const String* filePath = null;
9195 String listIndex = L"";
9196 String* temp = null;
9202 _timeCount = INDEX_UNIT_ZERO;
9203 _pPopupTimer->Cancel();
9206 if (_pExposureCloseTimer)
9208 _pExposureCloseTimer->Cancel();
9213 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
9214 pExtraData->Construct();
9216 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9217 pArrayList->Construct();
9219 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9220 pContentPathList->Construct();
9222 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9223 if (pContentPathList == null)
9227 AppLogDebug("EXIT - pContentPathList is null");
9231 loopCount = _pCameraPresentationModel->GetContentCount();
9232 for (index = 0; index < loopCount; ++index)
9234 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
9235 AppLogDebug("filePath = %ls", filePath->GetPointer());
9236 pArrayList->Add(new (std::nothrow) String(*filePath));
9239 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
9240 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
9242 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
9243 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
9246 SetMime(MIME_TYPE_VALUE_IMAGE);
9248 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
9249 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
9251 loopCount = pArrayList->GetCount();
9252 for (int i = 0; i < loopCount; ++i)
9254 temp = static_cast<String*>(pArrayList->GetAt(i));
9255 AppLog("print temp(%ls)", temp->GetPointer());
9257 AppLogDebug("EXIT");
9261 CameraForm::InDrawFocus(void)
9263 AppLogDebug("ENTER");
9264 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9265 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9266 Rectangle clientRect = GetClientAreaBounds();
9267 result r = E_SUCCESS;
9268 int selfPortraitEnable = 0;
9269 Point currentPosition;
9270 bool focusSupport = false;
9272 if (__dir == ORIENTATION_STATUS_PORTRAIT
9273 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9275 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9276 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9277 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9278 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9282 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9283 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9284 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9285 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9288 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9289 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9291 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9293 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9297 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9300 if (focusSupport == true && r == E_SUCCESS)
9302 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9303 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9304 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9308 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9309 _pCameraInfoPanel->Draw();
9310 _pCameraInfoPanel->Show();
9312 AppLogDebug("EXIT");
9316 CameraForm::GetCameraToForeground(void)
9318 AppLogDebug("ENTER");
9319 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9320 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9321 Rectangle clientRect = GetClientAreaBounds();
9322 result r = E_SUCCESS;
9323 Dimension previewResolutionDim;
9324 Dimension captureResolutionDim;
9325 int previewResolutionSize = 0;
9326 BufferInfo bufferinfo;
9328 __isLockScreenMode = false;
9330 _pCameraPresentationModel->KeepScreenOnState(true, false);
9332 StartInitAppTimer();
9334 StartPreviewFailPopupTimer();
9336 _batteryStatus = GetCurrentBatteryState();
9337 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9339 StartInitChargingTimer();
9341 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9342 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
9346 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
9347 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9349 __previewResolutionWidth = previewResolutionDim.width;
9350 __previewResolutionHeight = previewResolutionDim.height;
9352 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
9353 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9355 AppLogDebug("__screenMode [%d]", __screenMode);
9357 r = SetScreenMode(__screenMode, false);
9358 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
9360 if (__dir == ORIENTATION_STATUS_PORTRAIT
9361 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9363 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9367 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9372 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9373 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
9375 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9376 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9378 _pCameraPresentationModel->StartPreview(&bufferinfo);
9380 _pCameraPresentationModel->SetContinuousAutoFocus();
9382 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
9384 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
9386 SetCameraSettingsDevice();
9387 AppLogDebug("EXIT");
9391 CameraForm::SendCameraToBackground(void)
9393 AppLogDebug("ENTER");
9394 if (__isTimerRunning == true)
9397 _timeCount = INDEX_UNIT_ZERO;
9398 __isTimerRunning = false;
9399 _pCameraPresentationModel->SetIntervalTimerRun(false);
9400 _isUsedTimerCaptured = false;
9402 if (_pIntervalValueTimer != null)
9404 _pIntervalValueTimer->Cancel();
9407 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9408 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9409 _pCameraInfoPanel->SetDrawPopupTimer(false);
9410 _pCameraInfoPanel->Invalidate(true);
9414 if (_pAppTimer != null)
9416 _pAppTimer->Cancel();
9419 if (_pChargingTimer != null)
9422 _pChargingTimer->Cancel();
9425 if (_pChargingCompletedTimer != null)
9429 _pChargingCompletedTimer->Cancel();
9432 if (_pPreviewFailPopupTimer != null)
9434 _pPreviewFailPopupTimer->Cancel();
9437 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9438 _pCameraInfoPanel->Invalidate(true);
9442 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9443 _pCameraPresentationModel->StopCamera();
9444 _pCameraPresentationModel->KeepScreenOnState(false, true);
9446 AppLogDebug("EXIT");
9450 CameraForm::DrawThumbnail(void)
9452 AppLogDebug("ENTER");
9453 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9455 if (__pThumbnailButton)
9457 __pThumbnailButton->SetShowState(true);
9458 __pThumbnailButton->Draw();
9459 __pThumbnailButton->Show();
9462 if (_pThumbnailPanel)
9464 _pThumbnailPanel->SetShowState(false);
9465 _pThumbnailPanel->Draw();
9466 _pThumbnailPanel->Show();
9471 if (__pThumbnailButton)
9473 __pThumbnailButton->SetShowState(false);
9474 __pThumbnailButton->Draw();
9475 __pThumbnailButton->Show();
9478 if (_pThumbnailPanel)
9480 _pThumbnailPanel->SetShowState(true);
9481 _pThumbnailPanel->Draw();
9482 _pThumbnailPanel->Show();
9485 AppLogDebug("EXIT");
9489 CameraForm::SetCameraErrorOccurred(void)
9491 AppLogDebug("ENTER");
9492 result r = E_SUCCESS;
9493 Point currentPosition;
9494 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9495 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9496 int guideLineEnable = 0;
9497 BufferInfo bufferinfo;
9499 if (__dir == ORIENTATION_STATUS_PORTRAIT
9500 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9502 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9503 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9507 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9508 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9511 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9512 _pAppTimer->Cancel();
9514 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9515 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9517 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9518 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9520 _pCameraPresentationModel->StartPreview(&bufferinfo);
9522 _pCameraPresentationModel->SetContinuousAutoFocus();
9524 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
9525 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9527 if (guideLineEnable == DISABLE_GUIDELINE)
9540 _isUsedTimerCaptured = false;
9541 AppLogDebug("EXIT");
9545 CameraForm::SetScreenOverlayHelpTimer(void)
9547 AppLogDebug("ENTER");
9548 result r = E_SUCCESS;
9549 int overlayHelpEnable = 0;
9551 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9552 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9554 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
9556 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
9558 _pHelpCloseTimer = new (std::nothrow) Timer();
9559 _pHelpCloseTimer->Construct(*this);
9561 r = _pHelpCloseTimer->Start(CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE);
9562 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
9565 AppLogDebug("EXIT");
9569 delete _pHelpCloseTimer;
9570 _pHelpCloseTimer = null;
9572 AppLogDebug("EXIT - CATCH");
9577 CameraForm::DrawScreenOverlayHelp(void)
9579 AppLogDebug("ENTER");
9580 Bitmap* pBitmap = null;
9581 result r = E_SUCCESS;
9582 int overlayHelpEnable = 0;
9583 String ovelayHelpStr = L"";
9584 bool checkAppControlSwitch = false;
9585 //AppResource* pAppResource = null;
9587 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
9588 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
9589 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
9590 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
9591 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
9592 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
9593 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
9594 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
9595 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
9596 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
9598 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9599 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9601 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
9603 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
9605 HideScreenOverlayHelp();
9609 //pAppResource = Application::GetInstance()->GetAppResource();
9610 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
9612 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
9614 _pHelpGoToGallery->SetShowState(true);
9615 //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
9616 ovelayHelpStr = L"GO to Gallery";
9617 _pHelpGoToGalleryText->SetText(ovelayHelpStr);
9618 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9619 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9620 _pHelpGoToGalleryText->SetShowState(true);
9623 _pHelpSwitchCamera->SetShowState(true);
9624 //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
9625 ovelayHelpStr = L"Switch camera";
9626 _pHelpSwitchCameraText->SetText(ovelayHelpStr);
9627 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9628 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9629 _pHelpSwitchCameraText->SetShowState(true);
9631 _pHelpQuickSetting->SetShowState(true);
9632 //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
9633 ovelayHelpStr = L"Quick Settings";
9634 _pHelpQuickSettingText->SetText(ovelayHelpStr);
9635 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9636 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9637 _pHelpQuickSettingText->SetShowState(true);
9640 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9642 checkAppControlSwitch = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetAppControlSwitch();
9646 checkAppControlSwitch = true;
9649 if (checkAppControlSwitch)
9651 _pHelpRecordVideo->SetShowState(true);
9652 //pAppResource->GetString(L"IDS_HELP_CAPTURE_IMAGE", ovelayHelpStr);
9653 ovelayHelpStr = L"Capture image";
9654 _pHelpRecordVideoText->SetText(ovelayHelpStr);
9655 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9656 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9657 _pHelpRecordVideoText->SetShowState(true);
9660 _pHelpShutter->SetShowState(true);
9661 //pAppResource->GetString(L"IDS_HELP_SHUTTER", ovelayHelpStr);
9662 ovelayHelpStr = L"Shutter";
9663 _pHelpShutterText->SetText(ovelayHelpStr);
9664 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9665 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9666 _pHelpShutterText->SetShowState(true);
9668 if (__dir == ORIENTATION_STATUS_PORTRAIT
9669 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9671 _pHelpGoToGalleryText->Invalidate(true);
9672 _pHelpSwitchCameraText->Invalidate(true);
9673 _pHelpQuickSettingText->Invalidate(true);
9674 _pHelpRecordVideoText->Invalidate(true);
9675 _pHelpShutterText->Invalidate(true);
9677 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9678 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9680 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9681 _pHelpGoToGallery->Invalidate(true);
9686 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9687 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9689 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9690 _pHelpSwitchCamera->Invalidate(true);
9695 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9696 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9698 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9699 _pHelpQuickSetting->Invalidate(true);
9704 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
9705 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9707 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9708 _pHelpRecordVideo->Invalidate(true);
9713 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
9714 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9716 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9717 _pHelpShutter->Invalidate(true);
9722 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
9723 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9730 _pHelpGoToGalleryText->Invalidate(true);
9731 _pHelpSwitchCameraText->Invalidate(true);
9732 _pHelpQuickSettingText->Invalidate(true);
9733 _pHelpRecordVideoText->Invalidate(true);
9734 _pHelpShutterText->Invalidate(true);
9736 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9737 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9739 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9740 _pHelpGoToGallery->Invalidate(true);
9745 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
9746 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9748 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9749 _pHelpSwitchCamera->Invalidate(true);
9754 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9755 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9757 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9758 _pHelpQuickSetting->Invalidate(true);
9763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9764 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9766 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9767 _pHelpRecordVideo->Invalidate(true);
9772 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9773 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9775 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9776 _pHelpShutter->Invalidate(true);
9781 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9782 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9789 AppLogDebug("EXIT");
9793 AppLogDebug("EXIT - CATCH");
9798 CameraForm::CheckCameraSettingLabel(void)
9800 AppLogDebug("ENTER");
9801 if (__pCameraSettingLable)
9803 result r = E_SUCCESS;
9805 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9806 _pAppTimer->Cancel();
9808 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9809 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9811 if (_pListViewGeneralTabMainMenu)
9813 _pListViewGeneralTabMainMenu->SetShowState(false);
9816 if (_pListViewGeneralTabSubMenu)
9818 _pListViewGeneralTabSubMenu->SetShowState(false);
9821 MakeCameraTabSettingPopup();
9823 AppLogDebug("Exit");
9827 CameraForm::CheckGeneralSettingLabel(void)
9829 AppLogDebug("ENTER");
9830 if(__pGeneralSettingLable)
9832 result r = E_SUCCESS;
9834 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9835 _pAppTimer->Cancel();
9837 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9838 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9840 if (_pListViewCameraTabMainMenu)
9842 _pListViewCameraTabMainMenu->SetShowState(false);
9844 if (_pListViewCameraTabSubMenu)
9846 _pListViewCameraTabSubMenu->SetShowState(false);
9849 MakeGeneralTabSettingPopup();
9851 AppLogDebug("Exit");
9855 CameraForm::DrawBatteryLevelFull(void)
9857 AppLogDebug("ENTER");
9858 Bitmap* pBitmap = null;
9859 result r = E_SUCCESS;
9861 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9863 if (__dir == ORIENTATION_STATUS_PORTRAIT
9864 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9866 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9870 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9873 _batteryStatus = BATTERY_STATE_20;
9875 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
9876 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9878 __pBatteryState->SetBackgroundBitmap(*pBitmap);
9879 __pBatteryState->Invalidate(true);
9884 AppLogDebug("EXIT");
9888 AppLogDebug("EXIT - CATCH");
9893 CameraForm::CheckBatteryStatus(void)
9895 AppLogDebug("ENTER");
9896 Bitmap* pBitmap = null;
9897 result r = E_SUCCESS;
9898 int batteryLevel = 0;
9899 bool isCharging = false;
9901 Battery::IsCharging(isCharging);
9902 Battery::GetCurrentLevelInPercentage(batteryLevel);
9904 AppLogDebug("isCharging = %d", isCharging);
9905 AppLogDebug("batteryLevel = %d", batteryLevel);
9907 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9909 if (__dir == ORIENTATION_STATUS_PORTRAIT
9910 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9912 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9916 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9921 _batteryStatus = GetCurrentBatteryState();
9922 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9924 int currentImage = GetCurrentBatteryImage();
9926 AppLogDebug("currentImage = %d", currentImage);
9928 pBitmap = ResourceManager::GetBitmapN(currentImage);
9930 StartInitChargingTimer();
9934 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
9936 _batteryStatus = BATTERY_STATE_20;
9938 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
9940 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
9942 _batteryStatus = BATTERY_STATE_19;
9944 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
9946 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
9948 _batteryStatus = BATTERY_STATE_18;
9950 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
9952 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
9954 _batteryStatus = BATTERY_STATE_17;
9956 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
9958 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
9960 _batteryStatus = BATTERY_STATE_16;
9962 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
9964 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
9966 _batteryStatus = BATTERY_STATE_15;
9968 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
9970 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
9972 _batteryStatus = BATTERY_STATE_14;
9974 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
9976 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
9978 _batteryStatus = BATTERY_STATE_13;
9980 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
9982 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
9984 _batteryStatus = BATTERY_STATE_12;
9986 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
9988 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
9990 _batteryStatus = BATTERY_STATE_11;
9992 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
9994 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
9996 _batteryStatus = BATTERY_STATE_10;
9998 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
10000 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
10002 _batteryStatus = BATTERY_STATE_9;
10004 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
10006 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
10008 _batteryStatus = BATTERY_STATE_8;
10010 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
10012 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
10014 _batteryStatus = BATTERY_STATE_7;
10016 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
10018 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
10020 _batteryStatus = BATTERY_STATE_6;
10022 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
10024 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
10026 _batteryStatus = BATTERY_STATE_5;
10028 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
10030 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
10032 _batteryStatus = BATTERY_STATE_4;
10034 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
10036 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
10038 _batteryStatus = BATTERY_STATE_3;
10040 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
10042 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
10044 _batteryStatus = BATTERY_STATE_2;
10046 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
10048 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
10050 _batteryStatus = BATTERY_STATE_1;
10052 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
10054 else if (batteryLevel == BATT_LEVEL_VALUE_00)
10056 _batteryStatus = BATTERY_STATE_0;
10058 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
10061 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10063 AppLogDebug("_batteryStatus = %d", _batteryStatus);
10065 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10066 __pBatteryState->Invalidate(true);
10071 AppLogDebug("EXIT");
10075 AppLogDebug("EXIT - CATCH");
10080 CameraForm::CancelTimer(void)
10082 AppLogDebug("ENTER");
10083 if (_pAppTimer != null)
10085 _pAppTimer->Cancel();
10088 if (_pIntervalValueTimer != null)
10090 _pIntervalValueTimer->Cancel();
10093 if (_pCaptureStartTimer != null)
10095 _pCaptureStartTimer->Cancel();
10098 if (_pTouchAutoFocusTimer != null)
10100 _pTouchAutoFocusTimer->Cancel();
10105 _pPopupTimer->Cancel();
10108 if (_pExposureCloseTimer)
10110 _pExposureCloseTimer->Cancel();
10113 if (_pHelpCloseTimer)
10115 _pHelpCloseTimer->Cancel();
10118 if (_pChargingTimer)
10120 _chargingCount = INDEX_UNIT_ZERO;
10122 _pChargingTimer->Cancel();
10125 if (_pChargingCompletedTimer != null)
10127 _chargingCount = 0;
10129 _pChargingCompletedTimer->Cancel();
10132 if (_pPreviewFailPopupTimer != null)
10134 _pPreviewFailPopupTimer->Cancel();
10136 AppLogDebug("EXIT");
10140 CameraForm::MakeCameraTabMenuString(void)
10142 AppLogDebug("ENTER");
10145 result r = E_SUCCESS;
10146 AppResource* pAppResource = null;
10148 if (__pSettingMenuString == null)
10150 pAppResource = Application::GetInstance()->GetAppResource();
10151 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10153 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
10155 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
10157 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10159 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10160 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
10163 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
10164 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
10166 pAppResource->GetString(IDS_CAM_BODY_ISO, tmpString);
10167 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_01] = tmpString;
10168 pAppResource->GetString(IDS_CAM_BODY_AUTO, tmpString);
10169 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_02] = tmpString;
10170 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_03] = IDS_MENU_ISO_50;
10171 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_04] = IDS_MENU_ISO_100;
10172 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_05] = IDS_MENU_ISO_200;
10173 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_06] = IDS_MENU_ISO_400;
10174 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_07] = IDS_MENU_ISO_800;
10176 AppLogDebug("EXIT");
10180 if (__pSettingMenuString)
10182 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10184 if (__pSettingMenuString[idx])
10186 delete [] __pSettingMenuString[idx];
10187 __pSettingMenuString[idx] = null;
10195 delete __pSettingMenuString;
10196 __pSettingMenuString = null;
10203 CameraForm::MakeGeneralTabMenuString(void)
10205 AppLogDebug("ENTER");
10208 result r = E_SUCCESS;
10209 AppResource* pAppResource = null;
10211 if (__pSettingGeneralMenuString == null)
10213 pAppResource = Application::GetInstance()->GetAppResource();
10214 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10216 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
10218 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
10220 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10222 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10223 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
10226 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
10227 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
10229 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10230 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
10231 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
10232 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
10233 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
10234 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
10235 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
10236 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
10238 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
10239 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
10240 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10241 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
10242 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
10243 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
10245 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
10246 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
10247 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
10248 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
10249 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
10250 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
10252 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
10253 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
10255 //pAppResource->GetString(IDS_CAM_OVERLAY_HELP_VALUE, tmpString);
10256 //__pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
10257 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
10259 AppLogDebug("EXIT");
10263 if (__pSettingGeneralMenuString)
10265 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10267 if (__pSettingGeneralMenuString[idx])
10269 delete [] __pSettingGeneralMenuString[idx];
10270 __pSettingGeneralMenuString[idx] = null;
10278 delete __pSettingGeneralMenuString;
10279 __pSettingGeneralMenuString = null;
10286 CameraForm::RunStartPreviewThread(void)
10288 AppLogDebug("ENTER");
10289 result r = E_SUCCESS;
10291 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
10292 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10294 __pCameraStarterThread = CameraStarterThread::GetInstance();
10295 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
10297 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
10298 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10300 r = __pCameraStarterThread->Start();
10301 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10303 AppLogDebug("EXIT");
10307 ShowCameraFailPopup();
10309 AppLogDebug("EXIT - CATCH");
10314 CameraForm::SubListPopupTimerMode(int index)
10316 AppLogDebug("ENTER");
10317 result r = E_SUCCESS;
10320 __settingTimeInterval = index;
10323 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
10324 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10326 _pCameraInfoPanel->SetTimerType(regVal);
10327 _pCameraInfoPanel->Invalidate(true);
10329 AppLogDebug("EXIT");
10333 AppLogDebug("EXIT - CATCH");
10338 CameraForm::SubListPopupIsoMode(int index)
10340 AppLogDebug("ENTER");
10341 result r = E_SUCCESS;
10343 int selfPortraitEnable = 0;
10344 int updatedIndex = 0;
10346 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10347 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10349 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10351 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10355 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10358 if (r == E_SUCCESS)
10362 updatedIndex = index + 2;
10366 updatedIndex = index + 3;
10368 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
10371 __settingIsoIndex = index;
10372 regVal = __settingIsoIndex;
10374 r = _pCameraPresentationModel->SetValue(ISO_VALUE, regVal);
10375 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10377 AppLogDebug("EXIT");
10381 AppLogDebug("EXIT - CATCH");
10386 CameraForm::SubListPopupWhiteBalanceMode(int index)
10388 AppLogDebug("ENTER");
10389 result r = E_SUCCESS;
10391 String strRegKey = IDS_INIT_REG_KEY;
10392 int selfPortraitEnable = 0;
10394 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10395 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10397 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10399 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
10403 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
10406 if (r == E_SUCCESS)
10408 r = _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
10410 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10412 __settingWhiteBalance = index;
10413 regVal = __settingWhiteBalance;
10415 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10417 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
10418 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10422 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
10423 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10426 AppLogDebug("regVal = %d",regVal);
10428 AppLogDebug("EXIT");
10432 AppLogDebug("EXIT - CATCH");
10437 CameraForm::SubListPopupGuidelineMode(int index)
10439 AppLogDebug("ENTER");
10440 int value = SUBMENU_MODE_OFF;
10441 result r = E_SUCCESS;
10443 String strRegKey = IDS_INIT_REG_KEY;
10447 case SUBMENU_MODE_OFF:
10449 AppLogDebug("Setting - Guideline = off");
10450 value = SUBMENU_MODE_OFF;
10452 r = DrawMarker(false);
10453 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10457 case SUBMENU_MODE_ON:
10459 AppLogDebug("Setting - Guideline = on");
10460 value = SUBMENU_MODE_ON;
10462 r = DrawMarker(true);
10463 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10471 SetGuideLine(value);
10474 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
10475 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10477 AppLogDebug("EXIT");
10481 AppLogDebug("EXIT - CATCH");
10486 CameraForm::SubListPopupOverlayHelpMode(int index)
10488 AppLogDebug("ENTER");
10489 int value = SUBMENU_MODE_OFF;
10490 result r = E_SUCCESS;
10492 String strRegKey = IDS_INIT_REG_KEY;
10496 case SUBMENU_MODE_OFF:
10498 value = SUBMENU_MODE_OFF;
10502 case SUBMENU_MODE_ON:
10504 value = SUBMENU_MODE_ON;
10514 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
10515 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10517 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
10519 r = SetScreenOverlayHelpTimer();
10520 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
10522 r = DrawScreenOverlayHelp();
10523 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
10525 AppLogDebug("EXIT");
10529 AppLogDebug("EXIT - CATCH");
10534 CameraForm::SubListPopupResolutionMode(int index)
10536 AppLogDebug("ENTER");
10537 IList* pList = _pCameraPresentationModel->GetCaptureResolutionList();
10538 int resolutionCnt = 0;
10539 BufferInfo bufferinfo;
10540 int resolutionRatio = 0;
10541 result r = E_SUCCESS;
10543 int selfPortraitEnable = 0;
10545 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10549 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
10550 Dimension dimCaptureResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
10552 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10553 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: __captureResolution(W:%d, H:%d)", __captureResolutionWidth, __captureResolutionHeight);
10555 if ((__captureResolutionWidth == dimCaptureResolution.width ) && (__captureResolutionHeight == dimCaptureResolution.height))
10557 AppLogDebug("CAPTURE RESOLUTION Same");
10561 _pCameraPresentationModel->StopPreview();
10563 _pCameraPresentationModel->SetCaptureResolution(dimCaptureResolution);
10565 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10567 r = _pCameraPresentationModel->SetValue(PRIMARY_RESOLUTION_INDEX,index);
10568 AppLogDebug("result is %s",GetErrorMessage(r));
10572 r = _pCameraPresentationModel->SetValue(SECONDARY_RESOLUTION_INDEX,index);
10575 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10577 resolutionRatio = (dimCaptureResolution.width * MULTIPLY_BY_TEN) / (dimCaptureResolution.height);
10579 AppLogDebug("resolutionRatio (W:%d)", resolutionRatio);
10581 __resolutionChange = true;
10583 __captureResolutionWidth = dimCaptureResolution.width;
10585 __captureResolutionHeight = dimCaptureResolution.height;
10587 if (resolutionRatio > NORMAL_MODE_RATIO)
10589 r = SetScreenMode(SCREEN_MODE_FULL, true);
10593 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
10595 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
10597 AppLogDebug("__screenMode [%d]", __screenMode);
10601 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10603 __primaryCurrentResolutionIndex = index;
10604 regVal = __primaryCurrentResolutionIndex;
10608 __secondaryCurrentResolutionIndex = index;
10609 regVal = __secondaryCurrentResolutionIndex;
10611 __resolutionChange = false;
10613 AppLogDebug("EXIT");
10617 AppLogDebug("EXIT - CATCH");
10622 CameraForm::SubListPopupStorageTypeMode(int index)
10624 AppLogDebug("ENTER");
10625 int storage = STORAGE_TYPE_PHONE;
10626 String filePath = L"";
10627 result r = E_SUCCESS;
10631 case SUBMENU_STORAGE_TYPE_PHONE:
10633 AppLogDebug("Setting - Storage type = Phone");
10634 storage = STORAGE_TYPE_PHONE;
10635 SetStorageType(storage);
10639 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
10641 AppLogDebug("Setting - Storage type = card");
10642 storage = STORAGE_TYPE_MEMORYCARD;
10644 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
10646 SetStorageType(storage);
10650 storage = SUBMENU_STORAGE_TYPE_PHONE;
10651 AppLogDebug("Setting - don't draw t-flash icon");
10658 AppLogDebug("Setting - Storage, Invaild element id");
10663 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
10667 _pCameraInfoPanel->SetStorageType(storage);
10668 _pCameraInfoPanel->Invalidate(true);
10670 if (__pFileEventManager == null)
10672 __pFileEventManager = new (std::nothrow) FileEventManager();
10673 r = __pFileEventManager->Construct(*this);
10674 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10677 filePath = _pCameraPresentationModel->GetfilePath(storage);
10678 AppLogDebug("filePath %ls", filePath.GetPointer());
10681 if (File::IsFileExist(__pFileEventPath))
10683 __pFileEventManager->RemovePath(__pFileEventPath);
10686 if (File::IsFileExist(filePath))
10688 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
10689 __pFileEventPath = filePath;
10691 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10692 AppLogDebug("EXIT");
10696 CameraForm::CreateCameraTabMainMenuItem(int index, int itemWidth)
10698 AppLogDebug("ENTER");
10699 CustomItem* pItem = null;
10700 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
10701 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
10702 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
10703 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
10704 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
10705 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
10706 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
10707 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
10709 result r = E_SUCCESS;
10712 int cameraResolutionCount = 0;
10713 int storageType = STORAGE_TYPE_PHONE;
10714 String listName = L"";
10715 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS,
10716 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
10718 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE,
10719 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
10720 int selfPortraitEnable = 0;
10721 String strTmp = L"";
10723 pItem = new (std::nothrow) CustomItem();
10724 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
10726 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
10727 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
10729 elementId = (index * MENU_TWO_ELEMENT);
10731 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10732 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10734 strTmp = __pSettingMenuString[index][0];
10736 if (strTmp.GetLength())
10738 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
10740 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10742 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10744 if (r == E_SUCCESS)
10746 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10747 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10751 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);
10752 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10755 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10757 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
10759 if (r == E_SUCCESS)
10761 if (__pCaptureResolutionList != null)
10763 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10766 if (cameraResolutionCount > 1)
10768 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10772 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);
10774 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10778 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);
10779 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10784 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10785 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10790 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10792 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10794 if (r == E_SUCCESS && __pIsoList->GetCount()>1)
10796 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10797 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10801 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);
10802 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10805 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10807 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
10809 if (r == E_SUCCESS)
10811 cameraResolutionCount = 0;
10812 if (__pCaptureResolutionList != null)
10814 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10817 if (cameraResolutionCount > 1)
10819 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10823 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);
10825 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10829 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);
10830 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10835 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10836 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10841 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
10842 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10844 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
10846 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
10847 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10848 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
10851 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10853 if (__pCaptureResolutionList)
10855 int idx = __pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
10858 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10860 AppLogDebug("CAM_SELF_PORTRAIT_MODE_PRIMARY");
10861 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
10864 if (__primaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10866 __primaryCurrentResolutionIndex = __primaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10868 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10872 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10879 AppLogDebug("CAM_SELF_PORTRAIT_MODE_SECONDARY");
10880 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
10882 if (__secondaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10884 __secondaryCurrentResolutionIndex = __secondaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10886 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10890 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10896 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10900 int idx = __pIsoList->GetCount() - INDEX_UNIT_ONE;
10901 if (idx >= INDEX_UNIT_ZERO)
10903 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
10905 if (regVal == INDEX_UNIT_ZERO)
10907 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
10911 strTmp = *(static_cast<String*>(__pIsoList->GetAt(regVal)));
10917 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
10922 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
10927 if (strTmp.GetLength())
10929 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
10931 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10933 if (__pIsoList != null)
10935 if (__pIsoList->GetCount() >1)
10937 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);
10938 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10942 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);
10943 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10948 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);
10949 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10954 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
10955 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10960 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10962 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10964 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10968 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10971 if (r == E_SUCCESS)
10973 cameraResolutionCount = 0;
10974 if (__pCaptureResolutionList != null)
10976 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10979 if (cameraResolutionCount > 1)
10981 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
10985 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);
10987 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10991 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);
10992 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10997 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
10998 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11001 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11002 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11005 AppLogDebug("EXIT");
11012 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11013 AppLogDebug("EXIT - CATCH");
11018 CameraForm::CreateCameraTabSubMenuItem(int index, int itemWidth)
11020 AppLogDebug("ENTER");
11021 CustomItem* pItem = null;
11022 Bitmap* pBitmap = null;
11023 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11024 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11025 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11026 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11027 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11028 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11029 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11030 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11031 AppResource* pAppResource = null;
11033 result r = E_SUCCESS;
11036 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
11038 pItem = new (std::nothrow) CustomItem();
11039 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11041 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11042 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11044 pAppResource = Application::GetInstance()->GetAppResource();
11045 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11047 idx = GetCameraTabSettingSubMenuMode();
11050 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
11052 ResourceId resId = RESOURCE_ID_ISO_AUTO;
11056 case SUBMENU_ISO_AUTO:
11058 resId = RESOURCE_ID_ISO_AUTO;
11062 case SUBMENU_ISO_100:
11064 resId = RESOURCE_ID_ISO_100;
11068 case SUBMENU_ISO_200:
11070 resId = RESOURCE_ID_ISO_200;
11074 case SUBMENU_ISO_400:
11076 resId = RESOURCE_ID_ISO_400;
11080 case SUBMENU_ISO_800:
11082 resId = RESOURCE_ID_ISO_800;
11090 String arrString[] =
11099 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11100 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11105 if (__pIsoList->GetCount() > index)
11107 if (index == regVal)
11109 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11113 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11116 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11117 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11122 AppLogDebug("ISO index return is = %d", index);
11124 if (index == INDEX_UNIT_ZERO)
11126 pAppResource->GetString(arrString[index], str);
11130 str = *(static_cast<String*>(__pIsoList->GetAt(index)));
11134 pBitmap = ResourceManager::GetBitmapN(resId);
11135 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11137 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11138 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11144 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);
11145 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11151 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
11153 int selfPortraitEnable = 0;
11155 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11156 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11159 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY )
11161 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
11162 AppLogDebug("resolution index is %d",__primaryCurrentResolutionIndex);
11163 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11167 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
11168 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11171 if (__pCaptureResolutionList)
11174 if (__pCaptureResolutionList->GetCount() > index)
11176 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11178 if (index == __primaryCurrentResolutionIndex)
11180 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11184 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11189 if (index == __secondaryCurrentResolutionIndex)
11191 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11195 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11199 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11200 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11207 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11208 AppLogDebug("str = %ls", str.GetPointer());
11209 if (str.Equals(String(PHOTO_SIZE_3264_2488)))
11211 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11213 else if (str.Equals(String(PHOTO_SIZE_3264_2176)))
11215 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11217 else if (str.Equals(String(PHOTO_SIZE_3264_1836)))
11219 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11221 else if (str.Equals(String(PHOTO_SIZE_2048_1536)))
11223 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11225 else if (str.Equals(String(PHOTO_SIZE_2048_1152)))
11227 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11229 else if (str.Equals(String(PHOTO_SIZE_1280_720)))
11231 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.9M
11233 else if (str.Equals(String(PHOTO_SIZE_640_480)))
11235 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11239 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11241 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11243 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11244 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11249 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11252 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);
11253 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11263 AppLogDebug("EXIT");
11273 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11274 AppLogDebug("EXIT - CATCH");
11279 CameraForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11281 AppLogDebug("ENTER");
11282 CustomItem* pItem = null;
11283 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11284 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11285 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11286 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11287 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11288 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11289 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11290 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11292 result r = E_SUCCESS;
11295 String listName = L"";
11296 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11297 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11299 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11300 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11301 int selfPortraitEnable = 0;
11302 String strTmp = L"";
11304 String arrRegStringSuppor[] =
11309 OVERLAY_HELP_ENABLE,
11312 pItem = new (std::nothrow) CustomItem();
11313 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11315 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11316 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11318 elementId = (index * MENU_TWO_ELEMENT);
11320 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11321 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11323 strTmp = __pSettingGeneralMenuString[index][0];
11326 if (strTmp.GetLength())
11328 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11329 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11332 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11334 int storageType = STORAGE_TYPE_PHONE;
11336 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11337 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11339 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11341 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11342 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11343 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11346 r = _pCameraPresentationModel->GetValue(arrRegStringSuppor[index], regVal);
11347 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11349 AppLogDebug("Setting Main Menu");
11350 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11351 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11353 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11357 if (strTmp.GetLength())
11359 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11360 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11362 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11363 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11367 AppLogDebug("EXIT");
11374 AppLogDebug("EXIT - CATCH");
11379 CameraForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
11381 AppLogDebug("ENTER");
11382 CustomItem* pItem = null;
11383 Bitmap* pBitmap = null;
11384 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11385 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11386 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11387 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11388 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11389 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11390 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11391 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11392 AppResource* pAppResource = null;
11394 result r = E_SUCCESS;
11398 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
11400 pItem = new (std::nothrow) CustomItem();
11401 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11403 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11404 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11406 pAppResource = Application::GetInstance()->GetAppResource();
11407 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11409 idx = GetGeneralTabSettingSubMenuMode();
11412 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
11414 ResourceId resId = RESOURCE_ID_TIMER_OFF;
11418 case SETTING_TIMER_CAPTURE_0_SEC:
11420 resId = RESOURCE_ID_TIMER_OFF;
11424 case SETTING_TIMER_CAPTURE_2_SEC:
11426 resId = RESOURCE_ID_TIMER_2SEC;
11430 case SETTING_TIMER_CAPTURE_5_SEC:
11432 resId = RESOURCE_ID_TIMER_5SEC;
11436 case SETTING_TIMER_CAPTURE_10_SEC:
11438 resId = RESOURCE_ID_TIMER_10SEC;
11446 String arrString[] =
11449 IDS_CAM_BODY_2_SEC,
11450 IDS_CAM_BODY_5_SEC,
11451 IDS_CAM_BODY_10_SEC,
11454 pAppResource->GetString(arrString[index], tmpString);
11456 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
11457 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11459 if (index == regVal)
11461 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11465 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11467 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11469 elementId = (index * MENU_TWO_ELEMENT);
11471 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11472 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11475 pBitmap = ResourceManager::GetBitmapN(resId);
11477 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11478 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11479 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11484 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);
11485 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11489 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
11491 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
11495 case SUBMENU_GUIDELINE_OFF:
11497 resId = RESOURCE_ID_GUIDELINE_OFF;
11501 case SUBMENU_GUIDELINE_ON:
11503 resId = RESOURCE_ID_GUIDELINE_ON;
11511 elementId = (index * MENU_TWO_ELEMENT);
11513 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
11514 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11516 if (index == regVal)
11518 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11522 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11524 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11526 if (index == SUBMENU_MODE_OFF)
11528 str = IDS_CAM_BODY_OFF;
11532 str = IDS_CAM_BODY_ON;
11535 pAppResource->GetString(str, tmpString);
11537 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11538 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11545 pBitmap = ResourceManager::GetBitmapN(resId);
11546 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11548 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11549 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11555 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);
11556 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11560 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
11562 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
11566 case SUBMENU_MODE_OFF:
11568 resId = RESOURCE_ID_STORAGE_PHONE;
11572 case SUBMENU_MODE_ON:
11574 resId = RESOURCE_ID_STORAGE_CARD;
11582 elementId = (index * MENU_TWO_ELEMENT);
11584 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
11585 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11587 if (index == regVal)
11589 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11593 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11595 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11597 if (index == STORAGE_TYPE_PHONE)
11599 str = IDS_CAM_BODY_PHONE;
11603 str = IDS_CAM_OPT_MEMORY_CARD;
11606 pAppResource->GetString(str, tmpString);
11608 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11609 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11615 pBitmap = ResourceManager::GetBitmapN(resId);
11616 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11618 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11619 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11626 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
11628 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
11630 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);
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);
11639 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);
11641 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11645 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
11654 AppLogDebug("EXIT");
11664 AppLogDebug("EXIT - CATCH");
11669 CameraForm::CreateFlashMainMenuItem(int index, int itemWidth)
11671 AppLogDebug("ENTER");
11672 CustomItem* pItem = null;
11673 Bitmap* pBitmap = null;
11674 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11675 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11676 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11677 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11678 String listName = L"";
11679 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11680 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11681 AppResource* pAppResource = null;
11683 result r = E_SUCCESS;
11686 bool value = false;
11687 int selfPortraitEnable = 0;
11689 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11691 String arrString[] =
11698 pItem = new (std::nothrow) CustomItem();
11699 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11701 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11702 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11704 pAppResource = Application::GetInstance()->GetAppResource();
11705 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11707 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11708 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11710 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11712 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11714 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11715 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11717 if (flashMode != FLASH_MODE_OFF)
11719 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11720 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11725 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11727 if (value == true && r == E_SUCCESS)
11729 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11733 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11735 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11736 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11738 if (flashMode != FLASH_MODE_OFF)
11740 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11741 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11746 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11747 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11751 case SUBMENU_MODE_OFF:
11753 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
11757 case SUBMENU_MODE_ON:
11759 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11763 case SUBMENU_MODE_AUTO:
11765 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
11773 pAppResource->GetString(arrString[index], tmpString);
11775 if (index == regVal)
11777 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11781 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11783 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11785 elementId = (index * MENU_TWO_ELEMENT);
11787 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11788 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11794 pBitmap = ResourceManager::GetBitmapN(resId);
11795 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11797 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11798 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11805 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11807 if (value == true && r == E_SUCCESS)
11809 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11810 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11814 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);
11815 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11818 AppLogDebug("EXIT");
11828 AppLogDebug("EXIT - CATCH");
11833 CameraForm::CreateWhiteBalanceItem(int index, int itemWidth)
11835 AppLogDebug("ENTER");
11836 CustomItem* pItem = null;
11837 Bitmap* pBitmap = null;
11838 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11839 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11840 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11841 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11842 String listName = L"";
11843 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11844 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11846 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11847 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11849 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11850 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11851 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11852 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11853 AppResource* pAppResource = null;
11855 result r = E_SUCCESS;
11858 int selfPortraitEnable = 0;
11859 ResourceId resId = RESOURCE_ID_WB_AWB;
11861 String arrString[] =
11864 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
11865 IDS_CAM_BODY_FLUORESCENT,
11866 IDS_CAM_BODY_DAYLIGHT,
11867 IDS_CAM_BODY_CLOUDY,
11870 pItem = new (std::nothrow) CustomItem();
11871 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11873 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11874 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11876 pAppResource = Application::GetInstance()->GetAppResource();
11877 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11879 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11880 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11882 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11884 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
11885 if (r != E_SUCCESS)
11887 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, REG_DEFAULT_VAULE_ZERO);
11889 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
11890 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11894 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
11895 if (r != E_SUCCESS)
11897 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, REG_DEFAULT_VAULE_ZERO);
11899 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
11900 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11903 AppLogDebug("regVal = %d", regVal);
11909 resId = RESOURCE_ID_WB_AWB;
11913 case MODE_WHITEBALANCE_INCANDESCENT:
11915 resId = RESOURCE_ID_WB_DAYLIGHT;
11919 case MODE_FLUORESCENT:
11921 resId = RESOURCE_ID_WB_CLOUDY;
11925 case MODE_DAYLIGHT:
11927 resId = RESOURCE_ID_WB_FLUORESCENT_H;
11933 resId = RESOURCE_ID_WB_FLUORESCENT_L;
11941 pAppResource->GetString(arrString[index], tmpString);
11943 if (index == regVal)
11945 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11949 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11951 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11953 elementId = (index * MENU_THREE_ELEMENT);
11955 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11956 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11962 pBitmap = ResourceManager::GetBitmapN(resId);
11963 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11965 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11966 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11972 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);
11973 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11975 AppLogDebug("EXIT");
11985 AppLogDebug("EXIT - CATCH");
11990 CameraForm::UpdatePopUp(void)
11992 bool doHidePopup = false;
11993 MakeSettingPopupTab(false);
11995 doHidePopup = OnTouchDoHidePopup();
11996 AppLogDebug("doHidePopup = %d", doHidePopup);
12004 CameraForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
12006 AppLogDebug("ENTER");
12007 if (!__isTimerRunning)
12009 BackButtonPerformed();
12011 AppLogDebug("Exit");
12015 CameraForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12017 //Empty Implementation
12021 CameraForm::OnKeyPressed(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12023 //Empty Implementation
12027 CameraForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12029 AppLogDebug("Enter");
12033 if ((source.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12035 OnTouchModeSwitch();
12042 AppLogDebug("Exit");
12046 CameraForm::OnAccessibilityActionPerformed (const Control &control, const AccessibilityElement &element)
12048 AppLogDebug("Enter");
12050 if ((control.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12052 OnTouchModeSwitch();
12054 AppLogDebug("Exit");
12058 CameraForm::OnAccessibilityFocusIn (const Control &control, const AccessibilityElement &element)
12060 AppLogDebug("Enter");
12061 AppLogDebug("Exit");
12065 CameraForm::OnAccessibilityFocusOut (const Control &control, const AccessibilityElement &element)
12067 AppLogDebug("Enter");
12068 AppLogDebug("Exit");
12072 CameraForm::OnAccessibilityScreenReaderStatusChanged (const Control &control, const AccessibilityElement &element, AccessibilityScreenReaderStatus status)
12074 AppLogDebug("Enter");
12075 AppLogDebug("Exit");