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_50 = 1;
223 static const int SUBMENU_ISO_100 = 2;
224 static const int SUBMENU_ISO_200 = 3;
225 static const int SUBMENU_ISO_400 = 4;
226 static const int SUBMENU_ISO_800 = 5;
227 static const int SUBMENU_GUIDELINE_OFF = 0;
228 static const int SUBMENU_GUIDELINE_ON = 1;
229 static const int SUBMENU_MODE_OFF = 0;
230 static const int SUBMENU_MODE_ON = 1;
231 static const int SUBMENU_MODE_AUTO = 2;
232 static const int SUBMENU_STORAGE_TYPE_PHONE = 0;
233 static const int SUBMENU_STORAGE_TYPE_MEMORYCARD = 1;
234 static const int SUBMENU_TIMER_COUNT = 4;
235 static const int MAX_ISO_COUNT= 9;
236 static const int SUBMENU_GUIDELINE_COUNT = 2;
237 static const int SUBMENU_STORAGE_TYPE_COUNT = 2;
238 static const int MAX_SUBMENU_CONTENT = 10;
239 static const int DRAW_INITIALIZED = 0;
240 static const int DRAW_MOVED = 1;
241 static const int DRAW_RELEASED = 2;
242 static const int DISABLE_GUIDELINE = 0;
243 static const int EXPOSURE_TIMER_IS_ALIVE = 1;
244 static const int MAX_SETTING_MENU_COUNT = 2;
245 static const int MAX_GENERAL_TAB_SETTING_MENU_COUNT = 5;
246 static const int MAX_FLASH_MENU_COUNT = 3;
247 static const int MAX_WHITE_BALANCE_MENU_COUNT = 5;
248 static const int MENU_COUNT_CLEAR = 0;
249 static const int MENU_MODE_DISABLE = -1;
250 static const int MENU_TWO_ELEMENT = 2;
251 static const int MENU_THREE_ELEMENT = 3;
253 static const int UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN = 2048;
254 static const int MULTIPLY_BY_TEN = 10;
255 static const int NORMAL_MODE_RATIO = 13;
256 static const int PREVIEW_RESOLOTION_WIDTH = 640;
257 static const int PREVIEW_RESOLOTION_HEIGHT = 480;
258 static const int MODE_AUTO = 0;
259 static const int MODE_WHITEBALANCE_INCANDESCENT = 1;
260 static const int MODE_FLUORESCENT = 2;
261 static const int MODE_DAYLIGHT = 3;
262 static const int MODE_CLOUDY = 4;
263 static const int X_INDICATOR_BATTERY_PORTRAIT = 300;
264 static const int Y_INDICATOR_BATTERY_PORTRAIT = 4;
265 static const int X_INDICATOR_BATTERY_LANDSCAPE = 582;
266 static const int Y_INDICATOR_BATTERY_LANDSCAPE = 4;
267 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 10;
268 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 7;
269 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 7;
270 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 55;
271 static const int UNIT_VALUE_ZERO = 0;
272 static const int DISPLAY_WVGA = 1200;
273 static const int SCREEN_OVERLAY_HELP_ENABLE = 1;
274 static const int SCREEN_OVERLAY_HELP_DISABLE = 0;
275 static const int BACK_BUTTON_X_POS = 63;
276 static const int BACK_BUTTON_Y_POS = 63;
277 static const int STRING_BUFFER_SIZE = 32;
278 static const int SUPPORTED_CAMERA_NUM = 1;
280 static const int BRIGHTNESS_DIVIDER_PORTRAIT_MODE = 31;
282 static const wchar_t* IDS_MENU_SETTING_MAIN_MENU_NAME = L"SettingMainMenu";
283 static const wchar_t* IDS_MENU_SETTING_GEN_MAIN_MENU_NAME = L"SettingGenMainMenu";
284 static const wchar_t* IDS_GENERAL_SETTING_SUB_MENU= L"GeneralSettingsSubMenu";
285 static const wchar_t* IDS_CAMERA_SETTING_SUB_MENU= L"CameraSettingsSubMenu";
286 static const wchar_t* IDS_MENU_WB_MENU_NAME = L"WBMenu";
287 static const wchar_t* IDS_WB_BUTTON_NAME = L"WhiteBalanceButton";
288 static const wchar_t* IDS_MENU_FLASH_MENU_NAME = L"FlashMenu";
289 static const wchar_t* IDS_FLASH_BUTTON_NAME = L"FlashButton";
290 static const wchar_t* IDS_THUMBNAIL_PANLE_NAME = L"ThumbnailPanel";
291 static const wchar_t* IDS_CAMERA_INFO_PANEL_NAME = L"CameraInfoPanel";
292 static const wchar_t* IDS_SETTING_UI_PANEL_NAME = L"SettingPanel";
293 static const wchar_t* IDS_ACTION_UI_PANEL_NAME = L"ActionPanel";
294 static const wchar_t* IDS_ACTION_UI_PANEL_CAPTURE_NAME = L"ActionCapture";
295 static const wchar_t* IDS_ACTION_UI_CAMERA_MODE = L"ActionCameraMode";
296 static const wchar_t* IDS_ACTION_BACK = L"ActionBack";
297 static const wchar_t* IDS_INIT_REG_KEY = L"NONE";
298 static const wchar_t* PHOTO_SIZE_640_480 = L"640X480(4:3)";
299 static const wchar_t* PHOTO_SIZE_1280_720 = L"1280X720(16:9)";
300 static const wchar_t* PHOTO_SIZE_3264_2488 = L"3264X2448(4:3)";
301 static const wchar_t* PHOTO_SIZE_3264_2176 = L"3264X2176(16:9)";
302 static const wchar_t* PHOTO_SIZE_3264_1836 = L"3264X1836(16:9)";
303 static const wchar_t* PHOTO_SIZE_2048_1536 = L"2048X1536(4:3)";
304 static const wchar_t* PHOTO_SIZE_2048_1152 = L"2048X1152(16:9)";
306 CameraForm::CameraForm(void)
307 : __pOverlayPanel(null)
308 , __screenMode(SCREEN_MODE_NORMAL)
309 , __cameraTabMainMenuCount(MENU_MODE_DISABLE)
310 , __cameraTabSubMenuCount(MENU_MODE_DISABLE)
311 , __cameraTabSettingMode(CAMERA_TAB_SUB_MENU_CONTENT_MAX)
312 , __generalTabMainMenuCount(MENU_MODE_DISABLE)
313 , __generalTabSubMenuCount(MENU_MODE_DISABLE)
314 , __generalTabSettingMode(GENERAL_TAB_SUB_MENU_CONTENT_MAX)
315 , __settingWhiteBalance(0)
316 , __settingIsoIndex(0)
317 , __settingTimeInterval(0)
318 , __settingExposure(0)
319 , __primaryCurrentResolutionIndex(0)
320 , __secondaryCurrentResolutionIndex(0)
321 , __isTimerRunning(false)
322 , __previewResolutionWidth(0)
323 , __previewResolutionHeight(0)
324 , __captureResolutionWidth(0)
325 , __captureResolutionHeight(0)
326 , __lowMemoryCapacity(false)
327 , __isMemoryFull(false)
328 , __isLockScreenMode(false)
329 , __resolutionChange(false)
330 , __isToggleCameraDirection(false)
331 , __isOrientationChanged(false)
332 , __isProhibitionTouchEvent(false)
333 , __pSettingPanel(null)
334 , __pActionPanel(null)
335 , __dir(ORIENTATION_STATUS_NONE)
336 , __deviceOrientation(DEVICE_PORTRAIT)
337 , __pSettingLine(null)
338 , __pCameraIconLabel(null)
339 , __pCamcoderIconLabel(null)
341 , __pShutterButton(null)
342 , __pThumbnailButton(null)
343 , __pBackButton(null)
344 , __pBatteryState(null)
345 , __pButtonPoint(Point(0, 0))
346 , __pPreviewResolutionList(null)
347 , __pCaptureResolutionList(null)
349 , __pSettingMenuString(null)
350 , __pSettingGeneralMenuString(null)
351 , __pCameraStarterThread(null)
352 , __pCameraSetting(null)
353 , __pGeneralSetting(null)
354 , __pCameraSettingLable(null)
355 , __pGeneralSettingLable(null)
356 , __pFileEventManager(null)
359 , __formStatusFrameDeattivated(false)
361 AppLogDebug("ENTER");
365 CameraForm::~CameraForm(void)
367 AppLogDebug("ENTER");
372 CameraForm::OnInitializing(void)
374 AppLogDebug("ENTER");
375 result r = E_SUCCESS;
376 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
377 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
378 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
379 Point currentPosition;
380 int storageType = STORAGE_TYPE_PHONE;
381 int timerInterval = 0;
382 String filePath = L"";
384 _appControlActionCompleted = false;
385 __formStatusFrameDeattivated = false;
387 AddKeyEventListener(*this);
388 AddOrientationEventListener(*this);
389 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
390 __dir = GetOrientationStatus();
391 __deviceOrientation = __dir;
392 AppLogDebug("__dir = %d && __deviceOrientation = %d", __dir, __deviceOrientation);
394 _pCameraPresentationModel->SetOrientation(__dir);
395 _pCurrentSourceForm = SOURCE_FORM_CAMERA;
398 InitPreviewFailPopupTimer();
399 InitIntervalValueTimer();
400 InitCaptureStartTimer();
401 InitTouchAutoFocusStartTimer();
403 InitChargingCompletedTimer();
405 _isHwKeySupported = ((CameraApp*) Application::GetInstance())->CheckHwKeySupport();
407 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
410 storageType = STORAGE_TYPE_PHONE;
413 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
415 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
416 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
417 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
420 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
421 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
423 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
424 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
426 _pCameraInfoPanel = new (std::nothrow) CameraInfoPanel();
427 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
429 if (__dir == ORIENTATION_STATUS_PORTRAIT
430 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
432 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
433 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
434 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
435 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
439 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
440 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
441 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
442 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
445 if (__dir == ORIENTATION_STATUS_PORTRAIT
446 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
448 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
452 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
455 r = _pCameraInfoPanel->Initialize(rect);
456 TryCatch(r == E_SUCCESS, , "_pCameraInfoPanel Initialize fail[%s]", GetErrorMessage(r));
458 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
459 _pCameraInfoPanel->SetDrawMarkerFocus(true);
460 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
461 _pCameraInfoPanel->SetPreviewResolutionSize(REG_DEFAULT_VAULE_ZERO);
462 _pCameraInfoPanel->SetCurrentMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
463 _pCameraInfoPanel->SetStorageType(storageType);
464 _pCameraInfoPanel->SetTimerType(timerInterval);
465 _pCameraInfoPanel->SetDrawIndicator(true);
466 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
467 _pCameraInfoPanel->AddTouchEventListener(*this);
468 _pCameraInfoPanel->SetName(IDS_CAMERA_INFO_PANEL_NAME);
469 AddOrientationEventListener(*_pCameraInfoPanel);
470 AddControl(_pCameraInfoPanel);
471 SetControlAlwaysOnTop(*_pCameraInfoPanel, true);
473 SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
474 InitSettingMenuPanel();
475 InitActionMenuPanel();
476 InitScreenOverlayHelp();
477 CheckBatteryStatus();
481 __pFileEventManager = new (std::nothrow) FileEventManager();
482 r = __pFileEventManager->Construct(*this);
483 TryCatch(r == E_SUCCESS, , "__pFileEventManager Construct fail[%s]", GetErrorMessage(r));
485 filePath = _pCameraPresentationModel->GetfilePath(storageType);
486 AppLogDebug("filePath %ls", filePath.GetPointer());
488 if (File::IsFileExist(filePath))
490 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
491 __pFileEventPath = filePath;
493 AppLogDebug("FileEventManager()::AddPath() fail[%s]", GetErrorMessage(r));
496 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
497 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
503 delete _pCameraInfoPanel;
505 ShowCameraFailPopup();
507 AppLogDebug("EXIT - CATCH");
512 CameraForm::OnTerminating(void)
514 AppLogDebug("ENTER");
515 result r = E_SUCCESS;
517 _pCameraPresentationModel->KeepScreenOnState(false, true);
519 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
521 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
523 RemoveAllEventListener();
525 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
527 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
528 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
530 if (__isLockScreenMode)
532 AppLogDebug("OnTerminating KEY_POWER_HOLD");
534 __isLockScreenMode = false;
537 __lowMemoryCapacity = false;
539 __isTimerRunning = false;
541 _pCameraPresentationModel->SetIntervalTimerRun(false);
543 __resolutionChange = false;
545 __isToggleCameraDirection = false;
547 __isOrientationChanged = false;
549 __isProhibitionTouchEvent = false;
551 _pCameraPresentationModel = null;
552 __pCameraStarterThread = null;
554 __formStatusFrameDeattivated = false;
558 if (__pPreviewResolutionList)
560 __pPreviewResolutionList->RemoveAll(true);
561 delete __pPreviewResolutionList;
564 if (__pCaptureResolutionList)
566 __pCaptureResolutionList->RemoveAll(true);
567 delete __pCaptureResolutionList;
572 __pIsoList->RemoveAll(true);
576 if (__pSettingMenuString)
579 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
581 delete [] __pSettingMenuString[idx];
583 delete __pSettingMenuString;
586 if (__pSettingGeneralMenuString)
589 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
591 delete [] __pSettingGeneralMenuString[idx];
593 delete __pSettingGeneralMenuString;
596 if (__pFileEventManager != null)
598 delete __pFileEventManager;
599 __pFileEventManager = null;
607 CameraForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
609 AppLogDebug("ENTER");
610 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
611 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
612 Rectangle clientRect = GetClientAreaBounds();
613 result r = E_SUCCESS;
615 Dimension previewResolutionDim;
616 Dimension captureResolutionDim;
617 int previewResolutionSize = 0;
619 int storageType = STORAGE_TYPE_PHONE;
620 BufferInfo bufferinfo;
621 bool isRunStartPreviewThread = false;
622 bool isInitCameraStaus = false;
623 bool isCharging = false;
624 BatteryLevel batteryLevel;
626 __isTimerRunning = false;
628 _pCameraPresentationModel->SetIntervalTimerRun(false);
632 StartPreviewFailPopupTimer();
634 _batteryStatus = GetCurrentBatteryState();
635 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
637 StartInitChargingTimer();
639 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
641 _pCameraPresentationModel->KeepScreenOnState(true, false);
643 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
644 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
648 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
650 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
652 __previewResolutionWidth = previewResolutionDim.width;
653 __previewResolutionHeight = previewResolutionDim.height;
655 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
657 __captureResolutionWidth = captureResolutionDim.width;
658 __captureResolutionHeight = captureResolutionDim.height;
660 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
664 RemoveControl(__pOverlayPanel);
665 __pOverlayPanel = null;
668 AppLogDebug("__screenMode [%d]", __screenMode);
670 r = SetScreenMode(__screenMode, true);
671 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
673 if (__dir == ORIENTATION_STATUS_PORTRAIT
674 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
676 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
677 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
681 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
682 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
685 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
687 _pCameraInfoPanel->SetDrawPopupTimer(false);
689 _pCameraInfoPanel->Invalidate(true);
692 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
693 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
695 if (regVal == DISABLE_GUIDELINE)
706 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
707 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
709 MakeSettingPopupTab(false);
713 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
714 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
716 if (isInitCameraStaus)
718 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
719 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
721 if (isRunStartPreviewThread)
723 r = RunStartPreviewThread();
724 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
726 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
730 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
731 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
733 _pCameraPresentationModel->StartPreview(&bufferinfo);
736 _pCameraPresentationModel->SetContinuousAutoFocus();
738 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
740 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
742 SetCameraSettingsDevice();
745 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
747 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
749 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
750 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
753 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
754 isCharging = _pCameraPresentationModel->IsCharging();
756 AppLogDebug("batteryLevel = %d", batteryLevel);
757 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
759 if (isCharging == false)
765 CheckBatteryStatus();
771 CameraForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
773 AppLogDebug("ENTER");
774 __isTimerRunning = false;
776 _pCameraPresentationModel->SetIntervalTimerRun(false);
778 __resolutionChange = false;
780 __isToggleCameraDirection = false;
782 __isOrientationChanged = false;
784 __isProhibitionTouchEvent = false;
786 OnHelpCloseTimerExpired();
790 MakeSettingPopupTab(false);
796 if (_isUsedTimerCaptured == true)
800 _isUsedTimerCaptured = false;
802 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
804 _pCameraInfoPanel->SetDrawPopupTimer(false);
806 _pCameraInfoPanel->Invalidate(true);
810 if (_pCameraInfoPanel->GetDrawExposure() == true)
812 _pCameraInfoPanel->SetDrawExposure(false);
820 RemoveControl(__pOverlayPanel);
821 __pOverlayPanel = null;
824 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
829 CameraForm::Update(void)
831 AppLogDebug("ENTER");
832 Bitmap* pThumbnailBitmap = null;
833 Bitmap* pRotateBitmap = null;
834 Bitmap* pBitmap = null;
835 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
836 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
837 result r = E_SUCCESS;
839 HideUiActionButton();
841 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
843 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
845 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
847 if (pThumbnailBitmap == null)
849 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
851 _pThumbnailPanel->SetShowState(true);
858 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
860 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
861 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
863 r = pRotateBitmap->Scale(dimScaleSize);
864 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
866 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
867 delete pRotateBitmap;
868 pRotateBitmap = null;
876 AppLogDebug("CameraForm::Update :: Not thummail");
878 _pThumbnailPanel->SetShowState(false);
879 _pThumbnailPanel->Draw();
880 _pThumbnailPanel->Show();
882 __pThumbnailButton->SetShowState(true);
883 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
885 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
886 TryCatch(pBitmap != null, , "pBitmap is null");
888 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
893 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
894 TryCatch(pBitmap != null, , "pBitmap is null");
896 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
901 __pThumbnailButton->Draw();
902 __pThumbnailButton->Show();
912 delete pRotateBitmap;
913 pRotateBitmap = null;
918 CameraForm::OnCapuredPerform(void)
920 AppLogDebug("ENTER");
921 result r = E_SUCCESS;
922 Point currentPosition;
923 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
924 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
925 int guideLineEnable = 0;
926 BufferInfo bufferinfo;
927 Bitmap* pThumbnailBitmap = null;
928 Bitmap* pRotateBitmap = null;
930 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
931 // TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
932 if (pThumbnailBitmap == null)
934 AppLogDebug("OnCapuredPerform::pThumbnailBitmap = null");
936 _pThumbnailPanel->SetShowState(true);
941 if (__dir == ORIENTATION_STATUS_PORTRAIT
942 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
944 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
945 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
949 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
950 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
953 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
954 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
956 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
957 TryCatch(r == E_SUCCESS, , "pRotateBitmap::Scale() fail[%s]", GetErrorMessage(r));
959 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
960 _pThumbnailPanel->SetDrawSliderImg();
962 delete pRotateBitmap;
963 pRotateBitmap = null;
966 if (__formStatusFrameDeattivated)
968 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED after CAMERA_ACTION_EVENT_CAPTURED event");
972 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
973 _pAppTimer->Cancel();
975 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
976 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
978 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
979 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
981 _pCameraPresentationModel->StartPreview(&bufferinfo);
983 _pCameraPresentationModel->SetContinuousAutoFocus();
986 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
987 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
989 if (guideLineEnable == DISABLE_GUIDELINE)
991 r = DrawMarker(false);
995 r = DrawMarker(true);
997 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
1003 _isUsedTimerCaptured = false;
1007 AppLogDebug("EXIT");
1013 delete pRotateBitmap;
1014 pRotateBitmap = null;
1021 CameraForm::OnCameraActionPerformed(CameraActionEvent event)
1023 AppLogDebug("ENTER");
1024 result r = E_SUCCESS;
1026 AppLogDebug("OnCameraActionPerformed - event %d", event);
1029 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1031 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1032 DrawFocus(CAMERA_FOCUS_READY);
1036 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1038 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1039 DrawFocus(CAMERA_FOCUS_READY);
1041 TryReturnVoid(_pTouchAutoFocusTimer != null, "_pTouchAutoFocusTimer is null");
1042 _pTouchAutoFocusTimer->Cancel();
1044 r = _pTouchAutoFocusTimer->Start(CAMERA_TIMER_2_SEC);
1045 TryReturnVoid(r == E_SUCCESS, "Faled Start Timer[%s]", GetErrorMessage(r));
1049 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1051 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1052 DrawFocus(CAMERA_FOCUS_FAIL);
1056 case CAMERA_ACTION_EVENT_CAMERA_PREVIEWED:
1058 AppLogDebug("CAMERA_ACTION_EVENT_CAMERA_PREVIEWED.");
1062 case CAMERA_ACTION_EVENT_CAMERA_THUMBNAIL_BUTTON_LOCK:
1064 AppLogDebug("CAMERA_ACTION_EVENT_CAMERA_THUMBNAIL_BUTTON_LOCK.");
1069 case CAMERA_ACTION_EVENT_CAPTURED:
1071 AppLogDebug("CAMERA_ACTION_EVENT_CAPTURED");
1072 int requestType = 0;
1073 BufferInfo bufferinfo;
1074 bool isCharging = false;
1075 BatteryLevel batteryLevel;
1077 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1079 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1081 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1083 AppLogDebug("Camera Captured after TerminateApp");
1084 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1085 pCameraApp->SetFrameEnabled(false);
1087 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1088 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1090 _pCameraPresentationModel->StartPreview(&bufferinfo);
1092 __isProhibitionTouchEvent = true;
1095 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1102 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1103 isCharging = _pCameraPresentationModel->IsCharging();
1105 AppLogDebug("batteryLevel = %d", batteryLevel);
1106 AppLogDebug("isCharging = %d", isCharging);
1108 if (isCharging == false)
1110 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1113 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1119 case CAMERA_ACTION_EVENT_ERROR_OCCURRED:
1121 AppLogDebug("CAMERA_ACTION_EVENT_ERROR_OCCURRED.");
1123 result r = E_SUCCESS;
1124 BufferInfo bufferinfo;
1126 if (__pBatteryState != null)
1128 __pBatteryState->SetShowState(true);
1129 __pBatteryState->Draw();
1130 __pBatteryState->Show();
1133 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1135 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1136 _pCameraPresentationModel->StopCamera();
1138 r = _pCameraPresentationModel->InitializeCamera();
1139 TryReturnVoid(r == E_SUCCESS, "InitializeCamera [%s]", GetErrorMessage(r));
1141 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1142 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1144 _pCameraPresentationModel->StartPreview(&bufferinfo);
1145 _pCameraPresentationModel->SetContinuousAutoFocus();
1150 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1152 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1153 bool isEnabled = false;
1154 bool isInitCameraStaus = false;
1155 bool isCharging = false;
1156 BatteryLevel batteryLevel = BATTERY_FULL;
1158 __formStatusFrameDeattivated = false;
1160 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1161 isEnabled = pCameraApp->IsFrameEnabled();
1163 if (isEnabled == false)
1165 pCameraApp->SetFrameEnabled(true);
1168 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1169 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1171 if (isInitCameraStaus == false)
1173 AppLogDebug("InitCamera is fail");
1177 if (_pCameraPresentationModel->IsCameraPoweredOn())
1179 result r = E_SUCCESS;
1180 BufferInfo bufferinfo;
1181 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED:CameraPoweredOn");
1183 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1185 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1186 _pCameraPresentationModel->StopCamera();
1188 r = _pCameraPresentationModel->InitializeCamera();
1189 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
1191 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1192 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1194 _pCameraPresentationModel->StartPreview(&bufferinfo);
1195 _pCameraPresentationModel->SetContinuousAutoFocus();
1197 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1198 isCharging = _pCameraPresentationModel->IsCharging();
1200 AppLogDebug("batteryLevel = %d", batteryLevel);
1202 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1204 if (isCharging == false)
1206 ShowLowBatteryPopup();
1211 if (CheckCallStatus())
1218 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED");
1220 if (!CheckCallStatus())
1222 GetCameraToForeground();
1225 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1226 isCharging = _pCameraPresentationModel->IsCharging();
1228 AppLogDebug("batteryLevel = %d", batteryLevel);
1229 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1231 if (isCharging == false)
1233 ShowLowBatteryPopup();
1238 CheckBatteryStatus();
1241 HideUiActionButton();
1244 if (_pThumbnailPanel != null)
1246 _pThumbnailPanel->DeleteOldBitmap();
1253 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
1255 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
1256 bool isInitCameraStaus = false;
1258 __formStatusFrameDeattivated = true;
1260 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1261 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1263 if (isInitCameraStaus == false)
1265 AppLogDebug("InitCamera is fail");
1269 MakeSettingPopupTab(false);
1271 HideUiActionButton();
1274 if (_pThumbnailPanel != null)
1276 _pThumbnailPanel->DeleteOldBitmap();
1283 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1285 _pResetPopUp->SetShowState(false);
1287 SendCameraToBackground();
1291 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
1293 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
1295 ShowCameraFailPopup();
1299 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
1301 if (CheckCallStatus())
1303 AppLogDebug("Preview Fail And InCall");
1307 if (_pCameraPresentationModel->GetStartPreviewException())
1309 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
1311 ShowCameraFailPopup();
1316 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
1318 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
1319 bool isCharging = false;
1320 BatteryLevel batteryLevel;
1322 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1323 isCharging = _pCameraPresentationModel->IsCharging();
1325 AppLogDebug("batteryLevel = %d", batteryLevel);
1326 AppLogDebug("isCharging = %d", isCharging);
1328 if (isCharging == false)
1330 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1332 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
1334 if ((_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURING
1335 || _pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURED)
1336 && __isTimerRunning == false)
1338 AppLogDebug("CAPTURING or CAPTURED");
1339 ShowLowBatteryPopup();
1345 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1350 CheckBatteryStatus();
1355 CheckBatteryStatus();
1360 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
1362 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
1364 _batteryStatus = GetCurrentBatteryState();
1366 AppLogDebug("_batteryStatus = %d", _batteryStatus);
1368 CheckBatteryStatus();
1372 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
1374 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
1376 int requestType = 0;
1378 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1380 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
1382 AppLogDebug("Camera Captured after TerminateApp()");
1385 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1389 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1393 OnTimerCapturePause();
1399 case CAMERA_ACTION_EVENT_BACK_BUTTON_ACTIVATED:
1401 AppLogDebug("CAMERA_ACTION_EVENT_BACK_BUTTON_ACTIVATED");
1402 if (__pBackButton != null)
1404 __pBackButton->SetEnabled(true);
1412 AppLogDebug("EXIT");
1416 CameraForm::InitSettingMenuPanel(void)
1418 AppLogDebug("ENTER");
1419 result r = E_SUCCESS;
1420 int cameraCount = 0;
1422 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
1423 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
1425 __pSettingPanel->AddTouchEventListener(*this);
1426 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
1428 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
1429 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
1430 _pFlashButton->AddTouchEventListener(*this);
1432 _pFlashButton->SetActionId(IDA_BUTTON_CAMERA_FLASH);
1433 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
1434 _pFlashButton->AddActionEventListener(*this);
1436 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
1437 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
1438 _pSelfShotButton->AddTouchEventListener(*this);
1440 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMERA_SELF);
1441 _pSelfShotButton->AddActionEventListener(*this);
1443 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
1444 TryCatch(_pSettingButton != null, r = E_SYSTEM, "pSettingButton is null");
1445 _pSettingButton->AddTouchEventListener(*this);
1447 _pSettingButton->SetActionId(IDA_BUTTON_CAMERA_SETTING);
1448 _pSettingButton->AddActionEventListener(*this);
1450 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
1451 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
1452 __pSettingLine->AddTouchEventListener(*this);
1454 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
1455 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
1456 _pQuickSettingButton->AddTouchEventListener(*this);
1458 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMERA_QUICK_SETTING);
1459 _pQuickSettingButton->AddActionEventListener(*this);
1461 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
1462 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
1464 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
1465 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
1466 _pWhiteBalanceButton->AddTouchEventListener(*this);
1467 _pWhiteBalanceButton->AddActionEventListener(*this);
1469 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
1470 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
1472 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
1473 _pExposureValueButton->AddTouchEventListener(*this);
1474 _pExposureValueButton->AddActionEventListener(*this);
1476 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
1477 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
1478 _pCloseButton->AddTouchEventListener(*this);
1480 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
1481 _pCloseButton->AddActionEventListener(*this);
1483 r = UpdateUiPanelIcon();
1484 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateSetUiPanelIcon() - fail[%s]", GetErrorMessage(r));
1486 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
1487 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
1488 if (cameraCount > SUPPORTED_CAMERA_NUM)
1490 _pSelfShotButton->SetEnabled(true);
1494 _pSelfShotButton->SetEnabled(false);
1496 AppLogDebug("EXIT");
1500 _pFlashButton = null;
1501 _pSelfShotButton = null;
1502 _pSettingButton = null;
1503 __pSettingLine = null;
1504 _pQuickSettingButton = null;
1505 _pWhiteBalanceButton = null;
1506 _pExposureValueButton = null;
1507 _pCloseButton = null;
1513 CameraForm::OnTouchModeSwitch(void)
1515 AppLogDebug("ENTER");
1516 result r = E_SUCCESS;
1518 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
1520 SceneManager* pSceneManager = SceneManager::GetInstance();
1521 AppAssert(pSceneManager);
1523 AppLogDebug("GoForward to IDSCN_CAMCORDER!!!");
1525 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1526 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
1528 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMCORDER));
1529 TryReturnVoid(r == E_SUCCESS, "SceneManager GoForward[%s]", GetErrorMessage(r));
1533 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
1535 AppLogDebug("EXIT");
1539 CameraForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
1541 AppLogDebug("ENTER");
1542 result r = E_SUCCESS;
1544 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
1545 if (__dir == ORIENTATION_STATUS_PORTRAIT
1546 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1548 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1549 _closeTimerValue = UNIT_VALUE_ZERO;
1551 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1552 _pExposureCloseTimer->Cancel();
1554 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1555 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1559 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1560 _closeTimerValue = UNIT_VALUE_ZERO;
1562 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1563 _pExposureCloseTimer->Cancel();
1565 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1566 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1568 AppLogDebug("EXIT");
1572 CameraForm::OnTouchLaunchImageview(void)
1574 AppLogDebug("ENTER");
1575 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
1576 String fullFileName = L"";
1578 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
1580 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
1582 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
1584 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
1586 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1588 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1590 if (fullFileName == L"")
1592 AppLogDebug("file do not found");
1596 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
1603 AppLogDebug("LaunchImageview");
1604 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1606 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1608 if (fullFileName == L"")
1610 AppLogDebug("file do not found");
1618 AppLogDebug("EXIT");
1622 CameraForm::OnTimerCapturePause(void)
1624 AppLogDebug("ENTER");
1625 if (__isTimerRunning == true)
1627 if (_pPopupTimer != null)
1629 _pPopupTimer->Cancel();
1631 delete _pPopupTimer;
1632 _pPopupTimer = null;
1635 _timeCount = INDEX_UNIT_ZERO;
1637 if (_isUsedTimerCaptured == true)
1639 __isTimerRunning = false;
1641 _pCameraPresentationModel->SetIntervalTimerRun(false);
1643 _isUsedTimerCaptured = false;
1645 if (_pIntervalValueTimer != null)
1647 _pIntervalValueTimer->Cancel();
1649 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
1651 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
1653 _pCameraInfoPanel->Invalidate(true);
1655 _pCameraInfoPanel->SetDrawPopupTimer(false);
1657 _pCameraInfoPanel->Invalidate(true);
1662 AppLogDebug("EXIT");
1666 CameraForm::OnTouchDoHidePopup(void)
1668 AppLogDebug("ENTER");
1669 bool doHidePopup = false;
1671 if (_pListViewCameraTabMainMenu != null)
1673 if (_pListViewCameraTabMainMenu->GetShowState() == true)
1679 if (_pListViewGeneralTabMainMenu != null)
1681 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
1687 if (_pListFlashMainMenu != null)
1689 if (_pListFlashMainMenu->GetShowState() == true)
1695 if (_pListWbMainMenu != null)
1697 if (_pListWbMainMenu->GetShowState() == true)
1703 if (_pListViewCameraTabSubMenu != null)
1705 if (_pListViewCameraTabSubMenu->GetShowState() == true)
1711 if (_pListViewGeneralTabSubMenu != null)
1713 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
1719 if (_pCameraInfoPanel->GetDrawExposure() == true)
1721 doHidePopup = false;
1724 AppLogDebug("EXIT");
1729 CameraForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1731 AppLogDebug("ENTER");
1732 result r = E_SUCCESS;
1733 String controlName = L"";
1735 if (_appControlActionCompleted)
1737 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1741 controlName = source.GetName();
1743 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1745 AppLogDebug("OnTouchPressed return");
1749 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1750 _pAppTimer->Cancel();
1752 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
1753 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
1755 if (_pCameraInfoPanel->GetDrawExposure() == true)
1757 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1758 _pExposureCloseTimer->Cancel();
1760 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1761 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1763 AppLogDebug("EXIT");
1767 CameraForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1769 AppLogDebug("ENTER");
1770 String controlName = source.GetName();
1772 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1774 AppLogDebug("OnTouchLongPressed return");
1778 if ((controlName.Equals(String(IDS_ACTION_UI_PANEL_CAPTURE_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1780 AppLogDebug("OnTouchLongPressed Action");
1781 if (source.Equals(*__pShutterButton) == true)
1783 _pCameraPresentationModel->SetContinuousAutoFocus();
1786 AppLogDebug("EXIT");
1790 CameraForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1792 AppLogDebug("ENTER");
1793 String controlName = L"";
1794 int checkActivePanel = -1;
1795 bool doHidePopup = false;
1797 if (_appControlActionCompleted)
1799 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1802 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
1803 controlName = source.GetName();
1805 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1807 AppLogDebug("OnTouchReleased return");
1811 if (_pCameraInfoPanel->GetDrawExposure() == true)
1813 if (source.Equals(*__pShutterButton) == true)
1815 _closeTimerValue = 0;
1817 if (_pExposureCloseTimer)
1819 _pExposureCloseTimer->Cancel();
1822 _pCameraInfoPanel->SetDrawExposure(false);
1828 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1830 OnTouchDrawExposure(currentPosition);
1835 doHidePopup = OnTouchDoHidePopup();
1836 AppLogDebug("doHidePopup = %d", doHidePopup);
1838 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
1840 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1842 DrawTouchAutoFocus(currentPosition);
1847 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
1848 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
1850 if (_pCameraInfoGeneralSubPanel != null)
1852 if (_pCameraInfoGeneralSubPanel->GetShowState())
1854 checkActivePanel = 0;
1857 if (_pCameraInfoSubPanel != null)
1859 if (_pCameraInfoSubPanel->GetShowState())
1861 checkActivePanel = 1;
1865 if (checkActivePanel != -1)
1867 if (checkActivePanel == 0)
1869 _pCameraInfoGeneralSubPanel->SetShowState(false);
1873 _pCameraInfoSubPanel->SetShowState(false);
1883 if (source.Equals(*__pCameraSettingLable) == true)
1885 CheckCameraSettingLabel();
1888 if (source.Equals(*__pGeneralSettingLable) == true)
1890 CheckGeneralSettingLabel();
1893 if ((controlName.Equals(String(IDS_ACTION_UI_PANEL_CAPTURE_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1895 if (source.Equals(*__pShutterButton) == true)
1901 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
1902 && _pThumbnailPanel->GetShowState() == true
1903 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1904 && _pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED
1907 if (source.Equals(*_pThumbnailPanel) == true)
1909 AppLogDebug("Touch Thumbnail button");
1910 OnTouchLaunchImageview();
1913 AppLogDebug("EXIT");
1917 CameraForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1919 AppLogDebug("ENTER");
1920 String controlName = L"";
1921 result r = E_SUCCESS;
1923 if (_appControlActionCompleted)
1925 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1929 controlName = source.GetName();
1931 if ((controlName.Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
1933 OnTouchModeSwitch();
1937 if (_pCameraInfoPanel->GetDrawExposure() == true)
1939 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1941 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
1942 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
1943 _closeTimerValue = 0;
1945 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1946 _pExposureCloseTimer->Cancel();
1949 AppLogDebug("EXIT");
1953 CameraForm::OnAppTimerExpired(void)
1955 AppLogDebug("ENTER");
1956 result r = E_SUCCESS;
1957 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1961 _pCameraPresentationModel->StopCamera();
1963 r = SendAppControlResult(pCameraApp->GetRequestId());
1964 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
1965 AppLogDebug("EXIT");
1969 CameraForm::OnPreviewFailPopupTimerExpired(void)
1971 AppLogDebug("ENTER");
1972 if (CheckCallStatus())
1974 AppLogDebug("Preview Fail And InCall");
1978 ShowCameraFailPopup();
1979 AppLogDebug("EXIT");
1983 CameraForm::OnCaptureStartTimerExpired(void)
1985 AppLogDebug("ENTER");
1986 result r = E_SUCCESS;
1987 int timerInterval = 0;
1989 if (_pCaptureStartTimer)
1991 _pCaptureStartTimer->Cancel();
1994 timerInterval = GetTimerIntervalValue();
1998 _isUsedTimerCaptured = true;
2000 r = SetTimerIntervalValue(timerInterval);
2001 TryReturnVoid(r == E_SUCCESS, "SetTimerIntervalValue() fail[%s]", GetErrorMessage(r));
2005 r = DrawTimerPopup();
2006 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
2007 AppLogDebug("EXIT");
2011 CameraForm::OnTouchAutoFocusTimerExpired(void)
2013 AppLogDebug("ENTER");
2014 _pCameraPresentationModel->SetContinuousAutoFocus();
2016 _pTouchAutoFocusTimer->Cancel();
2017 AppLogDebug("EXIT");
2021 CameraForm::OnPopupTimerExpired(void)
2023 AppLogDebug("ENTER");
2024 if (_pCameraPresentationModel->IsPreviewState() == true)
2028 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
2030 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
2032 _pCameraInfoPanel->Invalidate(true);
2034 AppLogDebug("_timeCount=%d", _timeCount);
2036 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
2041 AppLogDebug("EXIT");
2045 CameraForm::OnIntervalValueTimerExpired(void)
2047 AppLogDebug("ENTER");
2048 result r = E_SUCCESS;
2049 bool focusSupport = false;
2050 int selfPortraitEnable = 0;
2052 if (_isUsedTimerCaptured == true)
2054 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
2056 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
2058 _pCameraInfoPanel->Invalidate(true);
2060 _pCameraInfoPanel->SetDrawPopupTimer(false);
2062 _pCameraInfoPanel->Invalidate(true);
2066 if (__pBackButton && !_isHwKeySupported)
2068 __pBackButton->SetShowState(false);
2069 __pBackButton->Invalidate(true);
2072 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2073 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
2075 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2077 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
2081 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
2084 if (focusSupport == true && r == E_SUCCESS)
2086 _pCameraInfoPanel->SetDrawMarkerFocus(true);
2088 DrawFocus(CAMERA_FOCUS_NOT_READY);
2092 _pCameraInfoPanel->SetDrawMarkerFocus(false);
2094 _pCameraInfoPanel->Invalidate(true);
2098 _pCameraPresentationModel->Capture();
2100 __isTimerRunning = false;
2102 _pCameraPresentationModel->SetIntervalTimerRun(false);
2104 if (__pBatteryState)
2106 __pBatteryState->SetShowState(true);
2107 __pBatteryState->Draw();
2108 __pBatteryState->Show();
2114 AppLogDebug("EXIT");
2118 CameraForm::OnExposureCloseTimerExpired(void)
2120 AppLogDebug("ENTER");
2123 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
2125 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
2127 if (_pCameraInfoPanel->GetDrawExposure() == true)
2129 _pCameraInfoPanel->SetDrawExposure(false);
2135 _closeTimerValue = 0;
2137 _pExposureCloseTimer->Cancel();
2139 AppLogDebug("EXIT");
2143 CameraForm::OnChargingCompletedTimerExpired(void)
2145 AppLogDebug("ENTER");
2146 Bitmap* pBitmap = null;
2147 result r = E_SUCCESS;
2149 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2151 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2153 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2157 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2162 if (_chargingCount % DIVIDE_BY_TWO)
2164 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
2168 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
2170 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2172 if (_chargingCount >= BATTERY_STATE_20)
2174 _chargingCount = INDEX_UNIT_ZERO;
2178 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2179 __pBatteryState->Invalidate(true);
2181 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2182 AppLogDebug("_chargingCount = %d", _chargingCount);
2183 AppLogDebug("_blinkCount = %d", _blinkCount);
2188 AppLogDebug("EXIT");
2192 AppLogDebug("EXIT - CATCH");
2197 CameraForm::OnChargingTimerExpired(void)
2199 AppLogDebug("ENTER");
2200 Bitmap* pBitmap = null;
2201 result r = E_SUCCESS;
2202 int maxChargingCnt = 0;
2203 int batteryLevel = 0;
2204 Battery::GetCurrentLevelInPercentage(batteryLevel);
2206 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2208 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2210 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2214 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2217 AppLogDebug("batteryLevel = %d", batteryLevel);
2221 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2222 AppLogDebug("_chargingCount = %d", _chargingCount);
2224 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
2226 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
2230 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
2232 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2234 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
2236 AppLogDebug("maxCount = %d", maxChargingCnt);
2238 if (maxChargingCnt >= BATTERY_STATE_20)
2240 _chargingCount = INDEX_UNIT_ZERO;
2243 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2244 __pBatteryState->Invalidate(true);
2249 AppLogDebug("EXIT");
2253 AppLogDebug("EXIT - CATCH");
2258 CameraForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
2260 AppLogDebug("ENTER");
2261 if (timer.Equals(*_pAppTimer))
2263 AppLogDebug("_pAppTimer");
2264 OnAppTimerExpired();
2266 else if (timer.Equals(*_pCaptureStartTimer))
2268 AppLogDebug("_pCaptureStartTimer");
2269 OnCaptureStartTimerExpired();
2271 else if (timer.Equals(*_pTouchAutoFocusTimer))
2273 AppLogDebug("_pTouchAutoFocusTimer");
2274 OnTouchAutoFocusTimerExpired();
2276 else if (timer.Equals(*_pPopupTimer))
2278 AppLogDebug("_pPopupTimer");
2279 OnPopupTimerExpired();
2281 else if (timer.Equals(*_pIntervalValueTimer))
2283 AppLogDebug("_pIntervalValueTimer");
2284 OnIntervalValueTimerExpired();
2285 StartInitChargingTimer();
2287 else if (timer.Equals(*_pHelpCloseTimer))
2289 AppLogDebug("__pHelpCloseTimer");
2290 OnHelpCloseTimerExpired();
2292 else if (timer.Equals(*_pExposureCloseTimer))
2294 AppLogDebug("_pExposureCloseTimer");
2295 OnExposureCloseTimerExpired();
2297 else if (timer.Equals(*_pChargingTimer))
2299 result r = E_SUCCESS;
2300 AppLogDebug("_pChargingTimer");
2301 bool isCharging = false;
2303 _batteryStatus = GetCurrentBatteryState();
2304 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2306 isCharging = _pCameraPresentationModel->IsCharging();
2310 if (_batteryStatus == BATTERY_STATE_20)
2312 _chargingCount = INDEX_UNIT_ZERO;
2314 _blinkCount = INDEX_UNIT_ZERO;
2316 _pChargingTimer->Cancel();
2318 StartInitChargingCompletedTimer();
2322 r = OnChargingTimerExpired();
2327 _chargingCount = INDEX_UNIT_ZERO;
2329 _blinkCount = INDEX_UNIT_ZERO;
2331 _pChargingTimer->Cancel();
2333 if (_batteryStatus == BATTERY_STATE_20)
2335 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
2337 StartInitChargingCompletedTimer();
2341 else if (timer.Equals(*_pChargingCompletedTimer))
2343 result r = E_SUCCESS;
2344 AppLogDebug("__pChargingCompletedTimer");
2345 bool isCharging = false;
2347 isCharging = _pCameraPresentationModel->IsCharging();
2349 _batteryStatus = GetCurrentBatteryState();
2350 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2352 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
2354 if (_blinkCount == INDEX_UNIT_TWENTY)
2356 AppLogDebug("__pChargingCompletedTimer cancel");
2358 _chargingCount = INDEX_UNIT_ZERO;
2360 _blinkCount = INDEX_UNIT_ZERO;
2362 _pChargingCompletedTimer->Cancel();
2364 CheckBatteryStatus();
2368 AppLogDebug("OnChargingCompletedTimerExpired");
2370 r = OnChargingCompletedTimerExpired();
2375 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
2377 _chargingCount = INDEX_UNIT_ZERO;
2379 _blinkCount = INDEX_UNIT_ZERO;
2381 _pChargingCompletedTimer->Cancel();
2383 CheckBatteryStatus();
2386 else if (timer.Equals(*_pPreviewFailPopupTimer))
2388 AppLogDebug("__pPreviewFailPopupTimer");
2389 _pPreviewFailPopupTimer->Cancel();
2391 if (_pCameraPresentationModel->GetStartPreviewException())
2393 OnPreviewFailPopupTimerExpired();
2398 AppLogDebug("Not expire");
2400 AppLogDebug("EXIT");
2404 CameraForm::InitActionMenuPanel(void)
2406 AppLogDebug("ENTER");
2407 result r = E_SUCCESS;
2408 Rectangle rectThumbnailButton;
2409 Rectangle clientArea = GetClientAreaBounds();
2411 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
2412 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
2414 __pActionPanel->AddTouchEventListener(*this);
2415 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
2417 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2419 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2420 || __dir == ORIENTATION_STATUS_PORTRAIT)
2422 if (clientArea.height == DISPLAY_WVGA)
2424 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2428 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2433 if (clientArea.width == DISPLAY_WVGA)
2435 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2439 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2443 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
2444 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2445 __pBatteryState->AddTouchEventListener(*this);
2446 __pBatteryState->SetShowState(true);
2448 __pCameraSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
2449 TryCatch(__pCameraSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
2450 __pCameraSetting->SetActionId(IDA_BUTTON_SETTING_CAMERA);
2451 __pCameraSetting->AddActionEventListener(*this);
2452 __pCameraSetting->SetShowState(false);
2454 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
2455 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
2456 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
2457 __pGeneralSetting->AddActionEventListener(*this);
2458 __pGeneralSetting->SetShowState(false);
2460 __pCameraSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
2461 TryCatch(__pCameraSettingLable != null, r = E_SYSTEM, "__pCameraSettingLable is null");
2462 __pCameraSettingLable->AddTouchEventListener(*this);
2463 __pCameraSettingLable->SetShowState(false);
2465 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
2466 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
2467 __pGeneralSettingLable->AddTouchEventListener(*this);
2468 __pGeneralSettingLable->SetShowState(false);
2470 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
2471 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
2472 __pCameraIconLabel->AddTouchEventListener(*this);
2474 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
2475 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
2477 __pSwButton->SetName(IDS_ACTION_UI_CAMERA_MODE);
2478 __pSwButton->AddTouchEventListener(*this);
2480 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
2481 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
2482 __pCamcoderIconLabel->AddTouchEventListener(*this);
2484 __pBackButton = static_cast<Button*>(GetControl(L"IDC_CAMERA_BACK"));
2485 TryCatch(__pBackButton != null, r = E_SYSTEM, "__pBackButton is null");
2486 __pBackButton->SetActionId(IDA_BUTTON_CAMERA_BACK);
2487 __pBackButton->SetName(IDS_ACTION_BACK);
2488 __pBackButton->AddActionEventListener(*this);
2489 // __pBackButton->AddTouchEventListener(*this);
2491 if (_isHwKeySupported)
2493 __pBackButton->SetShowState(false);
2496 __pShutterButton = static_cast<Button*>(GetControl(L"IDC_SHUTTER_BUTTON"));
2497 TryCatch(__pShutterButton != null, r = E_SYSTEM, "__pShutterButton is null");
2499 __pShutterButton->SetName(IDS_ACTION_UI_PANEL_CAPTURE_NAME);
2500 __pShutterButton->AddTouchEventListener(*this);
2502 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2504 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2505 || __dir == ORIENTATION_STATUS_PORTRAIT)
2507 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
2508 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
2512 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
2513 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
2516 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
2517 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
2518 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
2520 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
2521 _pThumbnailPanel->AddTouchEventListener(*this);
2522 AddControl(_pThumbnailPanel);
2523 AddOrientationEventListener(*_pThumbnailPanel);
2525 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
2526 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
2527 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMERA_THUMBNAIL);
2528 __pThumbnailButton->AddActionEventListener(*this);
2529 __pThumbnailButton->AddTouchEventListener(*this);
2530 __pThumbnailButton->SetShowState(false);
2532 r = UpdateUiActionPanelIcon();
2533 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() is fail[%s]", GetErrorMessage(r));
2535 AppLogDebug("EXIT");
2539 __pCameraIconLabel = null;
2540 __pCamcoderIconLabel = null;
2541 __pBatteryState = null;
2543 __pShutterButton = null;
2544 __pThumbnailButton = null;
2545 __pBackButton = null;
2546 __pCameraSetting = null;
2547 __pGeneralSetting = null;
2548 __pCameraSettingLable = null;
2549 __pGeneralSettingLable = null;
2551 delete _pThumbnailPanel;
2552 _pThumbnailPanel = null;
2558 CameraForm::UpdateUiPanelIcon(void)
2560 AppLogDebug("ENTER");
2561 result r = E_SUCCESS;
2562 Bitmap* pBitmap = null;
2563 Bitmap* pBitmapRotate = null;
2564 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
2567 ImageRotationType rotationType = IMAGE_ROTATION_0;
2569 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2571 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2572 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2574 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2576 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2577 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2579 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2580 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2582 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2583 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2585 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2590 delete pBitmapRotate;
2591 pBitmapRotate = null;
2593 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2594 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2596 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2597 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2599 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2604 delete pBitmapRotate;
2605 pBitmapRotate = null;
2607 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2609 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2611 if (value == true && r == E_SUCCESS)
2613 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2614 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2618 case FLASH_MODE_OFF:
2620 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2621 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2623 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2624 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2626 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2631 delete pBitmapRotate;
2632 pBitmapRotate = null;
2634 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2635 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2637 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2638 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2640 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2645 delete pBitmapRotate;
2646 pBitmapRotate = null;
2652 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2653 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2655 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2656 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2658 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2663 delete pBitmapRotate;
2664 pBitmapRotate = null;
2666 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2667 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2669 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2670 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2672 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2677 delete pBitmapRotate;
2678 pBitmapRotate = null;
2682 case FLASH_MODE_AUTO:
2684 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2685 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2687 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2688 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2690 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2695 delete pBitmapRotate;
2696 pBitmapRotate = null;
2698 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2699 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2701 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2702 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2704 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2709 delete pBitmapRotate;
2710 pBitmapRotate = null;
2720 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2721 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2723 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2724 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2726 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2727 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2729 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2734 delete pBitmapRotate;
2735 pBitmapRotate = null;
2737 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2739 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2741 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2742 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2744 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2749 delete pBitmapRotate;
2750 pBitmapRotate = null;
2754 _pFlashButton->Invalidate(true);
2755 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2757 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2759 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2761 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2765 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2767 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2768 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2770 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2775 delete pBitmapRotate;
2776 pBitmapRotate = null;
2778 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2780 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2782 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2784 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2786 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2788 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2789 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2791 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2796 delete pBitmapRotate;
2797 pBitmapRotate = null;
2799 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2801 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2805 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2807 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2809 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2810 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2812 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2817 delete pBitmapRotate;
2818 pBitmapRotate = null;
2820 if (__dir == ORIENTATION_STATUS_LANDSCAPE
2821 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
2823 rotationType = IMAGE_ROTATION_270;
2826 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2828 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2829 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2831 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2832 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2834 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2839 delete pBitmapRotate;
2840 pBitmapRotate = null;
2842 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2843 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2845 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2846 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2848 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2853 delete pBitmapRotate;
2854 pBitmapRotate = null;
2856 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2858 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2859 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2861 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2862 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2864 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2869 delete pBitmapRotate;
2870 pBitmapRotate = null;
2872 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2874 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2875 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2877 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2882 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2883 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2885 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2890 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2892 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2894 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2898 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2903 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2904 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2906 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2911 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2912 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2914 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2921 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2922 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2924 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2929 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2930 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2932 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2938 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2940 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2941 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2943 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2945 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2946 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2948 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2953 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2955 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2956 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2958 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2959 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2961 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2962 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2967 delete pBitmapRotate;
2968 pBitmapRotate = null;
2970 AppLogDebug("EXIT");
2974 if (pBitmap != null)
2984 CameraForm::UpdateUiActionPanelIcon(void)
2986 AppLogDebug("ENTER");
2987 result r = E_SUCCESS;
2988 Bitmap* pBitmap = null;
2989 Bitmap* pBitmapRotate = null;
2990 ImageRotationType rotationType = IMAGE_ROTATION_0;
2991 Point ptShutterIcon;
2992 Point ptModeChangeButton;
2993 Rectangle rectThumbnailButton;
2995 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2997 if (__dir == ORIENTATION_STATUS_PORTRAIT
2998 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3000 rotationType = IMAGE_ROTATION_90;
3001 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD, Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD);
3002 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
3004 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
3005 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
3007 rotationType = IMAGE_ROTATION_0;
3008 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD, Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD);
3009 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
3012 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
3013 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraIconLabel::pBitmap is null");
3015 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
3020 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
3021 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3023 pBitmapRotate = RotationImageN(pBitmap, rotationType);
3024 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
3026 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3027 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3031 delete pBitmapRotate;
3032 pBitmapRotate = null;
3034 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
3035 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3037 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
3041 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
3042 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderIconLabel::pBitmap is null");
3044 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
3049 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3050 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3052 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3053 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3055 __pBackButton->SetSize(BACK_BUTTON_X_POS, BACK_BUTTON_Y_POS);
3056 __pBackButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3061 delete pBitmapRotate;
3062 pBitmapRotate = null;
3064 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
3065 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3067 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3068 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3070 __pBackButton->SetSize(BACK_BUTTON_X_POS, BACK_BUTTON_Y_POS);
3071 __pBackButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3076 delete pBitmapRotate;
3077 pBitmapRotate = null;
3079 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3080 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3082 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3083 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3085 __pBackButton->SetSize(BACK_BUTTON_X_POS, BACK_BUTTON_Y_POS);
3086 __pBackButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
3091 delete pBitmapRotate;
3092 pBitmapRotate = null;
3094 if (__dir == ORIENTATION_STATUS_PORTRAIT
3095 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3097 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL);
3098 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3102 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL_LAND);
3103 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3106 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3107 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3109 __pShutterButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3114 delete pBitmapRotate;
3115 pBitmapRotate = null;
3117 if (__dir == ORIENTATION_STATUS_PORTRAIT
3118 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3120 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS);
3121 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3125 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS_LAND);
3126 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3129 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3130 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3132 __pShutterButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3136 delete pBitmapRotate;
3137 pBitmapRotate = null;
3139 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_ICON);
3140 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3142 __pShutterButton->SetNormalBitmap(ptShutterIcon, *pBitmap);
3147 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3148 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3150 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
3155 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
3156 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3158 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
3163 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMERA);
3164 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraSetting::pBitmap is null");
3166 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3167 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CameraSetting::pBitmapRotate is null");
3169 __pCameraSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3170 __pCameraSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3175 delete pBitmapRotate;
3176 pBitmapRotate = null;
3178 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
3179 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
3181 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3182 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
3184 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3185 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3190 delete pBitmapRotate;
3191 pBitmapRotate = null;
3193 AppLogDebug("EXIT");
3197 if (pBitmap != null)
3207 CameraForm::SetTimerIntervalValue(int timerIntervalValue)
3209 AppLogDebug("ENTER");
3210 result r = E_SUCCESS;
3212 AppLogDebug("timerIntervalValue = %d", timerIntervalValue);
3214 switch (timerIntervalValue)
3216 case SETTING_TIMER_CAPTURE_0_SEC:
3221 case SETTING_TIMER_CAPTURE_2_SEC:
3223 _pIntervalValueTimer->Cancel();
3225 r = _pIntervalValueTimer->Start(CAMERA_TIMER_2_SEC);
3226 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3230 case SETTING_TIMER_CAPTURE_5_SEC:
3232 _pIntervalValueTimer->Cancel();
3234 r = _pIntervalValueTimer->Start(CAMERA_TIMER_5_SEC);
3235 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3239 case SETTING_TIMER_CAPTURE_10_SEC:
3241 _pIntervalValueTimer->Cancel();
3243 r = _pIntervalValueTimer->Start(CAMERA_TIMER_10_SEC);
3244 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3250 AppLogDebug("timer Invaild element id");
3255 AppLogDebug("EXIT");
3263 CameraForm::SetExifOrientation(int deviceOrientation)
3265 AppLogDebug("ENTER");
3266 result r = E_SUCCESS;
3268 r = _pCameraPresentationModel->SetExifOrientation(deviceOrientation);
3269 AppLogDebug("SetExifOrientation : deviceOrientation = %d, fail[%s]", deviceOrientation, GetErrorMessage(r));
3270 AppLogDebug("EXIT");
3274 CameraForm::StartCaptured(void)
3276 AppLogDebug("ENTER");
3277 result r = E_SUCCESS;
3278 int timerInterval = 0;
3280 timerInterval = GetTimerIntervalValue();
3282 switch (timerInterval)
3284 case SETTING_TIMER_CAPTURE_0_SEC:
3286 _isUsedTimerCaptured = false;
3288 __isTimerRunning = false;
3290 _pCameraPresentationModel->SetIntervalTimerRun(false);
3292 _pIntervalValueTimer->Cancel();
3294 _pCameraPresentationModel->Capture();
3296 StartInitChargingTimer();
3300 case SETTING_TIMER_CAPTURE_2_SEC:
3302 case SETTING_TIMER_CAPTURE_5_SEC:
3304 case SETTING_TIMER_CAPTURE_10_SEC:
3306 __isTimerRunning = true;
3308 if (__pBatteryState)
3310 __pBatteryState->SetShowState(false);
3311 __pBatteryState->Draw();
3312 __pBatteryState->Show();
3315 _pCameraPresentationModel->SetIntervalTimerRun(true);
3319 if (_pCameraInfoPanel != null)
3321 _pCameraInfoPanel->SetDrawIndicator(false);
3322 _pCameraInfoPanel->Invalidate(true);
3325 if (_isUsedTimerCaptured == false)
3327 _pCaptureStartTimer->Cancel();
3329 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3331 _pCameraInfoPanel->Invalidate(true);
3333 r = _pCaptureStartTimer->Start(CAMERA_TIMER_1_SEC);
3334 TryReturnVoid(r == E_SUCCESS, "_pCaptureStartTimer start fail[%s]", GetErrorMessage(r));
3342 AppLogDebug("EXIT");
3346 CameraForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
3348 AppLogDebug("ENTER");
3349 result r = E_SUCCESS;
3350 int selfPortraitEnable = 0;
3351 int guideLineEnable = 0;
3354 case IDA_BUTTON_CAMERA_FLASH:
3356 int selfPortraitEnable = 0;
3357 result r = E_SUCCESS;
3359 bool isCharging = false;
3360 BatteryLevel batteryLevel;
3362 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
3363 isCharging = _pCameraPresentationModel->IsCharging();
3365 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3366 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3368 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3370 AppLogDebug("FLASEH OFF!!!");
3374 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3376 if (value == true && r == E_SUCCESS)
3378 if (batteryLevel == BATTERY_LOW && isCharging == false)
3383 AppResource* pAppResource = null;
3385 pAppResource = Application::GetInstance()->GetAppResource();
3386 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
3388 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
3390 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
3391 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
3392 msgBox.ShowAndWait(result);
3401 AppLogDebug("FLASEH OFF!!!");
3407 case IDA_BUTTON_CAMERA_SELF:
3409 int selfPortraitEnable = 0;
3410 result r = E_SUCCESS;
3412 int cameraCount = 0;
3414 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
3416 AppLogDebug("Camera Preview is not");
3420 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
3421 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
3423 if (cameraCount < SUPPORTED_CAMERA_NUM)
3425 AppLogDebug("The physical direction of the camera is not exit");
3429 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3430 TryReturnVoid(r == E_SUCCESS, "Faled to get value to registry[%s]", GetErrorMessage(r));
3431 MakeSettingPopupTab(false);
3435 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3437 AppLogDebug("PRIMARY -> SECONDARY");
3439 __isToggleCameraDirection = true;
3441 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3442 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3444 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3445 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3447 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
3448 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3451 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3453 AppLogDebug("SECONDARY -> PRIMARY");
3454 int primaryFlashValue = FLASH_MODE_OFF;
3455 __isToggleCameraDirection = true;
3457 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3458 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3460 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3461 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3463 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3464 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3466 if (value == true && r == E_SUCCESS)
3468 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3469 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3473 UpdateUiPanelIcon();
3474 MakePreviewResolutionList(true);
3475 MakeCaptrueResolutionList(true);
3478 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3479 _pFlashButton->Invalidate(true);
3481 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
3482 _pSelfShotButton->Invalidate(true);
3484 __isToggleCameraDirection = false;
3488 case IDA_BUTTON_CAMERA_SETTING:
3490 result r = E_SUCCESS;
3492 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3493 _pAppTimer->Cancel();
3495 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3496 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3498 UpdateUiPanelIcon();
3504 case IDA_BUTTON_CLOSE_SETTING:
3506 result r = E_SUCCESS;
3508 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3509 _pAppTimer->Cancel();
3511 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3512 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3518 case IDA_BUTTON_CAMERA_QUICK_SETTING:
3520 result r = E_SUCCESS;
3522 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3523 _pAppTimer->Cancel();
3525 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3526 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3528 MakeCameraTabSettingPopup();
3532 case IDA_BUTTON_SETTING_CAMERA:
3534 result r = E_SUCCESS;
3536 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3537 _pAppTimer->Cancel();
3539 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3540 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3542 if (_pListViewGeneralTabMainMenu)
3544 _pListViewGeneralTabMainMenu->SetShowState(false);
3547 if (_pListViewGeneralTabSubMenu)
3549 _pListViewGeneralTabSubMenu->SetShowState(false);
3552 MakeCameraTabSettingPopup();
3556 case IDA_BUTTON_SETTING_GENERAL:
3558 result r = E_SUCCESS;
3560 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3561 _pAppTimer->Cancel();
3563 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3564 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3566 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
3568 if (_pListViewCameraTabMainMenu)
3570 _pListViewCameraTabMainMenu->SetShowState(false);
3573 if (_pListViewCameraTabSubMenu)
3575 _pListViewCameraTabSubMenu->SetShowState(false);
3578 MakeGeneralTabSettingPopup();
3582 case IDA_BUTTON_CAMERA_EV:
3584 result r = E_SUCCESS;
3585 bool exposureValue = false;
3586 bool brighnesstValue = false;
3587 int selfPortraitEnable = 0;
3588 int adjustValue = 0;
3590 if (_pCameraInfoPanel->GetDrawExposure() == true)
3592 AppLogDebug("Draw is Exposure status");
3596 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3597 _pAppTimer->Cancel();
3599 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3600 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3602 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3603 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3605 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3606 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3608 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3610 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
3614 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
3617 if (exposureValue == true && r == E_SUCCESS)
3619 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3621 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
3622 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3624 AppLogDebug("adjustValue = %d", adjustValue);
3626 _pCameraPresentationModel->SetExposure(adjustValue);
3628 MakeSettingPopupTab(false);
3632 r = CreateExposureSlider();
3633 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3635 r = DrawExposureSlider();
3636 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3640 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3642 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3646 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3649 if (brighnesstValue == true && r == E_SUCCESS)
3651 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3653 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
3654 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3656 AppLogDebug("adjustValue = %d", adjustValue);
3658 _pCameraPresentationModel->SetBrightness(adjustValue);
3660 MakeSettingPopupTab(false);
3664 r = CreateExposureSlider();
3665 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3667 r = DrawExposureSlider();
3668 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3672 AppLogDebug("Exposure do not support");
3678 case IDA_BUTTON_CAMERA_WB:
3680 result r = E_SUCCESS;
3681 int selfPortraitEnable = 0;
3683 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3684 _pAppTimer->Cancel();
3686 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3687 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3689 if (_pCameraInfoPanel->GetDrawExposure() == true)
3691 _closeTimerValue = 0;
3693 if (_pExposureCloseTimer)
3695 _pExposureCloseTimer->Cancel();
3698 _pCameraInfoPanel->SetDrawExposure(false);
3702 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3703 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3705 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3707 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
3711 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
3716 SetWhiteBalancePopop();
3720 AppLogDebug("WB is not support");
3725 case IDA_BUTTON_CAMERA_BACK:
3727 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
3728 result r = E_SUCCESS;
3730 r = BackButtonPerformed();
3731 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
3738 AppLogDebug("ResetPopup : MSGBOX_RESULT_YES");
3740 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3742 _pResetPopUp->SetShowState(false);
3745 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
3746 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3748 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
3750 r = DrawMarker(false);
3751 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
3753 SetGuideLine(SUBMENU_MODE_OFF);
3756 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3757 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3759 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3761 RestoreDefaultSetting();
3763 r = RestorePrimaryResolution();
3764 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3768 BufferInfo bufferinfo;
3770 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
3772 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3773 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
3775 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3776 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3778 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
3779 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
3781 _pCameraPresentationModel->StartPreview(&bufferinfo);
3783 _pCameraPresentationModel->SetContinuousAutoFocus();
3785 MakePreviewResolutionList(true);
3787 MakeCaptrueResolutionList(true);
3791 RestoreSecondaryResolution();
3792 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3794 RestoreDefaultSetting();
3797 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3798 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
3800 MakeSettingPopupTab(false);
3804 r = UpdateUiPanelIcon();
3805 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
3807 r = SetScreenOverlayHelpTimer();
3808 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
3810 r = DrawScreenOverlayHelp();
3811 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
3813 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3814 _pFlashButton->Invalidate(true);
3821 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3823 _pResetPopUp->SetShowState(false);
3825 MakeSettingPopupTab(false);
3826 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
3834 AppLogDebug("EXIT");
3838 CameraForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
3840 AppLogDebug("ENTER");
3841 result r = E_SUCCESS;
3842 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
3852 _isUsedTimerCaptured = false;
3854 _closeTimerValue = 0;
3856 _closeTimerValue = 0;
3858 _pCameraPresentationModel->StopCamera();
3860 r = SendAppControlResult(pCameraApp->GetRequestId());
3861 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
3862 AppLogDebug("EXIT");
3866 CameraForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
3868 AppLogDebug("ENTER");
3869 if (_appControlActionCompleted)
3871 AppLogDebug("EXIT - App Terminate");
3874 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
3875 AppLogDebug("EXIT");
3879 CameraForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
3881 AppLogDebug("ENTER");
3882 bool isExistThumbnail = false;
3883 Bitmap* pBitmap = null;
3884 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
3886 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3888 if (isExistThumbnail == false)
3890 AppLogDebug("Thumbnail is not found");
3892 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
3894 _pThumbnailPanel->SetShowState(false);
3895 _pThumbnailPanel->Draw();
3896 _pThumbnailPanel->Show();
3898 __pThumbnailButton->SetShowState(true);
3900 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3901 TryReturnVoid(pBitmap != null, "pBitmap is null");
3903 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
3908 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3909 TryReturnVoid(pBitmap != null, "pBitmap is null");
3911 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
3916 __pThumbnailButton->Draw();
3917 __pThumbnailButton->Show();
3924 AppLogDebug("pThumbnailBitmap is not null");
3926 AppLogDebug("EXIT");
3930 CameraForm::Initialize(void)
3932 AppLogDebug("ENTER");
3933 result r = E_SUCCESS;
3935 Construct(L"IDL_CAMERA_FORM");
3937 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
3938 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
3940 AppLogDebug("EXIT");
3948 CameraForm::InitAppTimer(void)
3950 AppLogDebug("ENTER");
3951 _pAppTimer = new (std::nothrow) Timer();
3952 _pAppTimer->Construct(*this);
3953 AppLogDebug("EXIT");
3957 CameraForm::InitChargingTimer(void)
3959 AppLogDebug("ENTER");
3960 _pChargingTimer = new (std::nothrow) Timer();
3961 _pChargingTimer->Construct(*this);
3962 AppLogDebug("EXIT");
3966 CameraForm::InitChargingCompletedTimer(void)
3968 AppLogDebug("ENTER");
3969 _pChargingCompletedTimer = new (std::nothrow) Timer();
3970 _pChargingCompletedTimer->Construct(*this);
3971 AppLogDebug("EXIT");
3975 CameraForm::InitPreviewFailPopupTimer(void)
3977 AppLogDebug("ENTER");
3978 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
3979 _pPreviewFailPopupTimer->Construct(*this);
3980 AppLogDebug("EXIT");
3984 CameraForm::InitIntervalValueTimer(void)
3986 AppLogDebug("ENTER");
3987 _pIntervalValueTimer = new (std::nothrow) Timer();
3988 _pIntervalValueTimer->Construct(*this);
3989 AppLogDebug("EXIT");
3993 CameraForm::InitCaptureStartTimer(void)
3995 AppLogDebug("ENTER");
3996 _pCaptureStartTimer = new (std::nothrow) Timer();
3997 _pCaptureStartTimer->Construct(*this);
3998 AppLogDebug("EXIT");
4002 CameraForm::InitTouchAutoFocusStartTimer(void)
4004 AppLogDebug("ENTER");
4005 _pTouchAutoFocusTimer = new (std::nothrow) Timer();
4006 _pTouchAutoFocusTimer->Construct(*this);
4007 AppLogDebug("EXIT");
4011 CameraForm::StartInitAppTimer(void)
4013 AppLogDebug("ENTER");
4014 result r = E_SUCCESS;
4016 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4018 _pAppTimer->Cancel();
4020 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4021 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4022 AppLogDebug("EXIT");
4026 CameraForm::StartPreviewFailPopupTimer(void)
4028 AppLogDebug("ENTER");
4029 result r = E_SUCCESS;
4031 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4033 _pPreviewFailPopupTimer->Cancel();
4035 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4036 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4037 AppLogDebug("EXIT");
4041 CameraForm::StartInitChargingCompletedTimer(void)
4043 AppLogDebug("ENTER");
4044 result r = E_SUCCESS;
4045 bool isCharging = false;
4047 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4049 isCharging = _pCameraPresentationModel->IsCharging();
4051 _batteryStatus = GetCurrentBatteryState();
4052 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4054 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4056 if (_pChargingCompletedTimer)
4058 _pChargingCompletedTimer->Cancel();
4065 r = DrawBatteryLevelFull();
4066 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4068 AppLogDebug("EXIT");
4071 _chargingCount = INDEX_UNIT_ZERO;
4073 if (_batteryStatus == BATTERY_STATE_20)
4075 if (_pChargingCompletedTimer)
4077 _pChargingCompletedTimer->Cancel();
4079 r = _pChargingCompletedTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4080 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4085 if (_pChargingCompletedTimer)
4087 _pChargingCompletedTimer->Cancel();
4093 CheckBatteryStatus();
4095 AppLogDebug("EXIT");
4099 CameraForm::StartInitChargingTimer(void)
4101 AppLogDebug("ENTER");
4102 result r = E_SUCCESS;
4103 bool isCharging = false;
4105 TryReturnVoid(_pChargingTimer != null, "_pChargingTimer is null");
4107 isCharging = _pCameraPresentationModel->IsCharging();
4109 _chargingCount = INDEX_UNIT_ZERO;
4113 if (_pChargingTimer)
4115 _pChargingTimer->Cancel();
4117 r = _pChargingTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4118 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4123 if (_pChargingTimer)
4125 _pChargingTimer->Cancel();
4128 AppLogDebug("EXIT");
4132 CameraForm::ToggleCameraDirection(int direction)
4134 AppLogDebug("ENTER");
4135 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4136 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4137 result r = E_SUCCESS;
4139 Point currentPosition;
4140 BufferInfo bufferinfo;
4141 bool isInitCameraStaus = false;
4143 if (_pAppTimer != null)
4145 _pAppTimer->Cancel();
4147 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4148 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
4151 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4153 AppLogDebug("FRONT");
4154 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
4156 else if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
4158 AppLogDebug("BACK");
4159 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_BACK);
4161 TryCatch(r == E_SUCCESS, , "__pCamcorderPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
4163 dim = _pCameraPresentationModel->GetPreviewResolution();
4164 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
4166 AppLogDebug("__screenMode [%d]", __screenMode);
4168 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4170 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
4174 r = SetScreenMode(__screenMode, true);
4176 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
4178 if (__dir == ORIENTATION_STATUS_PORTRAIT
4179 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4181 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
4182 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
4186 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4187 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4192 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
4193 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
4195 if (isInitCameraStaus)
4197 SetCameraSettingsDevice();
4200 AppLogDebug("EXIT");
4208 CameraForm::MakePreviewResolutionList(bool remakeList = false)
4210 AppLogDebug("ENTER");
4211 Dimension dimResolution;
4212 IList* pTempList = null;
4213 String* pItemString = null;
4215 result r = E_SUCCESS;
4218 Dimension dimension;
4219 Dimension tempDimention(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
4220 int previewResolutionIdx = 0;
4224 if (__pPreviewResolutionList)
4226 __pPreviewResolutionList->RemoveAll(true);
4229 delete __pPreviewResolutionList;
4230 __pPreviewResolutionList = null;
4233 if (__pPreviewResolutionList == null)
4235 __pPreviewResolutionList = new (std::nothrow) ArrayList();
4236 r = __pPreviewResolutionList->Construct();
4237 TryCatch(r == E_SUCCESS, , "__pPreviewResolutionList construct fail[%s]", GetErrorMessage(r));
4239 pTempList = _pCameraPresentationModel->GetPreviewResolutionList();
4240 TryCatch(pTempList != null, , "GetPreviewResolutionList() return null");
4241 tot = pTempList->GetCount();
4244 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4246 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4248 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d", dimResolution.width, dimResolution.height);
4250 pItemString = new (std::nothrow) String(tempString);
4251 TryCatch(pItemString != null, , "pItemString is null");
4253 __pPreviewResolutionList->Add(*pItemString);
4255 AppLogDebug("GetPreviewResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4257 if (dimResolution == tempDimention)
4259 previewResolutionIdx = idx;
4265 AppLogDebug("Not Support CaptureResolution");
4268 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(previewResolutionIdx)));
4271 __previewResolutionWidth = dimResolution.width;
4272 __previewResolutionHeight = dimResolution.height;
4274 AppLogDebug("previewResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4276 AppLogDebug("EXIT");
4280 if (__pPreviewResolutionList)
4282 __pPreviewResolutionList->RemoveAll(true);
4284 delete __pPreviewResolutionList;
4285 __pPreviewResolutionList = null;
4290 CameraForm::MakeCaptrueResolutionList(bool remakeList = false)
4292 AppLogDebug("ENTER");
4293 Dimension dimPreviewResolution;
4294 Dimension dimResolution;
4295 IList* pTempList = null;
4296 String* pItemString = null;
4298 result r = E_SUCCESS;
4301 int resolutionRatio = 0;
4305 if (__pCaptureResolutionList)
4307 __pCaptureResolutionList->RemoveAll(true);
4310 delete __pCaptureResolutionList;
4311 __pCaptureResolutionList = null;
4314 if (__pCaptureResolutionList == null)
4316 __pCaptureResolutionList = new (std::nothrow) ArrayList();
4317 r = __pCaptureResolutionList->Construct();
4318 TryCatch(r == E_SUCCESS, , "__pCaptureResolutionList construct fail[%s]", GetErrorMessage(r));
4320 pTempList = _pCameraPresentationModel->GetCaptureResolutionList();
4321 TryCatch(pTempList != null, , "GetCaptureResolutionList() return null");
4322 tot = pTempList->GetCount();
4325 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4327 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4329 if (dimResolution.width >= __previewResolutionWidth && dimResolution.height >= __previewResolutionHeight)
4331 resolutionRatio = (dimResolution.width * MULTIPLY_BY_TEN) / (dimResolution.height);
4333 if (resolutionRatio > NORMAL_MODE_RATIO)
4335 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(16:9)", dimResolution.width, dimResolution.height);
4339 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(4:3)", dimResolution.width, dimResolution.height);
4342 pItemString = new (std::nothrow) String(tempString);
4343 TryCatch(pItemString != null, , "pItemString is null");
4345 __pCaptureResolutionList->Add(*pItemString);
4347 AppLogDebug("GetCaptureResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4353 AppLogDebug("Not Support CaptureResolution");
4357 AppLogDebug("EXIT");
4361 if (__pCaptureResolutionList)
4363 __pCaptureResolutionList->RemoveAll(true);
4365 delete __pCaptureResolutionList;
4366 __pCaptureResolutionList = null;
4371 CameraForm::MakeIsoList(bool remakeList = false)
4373 AppLogDebug("ENTER");
4374 IList* pTempList = null;
4375 String* pItemString = null;
4377 result r = E_SUCCESS;
4381 const mchar* isoMap[] =
4399 __pIsoList->RemoveAll(true);
4406 if (__pIsoList == null)
4408 __pIsoList = new (std::nothrow) ArrayList();
4409 r = __pIsoList->Construct();
4410 TryCatch(r == E_SUCCESS, , "__pIsoList construct fail[%s]", GetErrorMessage(r));
4412 pTempList = _pCameraPresentationModel->GetIsoList();
4413 TryCatch(pTempList != null, , "GetIsoList() return null");
4414 tot = pTempList->GetCount();
4417 for (idx = 0; idx < tot; idx++)
4419 Tizen::Base::Integer* isoObj = (Tizen::Base::Integer*) pTempList->GetAt(idx);
4421 int isoType = isoObj ? isoObj->ToInt() : -INDEX_UNIT_ONE;
4423 if (isoType > 0 && isoType < MAX_ISO_COUNT)
4425 pItemString = new (std::nothrow) String(isoMap[isoType]);
4426 TryCatch(pItemString != null, , "pItemString is null");
4428 AppLogDebug("ISO return is = %d VALUE = %ls", isoType, pItemString->GetPointer());
4429 __pIsoList->Add(*pItemString);
4433 AppLogDebug("isoType out of range");
4439 AppLogDebug("EXIT");
4445 __pIsoList->RemoveAll(true);
4456 CameraForm::MakeSettingPopupTab(bool isShow)
4458 AppLogDebug("ENTER");
4461 if (__pCameraSetting)
4463 __pCameraSetting->SetShowState(true);
4464 __pCameraSetting->Invalidate(true);
4467 if (__pCameraSettingLable)
4469 __pCameraSettingLable->SetShowState(true);
4470 __pCameraSettingLable->Invalidate(true);
4473 if (__pGeneralSetting)
4475 __pGeneralSetting->SetShowState(true);
4476 __pGeneralSetting->Invalidate(true);
4479 if (__pGeneralSettingLable)
4481 __pGeneralSettingLable->SetShowState(true);
4482 __pGeneralSettingLable->Invalidate(true);
4487 if (__pCameraSetting)
4489 __pCameraSetting->SetShowState(false);
4490 __pCameraSetting->Invalidate(true);
4493 if (__pCameraSettingLable)
4495 __pCameraSettingLable->SetShowState(false);
4496 __pCameraSettingLable->Invalidate(true);
4499 if (__pGeneralSetting)
4501 __pGeneralSetting->SetShowState(false);
4502 __pGeneralSetting->Invalidate(true);
4505 if (__pGeneralSettingLable)
4507 __pGeneralSettingLable->SetShowState(false);
4508 __pGeneralSettingLable->Invalidate(true);
4511 AppLogDebug("EXIT");
4515 CameraForm::MakeCameraTabSettingPopup(void)
4517 AppLogDebug("ENTER");
4518 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4519 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4522 MakePreviewResolutionList(true);
4524 MakeCaptrueResolutionList(false);
4530 _pCameraInfoPanel->SetDrawExposure(false);
4532 if (__dir == ORIENTATION_STATUS_PORTRAIT
4533 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4535 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4536 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN);
4540 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4541 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE- H_SETTING_MENU_LIST_MARGIN);
4544 MakeCameraTabMenuString();
4545 SetCameraTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
4546 MakeSettingPopupTab(true);
4548 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
4549 _pCameraInfoPanel->Invalidate(true);
4550 if (_pListViewCameraTabMainMenu == null)
4552 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
4553 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4555 _pListViewCameraTabMainMenu->SetItemProvider(*this);
4556 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
4557 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
4561 _pListViewCameraTabMainMenu->SetShowState(true);
4562 _pListViewCameraTabMainMenu->SetBounds(rectList);
4564 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
4566 _pListViewCameraTabMainMenu->UpdateList();
4567 AppLogDebug("EXIT");
4571 CameraForm::MakeGeneralTabSettingPopup(void)
4573 AppLogDebug("ENTER");
4574 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4575 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4578 _pCameraInfoPanel->SetDrawExposure(false);
4580 if (__dir == ORIENTATION_STATUS_PORTRAIT
4581 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4583 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4584 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT);
4588 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4589 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4592 MakeGeneralTabMenuString();
4593 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
4594 MakeSettingPopupTab(true);
4596 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
4597 _pCameraInfoPanel->Invalidate(true);
4599 if (_pListViewGeneralTabMainMenu == null)
4601 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
4602 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4604 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
4605 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
4606 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
4610 _pListViewGeneralTabMainMenu->SetShowState(true);
4611 _pListViewGeneralTabMainMenu->SetBounds(rectList);
4614 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
4615 _pListViewGeneralTabMainMenu->UpdateList();
4616 AppLogDebug("EXIT");
4620 CameraForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4622 AppLogDebug("ENTER");
4623 AppLogDebug("EXIT");
4627 CameraForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4629 AppLogDebug("ENTER");
4630 result r = E_SUCCESS;
4632 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4634 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4636 r = ProcessCameraTabMainListPopup(index);
4637 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4640 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4642 r = ProcessCameraTabSubListPopup(index);
4643 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4645 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4647 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4649 r = ProcessGeneraTabMainListPopup(index);
4650 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4653 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4655 r = ProcessGeneraTabSubListPopup(index);
4656 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4658 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4660 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4662 r = ProcessFlashListPopup(index);
4663 UpdateUiPanelIcon();
4664 TryReturnVoid(r == E_SUCCESS, "ProcessMainListPopup() fail[%s]", GetErrorMessage(r));
4667 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4669 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4671 r = SubListPopupWhiteBalanceMode(index);
4672 TryReturnVoid(r == E_SUCCESS, "SubListPopupWhiteBalanceMode() fail[%s]", GetErrorMessage(r));
4678 AppLogDebug("OnListViewItemStateChanged is not make");
4680 AppLogDebug("EXIT");
4684 CameraForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4686 AppLogDebug("ENTER");
4687 AppLogDebug("EXIT");
4691 CameraForm::CreateItem(int index, int itemWidth)
4693 AppLogDebug("ENTER");
4694 CustomItem* pItem = null;
4695 bool createSubMenu = false;
4696 bool createGenSubMenu = false;
4697 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
4698 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
4699 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
4700 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
4701 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
4702 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
4703 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
4704 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
4707 if (_pListViewCameraTabSubMenu)
4709 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4711 createSubMenu = true;
4712 pItem = CreateCameraTabSubMenuItem(index, itemWidth);
4716 AppLogDebug("CreateCameraTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4721 AppLogDebug("EXIT");
4727 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4729 if (createSubMenu == false)
4731 pItem = CreateCameraTabMainMenuItem(index, itemWidth);
4735 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4740 AppLogDebug("EXIT");
4746 if (_pListViewGeneralTabSubMenu)
4748 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4750 createGenSubMenu = true;
4751 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4755 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4760 AppLogDebug("EXIT");
4766 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4768 if (createGenSubMenu == false)
4770 AppLogDebug("CreateGeneralTabMainMenuItem");
4771 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4775 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4780 AppLogDebug("EXIT");
4786 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4788 pItem = CreateFlashMainMenuItem(index, itemWidth);
4792 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListFlashMainMenu");
4797 AppLogDebug("EXIT");
4802 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4804 pItem = CreateWhiteBalanceItem(index, itemWidth);
4808 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListWbMainMenu");
4813 AppLogDebug("EXIT");
4818 AppLogDebug("EXIT");
4823 CameraForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4825 AppLogDebug("ENTER");
4829 AppLogDebug("EXIT");
4834 CameraForm::GetItemCount(void)
4836 AppLogDebug("ENTER");
4837 if (_pListViewCameraTabSubMenu)
4839 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4841 AppLogDebug("EXIT");
4842 return GetCameraTabSettingSubMenuCount();
4846 if (_pListViewCameraTabMainMenu)
4848 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4850 AppLogDebug("EXIT");
4851 return GetCameraTabSettingMainMenuCount();
4855 if (_pListViewGeneralTabSubMenu)
4857 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4859 AppLogDebug("EXIT");
4860 return GetGeneralTabSettingSubMenuCount();
4864 if (_pListViewGeneralTabMainMenu)
4866 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4868 AppLogDebug("EXIT");
4869 return GetGeneralTabSettingMainMenuCount();
4873 if (_pListFlashMainMenu)
4875 AppLogDebug("EXIT");
4876 return GetCameraTabSettingMainMenuCount();
4879 if (_pListWbMainMenu)
4881 AppLogDebug("EXIT");
4882 return GetCameraTabSettingMainMenuCount();
4885 AppLogDebug("EXIT");
4890 CameraForm::GetGeneralTabSettingMainMenuCount(void) const
4892 AppLogDebug("ENTER");
4893 AppLogDebug("EXIT");
4894 return __generalTabMainMenuCount;
4898 CameraForm::SetGeneralTabSettingMainMenuCount(int count)
4900 AppLogDebug("ENTER");
4901 __generalTabMainMenuCount = count;
4902 AppLogDebug("EXIT");
4906 CameraForm::GetGeneralTabSettingSubMenuCount(void) const
4908 AppLogDebug("ENTER");
4909 AppLogDebug("EXIT");
4910 return __generalTabSubMenuCount;
4914 CameraForm::SetGeneralTabSettingSubMenuCount(int count)
4916 AppLogDebug("ENTER");
4917 __generalTabSubMenuCount = count;
4918 AppLogDebug("EXIT");
4921 inline GeneralTabSubMenuContent
4922 CameraForm::GetGeneralTabSettingSubMenuMode(void) const
4924 AppLogDebug("ENTER");
4925 AppLogDebug("EXIT");
4926 return __generalTabSettingMode;
4930 CameraForm::SetSettingGenSubMenuMode(const GeneralTabSubMenuContent mode)
4932 AppLogDebug("ENTER");
4933 AppLogDebug("EXIT");
4934 __generalTabSettingMode = mode;
4938 CameraForm::SetGeneralTabSubMenuListviewState(const int menuCount, const GeneralTabSubMenuContent mode)
4940 AppLogDebug("ENTER");
4941 SetGeneralTabSettingSubMenuCount(menuCount);
4942 SetSettingGenSubMenuMode(mode);
4943 AppLogDebug("EXIT");
4947 CameraForm::GetCameraTabSettingMainMenuCount(void) const
4949 AppLogDebug("ENTER");
4950 AppLogDebug("EXIT");
4951 return __cameraTabMainMenuCount;
4955 CameraForm::SetCameraTabSettingMainMenuCount(int count)
4957 AppLogDebug("ENTER");
4958 __cameraTabMainMenuCount = count;
4959 AppLogDebug("EXIT");
4963 CameraForm::GetCameraTabSettingSubMenuCount(void) const
4965 AppLogDebug("ENTER");
4966 AppLogDebug("EXIT");
4967 return __cameraTabSubMenuCount;
4971 CameraForm::SetCameraTabSettingSubMenuCount(int count)
4973 AppLogDebug("ENTER");
4974 __cameraTabSubMenuCount = count;
4975 AppLogDebug("EXIT");
4978 inline CameraTabSubMenuContent
4979 CameraForm::GetCameraTabSettingSubMenuMode(void) const
4981 AppLogDebug("ENTER");
4982 AppLogDebug("EXIT");
4983 return __cameraTabSettingMode;
4987 CameraForm::SetCameraTabSettingSubMenuMode(const CameraTabSubMenuContent mode)
4989 AppLogDebug("ENTER");
4990 AppLogDebug("EXIT");
4991 __cameraTabSettingMode = mode;
4995 CameraForm::SetCameraTabSubMenuListviewState(const int menuCount, const CameraTabSubMenuContent mode)
4997 AppLogDebug("ENTER");
4998 SetCameraTabSettingSubMenuCount(menuCount);
4999 SetCameraTabSettingSubMenuMode(mode);
5000 AppLogDebug("EXIT");
5004 CameraForm::SetMenuTitle(Canvas* pCanvas, const String& str, const int fntSize)
5006 AppLogDebug("ENTER");
5011 result r = E_SUCCESS;
5012 String listName = L"";
5014 TryCatch(pCanvas != null, r = E_SYSTEM, "pCanvas is null");
5016 if (_pListViewCameraTabSubMenu)
5018 listRect = _pListViewCameraTabSubMenu->GetBounds();
5020 else if (_pListViewCameraTabMainMenu)
5022 listRect = _pListViewCameraTabMainMenu->GetBounds();
5023 listName = _pListViewCameraTabMainMenu->GetName();
5025 else if (_pListFlashMainMenu)
5027 listRect = _pListFlashMainMenu->GetBounds();
5028 listName = _pListFlashMainMenu->GetName();
5030 else if (_pListWbMainMenu)
5032 listRect = _pListWbMainMenu->GetBounds();
5033 listName = _pListWbMainMenu->GetName();
5035 else if (_pListViewGeneralTabSubMenu)
5037 listRect = _pListViewGeneralTabSubMenu->GetBounds();
5039 else if (_pListViewGeneralTabMainMenu)
5041 listRect = _pListViewGeneralTabMainMenu->GetBounds();
5042 listName = _pListViewGeneralTabMainMenu->GetName();
5045 pFnt = new (std::nothrow) Font();
5046 pFnt->Construct(FONT_STYLE_PLAIN, fntSize);
5048 r = pFnt->GetTextExtent(str, str.GetLength(), dim);
5049 TryCatch(pFnt != null, , "pFnt GetTextExtent() fail[%s]", GetErrorMessage(r));
5051 r = pCanvas->SetFont(*pFnt);
5052 TryCatch(pFnt != null, , "pCanvas SetFont() fail[%s]", GetErrorMessage(r));
5054 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
5056 point.x = (listRect.width / DIVIDE_BY_TWO) - (dim.width / DIVIDE_BY_TWO);
5057 point.y = (H_SETTING_MENU_PANEL_TITLE / DIVIDE_BY_TWO) - (dim.height / DIVIDE_BY_TWO);
5059 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5061 if (__dir == ORIENTATION_STATUS_PORTRAIT
5062 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5064 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT;
5066 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
5067 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
5069 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE;
5072 else if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)))
5074 point.y += H_FLASH_MODE_TITLE_TOP_MARGIN;
5076 if (__dir == ORIENTATION_STATUS_PORTRAIT
5077 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5079 point.x += X_FLASH_MODE_LIST_START_POS_PORTRAIT;
5083 r = pCanvas->DrawText(point, str);
5084 TryCatch( r == E_SUCCESS, , "pCanvas DrawText() fail[%s]", GetErrorMessage(r));
5089 AppLogDebug("EXIT");
5100 CameraForm::GetTimerIntervalValue(void) const
5102 AppLogDebug("ENTER");
5103 result r = E_SUCCESS;
5104 int timerInterval = 0;
5106 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
5107 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
5109 AppLogDebug("EXIT");
5110 return timerInterval;
5117 CameraForm::SetGuideLine(int guideLineEnable)
5119 AppLogDebug("ENTER");
5120 result r = E_SUCCESS;
5122 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
5123 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
5124 AppLogDebug("EXIT");
5128 CameraForm::RestoreDefaultSetting(void)
5130 AppLogDebug("ENTER");
5131 result r = E_SUCCESS;
5132 int selfPortraitEnable = 0;
5133 bool exposureValue = false;
5134 bool brighnesstValue = false;
5135 int adjustValue = 0;
5137 r = _pCameraPresentationModel->ResetCameraSettingsRegistry();
5138 TryCatch(r == E_SUCCESS, ,"ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
5140 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5141 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5143 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5145 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5149 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5152 if (exposureValue == true && r == E_SUCCESS)
5154 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5155 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5157 AppLogDebug("adjustValue = %d", adjustValue);
5159 _pCameraPresentationModel->SetExposure(adjustValue);
5163 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5165 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5169 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5172 if (brighnesstValue == true && r == E_SUCCESS)
5174 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5175 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5177 AppLogDebug("adjustValue = %d", adjustValue);
5179 _pCameraPresentationModel->SetBrightness(adjustValue);
5183 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5185 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5189 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5194 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5196 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5200 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5202 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5204 AppLogDebug("adjustValue = %d", adjustValue);
5206 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5209 AppLogDebug("EXIT");
5213 AppLogDebug("EXIT - CATCH");
5218 CameraForm::RestorePrimaryResolution(void)
5220 AppLogDebug("ENTER");
5221 result r = E_SUCCESS;
5222 IList* pList = null;
5223 IList* pCaptureResolutionList = null;
5224 int resolutionCnt = 0;
5225 bool wideMode = false;
5226 int resolutionIndex = 0;
5227 int resolutionRatio = 0;
5228 Dimension resolutionDim;
5229 Dimension captureResolutionDim;
5230 BufferInfo bufferinfo;
5232 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5233 _pAppTimer->Cancel();
5235 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5236 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5238 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5240 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5242 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5244 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5246 if (resolutionRatio > NORMAL_MODE_RATIO)
5250 SetOverlayPanelWideMode(true);
5252 SetOverlayRendererRotation();
5258 SetOverlayPanelNormalMode(true);
5260 SetOverlayRendererRotation();
5263 _pCameraPresentationModel->KeepScreenOnState(true, false);
5265 _pCameraPresentationModel->StopCamera();
5267 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
5268 TryCatch(r == E_SUCCESS, , "SetMode fail[%s]", GetErrorMessage(r));
5270 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5272 resolutionCnt = pList->GetCount();
5274 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5276 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5278 __captureResolutionWidth = captureResolutionDim.width;
5280 __captureResolutionHeight = captureResolutionDim.height;
5282 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5284 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5286 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5287 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
5289 _pCameraPresentationModel->StartPreview(&bufferinfo);
5291 _pCameraPresentationModel->SetContinuousAutoFocus();
5293 if (wideMode == true)
5295 __pOverlayPanel->AddTouchEventListener(*this);
5297 HidePanel(true, true);
5299 __screenMode = SCREEN_MODE_FULL;
5303 __pOverlayPanel->RemoveTouchEventListener(*this);
5305 HidePanel(false, true);
5307 __screenMode = SCREEN_MODE_NORMAL;
5310 AppLogDebug("EXIT");
5314 __screenMode = SCREEN_MODE_NORMAL;
5320 CameraForm::RestoreSecondaryResolution(void)
5322 AppLogDebug("ENTER");
5323 result r = E_SUCCESS;
5324 IList* pList = null;
5325 IList* pCaptureResolutionList = null;
5326 int resolutionCnt = 0;
5327 bool wideMode = false;
5328 int resolutionIndex = 0;
5329 int resolutionRatio = 0;
5330 Dimension resolutionDim;
5331 Dimension captureResolutionDim;
5333 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5334 _pAppTimer->Cancel();
5336 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5337 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5339 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5341 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5343 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5345 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5347 if (resolutionRatio > NORMAL_MODE_RATIO)
5356 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5358 resolutionCnt = pList->GetCount();
5360 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5362 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5364 __captureResolutionWidth = captureResolutionDim.width;
5366 __captureResolutionHeight = captureResolutionDim.height;
5368 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5370 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5372 __secondaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5374 if (wideMode == true)
5376 __pOverlayPanel->AddTouchEventListener(*this);
5378 HidePanel(true, true);
5380 __screenMode = SCREEN_MODE_FULL;
5384 __pOverlayPanel->RemoveTouchEventListener(*this);
5386 HidePanel(false, true);
5388 __screenMode = SCREEN_MODE_NORMAL;
5391 AppLogDebug("EXIT");
5399 CameraForm::DrawMarker(bool useGuidline)
5401 AppLogDebug("ENTER");
5402 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5403 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5404 result r = E_SUCCESS;
5406 if (__dir == ORIENTATION_STATUS_PORTRAIT
5407 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5409 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5410 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5414 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5415 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5420 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5424 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5426 _pCameraInfoPanel->Invalidate(true);
5428 AppLogDebug("EXIT");
5433 CameraForm::DrawFocus(int focusMode)
5435 AppLogDebug("ENTER");
5436 int selfPortraitEnable = 0;
5437 bool focusSupport = false;
5438 result r = E_SUCCESS;
5439 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5440 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5442 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5443 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5445 if (__dir == ORIENTATION_STATUS_PORTRAIT
5446 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5448 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5449 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5453 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5454 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5457 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5459 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5463 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
5466 if (focusSupport == true && r == E_SUCCESS)
5468 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5470 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5471 _pCameraInfoPanel->Invalidate(true);
5475 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5476 _pCameraInfoPanel->Invalidate(true);
5479 AppLogDebug("EXIT");
5487 CameraForm::DrawTimerPopup(void)
5489 AppLogDebug("ENTER");
5490 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5491 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5492 result r = E_SUCCESS;
5494 if (__dir == ORIENTATION_STATUS_PORTRAIT
5495 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5497 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5498 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5502 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5503 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5506 _pCameraInfoPanel->SetDrawPopupTimer(true);
5507 _pCameraInfoPanel->Invalidate(true);
5511 AppLogDebug("EXIT");
5516 CameraForm::SetFlashPopop(void)
5518 AppLogDebug("ENTER");
5519 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5520 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5521 MakeSettingPopupTab(false);
5524 if (__dir == ORIENTATION_STATUS_PORTRAIT
5525 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5527 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5528 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5532 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5533 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5536 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5537 _pCameraInfoPanel->Invalidate(true);
5538 SetCameraTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5540 if (_pListFlashMainMenu == null)
5542 _pListFlashMainMenu = new (std::nothrow) ListView();
5543 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5545 _pListFlashMainMenu->SetItemProvider(*this);
5546 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5547 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5551 _pListFlashMainMenu->SetBounds(rectList);
5552 _pListFlashMainMenu->SetShowState(true);
5554 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5556 _pListFlashMainMenu->UpdateList();
5557 AppLogDebug("EXIT");
5561 CameraForm::SetWhiteBalancePopop(void)
5563 AppLogDebug("ENTER");
5564 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5565 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5566 MakeSettingPopupTab(false);
5569 if (__dir == ORIENTATION_STATUS_PORTRAIT
5570 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5572 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5573 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5577 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5578 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5581 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5582 _pCameraInfoPanel->Invalidate(true);
5583 SetCameraTabSettingMainMenuCount(MAX_WHITE_BALANCE_MENU_COUNT);
5585 if (_pListWbMainMenu == null)
5587 _pListWbMainMenu = new (std::nothrow) ListView();
5588 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5590 _pListWbMainMenu->SetItemProvider(*this);
5591 _pListWbMainMenu->AddListViewItemEventListener(*this);
5592 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5596 _pListWbMainMenu->SetBounds(rectList);
5597 _pListWbMainMenu->SetShowState(true);
5599 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5601 _pListWbMainMenu->UpdateList();
5602 AppLogDebug("EXIT");
5606 CameraForm::ProcessFlashListPopup(int index)
5608 AppLogDebug("ENTER");
5609 Rectangle rectPanel;
5611 String strTitle = L"";
5612 String listName = L"";
5613 Bitmap* pBitmapNormal = null;
5614 Bitmap* pBitmapPress = null;
5615 result r = E_SUCCESS;
5616 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5618 AppLogDebug("Sub Menu (%d)", index);
5621 int selfPortraitEnable = 0;
5623 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5624 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5626 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5627 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5629 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5631 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5633 regVal = SUBMENU_MODE_OFF;
5634 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5635 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5636 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5640 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5642 if (value == true && r == E_SUCCESS)
5644 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5648 case SUBMENU_MODE_OFF:
5650 regVal = SUBMENU_MODE_OFF;
5651 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5652 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5653 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5657 case SUBMENU_MODE_ON:
5659 regVal = SUBMENU_MODE_ON;
5660 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5661 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5662 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5666 case SUBMENU_MODE_AUTO:
5668 regVal = SUBMENU_MODE_AUTO;
5669 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5670 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5671 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5681 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5683 regVal = SUBMENU_MODE_OFF;
5684 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5685 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5686 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5690 _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5693 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5695 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5697 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5698 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5700 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5702 delete pBitmapNormal;
5703 pBitmapNormal = null;
5705 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5706 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5708 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5710 delete pBitmapPress;
5711 pBitmapPress = null;
5717 SetCameraTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5718 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5720 _pCameraPresentationModel->SetFlashMode(cameraFlashMode);
5722 AppLogDebug("EXIT");
5730 CameraForm::ProcessCameraTabMainListPopup(int index)
5732 AppLogDebug("ENTER");
5733 Rectangle rectPanel;
5735 String strTitle = L"";
5736 String listName = L"";
5737 bool resetPanel = false;
5738 int subPanelItemCount = 0;
5740 int captureResolutionCount = 0;
5741 result r = E_SUCCESS;
5742 bool drawPopup = true;
5744 listName = _pListViewCameraTabMainMenu->GetName();
5746 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
5747 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
5749 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5751 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5753 _pCameraInfoSubPanel->SetShowState(false);
5754 _pCameraInfoSubPanel->RemoveControl(_pListViewCameraTabSubMenu);
5755 _pListViewCameraTabSubMenu = null;
5756 RemoveControl(_pCameraInfoSubPanel);
5757 _pCameraInfoSubPanel = null;
5759 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5764 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5766 int selfPortraitEnable = 0;
5768 AppLogDebug("Set ISO");
5771 int isoCnt = __pIsoList->GetCount();
5773 subPanelItemCount = isoCnt;
5774 if (subPanelItemCount> 5)
5780 int X_Panel = X_SUBMENU_ISO_MODE_PANEL;
5781 int Y_Panel = Y_SUBMENU_ISO_MODE_PANEL;
5782 int W_Panel = W_SUBMENU_ISO_MODE_PANEL;
5783 int H_Panel = Y_SUBMENU_ISO_MODE_LIST + (isoCnt * H_SUBMENU_ISO_MODE_PANEL_MARGIN);
5785 int X_List = X_SUBMENU_ISO_MODE_LIST;
5786 int Y_List = Y_SUBMENU_ISO_MODE_LIST;
5787 int W_List = W_SUBMENU_ISO_MODE_LIST;
5788 int H_List = (isoCnt * H_SUBMENU_ISO_MODE_LIST_MARGIN);
5790 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel + 20);
5791 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5793 pAppResource->GetString(IDS_CAM_BODY_ISO, strTitle);
5794 SetCameraTabSubMenuListviewState(isoCnt, CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE);
5798 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5799 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5801 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5803 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
5807 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
5812 AppLogDebug("Support ISO");
5816 r = _pCameraPresentationModel->SetValue(ISO_VALUE, REG_DEFAULT_VAULE_ZERO);
5817 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
5824 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5826 if (__pCaptureResolutionList)
5828 captureResolutionCount = __pCaptureResolutionList->GetCount();
5830 subPanelItemCount = captureResolutionCount;
5831 if (subPanelItemCount > 5)
5836 if (captureResolutionCount > 1)
5838 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5839 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL;
5840 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5841 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captureResolutionCount * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5843 int X_List = X_SUBMENU_WB_MODE_LIST;
5844 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5845 int W_List = W_SUBMENU_WB_MODE_LIST;
5846 int H_List = (captureResolutionCount * W_SUBMENU_WB_MODE_LIST_MARGIN);
5848 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5849 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5851 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5852 SetCameraTabSubMenuListviewState(captureResolutionCount, CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE);
5858 AppLogDebug("captrueResolutionCnt count is %d",captureResolutionCount);
5865 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5866 AppLogDebug("Invaild index");
5874 if (__dir == ORIENTATION_STATUS_PORTRAIT
5875 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5877 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5878 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5882 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5886 rectList.height = rectList.height - 40 - (subPanelItemCount-5)*72;
5887 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
5889 rectPanel.height = rectPanel.height - 100;
5892 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
5894 rectPanel.height = rectPanel.height - 198;
5895 rectList.height = rectList.height - 20;
5900 if (_pCameraInfoSubPanel == null)
5902 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5903 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5905 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5906 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5908 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5909 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5910 AddOrientationEventListener(*this);
5911 AddControl(_pCameraInfoSubPanel);
5912 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5915 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5916 _pCameraInfoPanel->Invalidate(true);
5917 _pCameraInfoSubPanel->Invalidate(true);
5919 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5920 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5922 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5923 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5924 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5926 _pListViewCameraTabSubMenu->UpdateList();
5930 AppLogDebug("EXIT");
5934 if (_pCameraInfoSubPanel)
5936 RemoveControl(_pCameraInfoSubPanel);
5937 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5941 delete _pListViewCameraTabSubMenu;
5944 _pCameraInfoSubPanel = null;
5945 _pListViewCameraTabSubMenu = null;
5951 CameraForm::ProcessCameraTabSubListPopup(int index)
5953 AppLogDebug("ENTER");
5954 String strRegKey = IDS_INIT_REG_KEY;
5955 result r = E_SUCCESS;
5956 int selfPortraitEnable = 0;
5957 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
5959 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5960 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5962 idx = GetCameraTabSettingSubMenuMode();
5966 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5968 r = SubListPopupIsoMode(index);
5969 TryCatch(r == E_SUCCESS, , "SubListPopupIsoMode() fail[%s]", GetErrorMessage(r));
5973 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5975 r = SubListPopupResolutionMode(index);
5976 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
5984 MakeSettingPopupTab(false);
5988 AppLogDebug("EXIT");
5998 CameraForm::ProcessGeneraTabMainListPopup(int index)
6000 AppLogDebug("ENTER");
6001 Rectangle rectPanel;
6003 String strTitle = L"";
6004 String listName = L"";
6006 result r = E_SUCCESS;
6007 bool drawPopup = true;
6009 listName = _pListViewGeneralTabMainMenu->GetName();
6011 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
6012 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
6014 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
6016 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
6018 _pCameraInfoGeneralSubPanel->SetShowState(false);
6019 _pCameraInfoGeneralSubPanel->RemoveControl(_pListViewGeneralTabSubMenu);
6020 _pListViewGeneralTabSubMenu = null;
6021 RemoveControl(_pCameraInfoGeneralSubPanel);
6022 _pCameraInfoGeneralSubPanel = null;
6024 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6029 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6031 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
6032 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
6033 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL);
6034 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
6035 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
6036 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
6040 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6042 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
6043 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
6045 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
6046 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL);
6047 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
6048 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
6052 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6054 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
6055 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
6056 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL);
6057 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
6058 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
6059 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
6063 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6067 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
6069 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
6072 if (_pResetPopUp == null)
6074 _pResetPopUp = new (std::nothrow) Popup();
6075 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
6076 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
6081 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
6082 TryCatch(_pYes != null, , "Reset Popup not created!");
6083 _pYes->SetActionId(IDA_BTN_YES);
6084 _pYes->AddActionEventListener(*this);
6085 _pYes->SetShowState(true);
6090 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
6091 TryCatch(_pNo != null, , "Reset Popup not created!");
6092 _pNo->SetActionId(IDA_BTN_NO);
6093 _pNo->AddActionEventListener(*this);
6094 _pNo->SetShowState(true);
6095 _pResetPopUp->Show();
6098 _pResetPopUp->SetShowState(true);
6099 _pResetPopUp->Invalidate(true);
6100 _pResetPopUp->Show();
6104 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6106 result r = E_SUCCESS;
6108 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
6109 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6111 r = SetScreenOverlayHelpTimer();
6112 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6114 r = DrawScreenOverlayHelp();
6115 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6119 MakeSettingPopupTab(false);
6128 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6129 AppLogDebug("Invaild index");
6137 if (__dir == ORIENTATION_STATUS_PORTRAIT
6138 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6140 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
6141 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
6145 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
6148 if (_pCameraInfoGeneralSubPanel == null)
6150 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
6151 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
6153 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
6154 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
6156 if (index == GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
6157 index == GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
6158 index == GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
6160 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
6162 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
6163 AddOrientationEventListener(*this);
6164 AddControl(_pCameraInfoGeneralSubPanel);
6165 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
6168 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
6169 _pCameraInfoPanel->Invalidate(true);
6170 _pCameraInfoGeneralSubPanel->Invalidate(true);
6172 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
6173 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
6175 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
6176 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
6177 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
6179 _pListViewGeneralTabSubMenu->UpdateList();
6183 AppLogDebug("EXIT");
6187 if (_pCameraInfoGeneralSubPanel)
6189 RemoveControl(_pCameraInfoGeneralSubPanel);
6190 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6194 delete _pListViewGeneralTabSubMenu;
6197 _pCameraInfoGeneralSubPanel = null;
6198 _pListViewGeneralTabSubMenu = null;
6200 AppLogDebug("EXIT - CATCH");
6205 CameraForm::ProcessGeneraTabSubListPopup(int index)
6207 AppLogDebug("ENTER");
6208 String strRegKey = IDS_INIT_REG_KEY;
6209 result r = E_SUCCESS;
6210 int selfPortraitEnable = 0;
6211 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6213 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6214 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6216 idx = GetGeneralTabSettingSubMenuMode();
6220 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6222 r = SubListPopupTimerMode(index);
6223 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6227 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6229 r = SubListPopupGuidelineMode(index);
6230 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6234 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6236 SubListPopupStorageTypeMode(index);
6240 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6245 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6254 MakeSettingPopupTab(false);
6258 AppLogDebug("EXIT");
6262 MakeSettingPopupTab(false);
6269 CameraForm::StartPopupTimer(void)
6271 AppLogDebug("ENTER");
6272 result r = E_SUCCESS;
6273 int timerInterval = 0;
6277 _pPopupTimer = new (std::nothrow) Timer();
6279 _pPopupTimer->Construct(*this);
6281 r = _pPopupTimer->StartAsRepeatable(CAMERA_TIMER_1_SEC);
6282 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6284 timerInterval = GetTimerIntervalValue();
6286 switch (timerInterval)
6288 case SETTING_TIMER_CAPTURE_2_SEC:
6290 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6294 case SETTING_TIMER_CAPTURE_5_SEC:
6296 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6300 case SETTING_TIMER_CAPTURE_10_SEC:
6302 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6310 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6311 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6312 _pCameraInfoPanel->Invalidate(true);
6314 AppLogDebug("EXIT");
6318 delete _pPopupTimer;
6319 _pPopupTimer = null;
6325 CameraForm::StopPopupTimer(void)
6327 AppLogDebug("ENTER");
6328 result r = E_SUCCESS;
6329 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6331 r = _pPopupTimer->Cancel();
6333 delete _pPopupTimer;
6334 _pPopupTimer = null;
6336 AppLogDebug("EXIT");
6344 CameraForm::SetCameraSettingsDevice(void)
6346 AppLogDebug("ENTER");
6351 result r = E_SUCCESS;
6352 int selfPortraitEnable = 0;
6353 bool exposureValue = false;
6354 bool brighnesstValue = false;
6355 int updatedIndex = 0;
6357 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6358 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6360 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6362 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6366 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6369 if (exposureValue == true && r == E_SUCCESS)
6371 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6372 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6374 _pCameraPresentationModel->SetExposure(exposure);
6378 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6380 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6384 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6387 if (brighnesstValue == true && r == E_SUCCESS)
6389 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
6390 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
6392 _pCameraPresentationModel->SetBrightness(brightness);
6396 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6398 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
6402 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
6407 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
6408 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
6412 updatedIndex = isoIndex + 2;
6416 updatedIndex = isoIndex + 3;
6418 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
6421 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6423 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
6427 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
6432 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6434 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
6438 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
6441 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6443 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
6445 AppLogDebug("EXIT");
6449 CameraForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
6451 AppLogDebug("ENTER");
6452 Bitmap* pBitmap = null;
6453 ByteBuffer* pSrcByteBuff = null;
6454 ByteBuffer dstByteBuff;
6455 BufferInfo buffInfo;
6456 result r = E_SUCCESS;
6460 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
6462 if (rotationType == IMAGE_ROTATION_0)
6464 pBitmap = new (std::nothrow) Bitmap();
6465 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
6466 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6468 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
6472 dim.width = pSrcBitmap->GetWidth();
6473 dim.height = pSrcBitmap->GetHeight();
6475 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
6477 r = dstByteBuff.Construct(size);
6478 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6480 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
6481 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6483 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
6484 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
6486 dim.width = buffInfo.width;
6487 dim.height = buffInfo.height;
6489 size = buffInfo.pitch * buffInfo.height;
6491 pSrcByteBuff = new (std::nothrow) ByteBuffer();
6492 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
6494 r = pSrcByteBuff->Construct(size);
6495 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6497 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
6498 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6500 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
6501 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
6503 r = pSrcBitmap->Unlock();
6504 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
6506 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
6507 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
6509 if (rotationType == IMAGE_ROTATION_90
6510 || rotationType == IMAGE_ROTATION_270)
6512 dim.width = buffInfo.height;
6513 dim.height = buffInfo.width;
6517 dim.width = buffInfo.width;
6518 dim.height = buffInfo.height;
6521 pBitmap = new (std::nothrow) Bitmap();
6522 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
6523 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6525 delete pSrcByteBuff;
6526 pSrcByteBuff = null;
6528 AppLogDebug("EXIT");
6532 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
6533 if (pSrcByteBuff != null)
6535 delete pSrcByteBuff;
6536 pSrcByteBuff = null;
6539 if (pBitmap != null) //Prevent issue fix.
6547 CameraForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
6549 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
6550 result r = E_SUCCESS;
6551 int adjustEntryValue = 0;
6552 int currentEntryValue = 0;
6554 bool exposureValue = false;
6555 bool brighnesstValue = false;
6556 int selfPortraitEnable = 0;
6557 bool IsSliderAdjustValue = false;
6559 if (__dir == ORIENTATION_STATUS_PORTRAIT
6560 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6562 step = movableValidRect.width / maxEntryValue;
6563 if (currentPosition.x > movableValidRect.x)
6565 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
6567 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6568 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6569 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
6571 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
6576 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6579 IsSliderAdjustValue = true;
6583 IsSliderAdjustValue = false;
6588 step = movableValidRect.height / maxEntryValue;
6589 if (currentPosition.y > movableValidRect.y)
6591 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
6592 IsSliderAdjustValue = true;
6596 IsSliderAdjustValue = false;
6600 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6601 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6603 if (entryName.Equals(String(EXPOSURE_VALUE)))
6605 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6607 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6611 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6614 if (exposureValue == true && r == E_SUCCESS)
6616 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
6617 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6621 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6623 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6627 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6630 if (brighnesstValue == true && r == E_SUCCESS)
6632 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
6633 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6637 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6638 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
6640 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6642 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6646 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6649 if (exposureValue == true && r == E_SUCCESS)
6651 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
6652 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6656 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6658 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6662 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6665 if (brighnesstValue == true && r == E_SUCCESS)
6667 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
6668 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6672 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6674 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6678 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6681 if (exposureValue == true && r == E_SUCCESS)
6683 _pCameraPresentationModel->SetExposure(adjustEntryValue);
6687 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6689 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6693 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6696 if (brighnesstValue == true && r == E_SUCCESS)
6698 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
6702 AppLogDebug("Exposure do not support");
6708 AppLogDebug("EXIT");
6716 CameraForm::CreateExposureSlider(void)
6718 AppLogDebug("ENTER");
6719 result r = E_SUCCESS;
6721 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
6723 _closeTimerValue = 0;
6724 _pExposureCloseTimer = new (std::nothrow) Timer();
6725 _pExposureCloseTimer->Construct(*this);
6727 _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
6728 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
6730 _pCameraInfoPanel->SetDrawExposure(true);
6731 _pCameraInfoPanel->Invalidate(true);
6733 AppLogDebug("EXIT");
6737 delete _pExposureCloseTimer;
6738 _pExposureCloseTimer = null;
6744 CameraForm::DrawExposureSlider(void)
6746 AppLogDebug("ENTER");
6747 Point buttonPosition;
6748 result r = E_SUCCESS;
6749 Rectangle rectSlider;
6752 int selfPortraitEnable = 0;
6753 bool exposureValue = false;
6754 bool brighnesstValue = false;
6756 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6757 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6759 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6761 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6765 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6768 if (exposureValue == true && r == E_SUCCESS)
6770 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6771 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6772 AppLogDebug("Exposure value %d", exposure);
6776 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6778 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6782 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6785 if (brighnesstValue == true && r == E_SUCCESS)
6787 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
6788 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6789 AppLogDebug("Exposure value %d", exposure);
6793 if (__dir == ORIENTATION_STATUS_PORTRAIT
6794 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6796 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6797 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6798 step = rectSlider.width / MAX_CAMERA_EXPOSURE_VALUE;
6800 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + rectSlider.x;
6801 buttonPosition.y = rectSlider.y;
6802 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
6806 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6807 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6808 step = rectSlider.height / MAX_CAMERA_EXPOSURE_VALUE;
6810 buttonPosition.x = rectSlider.x;
6811 buttonPosition.y = (step * exposure) + rectSlider.y;
6812 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
6815 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
6816 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6818 AppLogDebug("EXIT");
6826 CameraForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
6828 AppLogDebug("ENTER");
6829 result r = E_SUCCESS;
6830 Point buttonPosition;
6831 Rectangle rectSlider;
6832 float adjustedXvalue = 0;
6833 int adjustedXinInt = 0;
6835 bool IsSliderRectValid = false;
6837 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
6839 if (__dir == ORIENTATION_STATUS_PORTRAIT
6840 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6842 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6843 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6846 case DRAW_INITIALIZED:
6848 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6849 buttonPosition.y = currentPosition.y;
6850 IsSliderRectValid = true;
6856 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6858 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6860 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6861 buttonPosition.y = rectSlider.y;
6862 IsSliderRectValid = true;
6863 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
6865 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6866 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6868 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6869 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6871 if ((adjustedXvalue - adjustedXinInt) != 0)
6873 adjustedXinInt = adjustedXinInt+1;
6876 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
6878 buttonPosition.x = X_EXPOSURE_PANEL_SIDER_PORTRAIT + adjustedXinInt;
6879 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
6880 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6881 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6886 IsSliderRectValid = false;
6893 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6895 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6897 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6898 buttonPosition.y = rectSlider.y;
6899 IsSliderRectValid = true;
6900 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6901 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6906 IsSliderRectValid = false;
6909 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6911 IsSliderRectValid = false;
6922 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6923 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6926 case DRAW_INITIALIZED:
6928 buttonPosition.x = currentPosition.x;
6929 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6930 IsSliderRectValid = true;
6936 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6938 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6940 buttonPosition.x = rectSlider.x;
6941 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6942 IsSliderRectValid = true;
6943 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6944 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6949 IsSliderRectValid = false;
6956 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6958 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6960 buttonPosition.x = rectSlider.x;
6961 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6962 IsSliderRectValid = true;
6963 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6964 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6969 IsSliderRectValid = false;
6972 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6974 IsSliderRectValid = false;
6984 if (IsSliderRectValid)
6986 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
6987 _pCameraInfoPanel->Invalidate(true);
6990 AppLogDebug("EXIT");
6998 CameraForm::ShowExposureSlider(void)
7000 AppLogDebug("ENTER");
7001 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7002 bool exposureValue = false;
7003 bool brighnesstValue = false;
7004 result r = E_SUCCESS;
7006 if (_pExposureCloseTimer)
7008 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7009 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7011 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7015 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7017 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7021 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7024 if (exposureValue == true && r == E_SUCCESS)
7026 r = CreateExposureSlider();
7027 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7029 r = DrawExposureSlider();
7030 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7034 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7036 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7040 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7043 if (brighnesstValue == true && r == E_SUCCESS)
7045 r = CreateExposureSlider();
7046 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7048 r = DrawExposureSlider();
7049 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7054 AppLogDebug("EXIT");
7058 CameraForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7060 AppLogDebug("ENTER");
7061 result r = E_SUCCESS;
7062 bool modified = false;
7063 bool isValidRect = false;
7064 Dimension dimRendererSize;
7066 if (__screenMode == SCREEN_MODE_NORMAL)
7068 Dimension dim = Dimension(0, 0);
7069 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7070 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7071 Rectangle clientRect = GetClientAreaBounds();
7072 bool isToCompensated = false;
7074 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7075 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7077 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7079 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7080 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7084 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7085 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7090 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7092 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7093 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7097 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7098 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7102 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7104 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7105 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7107 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7108 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7110 if (modified == true)
7112 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7115 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7116 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7118 if (evaluateBoundsRect.height == rect.height)
7120 isToCompensated = false;
7124 isToCompensated = true;
7129 if (evaluateBoundsRect.width == rect.width)
7131 isToCompensated = false;
7135 isToCompensated = true;
7139 r = __pOverlayPanel->SetBounds(rect);
7140 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7141 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7143 if (isToCompensated == true)
7145 AppLogDebug("isToCompensated = true");
7147 rect = __pOverlayPanel->GetBounds();
7148 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7150 r = __pOverlayPanel->SetBounds(rect);
7151 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7152 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7155 dimRendererSize = __pOverlayPanel->GetSize();
7156 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7157 __pOverlayPanel->SetRenderSize(dimRendererSize);
7161 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7162 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7163 Rectangle clientRect = GetClientAreaBounds();
7164 bool isToCompensated = false;
7166 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7167 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7169 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7171 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7175 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7180 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7182 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7186 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7190 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7192 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7193 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7195 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7196 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7198 if (modified == true)
7200 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7203 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7204 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7206 if (evaluateBoundsRect.height == rect.height)
7208 isToCompensated = false;
7212 isToCompensated = true;
7217 if (evaluateBoundsRect.width == rect.width)
7219 isToCompensated = false;
7223 isToCompensated = true;
7227 r = __pOverlayPanel->SetBounds(rect);
7228 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7229 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7231 if (isToCompensated == true)
7233 AppLogDebug("isToCompensated = true");
7234 rect = __pOverlayPanel->GetBounds();
7235 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7237 r = __pOverlayPanel->SetBounds(rect);
7238 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7239 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7242 dimRendererSize = __pOverlayPanel->GetSize();
7243 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7244 __pOverlayPanel->SetRenderSize(dimRendererSize);
7246 AppLogDebug("EXIT");
7250 CameraForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7252 AppLogDebug("ENTER");
7253 result r = E_SUCCESS;
7254 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7255 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7256 Rectangle clientRect = GetClientAreaBounds();
7257 BufferInfo bufferinfo;
7258 String listName = L"";
7259 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7260 int guideLineEnable = DISABLE_GUIDELINE;
7262 if (_appControlActionCompleted)
7264 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7266 if (__dir != orientationStatus)
7268 __dir = orientationStatus;
7269 __deviceOrientation = orientationStatus;
7274 if (__dir != orientationStatus)
7276 __isOrientationChanged = true;
7278 if (_pAppTimer != null)
7280 _pAppTimer->Cancel();
7282 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
7284 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7285 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7287 SetOverlayPanelOrientationChanged(orientationStatus);
7289 if (__pOverlayPanel)
7291 switch (orientationStatus)
7293 case ORIENTATION_STATUS_PORTRAIT:
7295 AppLogDebug("PORTRAIT");
7296 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7300 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7302 AppLogDebug("PORTRAIT_REVERSE");
7303 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7307 case ORIENTATION_STATUS_LANDSCAPE:
7309 AppLogDebug("LANDSCAPE");
7310 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7314 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7316 AppLogDebug("LANDSCAPE_REVERSE");
7317 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7326 if (__screenMode == SCREEN_MODE_FULL)
7328 HidePanel(true, true);
7331 __dir = orientationStatus;
7332 __deviceOrientation = orientationStatus;
7334 AppLogDebug("__dir = %d", __dir);
7335 _pCameraPresentationModel->SetOrientation(__dir);
7337 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7338 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7340 if (guideLineEnable == DISABLE_GUIDELINE)
7349 UpdateUiPanelIcon();
7350 UpdateUiActionPanelIcon();
7351 OnHelpCloseTimerExpired();
7353 if (__isTimerRunning)
7355 if (_pHelpCloseTimer)
7357 _pHelpCloseTimer->Cancel();
7359 delete _pHelpCloseTimer;
7360 _pHelpCloseTimer = null;
7363 HideScreenOverlayHelp();
7366 if (_pListViewCameraTabMainMenu != null)
7368 listName = _pListViewCameraTabMainMenu->GetName();
7369 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7375 if (_pListViewGeneralTabMainMenu != null)
7377 listName = _pListViewGeneralTabMainMenu->GetName();
7378 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7384 if (_pListFlashMainMenu != null)
7386 listName = _pListFlashMainMenu->GetName();
7388 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME))&& _pListFlashMainMenu->GetShowState() == true)
7394 if (_pListWbMainMenu != null)
7396 listName = _pListWbMainMenu->GetName();
7398 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME))&& _pListWbMainMenu->GetShowState() == true)
7404 if (_pListViewCameraTabSubMenu != null)
7406 if (_pListViewCameraTabSubMenu->GetShowState() == true)
7412 if (_pListViewGeneralTabSubMenu != null)
7414 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
7420 ShowExposureSlider();
7422 MakeSettingPopupTab(false);
7425 __isOrientationChanged = false;
7427 AppLogDebug("EXIT");
7431 CameraForm::HidePopup(void)
7433 AppLogDebug("ENTER");
7434 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
7436 if (_pListViewCameraTabSubMenu)
7438 if (_pCameraInfoSubPanel != null)
7440 _pCameraInfoSubPanel->SetShowState(false);
7443 _pListViewCameraTabSubMenu->SetShowState(false);
7446 if (_pListViewCameraTabMainMenu)
7448 _pListViewCameraTabMainMenu->SetShowState(false);
7451 if (_pListFlashMainMenu)
7453 _pListFlashMainMenu->SetShowState(false);
7456 if (_pListWbMainMenu)
7458 _pListWbMainMenu->SetShowState(false);
7461 if (_pListViewGeneralTabSubMenu)
7463 if (_pCameraInfoGeneralSubPanel != null)
7465 _pCameraInfoGeneralSubPanel->SetShowState(false);
7467 _pListViewGeneralTabSubMenu->SetShowState(false);
7470 if (_pListViewGeneralTabMainMenu)
7472 _pListViewGeneralTabMainMenu->SetShowState(false);
7475 _pCameraInfoPanel->SetDrawExposure(false);
7476 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7477 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7478 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7479 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7481 if (__isOrientationChanged)
7483 __isOrientationChanged = false;
7484 _pCameraInfoPanel->Invalidate(true);
7488 _pCameraInfoPanel->Draw();
7489 _pCameraInfoPanel->Show();
7491 __resolutionChange = false;
7492 AppLogDebug("EXIT");
7496 CameraForm::CheckStorageInfo(void)
7498 AppLogDebug("ENTER");
7499 result r = E_SUCCESS;
7500 MessageBox messageBox;
7502 String strTemp = L"";
7503 int remainedNum = 0;
7505 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
7506 AppLogDebug("CheckStorageInfo remainedNum = %d", remainedNum);
7508 if (remainedNum == STORAGE_VALUE_ZERO)
7510 if (__lowMemoryCapacity == false)
7512 __lowMemoryCapacity = true;
7513 __isMemoryFull = false;
7514 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);
7516 else if (__lowMemoryCapacity == true)
7518 __isMemoryFull = true;
7519 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
7521 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
7523 r = messageBox.ShowAndWait(result);
7524 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
7528 case MSGBOX_RESULT_OK:
7530 if (__lowMemoryCapacity == true)
7532 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7533 _pCameraInfoPanel->SetStorageTitle(strTemp);
7534 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7535 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7536 _pCameraInfoPanel->Invalidate(true);
7539 if (__isMemoryFull == true)
7541 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7542 _pCameraInfoPanel->SetStorageTitle(strTemp);
7543 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7544 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7545 _pCameraInfoPanel->Invalidate(true);
7554 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
7558 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
7560 _pCameraInfoPanel->SetStorageTitle(strTemp);
7561 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
7562 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
7563 _pCameraInfoPanel->Invalidate(true);
7566 SetExifOrientation(__deviceOrientation);
7570 AppLogDebug("EXIT");
7574 CameraForm::AppControlRequestHideButton(void)
7576 AppLogDebug("ENTER");
7577 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7578 const IMap* pArguments = pApp->GetAppControlArguments();
7579 if (pArguments == null)
7581 AppLogDebug("pAllowSwtich is null");
7582 if (__pCameraIconLabel)
7584 __pCameraIconLabel->SetShowState(true);
7587 if (__pCamcoderIconLabel)
7589 __pCamcoderIconLabel->SetShowState(true);
7594 __pSwButton->SetShowState(true);
7599 AppLogDebug("pAllowSwitch is not null");
7600 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7601 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7603 AppLogDebug("ALLOW_SWITCH_TRUE");
7605 if (__isTimerRunning)
7607 if (__pCameraIconLabel)
7609 __pCameraIconLabel->SetShowState(false);
7612 if (__pCamcoderIconLabel)
7614 __pCamcoderIconLabel->SetShowState(false);
7619 __pSwButton->SetShowState(false);
7624 if (__pCameraIconLabel)
7626 __pCameraIconLabel->SetShowState(true);
7629 if (__pCamcoderIconLabel)
7631 __pCamcoderIconLabel->SetShowState(true);
7636 __pSwButton->SetShowState(true);
7642 AppLogDebug("ALLOW_SWITCH_FALSE");
7643 if (__pCameraIconLabel)
7645 __pCameraIconLabel->SetShowState(false);
7648 if (__pCamcoderIconLabel)
7650 __pCamcoderIconLabel->SetShowState(false);
7655 __pSwButton->SetShowState(false);
7659 AppLogDebug("EXIT");
7663 CameraForm::HideUiActionButton(void)
7665 AppLogDebug("ENTER");
7666 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7668 AppControlRequestHideButton();
7670 if (__pBackButton && !_isHwKeySupported)
7672 __pBackButton->SetShowState(true);
7677 if (__pCameraIconLabel)
7679 __pCameraIconLabel->SetShowState(true);
7682 if (__pCamcoderIconLabel)
7684 __pCamcoderIconLabel->SetShowState(true);
7689 __pSwButton->SetShowState(true);
7692 if (__pBackButton && !_isHwKeySupported)
7694 __pBackButton->SetShowState(true);
7697 AppLogDebug("EXIT");
7701 CameraForm::HideUiPanel(bool state)
7703 AppLogDebug("ENTER");
7706 _pFlashButton->SetShowState(false);
7707 _pSelfShotButton->SetShowState(false);
7708 _pSettingButton->SetShowState(false);
7709 __pSettingLine->SetShowState(false);
7711 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7713 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7714 const IMap* pArguments = pApp->GetAppControlArguments();
7715 if (pArguments == null)
7717 AppLogDebug("pArguments is null");
7718 if (__pCameraIconLabel)
7720 __pCameraIconLabel->SetShowState(false);
7723 if (__pCamcoderIconLabel)
7725 __pCamcoderIconLabel->SetShowState(false);
7730 __pSwButton->SetShowState(false);
7735 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7736 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7738 if (__isTimerRunning)
7740 if (__pCameraIconLabel)
7742 __pCameraIconLabel->SetShowState(false);
7745 if (__pCamcoderIconLabel)
7747 __pCamcoderIconLabel->SetShowState(false);
7752 __pSwButton->SetShowState(false);
7757 if (__pCameraIconLabel)
7759 __pCameraIconLabel->SetShowState(true);
7762 if (__pCamcoderIconLabel)
7764 __pCamcoderIconLabel->SetShowState(true);
7769 __pSwButton->SetShowState(true);
7775 AppLogDebug("ALLOW_SWITCH_FALSE");
7776 if (__pCameraIconLabel)
7778 __pCameraIconLabel->SetShowState(false);
7781 if (__pCamcoderIconLabel)
7783 __pCamcoderIconLabel->SetShowState(false);
7788 __pSwButton->SetShowState(false);
7795 if (__isTimerRunning)
7797 __pCameraIconLabel->SetShowState(false);
7798 __pCamcoderIconLabel->SetShowState(false);
7799 __pSwButton->SetShowState(false);
7803 __pCameraIconLabel->SetShowState(true);
7804 __pCamcoderIconLabel->SetShowState(true);
7805 __pSwButton->SetShowState(true);
7809 if (__isTimerRunning)
7811 if (!_isHwKeySupported)
7813 __pBackButton->SetShowState(false);
7818 if (!_isHwKeySupported)
7820 __pBackButton->SetShowState(true);
7824 _pQuickSettingButton->SetShowState(false);
7825 _pWhiteBalanceButton->SetShowState(false);
7826 _pExposureValueButton->SetShowState(false);
7827 _pCloseButton->SetShowState(false);
7828 __pShutterButton->SetShowState(false);
7829 __pThumbnailButton->SetShowState(false);
7830 _pThumbnailPanel->SetShowState(false);
7832 if (__screenMode == SCREEN_MODE_NORMAL)
7834 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7835 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7840 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7842 if (__pThumbnailButton)
7844 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
7846 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
7847 SetControlAlwaysOnTop(*__pThumbnailButton, false);
7851 if (_pThumbnailPanel)
7853 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
7855 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
7856 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
7860 _pFlashButton->SetShowState(false);
7861 _pSelfShotButton->SetShowState(true);
7862 _pSettingButton->SetShowState(true);
7863 __pSettingLine->SetShowState(true);
7864 _pQuickSettingButton->SetShowState(false);
7865 _pWhiteBalanceButton->SetShowState(false);
7866 _pExposureValueButton->SetShowState(false);
7867 _pCloseButton->SetShowState(false);
7869 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7871 AppControlRequestHideButton();
7875 __pCameraIconLabel->SetShowState(true);
7876 __pCamcoderIconLabel->SetShowState(true);
7877 __pSwButton->SetShowState(true);
7880 if (__isTimerRunning)
7882 if (!_isHwKeySupported)
7884 __pBackButton->SetShowState(false);
7889 if (!_isHwKeySupported)
7891 __pBackButton->SetShowState(true);
7894 __pShutterButton->SetShowState(true);
7895 __pThumbnailButton->SetShowState(true);
7896 _pThumbnailPanel->SetShowState(true);
7898 if (__screenMode == SCREEN_MODE_NORMAL)
7900 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7901 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7905 if (__screenMode == SCREEN_MODE_FULL)
7914 AppLogDebug("EXIT");
7918 CameraForm::HideUiSettingMenu(void)
7920 AppLogDebug("ENTER");
7921 if (_pCameraInfoPanel)
7923 _pCameraInfoPanel->SetDrawExposure(false);
7924 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7925 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7926 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7927 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7930 if (_pListViewCameraTabSubMenu)
7932 if (_pCameraInfoSubPanel != null)
7934 _pCameraInfoSubPanel->SetShowState(false);
7937 _pListViewCameraTabSubMenu->SetShowState(false);
7940 if (_pListViewCameraTabMainMenu)
7942 _pListViewCameraTabMainMenu->SetShowState(false);
7945 if (_pListFlashMainMenu)
7947 _pListFlashMainMenu->SetShowState(false);
7950 if (_pListWbMainMenu)
7952 _pListWbMainMenu->SetShowState(false);
7955 if (_pListViewGeneralTabSubMenu)
7957 if (_pCameraInfoGeneralSubPanel != null)
7959 _pCameraInfoGeneralSubPanel->SetShowState(false);
7961 _pListViewGeneralTabSubMenu->SetShowState(false);
7964 if (_pListViewGeneralTabMainMenu)
7966 _pListViewGeneralTabMainMenu->SetShowState(false);
7968 AppLogDebug("EXIT");
7972 CameraForm::HideUiQuickMenu(void)
7974 AppLogDebug("ENTER");
7975 if (_pSelfShotButton != null)
7977 _pSelfShotButton->SetShowState(true);
7978 _pSelfShotButton->Invalidate(true);
7981 if (_pSettingButton != null)
7983 _pSettingButton->SetShowState(true);
7984 _pSettingButton->Invalidate(true);
7987 if (__pSettingLine != null)
7989 __pSettingLine->SetShowState(true);
7990 __pSettingLine->Invalidate(true);
7993 if (_pCameraInfoPanel != null)
7995 _pCameraInfoPanel->SetDrawIndicator(true);
7996 _pCameraInfoPanel->Invalidate(true);
7999 if (_pFlashButton != null)
8001 _pFlashButton->SetShowState(false);
8002 _pFlashButton->Invalidate(true);
8005 if (_pQuickSettingButton != null)
8007 _pQuickSettingButton->SetShowState(false);
8008 _pQuickSettingButton->Invalidate(true);
8011 if (_pWhiteBalanceButton != null)
8013 _pWhiteBalanceButton->SetShowState(false);
8014 _pWhiteBalanceButton->Invalidate(true);
8017 if (_pExposureValueButton != null)
8019 _pExposureValueButton->SetShowState(false);
8020 _pExposureValueButton->Invalidate(true);
8023 if (_pCloseButton != null)
8025 _pCloseButton->SetShowState(false);
8026 _pCloseButton->Invalidate(true);
8028 AppLogDebug("EXIT");
8032 CameraForm::ShowUiQuickMenu(void)
8034 AppLogDebug("ENTER");
8035 if (_pCameraInfoPanel != null)
8037 _pCameraInfoPanel->SetDrawIndicator(false);
8038 _pCameraInfoPanel->Invalidate(true);
8041 if (_pSelfShotButton != null)
8043 _pSelfShotButton->SetShowState(false);
8044 _pSelfShotButton->Invalidate(true);
8047 if (_pSettingButton != null)
8049 _pSettingButton->SetShowState(false);
8050 _pSettingButton->Invalidate(true);
8053 if (__pSettingLine != null)
8055 __pSettingLine->SetShowState(false);
8056 __pSettingLine->Invalidate(true);
8059 if (_pFlashButton != null)
8061 _pFlashButton->SetShowState(true);
8062 _pFlashButton->Invalidate(true);
8065 if (_pQuickSettingButton != null)
8067 _pQuickSettingButton->SetShowState(true);
8068 _pQuickSettingButton->Invalidate(true);
8071 if (_pWhiteBalanceButton != null)
8073 _pWhiteBalanceButton->SetShowState(true);
8074 _pWhiteBalanceButton->Invalidate(true);
8077 if (_pExposureValueButton != null)
8079 _pExposureValueButton->SetShowState(true);
8080 _pExposureValueButton->Invalidate(true);
8083 if (_pCloseButton != null)
8085 _pCloseButton->SetShowState(true);
8086 _pCloseButton->Invalidate(true);
8088 AppLogDebug("EXIT");
8092 CameraForm::SetCameraMode(bool isWideMode)
8094 AppLogDebug("ENTER");
8095 result r = E_SUCCESS;
8096 Dimension normalMode(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
8097 Dimension resolutionDim;
8098 Dimension captureResolutionDim;
8099 IList* pList = null;
8100 int previewResolutionSize = 0;
8101 int resolutionCnt = 0;
8102 int resolutionRatio = 0;
8104 int tempResolutionIndex = 0;
8106 int selfPortraitEnable = 0;
8107 BufferInfo bufferinfo;
8109 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
8110 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8112 if (isWideMode == true)
8114 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8118 resolutionCnt = pList->GetCount();
8120 if (resolutionCnt > 0)
8122 for (index = 0; index < resolutionCnt; index++)
8124 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8126 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
8128 if (resolutionRatio > NORMAL_MODE_RATIO)
8135 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(count - INDEX_UNIT_ONE)));
8136 __previewResolutionWidth = resolutionDim.width;
8137 __previewResolutionHeight = resolutionDim.height;
8141 __previewResolutionWidth = PREVIEW_RESOLOTION_WIDTH;
8142 __previewResolutionHeight = PREVIEW_RESOLOTION_HEIGHT;
8145 AppLogDebug("Wide Mode W[%d] x H[%d]", resolutionDim.width, resolutionDim.height);
8147 _pCameraPresentationModel->SetPreviewResolution(resolutionDim);
8151 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8152 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
8154 _pCameraPresentationModel->SetPreviewResolution(normalMode);
8156 __previewResolutionWidth = normalMode.width;
8157 __previewResolutionHeight = normalMode.height;
8159 AppLogDebug("Normal Mode W[%d] x H[%d]", normalMode.width, normalMode.height);
8161 if (__isToggleCameraDirection)
8163 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8165 resolutionCnt = pList->GetCount();
8167 AppLogDebug("pList resolutionCnt = %d", resolutionCnt);
8169 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8171 captureResolutionDim.width = __captureResolutionWidth;
8173 captureResolutionDim.height = __captureResolutionHeight;
8175 if (resolutionCnt > 0)
8177 for (index = 0; index < resolutionCnt; index++)
8179 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8181 if (resolutionDim == captureResolutionDim)
8183 tempResolutionIndex = index;
8185 AppLogDebug("primary captureResolutionDim == W:%d H:%d for index = %d", resolutionDim.width, resolutionDim.height, index);
8189 __primaryCurrentResolutionIndex = resolutionCnt - tempResolutionIndex;
8192 AppLogDebug("__primaryCurrentResolutionIndex = %d", __primaryCurrentResolutionIndex);
8196 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
8197 __captureResolutionWidth = captureResolutionDim.width;
8198 __captureResolutionHeight = captureResolutionDim.height;
8200 AppLogDebug("secondary captureResolutionDim : w->%d x h->%d", captureResolutionDim.width, captureResolutionDim.height);
8205 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8206 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
8208 _pCameraPresentationModel->StartPreview(&bufferinfo);
8210 _pCameraPresentationModel->SetContinuousAutoFocus();
8212 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8214 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8215 AppLogDebug("EXIT");
8219 CameraForm::SetOverlayRendererRotation(void)
8221 AppLogDebug("ENTER");
8222 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8226 case ORIENTATION_STATUS_PORTRAIT:
8228 AppLogDebug("ORIENTATION_STATUS_PORTRAIT");
8229 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8233 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8235 AppLogDebug("ORIENTATION_STATUS_PORTRAIT_REVERSE");
8236 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8240 case ORIENTATION_STATUS_LANDSCAPE:
8242 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE");
8243 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8247 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8249 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE_REVERSE");
8250 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8257 AppLogDebug("EXIT");
8261 CameraForm::CreateOverlayRegion(Rectangle rect)
8263 AppLogDebug("ENTER");
8264 result r = E_SUCCESS;
8266 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8267 r = __pOverlayPanel->Construct(rect);
8268 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8269 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8271 r = AddControl(__pOverlayPanel);
8272 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8273 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8275 __pOverlayPanel->AddTouchEventListener(*this);
8277 AppLogDebug("EXIT");
8281 RemoveControl(__pOverlayPanel);
8282 __pOverlayPanel = null;
8283 AppLogDebug("EXIT - CATCH");
8288 CameraForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8290 AppLogDebug("ENTER");
8291 bool modified = false;
8292 bool isValidRect = false;
8293 Dimension dim = Dimension(0, 0);
8294 bool isToCompensated = false;
8295 Dimension dimRendererSize;
8296 result r = E_SUCCESS;
8298 if (destroyOverlay == true)
8300 if (__pOverlayPanel)
8302 __pOverlayPanel->RemoveTouchEventListener(*this);
8303 RemoveControl(__pOverlayPanel);
8304 __pOverlayPanel = null;
8307 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8308 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8310 if (isWideMode == false)
8312 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8313 r = GetLastResult();
8317 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8318 r = GetLastResult();
8320 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8321 TryReturn(r == E_SUCCESS, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(r));
8323 if (modified == true)
8325 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8328 if (__dir == ORIENTATION_STATUS_PORTRAIT
8329 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8331 if (evaluateBoundsRect.height == rect.height)
8333 isToCompensated = false;
8337 isToCompensated = true;
8342 if (evaluateBoundsRect.width == rect.width)
8344 isToCompensated = false;
8348 isToCompensated = true;
8352 r = CreateOverlayRegion(rect);
8353 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8355 if (isToCompensated == true)
8357 AppLogDebug("isToCompensated = true");
8359 rect = __pOverlayPanel->GetBounds();
8360 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8362 r = __pOverlayPanel->SetBounds(rect);
8363 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8366 dimRendererSize = __pOverlayPanel->GetSize();
8367 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8369 __pOverlayPanel->SetRenderSize(dimRendererSize);
8373 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8375 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8376 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8378 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8379 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8381 if (modified == true)
8383 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8386 if (__dir == ORIENTATION_STATUS_PORTRAIT
8387 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8389 if (evaluateBoundsRect.height == rect.height)
8391 isToCompensated = false;
8395 isToCompensated = true;
8400 if (evaluateBoundsRect.width == rect.width)
8402 isToCompensated = false;
8406 isToCompensated = true;
8410 r = __pOverlayPanel->SetBounds(rect);
8411 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8412 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8414 if (isToCompensated == true)
8416 rect = __pOverlayPanel->GetBounds();
8417 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8419 r = __pOverlayPanel->SetBounds(rect);
8420 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8421 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8424 dimRendererSize = __pOverlayPanel->GetSize();
8425 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8426 __pOverlayPanel->SetRenderSize(dimRendererSize);
8428 AppLogDebug("EXIT");
8432 RemoveControl(__pOverlayPanel);
8433 __pOverlayPanel = null;
8434 AppLogDebug("EXIT - CATCH");
8439 CameraForm::SetOverlayPanelNormalMode(bool isRemoved)
8441 AppLogDebug("ENTER");
8442 result r = E_SUCCESS;
8443 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8444 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8445 Rectangle clientRect = GetClientAreaBounds();
8447 if (__dir == ORIENTATION_STATUS_PORTRAIT
8448 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8450 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8452 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8453 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8457 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8458 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8463 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8465 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8466 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8470 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8471 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8475 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8476 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8477 AppLogDebug("EXIT");
8481 CameraForm::SetOverlayPanelWideMode(bool isRemoved)
8483 AppLogDebug("ENTER");
8484 result r = E_SUCCESS;
8485 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8486 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8487 Rectangle clientRect = GetClientAreaBounds();
8489 if (__dir == ORIENTATION_STATUS_PORTRAIT
8490 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8492 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8494 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8498 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8503 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8505 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8509 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8513 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8514 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8515 AppLogDebug("EXIT");
8519 CameraForm::SetControlAlwaysOnTopPanel(void)
8521 AppLogDebug("ENTER");
8522 if (__pSettingPanel)
8524 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
8526 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
8527 SetControlAlwaysOnTop(*__pSettingPanel, true);
8533 if (IsControlAlwaysOnTop(__pActionPanel) == false)
8535 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
8536 SetControlAlwaysOnTop(*__pActionPanel, true);
8542 if (IsControlAlwaysOnTop(_pFlashButton) == false)
8544 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
8545 SetControlAlwaysOnTop(*_pFlashButton, true);
8549 if (_pSelfShotButton)
8551 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
8553 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8554 SetControlAlwaysOnTop(*_pSelfShotButton, true);
8558 if (_pSettingButton)
8560 if (IsControlAlwaysOnTop(_pSettingButton) == false)
8562 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
8563 SetControlAlwaysOnTop(*_pSettingButton, true);
8569 if (IsControlAlwaysOnTop(__pSettingLine) == false)
8571 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
8572 SetControlAlwaysOnTop(*__pSettingLine, true);
8576 if (__pCameraIconLabel)
8578 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
8580 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8581 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
8585 if (__pCamcoderIconLabel)
8587 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
8589 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
8590 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
8594 if (_pQuickSettingButton)
8596 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
8598 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
8599 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
8603 if (_pWhiteBalanceButton)
8605 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
8607 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
8608 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
8612 if (_pExposureValueButton)
8614 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
8616 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
8617 SetControlAlwaysOnTop(*_pExposureValueButton, true);
8623 if (IsControlAlwaysOnTop(_pCloseButton) == false)
8625 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
8626 SetControlAlwaysOnTop(*_pCloseButton, true);
8630 if (__pBatteryState)
8632 if (IsControlAlwaysOnTop(__pBatteryState) == false)
8634 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
8635 SetControlAlwaysOnTop(*__pBatteryState, true);
8641 if (IsControlAlwaysOnTop(__pSwButton) == false)
8643 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
8644 SetControlAlwaysOnTop(*__pSwButton, true);
8650 if (IsControlAlwaysOnTop(__pBackButton) == false)
8652 AppLogDebug("IsControlAlwaysOnTop __pBackButton");
8653 SetControlAlwaysOnTop(*__pBackButton, true);
8657 if (__pShutterButton)
8659 if (IsControlAlwaysOnTop(__pShutterButton) == false)
8661 AppLogDebug("IsControlAlwaysOnTop __pShutterButton");
8662 SetControlAlwaysOnTop(*__pShutterButton, true);
8666 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
8668 if (__pThumbnailButton)
8670 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
8672 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8673 SetControlAlwaysOnTop(*__pThumbnailButton, false);
8677 if (_pThumbnailPanel)
8679 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
8681 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8682 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
8688 if (__pThumbnailButton)
8690 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
8692 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8693 SetControlAlwaysOnTop(*__pThumbnailButton, true);
8697 if (_pThumbnailPanel)
8699 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
8701 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8702 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
8707 if (_pHelpGoToGallery)
8709 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
8711 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
8712 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
8716 if (_pHelpGoToGalleryText)
8718 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
8720 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
8721 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
8725 if (_pHelpSwitchCamera)
8727 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
8729 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
8730 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
8734 if (_pHelpSwitchCameraText)
8736 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
8738 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
8739 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
8743 if (_pHelpQuickSetting)
8745 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
8747 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
8748 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
8752 if (_pHelpQuickSettingText)
8754 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
8756 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
8757 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
8761 if (_pHelpRecordVideo)
8763 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
8765 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
8766 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
8770 if (_pHelpRecordVideoText)
8772 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
8774 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
8775 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
8781 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
8783 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
8784 SetControlAlwaysOnTop(*_pHelpShutter, true);
8788 if (_pHelpShutterText)
8790 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
8792 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
8793 SetControlAlwaysOnTop(*_pHelpShutterText, true);
8797 if (_pHelpGoToPreviousScreen)
8799 if (IsControlAlwaysOnTop(_pHelpGoToPreviousScreen) == false)
8801 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToPreviousScreen");
8802 SetControlAlwaysOnTop(*_pHelpGoToPreviousScreen, true);
8806 if (_pHelpGoToPreviousScreenText)
8808 if (IsControlAlwaysOnTop(_pHelpGoToPreviousScreenText) == false)
8810 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToPreviousScreenText");
8811 SetControlAlwaysOnTop(*_pHelpGoToPreviousScreenText, true);
8815 if (__pCameraSetting)
8817 if (IsControlAlwaysOnTop(__pCameraSetting) == false)
8819 AppLogDebug("IsControlAlwaysOnTop __pCameraSetting");
8820 SetControlAlwaysOnTop(*__pCameraSetting, true);
8824 if (__pCameraSettingLable)
8826 if (IsControlAlwaysOnTop(__pCameraSettingLable) == false)
8828 AppLogDebug("IsControlAlwaysOnTop __pCameraSettingLable");
8829 SetControlAlwaysOnTop(*__pCameraSettingLable, true);
8833 if (__pGeneralSetting)
8835 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
8837 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
8838 SetControlAlwaysOnTop(*__pGeneralSetting, true);
8842 if (__pGeneralSettingLable)
8844 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
8846 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
8847 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
8850 AppLogDebug("EXIT");
8854 CameraForm::HidePanel(bool isWideMode, bool isInvalidated)
8856 AppLogDebug("ENTER");
8857 result r = E_SUCCESS;
8859 SetControlAlwaysOnTopPanel();
8861 if (isWideMode == true)
8863 AppLogDebug("Wide MODE");
8865 if (__pSettingPanel)
8867 r = __pSettingPanel->SetShowState(false);
8868 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8873 r = __pActionPanel->SetShowState(false);
8874 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8879 AppLogDebug("Normal MODE");
8881 if (__pSettingPanel)
8883 r = __pSettingPanel->SetShowState(true);
8884 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8889 r = __pActionPanel->SetShowState(true);
8890 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8894 if (isInvalidated == true)
8903 AppLogDebug("EXIT");
8907 CameraForm::SetScreenMode(const ScreenMode mode, bool destory)
8909 AppLogDebug("ENTER");
8910 result r = E_SUCCESS;
8912 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8916 case SCREEN_MODE_NORMAL:
8918 if (destory == true)
8920 if (__screenMode != mode)
8922 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8923 _pAppTimer->Cancel();
8925 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8926 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8928 _pCameraPresentationModel->KeepScreenOnState(true, false);
8930 _pCameraPresentationModel->StopCamera();
8934 if (__isToggleCameraDirection || __resolutionChange)
8936 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8937 _pAppTimer->Cancel();
8939 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8940 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8942 _pCameraPresentationModel->KeepScreenOnState(true, false);
8944 _pCameraPresentationModel->StopCamera();
8948 SetOverlayPanelNormalMode(true);
8950 SetOverlayRendererRotation();
8952 if (__screenMode != mode)
8954 SetCameraMode(false);
8958 if (__isToggleCameraDirection || __resolutionChange)
8960 SetCameraMode(false);
8964 __screenMode = SCREEN_MODE_NORMAL;
8968 SetOverlayPanelNormalMode(false);
8970 SetOverlayRendererRotation();
8972 __screenMode = SCREEN_MODE_NORMAL;
8975 if (__pOverlayPanel != null)
8977 __pOverlayPanel->RemoveTouchEventListener(*this);
8980 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8981 HidePanel(false, false);
8985 case SCREEN_MODE_FULL:
8987 if (destory == true)
8989 if (__screenMode != mode)
8991 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8992 _pAppTimer->Cancel();
8994 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8995 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8997 _pCameraPresentationModel->KeepScreenOnState(true, false);
8999 _pCameraPresentationModel->StopCamera();
9003 if (__isToggleCameraDirection || __resolutionChange)
9005 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
9006 _pAppTimer->Cancel();
9008 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9009 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
9011 _pCameraPresentationModel->KeepScreenOnState(true, false);
9013 _pCameraPresentationModel->StopCamera();
9017 SetOverlayPanelWideMode(true);
9019 SetOverlayRendererRotation();
9021 if (__screenMode != mode)
9023 SetCameraMode(true);
9027 if (__isToggleCameraDirection || __resolutionChange)
9029 SetCameraMode(true);
9033 __screenMode = SCREEN_MODE_FULL;
9037 SetOverlayPanelWideMode(false);
9039 SetOverlayRendererRotation();
9041 __screenMode = SCREEN_MODE_FULL;
9044 if (__pOverlayPanel != null)
9046 __pOverlayPanel->AddTouchEventListener(*this);
9049 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
9050 HidePanel(true, false);
9058 AppLogDebug("EXIT");
9062 _pCameraInfoPanel->SetOverlayPanelMode(SCREEN_MODE_NORMAL);
9063 __screenMode = SCREEN_MODE_NORMAL;
9069 CameraForm::BackButtonPerformed(void)
9071 AppLogDebug("ENTER");
9072 result r = E_SUCCESS;
9074 if (_pHelpGoToGallery->GetShowState() == true)
9076 AppLogDebug("EXIT - Screen Overlay Help");
9077 OnHelpCloseTimerExpired();
9081 if (_pCameraPresentationModel->GetPreviewState() == false)
9083 AppLogDebug("EXIT - StartPreview do not call");
9084 __pBackButton->SetEnabled(false);
9088 if (_pCameraInfoPanel->GetDrawExposure() == true)
9090 _closeTimerValue = 0;
9092 if (_pExposureCloseTimer)
9094 _pExposureCloseTimer->Cancel();
9097 _pCameraInfoPanel->SetDrawExposure(false);
9102 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9104 r = PressBackButton();
9105 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
9109 if (__isTimerRunning == true)
9111 OnTimerCapturePause();
9117 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
9122 AppLogDebug("EXIT");
9126 AppLogDebug("EXIT - CATCH");
9131 CameraForm::PressBackButton(void)
9133 AppLogDebug("ENTER");
9134 result r = E_SUCCESS;
9136 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9138 AppLogDebug("PressBackButton >> Back to the App");
9140 if (_pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED)
9142 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
9146 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
9149 AppLogDebug("EXIT");
9154 CameraForm::SetBackButton(void)
9156 AppLogDebug("ENTER");
9157 Bitmap* pBitmap = null;
9158 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
9159 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
9161 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9163 if (__pThumbnailButton)
9165 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9167 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9168 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9172 if (_pThumbnailPanel)
9174 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9176 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9177 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9181 AppControlRequestHideButton();
9185 if (__pThumbnailButton)
9187 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
9189 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9190 SetControlAlwaysOnTop(*__pThumbnailButton, true);
9194 if (_pThumbnailPanel)
9196 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
9198 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9199 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
9203 if (__pCameraIconLabel)
9205 __pCameraIconLabel->SetShowState(true);
9208 if (__pCamcoderIconLabel)
9210 __pCamcoderIconLabel->SetShowState(true);
9215 __pSwButton->SetShowState(true);
9219 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
9220 TryCatch(__pThumbnailButton != null, , "__pThumbnailButton is null");
9222 _pThumbnailPanel->SetShowState(false);
9223 _pThumbnailPanel->Draw();
9224 _pThumbnailPanel->Show();
9226 __pThumbnailButton->SetShowState(true);
9228 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
9229 TryCatch(pBitmap != null, , "pBitmap is null");
9231 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
9235 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
9236 TryCatch(pBitmap != null, , "pBitmap is null");
9238 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
9242 __pThumbnailButton->Draw();
9243 __pThumbnailButton->Show();
9245 AppLogDebug("EXIT");
9253 CameraForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
9255 AppLogDebug("ENTER");
9256 result r = E_SUCCESS;
9257 bool focusSupport = false;
9258 int selfPortraitEnable = 0;
9260 if (__isTimerRunning == false)
9262 AppLogDebug("__isTimerRunning:false");
9264 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9265 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9267 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9269 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9273 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9276 if (focusSupport == true && r == E_SUCCESS)
9278 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9279 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9280 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9281 _pCameraInfoPanel->Invalidate(true);
9285 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9286 _pCameraInfoPanel->Invalidate(true);
9288 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
9292 AppLogDebug("__isTimerRunning:true");
9294 AppLogDebug("EXIT");
9298 CameraForm::DoCapture(void)
9300 AppLogDebug("ENTER");
9301 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9303 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9304 _pAppTimer->Cancel();
9308 _timeCount = INDEX_UNIT_ZERO;
9309 _pPopupTimer->Cancel();
9312 if (_pExposureCloseTimer)
9314 _pExposureCloseTimer->Cancel();
9317 if (_pCameraInfoPanel->GetDrawExposure() == true)
9319 _pCameraInfoPanel->SetDrawExposure(false);
9323 if (_pTouchAutoFocusTimer)
9325 _pTouchAutoFocusTimer->Cancel();
9328 if (_pChargingTimer)
9330 _pChargingTimer->Cancel();
9335 _pCameraInfoPanel->CheckAvailableStorageSpace();
9337 AppLogDebug("EXIT");
9341 CameraForm::SetUri(const Tizen::Base::String& uri)
9343 AppLogDebug("ENTER");
9344 AppLogDebug("[URI] %ls", uri.GetPointer());
9345 __uri = String(uri);
9346 AppLogDebug("EXIT");
9350 CameraForm::SetMime(const Tizen::Base::String& mime)
9352 AppLogDebug("ENTER");
9353 AppLogDebug("[MIME] %ls", mime.GetPointer());
9354 __mime = String(mime);
9355 AppLogDebug("EXIT");
9358 const Tizen::Base::String&
9359 CameraForm::GetUri(void) const
9361 AppLogDebug("ENTER");
9362 AppLogDebug("EXIT");
9366 const Tizen::Base::String&
9367 CameraForm::GetMime(void) const
9369 AppLogDebug("ENTER");
9370 AppLogDebug("EXIT");
9375 CameraForm::LaunchImageview(void)
9377 AppLogDebug("ENTER");
9378 result r = E_SUCCESS;
9379 const String* filePath = null;
9380 String listIndex = L"";
9381 String* temp = null;
9387 _timeCount = INDEX_UNIT_ZERO;
9388 _pPopupTimer->Cancel();
9391 if (_pExposureCloseTimer)
9393 _pExposureCloseTimer->Cancel();
9398 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
9399 pExtraData->Construct();
9401 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9402 pArrayList->Construct();
9404 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9405 pContentPathList->Construct();
9407 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9408 if (pContentPathList == null)
9412 AppLogDebug("EXIT - pContentPathList is null");
9416 loopCount = _pCameraPresentationModel->GetContentCount();
9417 for (index = 0; index < loopCount; ++index)
9419 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
9420 AppLogDebug("filePath = %ls", filePath->GetPointer());
9421 pArrayList->Add(new (std::nothrow) String(*filePath));
9424 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
9425 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
9427 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
9428 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
9431 SetMime(MIME_TYPE_VALUE_IMAGE);
9433 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
9434 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
9436 loopCount = pArrayList->GetCount();
9437 for (int i = 0; i < loopCount; ++i)
9439 temp = static_cast<String*>(pArrayList->GetAt(i));
9440 AppLog("print temp(%ls)", temp->GetPointer());
9442 AppLogDebug("EXIT");
9446 CameraForm::InDrawFocus(void)
9448 AppLogDebug("ENTER");
9449 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9450 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9451 Rectangle clientRect = GetClientAreaBounds();
9452 result r = E_SUCCESS;
9453 int selfPortraitEnable = 0;
9454 Point currentPosition;
9455 bool focusSupport = false;
9457 if (__dir == ORIENTATION_STATUS_PORTRAIT
9458 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9460 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9461 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9462 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9463 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9467 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9468 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9469 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9470 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9473 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9474 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9476 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9478 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9482 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9485 if (focusSupport == true && r == E_SUCCESS)
9487 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9488 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9489 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9493 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9494 _pCameraInfoPanel->Draw();
9495 _pCameraInfoPanel->Show();
9497 AppLogDebug("EXIT");
9501 CameraForm::GetCameraToForeground(void)
9503 AppLogDebug("ENTER");
9504 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9505 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9506 Rectangle clientRect = GetClientAreaBounds();
9507 result r = E_SUCCESS;
9508 Dimension previewResolutionDim;
9509 Dimension captureResolutionDim;
9510 int previewResolutionSize = 0;
9511 BufferInfo bufferinfo;
9513 __isLockScreenMode = false;
9515 _pCameraPresentationModel->KeepScreenOnState(true, false);
9517 StartInitAppTimer();
9519 StartPreviewFailPopupTimer();
9521 _batteryStatus = GetCurrentBatteryState();
9522 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9524 StartInitChargingTimer();
9526 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9527 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
9531 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
9532 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9534 __previewResolutionWidth = previewResolutionDim.width;
9535 __previewResolutionHeight = previewResolutionDim.height;
9537 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
9538 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9540 AppLogDebug("__screenMode [%d]", __screenMode);
9542 r = SetScreenMode(__screenMode, false);
9543 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
9545 if (__dir == ORIENTATION_STATUS_PORTRAIT
9546 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9548 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9552 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9557 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9558 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
9560 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9561 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9563 _pCameraPresentationModel->StartPreview(&bufferinfo);
9565 _pCameraPresentationModel->SetContinuousAutoFocus();
9567 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
9569 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
9571 SetCameraSettingsDevice();
9572 AppLogDebug("EXIT");
9576 CameraForm::SendCameraToBackground(void)
9578 AppLogDebug("ENTER");
9579 if (__isTimerRunning == true)
9582 _timeCount = INDEX_UNIT_ZERO;
9583 __isTimerRunning = false;
9584 _pCameraPresentationModel->SetIntervalTimerRun(false);
9585 _isUsedTimerCaptured = false;
9587 if (_pIntervalValueTimer != null)
9589 _pIntervalValueTimer->Cancel();
9592 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9593 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9594 _pCameraInfoPanel->SetDrawPopupTimer(false);
9595 _pCameraInfoPanel->Invalidate(true);
9599 if (_pAppTimer != null)
9601 _pAppTimer->Cancel();
9604 if (_pChargingTimer != null)
9607 _pChargingTimer->Cancel();
9610 if (_pChargingCompletedTimer != null)
9614 _pChargingCompletedTimer->Cancel();
9617 if (_pPreviewFailPopupTimer != null)
9619 _pPreviewFailPopupTimer->Cancel();
9622 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9623 _pCameraInfoPanel->Invalidate(true);
9627 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9628 _pCameraPresentationModel->StopCamera();
9629 _pCameraPresentationModel->KeepScreenOnState(false, true);
9631 AppLogDebug("EXIT");
9635 CameraForm::DrawThumbnail(void)
9637 AppLogDebug("ENTER");
9638 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9640 if (__pThumbnailButton)
9642 __pThumbnailButton->SetShowState(true);
9643 __pThumbnailButton->Draw();
9644 __pThumbnailButton->Show();
9647 if (_pThumbnailPanel)
9649 _pThumbnailPanel->SetShowState(false);
9650 _pThumbnailPanel->Draw();
9651 _pThumbnailPanel->Show();
9656 if (__pThumbnailButton)
9658 __pThumbnailButton->SetShowState(false);
9659 __pThumbnailButton->Draw();
9660 __pThumbnailButton->Show();
9663 if (_pThumbnailPanel)
9665 _pThumbnailPanel->SetShowState(true);
9666 _pThumbnailPanel->Draw();
9667 _pThumbnailPanel->Show();
9670 AppLogDebug("EXIT");
9674 CameraForm::SetCameraErrorOccurred(void)
9676 AppLogDebug("ENTER");
9677 result r = E_SUCCESS;
9678 Point currentPosition;
9679 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9680 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9681 int guideLineEnable = 0;
9682 BufferInfo bufferinfo;
9684 if (__dir == ORIENTATION_STATUS_PORTRAIT
9685 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9687 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9688 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9692 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9693 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9696 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9697 _pAppTimer->Cancel();
9699 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9700 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9702 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9703 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9705 _pCameraPresentationModel->StartPreview(&bufferinfo);
9707 _pCameraPresentationModel->SetContinuousAutoFocus();
9709 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
9710 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9712 if (guideLineEnable == DISABLE_GUIDELINE)
9725 _isUsedTimerCaptured = false;
9726 AppLogDebug("EXIT");
9730 CameraForm::SetScreenOverlayHelpTimer(void)
9732 AppLogDebug("ENTER");
9733 result r = E_SUCCESS;
9734 int overlayHelpEnable = 0;
9736 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9737 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9739 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
9741 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
9743 _pHelpCloseTimer = new (std::nothrow) Timer();
9744 _pHelpCloseTimer->Construct(*this);
9746 r = _pHelpCloseTimer->Start(CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE);
9747 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
9750 AppLogDebug("EXIT");
9754 delete _pHelpCloseTimer;
9755 _pHelpCloseTimer = null;
9757 AppLogDebug("EXIT - CATCH");
9762 CameraForm::DrawScreenOverlayHelp(void)
9764 AppLogDebug("ENTER");
9765 Bitmap* pBitmap = null;
9766 result r = E_SUCCESS;
9767 int overlayHelpEnable = 0;
9768 String ovelayHelpStr = L"";
9769 bool checkAppControlSwitch = false;
9770 //AppResource* pAppResource = null;
9772 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
9773 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
9774 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
9775 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
9776 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
9777 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
9778 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
9779 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
9780 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
9781 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
9782 TryCatch(_pHelpGoToPreviousScreen != null, r = E_FAILURE, "_pHelpGoToPreviousScreen is null");
9783 TryCatch(_pHelpGoToPreviousScreenText != null, r = E_FAILURE, "_pHelpGoToPreviousScreenText is null");
9785 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9786 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9788 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
9790 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
9792 HideScreenOverlayHelp();
9796 //pAppResource = Application::GetInstance()->GetAppResource();
9797 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
9799 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
9801 _pHelpGoToGallery->SetShowState(true);
9802 //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
9803 ovelayHelpStr = L"GO to Gallery";
9804 _pHelpGoToGalleryText->SetText(ovelayHelpStr);
9805 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9806 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9807 _pHelpGoToGalleryText->SetShowState(true);
9810 _pHelpSwitchCamera->SetShowState(true);
9811 //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
9812 ovelayHelpStr = L"Switch camera";
9813 _pHelpSwitchCameraText->SetText(ovelayHelpStr);
9814 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9815 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9816 _pHelpSwitchCameraText->SetShowState(true);
9818 _pHelpQuickSetting->SetShowState(true);
9819 //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
9820 ovelayHelpStr = L"Quick Settings";
9821 _pHelpQuickSettingText->SetText(ovelayHelpStr);
9822 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9823 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9824 _pHelpQuickSettingText->SetShowState(true);
9827 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9829 checkAppControlSwitch = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetAppControlSwitch();
9833 checkAppControlSwitch = true;
9836 if (checkAppControlSwitch)
9838 _pHelpRecordVideo->SetShowState(true);
9839 //pAppResource->GetString(L"IDS_HELP_CAPTURE_IMAGE", ovelayHelpStr);
9840 ovelayHelpStr = L"Capture image";
9841 _pHelpRecordVideoText->SetText(ovelayHelpStr);
9842 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9843 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9844 _pHelpRecordVideoText->SetShowState(true);
9847 _pHelpShutter->SetShowState(true);
9848 //pAppResource->GetString(L"IDS_HELP_SHUTTER", ovelayHelpStr);
9849 ovelayHelpStr = L"Shutter";
9850 _pHelpShutterText->SetText(ovelayHelpStr);
9851 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9852 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9853 _pHelpShutterText->SetShowState(true);
9855 if (!_isHwKeySupported)
9857 _pHelpGoToPreviousScreen->SetShowState(true);
9858 //pAppResource->GetString(L"IDS_HELP_GOTO_PREVIOUS_SCREEN", ovelayHelpStr);
9859 ovelayHelpStr = L"Go to Previous Screen";
9860 _pHelpGoToPreviousScreenText->SetText(ovelayHelpStr);
9861 _pHelpGoToPreviousScreenText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9862 _pHelpGoToPreviousScreenText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9863 _pHelpGoToPreviousScreenText->SetShowState(true);
9866 if (__dir == ORIENTATION_STATUS_PORTRAIT
9867 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9869 _pHelpGoToGalleryText->Invalidate(true);
9870 _pHelpSwitchCameraText->Invalidate(true);
9871 _pHelpQuickSettingText->Invalidate(true);
9872 _pHelpRecordVideoText->Invalidate(true);
9873 _pHelpShutterText->Invalidate(true);
9875 if (!_isHwKeySupported)
9877 _pHelpGoToPreviousScreenText->Invalidate(true);
9880 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9881 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9883 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9884 _pHelpGoToGallery->Invalidate(true);
9889 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9890 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9892 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9893 _pHelpSwitchCamera->Invalidate(true);
9898 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9899 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9901 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9902 _pHelpQuickSetting->Invalidate(true);
9907 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
9908 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9910 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9911 _pHelpRecordVideo->Invalidate(true);
9916 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
9917 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9919 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9920 _pHelpShutter->Invalidate(true);
9925 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
9926 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9928 _pHelpGoToPreviousScreen->SetBackgroundBitmap(*pBitmap);
9929 _pHelpGoToPreviousScreen->Invalidate(true);
9936 _pHelpGoToGalleryText->Invalidate(true);
9937 _pHelpSwitchCameraText->Invalidate(true);
9938 _pHelpQuickSettingText->Invalidate(true);
9939 _pHelpRecordVideoText->Invalidate(true);
9940 _pHelpShutterText->Invalidate(true);
9941 _pHelpGoToPreviousScreenText->Invalidate(true);
9943 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9944 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9946 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9947 _pHelpGoToGallery->Invalidate(true);
9952 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
9953 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9955 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9956 _pHelpSwitchCamera->Invalidate(true);
9961 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9962 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9964 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9965 _pHelpQuickSetting->Invalidate(true);
9970 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9971 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9973 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9974 _pHelpRecordVideo->Invalidate(true);
9979 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9980 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9982 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9983 _pHelpShutter->Invalidate(true);
9988 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9989 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9991 _pHelpGoToPreviousScreen->SetBackgroundBitmap(*pBitmap);
9992 _pHelpGoToPreviousScreen->Invalidate(true);
9999 AppLogDebug("EXIT");
10003 AppLogDebug("EXIT - CATCH");
10008 CameraForm::CheckCameraSettingLabel(void)
10010 AppLogDebug("ENTER");
10011 if (__pCameraSettingLable)
10013 result r = E_SUCCESS;
10015 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10016 _pAppTimer->Cancel();
10018 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
10019 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10021 if (_pListViewGeneralTabMainMenu)
10023 _pListViewGeneralTabMainMenu->SetShowState(false);
10026 if (_pListViewGeneralTabSubMenu)
10028 _pListViewGeneralTabSubMenu->SetShowState(false);
10031 MakeCameraTabSettingPopup();
10033 AppLogDebug("Exit");
10037 CameraForm::CheckGeneralSettingLabel(void)
10039 AppLogDebug("ENTER");
10040 if(__pGeneralSettingLable)
10042 result r = E_SUCCESS;
10044 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10045 _pAppTimer->Cancel();
10047 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
10048 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10050 if (_pListViewCameraTabMainMenu)
10052 _pListViewCameraTabMainMenu->SetShowState(false);
10054 if (_pListViewCameraTabSubMenu)
10056 _pListViewCameraTabSubMenu->SetShowState(false);
10059 MakeGeneralTabSettingPopup();
10061 AppLogDebug("Exit");
10065 CameraForm::DrawBatteryLevelFull(void)
10067 AppLogDebug("ENTER");
10068 Bitmap* pBitmap = null;
10069 result r = E_SUCCESS;
10071 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
10073 if (__dir == ORIENTATION_STATUS_PORTRAIT
10074 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10076 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
10080 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
10083 _batteryStatus = BATTERY_STATE_20;
10085 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
10086 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10088 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10089 __pBatteryState->Invalidate(true);
10094 AppLogDebug("EXIT");
10098 AppLogDebug("EXIT - CATCH");
10103 CameraForm::CheckBatteryStatus(void)
10105 AppLogDebug("ENTER");
10106 Bitmap* pBitmap = null;
10107 result r = E_SUCCESS;
10108 int batteryLevel = 0;
10109 bool isCharging = false;
10111 Battery::IsCharging(isCharging);
10112 Battery::GetCurrentLevelInPercentage(batteryLevel);
10114 AppLogDebug("isCharging = %d", isCharging);
10115 AppLogDebug("batteryLevel = %d", batteryLevel);
10117 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
10119 if (__dir == ORIENTATION_STATUS_PORTRAIT
10120 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10122 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
10126 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
10131 _batteryStatus = GetCurrentBatteryState();
10132 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
10134 int currentImage = GetCurrentBatteryImage();
10136 AppLogDebug("currentImage = %d", currentImage);
10138 pBitmap = ResourceManager::GetBitmapN(currentImage);
10140 StartInitChargingTimer();
10144 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
10146 _batteryStatus = BATTERY_STATE_20;
10148 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
10150 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
10152 _batteryStatus = BATTERY_STATE_19;
10154 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
10156 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
10158 _batteryStatus = BATTERY_STATE_18;
10160 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
10162 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
10164 _batteryStatus = BATTERY_STATE_17;
10166 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
10168 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
10170 _batteryStatus = BATTERY_STATE_16;
10172 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
10174 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
10176 _batteryStatus = BATTERY_STATE_15;
10178 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
10180 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
10182 _batteryStatus = BATTERY_STATE_14;
10184 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
10186 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
10188 _batteryStatus = BATTERY_STATE_13;
10190 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
10192 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
10194 _batteryStatus = BATTERY_STATE_12;
10196 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
10198 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
10200 _batteryStatus = BATTERY_STATE_11;
10202 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
10204 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
10206 _batteryStatus = BATTERY_STATE_10;
10208 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
10210 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
10212 _batteryStatus = BATTERY_STATE_9;
10214 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
10216 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
10218 _batteryStatus = BATTERY_STATE_8;
10220 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
10222 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
10224 _batteryStatus = BATTERY_STATE_7;
10226 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
10228 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
10230 _batteryStatus = BATTERY_STATE_6;
10232 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
10234 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
10236 _batteryStatus = BATTERY_STATE_5;
10238 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
10240 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
10242 _batteryStatus = BATTERY_STATE_4;
10244 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
10246 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
10248 _batteryStatus = BATTERY_STATE_3;
10250 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
10252 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
10254 _batteryStatus = BATTERY_STATE_2;
10256 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
10258 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
10260 _batteryStatus = BATTERY_STATE_1;
10262 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
10264 else if (batteryLevel == BATT_LEVEL_VALUE_00)
10266 _batteryStatus = BATTERY_STATE_0;
10268 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
10271 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10273 AppLogDebug("_batteryStatus = %d", _batteryStatus);
10275 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10276 __pBatteryState->Invalidate(true);
10281 AppLogDebug("EXIT");
10285 AppLogDebug("EXIT - CATCH");
10290 CameraForm::CancelTimer(void)
10292 AppLogDebug("ENTER");
10293 if (_pAppTimer != null)
10295 _pAppTimer->Cancel();
10298 if (_pIntervalValueTimer != null)
10300 _pIntervalValueTimer->Cancel();
10303 if (_pCaptureStartTimer != null)
10305 _pCaptureStartTimer->Cancel();
10308 if (_pTouchAutoFocusTimer != null)
10310 _pTouchAutoFocusTimer->Cancel();
10315 _pPopupTimer->Cancel();
10318 if (_pExposureCloseTimer)
10320 _pExposureCloseTimer->Cancel();
10323 if (_pHelpCloseTimer)
10325 _pHelpCloseTimer->Cancel();
10328 if (_pChargingTimer)
10330 _chargingCount = INDEX_UNIT_ZERO;
10332 _pChargingTimer->Cancel();
10335 if (_pChargingCompletedTimer != null)
10337 _chargingCount = 0;
10339 _pChargingCompletedTimer->Cancel();
10342 if (_pPreviewFailPopupTimer != null)
10344 _pPreviewFailPopupTimer->Cancel();
10346 AppLogDebug("EXIT");
10350 CameraForm::MakeCameraTabMenuString(void)
10352 AppLogDebug("ENTER");
10355 result r = E_SUCCESS;
10356 AppResource* pAppResource = null;
10358 if (__pSettingMenuString == null)
10360 pAppResource = Application::GetInstance()->GetAppResource();
10361 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10363 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
10365 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
10367 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10369 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10370 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
10373 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
10374 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
10376 pAppResource->GetString(IDS_CAM_BODY_ISO, tmpString);
10377 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_01] = tmpString;
10378 pAppResource->GetString(IDS_CAM_BODY_AUTO, tmpString);
10379 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_02] = tmpString;
10380 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_03] = IDS_MENU_ISO_50;
10381 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_04] = IDS_MENU_ISO_100;
10382 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_05] = IDS_MENU_ISO_200;
10383 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_06] = IDS_MENU_ISO_400;
10384 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_07] = IDS_MENU_ISO_800;
10386 AppLogDebug("EXIT");
10390 if (__pSettingMenuString)
10392 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10394 if (__pSettingMenuString[idx])
10396 delete [] __pSettingMenuString[idx];
10397 __pSettingMenuString[idx] = null;
10405 delete __pSettingMenuString;
10406 __pSettingMenuString = null;
10413 CameraForm::MakeGeneralTabMenuString(void)
10415 AppLogDebug("ENTER");
10418 result r = E_SUCCESS;
10419 AppResource* pAppResource = null;
10421 if (__pSettingGeneralMenuString == null)
10423 pAppResource = Application::GetInstance()->GetAppResource();
10424 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10426 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
10428 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
10430 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10432 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10433 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
10436 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
10437 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
10439 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10440 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
10441 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
10442 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
10443 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
10444 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
10445 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
10446 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
10448 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
10449 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
10450 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10451 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
10452 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
10453 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
10455 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
10456 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
10457 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
10458 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
10459 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
10460 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
10462 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
10463 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
10465 //pAppResource->GetString(IDS_CAM_OVERLAY_HELP_VALUE, tmpString);
10466 //__pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
10467 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
10469 AppLogDebug("EXIT");
10473 if (__pSettingGeneralMenuString)
10475 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10477 if (__pSettingGeneralMenuString[idx])
10479 delete [] __pSettingGeneralMenuString[idx];
10480 __pSettingGeneralMenuString[idx] = null;
10488 delete __pSettingGeneralMenuString;
10489 __pSettingGeneralMenuString = null;
10496 CameraForm::RunStartPreviewThread(void)
10498 AppLogDebug("ENTER");
10499 result r = E_SUCCESS;
10501 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
10502 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10504 __pCameraStarterThread = CameraStarterThread::GetInstance();
10505 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
10507 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
10508 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10510 r = __pCameraStarterThread->Start();
10511 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10513 AppLogDebug("EXIT");
10517 ShowCameraFailPopup();
10519 AppLogDebug("EXIT - CATCH");
10524 CameraForm::SubListPopupTimerMode(int index)
10526 AppLogDebug("ENTER");
10527 result r = E_SUCCESS;
10530 __settingTimeInterval = index;
10533 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
10534 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10536 _pCameraInfoPanel->SetTimerType(regVal);
10537 _pCameraInfoPanel->Invalidate(true);
10539 AppLogDebug("EXIT");
10543 AppLogDebug("EXIT - CATCH");
10548 CameraForm::SubListPopupIsoMode(int index)
10550 AppLogDebug("ENTER");
10551 result r = E_SUCCESS;
10553 int selfPortraitEnable = 0;
10554 int updatedIndex = 0;
10556 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10557 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10559 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10561 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10565 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10568 if (r == E_SUCCESS)
10572 updatedIndex = index + 2;
10576 updatedIndex = index + 3;
10578 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
10581 __settingIsoIndex = index;
10582 regVal = __settingIsoIndex;
10584 r = _pCameraPresentationModel->SetValue(ISO_VALUE, regVal);
10585 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10587 AppLogDebug("EXIT");
10591 AppLogDebug("EXIT - CATCH");
10596 CameraForm::SubListPopupWhiteBalanceMode(int index)
10598 AppLogDebug("ENTER");
10599 result r = E_SUCCESS;
10601 String strRegKey = IDS_INIT_REG_KEY;
10602 int selfPortraitEnable = 0;
10604 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10605 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10607 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10609 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
10613 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
10616 if (r == E_SUCCESS)
10618 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
10621 __settingWhiteBalance = index;
10622 regVal = __settingWhiteBalance;
10624 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10626 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
10627 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10631 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
10632 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10635 AppLogDebug("regVal = %d",regVal);
10637 AppLogDebug("EXIT");
10641 AppLogDebug("EXIT - CATCH");
10646 CameraForm::SubListPopupGuidelineMode(int index)
10648 AppLogDebug("ENTER");
10649 int value = SUBMENU_MODE_OFF;
10650 result r = E_SUCCESS;
10652 String strRegKey = IDS_INIT_REG_KEY;
10656 case SUBMENU_MODE_OFF:
10658 AppLogDebug("Setting - Guideline = off");
10659 value = SUBMENU_MODE_OFF;
10661 r = DrawMarker(false);
10662 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10666 case SUBMENU_MODE_ON:
10668 AppLogDebug("Setting - Guideline = on");
10669 value = SUBMENU_MODE_ON;
10671 r = DrawMarker(true);
10672 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10680 SetGuideLine(value);
10683 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
10684 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10686 AppLogDebug("EXIT");
10690 AppLogDebug("EXIT - CATCH");
10695 CameraForm::SubListPopupOverlayHelpMode(int index)
10697 AppLogDebug("ENTER");
10698 int value = SUBMENU_MODE_OFF;
10699 result r = E_SUCCESS;
10701 String strRegKey = IDS_INIT_REG_KEY;
10705 case SUBMENU_MODE_OFF:
10707 value = SUBMENU_MODE_OFF;
10711 case SUBMENU_MODE_ON:
10713 value = SUBMENU_MODE_ON;
10723 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
10724 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10726 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
10728 r = SetScreenOverlayHelpTimer();
10729 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
10731 r = DrawScreenOverlayHelp();
10732 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
10734 AppLogDebug("EXIT");
10738 AppLogDebug("EXIT - CATCH");
10743 CameraForm::SubListPopupResolutionMode(int index)
10745 AppLogDebug("ENTER");
10746 IList* pList = _pCameraPresentationModel->GetCaptureResolutionList();
10747 int resolutionCnt = 0;
10748 BufferInfo bufferinfo;
10749 int resolutionRatio = 0;
10750 result r = E_SUCCESS;
10752 int selfPortraitEnable = 0;
10754 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10758 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
10759 Dimension dimCaptureResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
10761 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10762 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: __captureResolution(W:%d, H:%d)", __captureResolutionWidth, __captureResolutionHeight);
10764 if ((__captureResolutionWidth == dimCaptureResolution.width ) && (__captureResolutionHeight == dimCaptureResolution.height))
10766 AppLogDebug("CAPTURE RESOLUTION Same");
10770 _pCameraPresentationModel->StopPreview();
10772 _pCameraPresentationModel->SetCaptureResolution(dimCaptureResolution);
10774 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10776 r = _pCameraPresentationModel->SetValue(PRIMARY_RESOLUTION_INDEX,index);
10777 AppLogDebug("result is %s",GetErrorMessage(r));
10781 r = _pCameraPresentationModel->SetValue(SECONDARY_RESOLUTION_INDEX,index);
10784 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10786 resolutionRatio = (dimCaptureResolution.width * MULTIPLY_BY_TEN) / (dimCaptureResolution.height);
10788 AppLogDebug("resolutionRatio (W:%d)", resolutionRatio);
10790 __resolutionChange = true;
10792 __captureResolutionWidth = dimCaptureResolution.width;
10794 __captureResolutionHeight = dimCaptureResolution.height;
10796 if (resolutionRatio > NORMAL_MODE_RATIO)
10798 r = SetScreenMode(SCREEN_MODE_FULL, true);
10802 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
10804 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
10806 AppLogDebug("__screenMode [%d]", __screenMode);
10810 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10812 __primaryCurrentResolutionIndex = index;
10813 regVal = __primaryCurrentResolutionIndex;
10817 __secondaryCurrentResolutionIndex = index;
10818 regVal = __secondaryCurrentResolutionIndex;
10820 __resolutionChange = false;
10822 AppLogDebug("EXIT");
10826 AppLogDebug("EXIT - CATCH");
10831 CameraForm::SubListPopupStorageTypeMode(int index)
10833 AppLogDebug("ENTER");
10834 int storage = STORAGE_TYPE_PHONE;
10835 String filePath = L"";
10836 result r = E_SUCCESS;
10840 case SUBMENU_STORAGE_TYPE_PHONE:
10842 AppLogDebug("Setting - Storage type = Phone");
10843 storage = STORAGE_TYPE_PHONE;
10844 SetStorageType(storage);
10848 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
10850 AppLogDebug("Setting - Storage type = card");
10851 storage = STORAGE_TYPE_MEMORYCARD;
10853 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
10855 SetStorageType(storage);
10859 storage = SUBMENU_STORAGE_TYPE_PHONE;
10860 AppLogDebug("Setting - don't draw t-flash icon");
10867 AppLogDebug("Setting - Storage, Invaild element id");
10872 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
10876 _pCameraInfoPanel->SetStorageType(storage);
10877 _pCameraInfoPanel->Invalidate(true);
10879 if (__pFileEventManager == null)
10881 __pFileEventManager = new (std::nothrow) FileEventManager();
10882 r = __pFileEventManager->Construct(*this);
10883 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10886 filePath = _pCameraPresentationModel->GetfilePath(storage);
10887 AppLogDebug("filePath %ls", filePath.GetPointer());
10890 if (File::IsFileExist(__pFileEventPath))
10892 __pFileEventManager->RemovePath(__pFileEventPath);
10895 if (File::IsFileExist(filePath))
10897 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
10898 __pFileEventPath = filePath;
10900 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10901 AppLogDebug("EXIT");
10905 CameraForm::CreateCameraTabMainMenuItem(int index, int itemWidth)
10907 AppLogDebug("ENTER");
10908 CustomItem* pItem = null;
10909 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
10910 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
10911 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
10912 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
10913 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
10914 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
10915 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
10916 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
10918 result r = E_SUCCESS;
10921 int cameraResolutionCount = 0;
10922 int storageType = STORAGE_TYPE_PHONE;
10923 String listName = L"";
10924 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS,
10925 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
10927 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE,
10928 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
10929 int selfPortraitEnable = 0;
10930 String strTmp = L"";
10932 pItem = new (std::nothrow) CustomItem();
10933 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
10935 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
10936 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
10938 elementId = (index * MENU_TWO_ELEMENT);
10940 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10941 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10943 strTmp = __pSettingMenuString[index][0];
10945 if (strTmp.GetLength())
10947 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
10949 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10951 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10953 if (r == E_SUCCESS)
10955 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10956 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10960 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);
10961 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10964 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10966 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
10968 if (r == E_SUCCESS)
10970 if (__pCaptureResolutionList != null)
10972 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10975 if (cameraResolutionCount > 1)
10977 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10981 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);
10983 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10987 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);
10988 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10993 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10994 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10999 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11001 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
11003 if (r == E_SUCCESS && __pIsoList->GetCount()>1)
11005 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11006 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11010 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);
11011 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11014 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
11016 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
11018 if (r == E_SUCCESS)
11020 cameraResolutionCount = 0;
11021 if (__pCaptureResolutionList != null)
11023 cameraResolutionCount = __pCaptureResolutionList->GetCount();
11026 if (cameraResolutionCount > 1)
11028 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11032 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);
11034 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11038 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);
11039 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11044 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11045 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11050 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11051 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11053 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11055 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11056 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11057 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11060 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
11062 if (__pCaptureResolutionList)
11064 int idx = __pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
11067 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11069 AppLogDebug("CAM_SELF_PORTRAIT_MODE_PRIMARY");
11070 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
11073 if (__primaryCurrentResolutionIndex == INDEX_UNIT_ONE)
11075 __primaryCurrentResolutionIndex = __primaryCurrentResolutionIndex - INDEX_UNIT_ONE;
11077 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
11081 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
11088 AppLogDebug("CAM_SELF_PORTRAIT_MODE_SECONDARY");
11089 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
11091 if (__secondaryCurrentResolutionIndex == INDEX_UNIT_ONE)
11093 __secondaryCurrentResolutionIndex = __secondaryCurrentResolutionIndex - INDEX_UNIT_ONE;
11095 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
11099 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
11105 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11109 int idx = __pIsoList->GetCount() - INDEX_UNIT_ONE;
11110 if (idx >= INDEX_UNIT_ZERO)
11112 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11114 if (regVal == INDEX_UNIT_ZERO)
11116 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11120 strTmp = *(static_cast<String*>(__pIsoList->GetAt(regVal)));
11126 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11131 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11136 if (strTmp.GetLength())
11138 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11140 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11142 if (__pIsoList != null)
11144 if (__pIsoList->GetCount() >1)
11146 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);
11147 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11151 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);
11152 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11157 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);
11158 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11163 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11164 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11169 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11171 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11173 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
11177 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
11180 if (r == E_SUCCESS)
11182 cameraResolutionCount = 0;
11183 if (__pCaptureResolutionList != null)
11185 cameraResolutionCount = __pCaptureResolutionList->GetCount();
11188 if (cameraResolutionCount > 1)
11190 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11194 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);
11196 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11200 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);
11201 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11206 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11207 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11210 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11211 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11214 AppLogDebug("EXIT");
11221 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11222 AppLogDebug("EXIT - CATCH");
11227 CameraForm::CreateCameraTabSubMenuItem(int index, int itemWidth)
11229 AppLogDebug("ENTER");
11230 CustomItem* pItem = null;
11231 Bitmap* pBitmap = null;
11232 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11233 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11234 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11235 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11236 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11237 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11238 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11239 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11240 AppResource* pAppResource = null;
11242 result r = E_SUCCESS;
11245 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
11247 pItem = new (std::nothrow) CustomItem();
11248 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11250 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11251 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11253 pAppResource = Application::GetInstance()->GetAppResource();
11254 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11256 idx = GetCameraTabSettingSubMenuMode();
11259 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
11261 ResourceId resId = RESOURCE_ID_ISO_AUTO;
11265 case SUBMENU_ISO_AUTO:
11267 resId = RESOURCE_ID_ISO_AUTO;
11271 case SUBMENU_ISO_50:
11273 resId = RESOURCE_ID_ISO_100;
11277 case SUBMENU_ISO_100:
11279 resId = RESOURCE_ID_ISO_100;
11283 case SUBMENU_ISO_200:
11285 resId = RESOURCE_ID_ISO_200;
11289 case SUBMENU_ISO_400:
11291 resId = RESOURCE_ID_ISO_400;
11295 case SUBMENU_ISO_800:
11297 resId = RESOURCE_ID_ISO_800;
11305 String arrString[] =
11315 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11316 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11321 if (__pIsoList->GetCount() > index)
11323 if (index == regVal)
11325 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11329 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11332 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11333 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11338 AppLogDebug("ISO index return is = %d", index);
11340 if (index == INDEX_UNIT_ZERO)
11342 pAppResource->GetString(arrString[index], str);
11346 str = *(static_cast<String*>(__pIsoList->GetAt(index)));
11350 pBitmap = ResourceManager::GetBitmapN(resId);
11351 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11353 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11354 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11360 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);
11361 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11367 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
11369 int selfPortraitEnable = 0;
11371 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11372 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11375 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY )
11377 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
11378 AppLogDebug("resolution index is %d",__primaryCurrentResolutionIndex);
11379 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11383 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
11384 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11387 if (__pCaptureResolutionList)
11390 if (__pCaptureResolutionList->GetCount() > index)
11392 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11394 if (index == __primaryCurrentResolutionIndex)
11396 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11400 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11405 if (index == __secondaryCurrentResolutionIndex)
11407 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11411 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11415 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11416 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11423 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11424 AppLogDebug("str = %ls", str.GetPointer());
11425 if (str.Equals(String(PHOTO_SIZE_3264_2488)))
11427 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11429 else if (str.Equals(String(PHOTO_SIZE_3264_2176)))
11431 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11433 else if (str.Equals(String(PHOTO_SIZE_3264_1836)))
11435 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11437 else if (str.Equals(String(PHOTO_SIZE_2048_1536)))
11439 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11441 else if (str.Equals(String(PHOTO_SIZE_2048_1152)))
11443 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11445 else if (str.Equals(String(PHOTO_SIZE_1280_720)))
11447 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.9M
11449 else if (str.Equals(String(PHOTO_SIZE_640_480)))
11451 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11455 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11457 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11459 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11460 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11465 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11468 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);
11469 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11479 AppLogDebug("EXIT");
11489 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11490 AppLogDebug("EXIT - CATCH");
11495 CameraForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11497 AppLogDebug("ENTER");
11498 CustomItem* pItem = null;
11499 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11500 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11501 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11502 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11503 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11504 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11505 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11506 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11508 result r = E_SUCCESS;
11511 String listName = L"";
11512 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11513 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11515 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11516 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11517 int selfPortraitEnable = 0;
11518 String strTmp = L"";
11520 String arrRegStringSuppor[] =
11525 OVERLAY_HELP_ENABLE,
11528 pItem = new (std::nothrow) CustomItem();
11529 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11531 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11532 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11534 elementId = (index * MENU_TWO_ELEMENT);
11536 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11537 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11539 strTmp = __pSettingGeneralMenuString[index][0];
11542 if (strTmp.GetLength())
11544 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11545 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11548 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11550 int storageType = STORAGE_TYPE_PHONE;
11552 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11553 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11555 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11557 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11558 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11559 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11562 r = _pCameraPresentationModel->GetValue(arrRegStringSuppor[index], regVal);
11563 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11565 AppLogDebug("Setting Main Menu");
11566 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11567 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11569 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11573 if (strTmp.GetLength())
11575 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11576 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11578 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11579 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11583 AppLogDebug("EXIT");
11590 AppLogDebug("EXIT - CATCH");
11595 CameraForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
11597 AppLogDebug("ENTER");
11598 CustomItem* pItem = null;
11599 Bitmap* pBitmap = null;
11600 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11601 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11602 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11603 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11604 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11605 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11606 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11607 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11608 AppResource* pAppResource = null;
11610 result r = E_SUCCESS;
11614 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
11616 pItem = new (std::nothrow) CustomItem();
11617 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11619 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11620 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11622 pAppResource = Application::GetInstance()->GetAppResource();
11623 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11625 idx = GetGeneralTabSettingSubMenuMode();
11628 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
11630 ResourceId resId = RESOURCE_ID_TIMER_OFF;
11634 case SETTING_TIMER_CAPTURE_0_SEC:
11636 resId = RESOURCE_ID_TIMER_OFF;
11640 case SETTING_TIMER_CAPTURE_2_SEC:
11642 resId = RESOURCE_ID_TIMER_2SEC;
11646 case SETTING_TIMER_CAPTURE_5_SEC:
11648 resId = RESOURCE_ID_TIMER_5SEC;
11652 case SETTING_TIMER_CAPTURE_10_SEC:
11654 resId = RESOURCE_ID_TIMER_10SEC;
11662 String arrString[] =
11665 IDS_CAM_BODY_2_SEC,
11666 IDS_CAM_BODY_5_SEC,
11667 IDS_CAM_BODY_10_SEC,
11670 pAppResource->GetString(arrString[index], tmpString);
11672 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
11673 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11675 if (index == regVal)
11677 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11681 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11683 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11685 elementId = (index * MENU_TWO_ELEMENT);
11687 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11688 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11691 pBitmap = ResourceManager::GetBitmapN(resId);
11693 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11694 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11695 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11700 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);
11701 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11705 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
11707 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
11711 case SUBMENU_GUIDELINE_OFF:
11713 resId = RESOURCE_ID_GUIDELINE_OFF;
11717 case SUBMENU_GUIDELINE_ON:
11719 resId = RESOURCE_ID_GUIDELINE_ON;
11727 elementId = (index * MENU_TWO_ELEMENT);
11729 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
11730 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11732 if (index == regVal)
11734 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11738 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11740 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11742 if (index == SUBMENU_MODE_OFF)
11744 str = IDS_CAM_BODY_OFF;
11748 str = IDS_CAM_BODY_ON;
11751 pAppResource->GetString(str, tmpString);
11753 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11754 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11761 pBitmap = ResourceManager::GetBitmapN(resId);
11762 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11764 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11765 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11771 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);
11772 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11776 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
11778 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
11782 case SUBMENU_MODE_OFF:
11784 resId = RESOURCE_ID_STORAGE_PHONE;
11788 case SUBMENU_MODE_ON:
11790 resId = RESOURCE_ID_STORAGE_CARD;
11798 elementId = (index * MENU_TWO_ELEMENT);
11800 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
11801 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11803 if (index == regVal)
11805 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11809 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11811 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11813 if (index == STORAGE_TYPE_PHONE)
11815 str = IDS_CAM_BODY_PHONE;
11819 str = IDS_CAM_OPT_MEMORY_CARD;
11822 pAppResource->GetString(str, tmpString);
11824 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11825 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11831 pBitmap = ResourceManager::GetBitmapN(resId);
11832 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11834 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11835 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11842 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
11844 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
11846 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);
11850 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);
11855 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);
11857 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11861 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
11870 AppLogDebug("EXIT");
11880 AppLogDebug("EXIT - CATCH");
11885 CameraForm::CreateFlashMainMenuItem(int index, int itemWidth)
11887 AppLogDebug("ENTER");
11888 CustomItem* pItem = null;
11889 Bitmap* pBitmap = null;
11890 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11891 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11892 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11893 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11894 String listName = L"";
11895 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11896 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11897 AppResource* pAppResource = null;
11899 result r = E_SUCCESS;
11902 bool value = false;
11903 int selfPortraitEnable = 0;
11905 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11907 String arrString[] =
11914 pItem = new (std::nothrow) CustomItem();
11915 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11917 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11918 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11920 pAppResource = Application::GetInstance()->GetAppResource();
11921 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11923 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11924 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11926 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11928 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11930 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11931 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11933 if (flashMode != FLASH_MODE_OFF)
11935 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11936 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11941 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11943 if (value == true && r == E_SUCCESS)
11945 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11949 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11951 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11952 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11954 if (flashMode != FLASH_MODE_OFF)
11956 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11957 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11962 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11963 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11967 case SUBMENU_MODE_OFF:
11969 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
11973 case SUBMENU_MODE_ON:
11975 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11979 case SUBMENU_MODE_AUTO:
11981 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
11989 pAppResource->GetString(arrString[index], tmpString);
11991 if (index == regVal)
11993 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11997 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11999 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12001 elementId = (index * MENU_TWO_ELEMENT);
12003 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12004 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12010 pBitmap = ResourceManager::GetBitmapN(resId);
12011 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12013 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12014 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12021 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
12023 if (value == true && r == E_SUCCESS)
12025 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12026 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12030 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);
12031 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12034 AppLogDebug("EXIT");
12044 AppLogDebug("EXIT - CATCH");
12049 CameraForm::CreateWhiteBalanceItem(int index, int itemWidth)
12051 AppLogDebug("ENTER");
12052 CustomItem* pItem = null;
12053 Bitmap* pBitmap = null;
12054 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12055 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12056 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12057 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12058 String listName = L"";
12059 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
12060 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
12062 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
12063 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
12065 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12066 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12067 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
12068 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12069 AppResource* pAppResource = null;
12071 result r = E_SUCCESS;
12074 int selfPortraitEnable = 0;
12075 ResourceId resId = RESOURCE_ID_WB_AWB;
12077 String arrString[] =
12080 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
12081 IDS_CAM_BODY_FLUORESCENT,
12082 IDS_CAM_BODY_DAYLIGHT,
12083 IDS_CAM_BODY_CLOUDY,
12086 pItem = new (std::nothrow) CustomItem();
12087 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12089 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12090 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12092 pAppResource = Application::GetInstance()->GetAppResource();
12093 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
12095 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
12096 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
12098 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
12100 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
12101 if (r != E_SUCCESS)
12103 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, REG_DEFAULT_VAULE_ZERO);
12105 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
12106 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12110 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
12111 if (r != E_SUCCESS)
12113 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, REG_DEFAULT_VAULE_ZERO);
12115 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
12116 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12119 AppLogDebug("regVal = %d", regVal);
12125 resId = RESOURCE_ID_WB_AWB;
12129 case MODE_WHITEBALANCE_INCANDESCENT:
12131 resId = RESOURCE_ID_WB_DAYLIGHT;
12135 case MODE_FLUORESCENT:
12137 resId = RESOURCE_ID_WB_CLOUDY;
12141 case MODE_DAYLIGHT:
12143 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12149 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12157 pAppResource->GetString(arrString[index], tmpString);
12159 if (index == regVal)
12161 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12165 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12167 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12169 elementId = (index * MENU_THREE_ELEMENT);
12171 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12172 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12178 pBitmap = ResourceManager::GetBitmapN(resId);
12179 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12181 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12182 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12188 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);
12189 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12191 AppLogDebug("EXIT");
12201 AppLogDebug("EXIT - CATCH");
12206 CameraForm::UpdatePopUp(void)
12208 bool doHidePopup = false;
12209 MakeSettingPopupTab(false);
12211 doHidePopup = OnTouchDoHidePopup();
12212 AppLogDebug("doHidePopup = %d", doHidePopup);
12220 CameraForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12222 AppLogDebug("ENTER");
12223 AppLogDebug("EXIT");
12227 CameraForm::OnKeyPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12229 AppLogDebug("ENTER");
12230 AppLogDebug("EXIT");
12234 CameraForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12236 AppLogDebug("ENTER");
12237 AppLogDebug("source name is %ls",source.GetName().GetPointer());
12238 AppLogDebug("keyCode is %d",keyCode);
12240 if (keyCode == KEY_CLEAR)
12242 if (!__isTimerRunning)
12244 BackButtonPerformed();
12247 AppLogDebug("EXIT");