2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CmCameraForm.cpp
19 * @brief This is the implementation file for CameraForm class.
22 #include "CmCameraApp.h"
23 #include "CmCameraForm.h"
24 #include "CmCameraStarterThread.h"
25 #include "CmCameraPresentationModel.h"
26 #include "CmCameraSettingsPresentationModel.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Base::Runtime;
32 using namespace Tizen::Content;
33 using namespace Tizen::Graphics;
34 using namespace Tizen::Io;
35 using namespace Tizen::Media;
36 using namespace Tizen::System;
37 using namespace Tizen::Telephony;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
42 static const int INDEX_FREE_SPACE_BUFFER_LEN = 10;
43 static const int MAX_CAMERA_EXPOSURE_VALUE = 8;
44 static const int CAMERA_EXPOSURE_VALUE_ZERO = 0;
45 static const int CAMERA_EXPOSURE_VALUE_ONE = 1;
46 static const int SLIDER_RECTVALID_X_POS = 430;
47 static const int CAMERA_EXPOSURE_TIMER_VALUE = 2000;
48 static const int CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE = 3000;
49 static const int CAMERA_GUIDELINE_ENABLE = 1;
50 static const int FLASH_MODE_OFF = 0;
51 static const int FLASH_MODE_ON = 1;
52 static const int FLASH_MODE_AUTO = 2;
53 static const int X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD = 20;
54 static const int Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD = 73;
55 static const int X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD = 73;
56 static const int Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD = 20;
57 static const int X_EXPOSURE_PANEL_SIDER_LANDSCAPE = 40;
58 static const int Y_EXPOSURE_PANEL_SIDER_LANDSCAPE = 190;
59 static const int W_EXPOSURE_PANEL_SIDER_LANDSCAPE = 60;
60 static const int H_EXPOSURE_PANEL_SIDER_LANDSCAPE = 336;
61 static const int X_EXPOSURE_PANEL_SIDER_PORTRAIT = 190;
62 static const int Y_EXPOSURE_PANEL_SIDER_PORTRAIT = 40;
63 static const int W_EXPOSURE_PANEL_SIDER_PORTRAIT = 336;
64 static const int H_EXPOSURE_PANEL_SIDER_PORTRAIT = 60;
65 static const int OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON = 20;
66 static const int FONT_SIZE_SETTING_MENU_ITEM = 34;
67 static const int FONT_SIZE_SETTING_SUB_MENU_ITEM = 34;
68 static const int H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT = 26;
69 static const int H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE = 94;
70 static const int H_SETTING_MENU_PANEL_TITLE = 50;
71 static const int H_SETTING_MENU_ITEM = 65;
72 static const int X_SETTING_MENU_LIST_PORTRAIT = 36;
73 static const int Y_SETTING_MENU_LIST_PORTRAIT = 135;
74 static const int W_SETTING_MENU_LIST_PORTRAIT = 538;
75 static const int H_SETTING_MENU_LIST_PORTRAIT = 380;
76 static const int H_SETTING_MENU_LIST_MARGIN = 200;
77 static const int X_SETTING_MENU_LIST_LANDSCAPE = 38;
78 static const int Y_SETTING_MENU_LIST_LANDSCAPE = 74;
79 static const int Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN = 130;
80 static const int W_SETTING_MENU_LIST_LANDSCAPE = 538;
81 static const int H_SETTING_MENU_LIST_LANDSCAPE = 360;
82 static const int X_SETTING_MENU_CONTESTS = 34;
83 static const int Y_SETTING_MENU_CONTESTS = 0;
84 static const int W_SETTING_MENU_CONTESTS = 280;
85 static const int H_SETTING_MENU_CONTESTS = 65;
86 static const int X_SETTING_MENU_CONTENTS_VALUE = 280;
87 static const int Y_SETTING_MENU_CONTENTS_VALUE = 0;
88 static const int W_SETTING_MENU_CONTENTS_VALUE = 290;
89 static const int H_SETTING_MENU_CONTENTS_VALUE = 65;
90 static const int H_SETTING_SUBMENU_ITEM = 88;
91 static const int X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN = 390;
92 static const int X_WHITE_BALANCE_RADIO_ICON_MARGIN = 376;
93 static const int X_SETTING_SUBMENU_RADIO_ICON = 0;
94 static const int X_SETTING_SUBMENU_RADIO_ICON_MARGIN = 350;
95 static const int Y_SETTING_SUBMENU_RADIO_ICON = 0;
96 static const int W_SETTING_SUBMENU_RADIO_ICON = 84;
97 static const int H_SETTING_SUBMENU_RADIO_ICON = 84;
98 static const int X_SETTING_SUBMENU_ICON_ZERO = 0;
99 static const int X_SETTING_SUBMENU_ICON = 75;
100 static const int X_SETTING_SUBMENU_ICON_MARGIN = 65;
101 static const int Y_SETTING_SUBMENU_ICON = 0;
102 static const int W_SETTING_SUBMENU_ICON = 88;
103 static const int H_SETTING_SUBMENU_ICON = 88;
104 static const int X_SETTING_SUBMENU_2TEXT_ITEM = 75;
105 static const int Y_SETTING_SUBMENU_2TEXT_ITEM = 0;
106 static const int W_SETTING_SUBMENU_2TEXT_ITEM = 320;
107 static const int H_SETTING_SUBMENU_2TEXT_ITEM = 84;
108 static const int X_SETTING_SUBMENU_3TEXT_ITEM = 165;
109 static const int X_FLASH_SETTING_SUBMENU_3TEXT_ITEM = 57;
110 static const int X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN = 70;
111 static const int Y_SETTING_SUBMENU_3TEXT_ITEM = 0;
112 static const int W_SETTING_SUBMENU_3TEXT_ITEM = 250;
113 static const int H_SETTING_SUBMENU_3TEXT_ITEM = 84;
114 static const int X_SUBMENU_PANEL_START_PORTRAIT = 170;
115 static const int X_SUBMENU_PANEL_START_LANDSCAPE = 340;
116 static const int Y_SUBMENU_PANEL_OFFSET_PORTRAIT = 150;
117 static const int X_SUBMENU_TIMER_MODE_PANEL = 340;
118 static const int Y_SUBMENU_TIMER_MODE_PANEL = 120;
119 static const int W_SUBMENU_TIMER_MODE_PANEL = 460;
120 static const int H_SUBMENU_TIMER_MODE_PANEL = 445;
121 static const int X_SUBMENU_TIMER_MODE_LIST = 20;
122 static const int Y_SUBMENU_TIMER_MODE_LIST = 64;
123 static const int W_SUBMENU_TIMER_MODE_LIST = 431;
124 static const int H_SUBMENU_TIMER_MODE_LIST = 420;
125 static const int X_SUBMENU_ISO_MODE_PANEL = 340;
126 static const int Y_SUBMENU_ISO_MODE_PANEL = 205;
127 static const int W_SUBMENU_ISO_MODE_PANEL = 460;
128 static const int X_SUBMENU_ISO_MODE_LIST = 20;
129 static const int Y_SUBMENU_ISO_MODE_LIST = 64;
130 static const int H_SUBMENU_ISO_MODE_PANEL_MARGIN = 88;
131 static const int W_SUBMENU_ISO_MODE_LIST = 431;
132 static const int H_SUBMENU_ISO_MODE_LIST_MARGIN = 90;
133 static const int X_SUBMENU_WB_MODE_PANEL = 340;
134 static const int Y_SUBMENU_WB_MODE_PANEL = 205;
135 static const int W_SUBMENU_WB_MODE_PANEL = 460;
136 static const int H_SUBMENU_WB_MODE_PANEL_MARGIN = 88;
137 static const int X_SUBMENU_WB_MODE_LIST = 20;
138 static const int Y_SUBMENU_WB_MODE_LIST = 64;
139 static const int W_SUBMENU_WB_MODE_LIST = 431;
140 static const int H_SUBMENU_WB_MODE_LIST = 90;
141 static const int W_SUBMENU_WB_MODE_LIST_MARGIN = 90;
142 static const int X_SUBMENU_GUIDELINE_MODE_PANEL = 340;
143 static const int Y_SUBMENU_GUIDELINE_MODE_PANEL = 260;
144 static const int W_SUBMENU_GUIDELINE_MODE_PANEL = 460;
145 static const int H_SUBMENU_GUIDELINE_MODE_PANEL = 265;
146 static const int X_SUBMENU_GUIDELINE_MODE_LIST = 20;
147 static const int Y_SUBMENU_GUIDELINE_MODE_LIST = 64;
148 static const int W_SUBMENU_GUIDELINE_MODE_LIST = 431;
149 static const int H_SUBMENU_GUIDELINE_MODE_LIST = 240;
150 static const int X_SUBMENU_STORAGE_MODE_PANEL = 340;
151 static const int Y_SUBMENU_STORAGE_MODE_PANEL = 320;
152 static const int W_SUBMENU_STORAGE_MODE_PANEL = 460;
153 static const int H_SUBMENU_STORAGE_MODE_PANEL = 265;
154 static const int X_SUBMENU_STORAGE_MODE_LIST = 20;
155 static const int Y_SUBMENU_STORAGE_MODE_LIST = 64;
156 static const int W_SUBMENU_STORAGE_MODE_LIST = 431;
157 static const int H_SUBMENU_STORAGE_MODE_LIST = 240;
158 static const int X_FLASH_MODE_SETTING_LIST_LANDSCAPE = 38;
159 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE = 94;
160 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN = 150;
161 static const int W_FLASH_MODE_SETTING_LIST_LANDSCAPE = 480;
162 static const int H_FLASH_MODE_SETTING_LIST_LANDSCAPE = 350;
163 static const int H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN = 200;
164 static const int X_FLASH_MODE_SETTING_LIST_PORTRAIT = 112;
165 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT = 85;
166 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN = 50;
167 static const int W_FLASH_MODE_SETTING_LIST_PORTRAIT = 480;
168 static const int H_FLASH_MODE_SETTING_LIST_PORTRAIT = 350;
169 static const int H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN = 200;
170 static const int H_FLASH_MODE_TITLE_TOP_MARGIN = 28;
171 static const int X_FLASH_MODE_LIST_START_POS_PORTRAIT = 288;
172 static const int CAMERA_PANEL_SUM_SIZE = 320;
173 static const int PREVIEW_OVERLAY_PANEL_SIZE = 960;
174 static const int PREVIEW_OVERLAY_PANEL_SIZE_MARGIN = 80;
175 static const int X_PREVIEW_OVERLAY_PORTRAIT = 0;
176 static const int Y_PREVIEW_OVERLAY_PORTRAIT = 160;
177 static const int W_PREVIEW_OVERLAY_PORTRAIT = 720;
178 static const int H_PREVIEW_OVERLAY_PORTRAIT = 960;
179 static const int W_FULL_PREVIEW_OVERLAY_PORTRAIT = 720;
180 static const int X_PREVIEW_OVERLAY_LANDSCAPE = 160;
181 static const int Y_PREVIEW_OVERLAY_LANDSCAPE = 0;
182 static const int W_PREVIEW_OVERLAY_LANDSCAPE = 960;
183 static const int H_PREVIEW_OVERLAY_LANDSCAPE = 720;
184 static const int W_FULL_PREVIEW_OVERLAY_LANDSCAPE = 1280;
185 static const int W_THUMBNAIL_SCALE_SIZE = 80;
186 static const int H_THUMBNAIL_SCALE_SIZE = 80;
187 static const int X_THUMBNAIL_BUTTON_IMG = 14;
188 static const int Y_THUMBNAIL_BUTTON_IMG = 14;
189 static const int X_BASE_POS = 0;
190 static const int Y_BASE_POS = 0;
191 static const int BITS_PER_BYTE = 8;
192 static const int BYTE_BUFFER_START_POS = 0;
193 static const int BYTE_ARRAY_START_POS = 0;
194 static const int CAMERA_TIMER_ONE_MILLI_SEC = 1;
195 static const int FRAME_SKIP = 4;
196 static const int REG_DEFAULT_VAULE_ZERO = 0;
197 static const int STORAGE_VALUE_ZERO = 0;
198 static const int STORAGE_DISPLAY_PLACE = 300;
199 static const int DIVIDE_BY_TWO = 2;
200 static const int INDEX_UNIT_TWENTY = 20;
201 static const int INDEX_UNIT_ZERO = 0;
202 static const int INDEX_UNIT_ONE = 1;
203 static const int DEVICE_PORTRAIT = 1;
204 static const int CAMERA_FOCUS_NOT_READY = 0;
205 static const int CAMERA_FOCUS_READY = 1;
206 static const int CAMERA_FOCUS_FAIL = 2;
207 static const int CAMERA_TIMER_LIMIT = 120000;
208 static const int SETTING_TIMER_CAPTURE_0_SEC = 0;
209 static const int SETTING_TIMER_CAPTURE_2_SEC = 1;
210 static const int SETTING_TIMER_CAPTURE_5_SEC = 2;
211 static const int SETTING_TIMER_CAPTURE_10_SEC = 3;
212 static const int SETTING_TIMER_2_SEC_COUNT = 2;
213 static const int SETTING_TIMER_5_SEC_COUNT = 5;
214 static const int SETTING_TIMER_10_SEC_COUNT = 10;
215 static const int CAMERA_CHARGING_TIMER = 1000;
216 static const int PREVIEW_FAIL_TIMER = 1000;
217 static const int CAMERA_TIMER_1_SEC = 1000;
218 static const int CAMERA_TIMER_2_SEC = 2000;
219 static const int CAMERA_TIMER_5_SEC = 5000;
220 static const int CAMERA_TIMER_10_SEC = 10000;
221 static const int SUBMENU_ISO_AUTO = 0;
222 static const int SUBMENU_ISO_100 = 1;
223 static const int SUBMENU_ISO_200 = 2;
224 static const int SUBMENU_ISO_400 = 3;
225 static const int SUBMENU_ISO_800 = 4;
226 static const int SUBMENU_GUIDELINE_OFF = 0;
227 static const int SUBMENU_GUIDELINE_ON = 1;
228 static const int SUBMENU_MODE_OFF = 0;
229 static const int SUBMENU_MODE_ON = 1;
230 static const int SUBMENU_MODE_AUTO = 2;
231 static const int SUBMENU_STORAGE_TYPE_PHONE = 0;
232 static const int SUBMENU_STORAGE_TYPE_MEMORYCARD = 1;
233 static const int SUBMENU_TIMER_COUNT = 4;
234 static const int MAX_ISO_COUNT= 9;
235 static const int SUBMENU_GUIDELINE_COUNT = 2;
236 static const int SUBMENU_STORAGE_TYPE_COUNT = 2;
237 static const int MAX_SUBMENU_CONTENT = 10;
238 static const int DRAW_INITIALIZED = 0;
239 static const int DRAW_MOVED = 1;
240 static const int DRAW_RELEASED = 2;
241 static const int DISABLE_GUIDELINE = 0;
242 static const int EXPOSURE_TIMER_IS_ALIVE = 1;
243 static const int MAX_SETTING_MENU_COUNT = 2;
244 static const int MAX_GENERAL_TAB_SETTING_MENU_COUNT = 5;
245 static const int MAX_FLASH_MENU_COUNT = 3;
246 static const int MAX_WHITE_BALANCE_MENU_COUNT = 5;
247 static const int MENU_COUNT_CLEAR = 0;
248 static const int MENU_MODE_DISABLE = -1;
249 static const int MENU_TWO_ELEMENT = 2;
250 static const int MENU_THREE_ELEMENT = 3;
252 static const int UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN = 2048;
253 static const int MULTIPLY_BY_TEN = 10;
254 static const int NORMAL_MODE_RATIO = 13;
255 static const int PREVIEW_RESOLOTION_WIDTH = 640;
256 static const int PREVIEW_RESOLOTION_HEIGHT = 480;
257 static const int MODE_AUTO = 0;
258 static const int MODE_WHITEBALANCE_INCANDESCENT = 1;
259 static const int MODE_FLUORESCENT = 2;
260 static const int MODE_DAYLIGHT = 3;
261 static const int MODE_CLOUDY = 4;
262 static const int X_INDICATOR_BATTERY_PORTRAIT = 300;
263 static const int Y_INDICATOR_BATTERY_PORTRAIT = 4;
264 static const int X_INDICATOR_BATTERY_LANDSCAPE = 582;
265 static const int Y_INDICATOR_BATTERY_LANDSCAPE = 4;
266 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 10;
267 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 7;
268 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 7;
269 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 55;
270 static const int UNIT_VALUE_ZERO = 0;
271 static const int DISPLAY_WVGA = 1200;
272 static const int SCREEN_OVERLAY_HELP_ENABLE = 1;
273 static const int SCREEN_OVERLAY_HELP_DISABLE = 0;
274 static const int BACK_BUTTON_X_POS = 63;
275 static const int BACK_BUTTON_Y_POS = 63;
276 static const int STRING_BUFFER_SIZE = 32;
277 static const int SUPPORTED_CAMERA_NUM = 1;
279 static const int BRIGHTNESS_DIVIDER_PORTRAIT_MODE = 31;
281 static const wchar_t* IDS_MENU_SETTING_MAIN_MENU_NAME = L"SettingMainMenu";
282 static const wchar_t* IDS_MENU_SETTING_GEN_MAIN_MENU_NAME = L"SettingGenMainMenu";
283 static const wchar_t* IDS_GENERAL_SETTING_SUB_MENU= L"GeneralSettingsSubMenu";
284 static const wchar_t* IDS_CAMERA_SETTING_SUB_MENU= L"CameraSettingsSubMenu";
285 static const wchar_t* IDS_MENU_WB_MENU_NAME = L"WBMenu";
286 static const wchar_t* IDS_WB_BUTTON_NAME = L"WhiteBalanceButton";
287 static const wchar_t* IDS_MENU_FLASH_MENU_NAME = L"FlashMenu";
288 static const wchar_t* IDS_FLASH_BUTTON_NAME = L"FlashButton";
289 static const wchar_t* IDS_THUMBNAIL_PANLE_NAME = L"ThumbnailPanel";
290 static const wchar_t* IDS_CAMERA_INFO_PANEL_NAME = L"CameraInfoPanel";
291 static const wchar_t* IDS_SETTING_UI_PANEL_NAME = L"SettingPanel";
292 static const wchar_t* IDS_ACTION_UI_PANEL_NAME = L"ActionPanel";
293 static const wchar_t* IDS_ACTION_UI_PANEL_CAPTURE_NAME = L"ActionCapture";
294 static const wchar_t* IDS_ACTION_UI_CAMERA_MODE = L"ActionCameraMode";
295 static const wchar_t* IDS_INIT_REG_KEY = L"NONE";
296 static const wchar_t* PHOTO_SIZE_640_480 = L"640X480(4:3)";
297 static const wchar_t* PHOTO_SIZE_1280_720 = L"1280X720(16:9)";
298 static const wchar_t* PHOTO_SIZE_3264_2488 = L"3264X2448(4:3)";
299 static const wchar_t* PHOTO_SIZE_3264_2176 = L"3264X2176(16:9)";
300 static const wchar_t* PHOTO_SIZE_3264_1836 = L"3264X1836(16:9)";
301 static const wchar_t* PHOTO_SIZE_2048_1536 = L"2048X1536(4:3)";
302 static const wchar_t* PHOTO_SIZE_2048_1152 = L"2048X1152(16:9)";
304 CameraForm::CameraForm(void)
305 : __pOverlayPanel(null)
306 , __screenMode(SCREEN_MODE_NORMAL)
307 , __cameraTabMainMenuCount(MENU_MODE_DISABLE)
308 , __cameraTabSubMenuCount(MENU_MODE_DISABLE)
309 , __cameraTabSettingMode(CAMERA_TAB_SUB_MENU_CONTENT_MAX)
310 , __generalTabMainMenuCount(MENU_MODE_DISABLE)
311 , __generalTabSubMenuCount(MENU_MODE_DISABLE)
312 , __generalTabSettingMode(GENERAL_TAB_SUB_MENU_CONTENT_MAX)
313 , __settingWhiteBalance(0)
314 , __settingIsoIndex(0)
315 , __settingTimeInterval(0)
316 , __settingExposure(0)
317 , __primaryCurrentResolutionIndex(0)
318 , __secondaryCurrentResolutionIndex(0)
319 , __isTimerRunning(false)
320 , __previewResolutionWidth(0)
321 , __previewResolutionHeight(0)
322 , __captureResolutionWidth(0)
323 , __captureResolutionHeight(0)
324 , __lowMemoryCapacity(false)
325 , __isMemoryFull(false)
326 , __isLockScreenMode(false)
327 , __resolutionChange(false)
328 , __isToggleCameraDirection(false)
329 , __isOrientationChanged(false)
330 , __isProhibitionTouchEvent(false)
331 , __pSettingPanel(null)
332 , __pActionPanel(null)
333 , __dir(ORIENTATION_STATUS_NONE)
334 , __deviceOrientation(DEVICE_PORTRAIT)
335 , __pSettingLine(null)
336 , __pCameraIconLabel(null)
337 , __pCamcoderIconLabel(null)
338 , __pShutterButton(null)
339 , __pThumbnailButton(null)
340 , __pBatteryState(null)
341 , __pButtonPoint(Point(0, 0))
342 , __pPreviewResolutionList(null)
343 , __pCaptureResolutionList(null)
345 , __pSettingMenuString(null)
346 , __pSettingGeneralMenuString(null)
347 , __pCameraStarterThread(null)
348 , __pCameraSetting(null)
349 , __pGeneralSetting(null)
350 , __pCameraSettingLable(null)
351 , __pGeneralSettingLable(null)
352 , __pFileEventManager(null)
355 , __formStatusFrameDeattivated(false)
357 AppLogDebug("ENTER");
361 CameraForm::~CameraForm(void)
363 AppLogDebug("ENTER");
368 CameraForm::OnInitializing(void)
370 AppLogDebug("ENTER");
371 result r = E_SUCCESS;
372 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
373 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
374 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
375 Point currentPosition;
376 int storageType = STORAGE_TYPE_PHONE;
377 int timerInterval = 0;
378 String filePath = L"";
380 _appControlActionCompleted = false;
381 __formStatusFrameDeattivated = false;
383 SetFormBackEventListener(this);
384 AddOrientationEventListener(*this);
385 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
386 __dir = GetOrientationStatus();
387 __deviceOrientation = __dir;
388 AppLogDebug("__dir = %d && __deviceOrientation = %d", __dir, __deviceOrientation);
390 _pCameraPresentationModel->SetOrientation(__dir);
391 _pCurrentSourceForm = SOURCE_FORM_CAMERA;
394 InitPreviewFailPopupTimer();
395 InitIntervalValueTimer();
396 InitCaptureStartTimer();
397 InitTouchAutoFocusStartTimer();
399 InitChargingCompletedTimer();
401 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
404 storageType = STORAGE_TYPE_PHONE;
407 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
409 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
410 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
411 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
414 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
415 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
417 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
418 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
420 _pCameraInfoPanel = new (std::nothrow) CameraInfoPanel();
421 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
423 if (__dir == ORIENTATION_STATUS_PORTRAIT
424 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
426 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
427 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
428 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
429 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
433 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
434 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
435 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
436 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
439 if (__dir == ORIENTATION_STATUS_PORTRAIT
440 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
442 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
446 rectPanel = Rectangle(X_BASE_POS, Y_BASE_POS, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
449 r = _pCameraInfoPanel->Initialize(rect);
450 TryCatch(r == E_SUCCESS, , "_pCameraInfoPanel Initialize fail[%s]", GetErrorMessage(r));
452 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
453 _pCameraInfoPanel->SetDrawMarkerFocus(true);
454 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
455 _pCameraInfoPanel->SetPreviewResolutionSize(REG_DEFAULT_VAULE_ZERO);
456 _pCameraInfoPanel->SetCurrentMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
457 _pCameraInfoPanel->SetStorageType(storageType);
458 _pCameraInfoPanel->SetTimerType(timerInterval);
459 _pCameraInfoPanel->SetDrawIndicator(true);
460 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
461 _pCameraInfoPanel->AddTouchEventListener(*this);
462 _pCameraInfoPanel->SetName(IDS_CAMERA_INFO_PANEL_NAME);
463 AddOrientationEventListener(*_pCameraInfoPanel);
464 AddControl(_pCameraInfoPanel);
465 SetControlAlwaysOnTop(*_pCameraInfoPanel, true);
467 SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
468 InitSettingMenuPanel();
469 InitActionMenuPanel();
470 InitScreenOverlayHelp();
471 CheckBatteryStatus();
475 __pFileEventManager = new (std::nothrow) FileEventManager();
476 r = __pFileEventManager->Construct(*this);
477 TryCatch(r == E_SUCCESS, , "__pFileEventManager Construct fail[%s]", GetErrorMessage(r));
479 filePath = _pCameraPresentationModel->GetfilePath(storageType);
480 AppLogDebug("filePath %ls", filePath.GetPointer());
482 if (File::IsFileExist(filePath))
484 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
485 __pFileEventPath = filePath;
487 AppLogDebug("FileEventManager()::AddPath() fail[%s]", GetErrorMessage(r));
490 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
491 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
497 if (_pCameraInfoPanel)
499 delete _pCameraInfoPanel;
500 _pCameraInfoPanel = null;
503 ShowCameraFailPopup();
505 AppLogDebug("EXIT - CATCH");
510 CameraForm::OnTerminating(void)
512 AppLogDebug("ENTER");
513 result r = E_SUCCESS;
515 _pCameraPresentationModel->KeepScreenOnState(false, true);
517 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
519 if (_pCameraInfoPanel != null)
521 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
524 RemoveAllEventListener();
526 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
528 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
529 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
531 if (__isLockScreenMode)
533 AppLogDebug("OnTerminating KEY_POWER_HOLD");
535 __isLockScreenMode = false;
538 __lowMemoryCapacity = false;
540 __isTimerRunning = false;
541 _pCameraPresentationModel->SetTimerEnabled(false);
543 _pCameraPresentationModel->SetIntervalTimerRun(false);
545 __resolutionChange = false;
547 __isToggleCameraDirection = false;
549 __isOrientationChanged = false;
551 __isProhibitionTouchEvent = false;
553 _pCameraPresentationModel = null;
554 __pCameraStarterThread = null;
556 __formStatusFrameDeattivated = false;
560 if (__pPreviewResolutionList)
562 __pPreviewResolutionList->RemoveAll(true);
563 delete __pPreviewResolutionList;
566 if (__pCaptureResolutionList)
568 __pCaptureResolutionList->RemoveAll(true);
569 delete __pCaptureResolutionList;
574 __pIsoList->RemoveAll(true);
578 if (__pSettingMenuString)
581 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
583 delete [] __pSettingMenuString[idx];
585 delete [] __pSettingMenuString;
588 if (__pSettingGeneralMenuString)
591 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
593 delete [] __pSettingGeneralMenuString[idx];
595 delete [] __pSettingGeneralMenuString;
598 if (__pFileEventManager != null)
600 delete __pFileEventManager;
601 __pFileEventManager = null;
609 CameraForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
611 AppLogDebug("ENTER");
612 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
613 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
614 Rectangle clientRect = GetClientAreaBounds();
615 result r = E_SUCCESS;
617 Dimension previewResolutionDim;
618 Dimension captureResolutionDim;
619 int previewResolutionSize = 0;
621 int storageType = STORAGE_TYPE_PHONE;
622 BufferInfo bufferinfo;
623 bool isRunStartPreviewThread = false;
624 bool isInitCameraStaus = false;
625 bool isCharging = false;
626 BatteryLevel batteryLevel;
628 __isTimerRunning = false;
629 _pCameraPresentationModel->SetTimerEnabled(false);
633 _pCameraPresentationModel->SetIntervalTimerRun(false);
637 StartPreviewFailPopupTimer();
639 _batteryStatus = GetCurrentBatteryState();
640 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
642 StartInitChargingTimer();
644 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
646 _pCameraPresentationModel->KeepScreenOnState(true, false);
648 _pCameraPresentationModel->SetCurrentSourceForm(SOURCE_FORM_CAMERA);
650 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
651 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
655 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
657 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
659 __previewResolutionWidth = previewResolutionDim.width;
660 __previewResolutionHeight = previewResolutionDim.height;
662 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
664 __captureResolutionWidth = captureResolutionDim.width;
665 __captureResolutionHeight = captureResolutionDim.height;
667 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
671 RemoveControl(__pOverlayPanel);
672 __pOverlayPanel = null;
675 AppLogDebug("__screenMode [%d]", __screenMode);
677 r = SetScreenMode(__screenMode, true);
678 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
680 if (__dir == ORIENTATION_STATUS_PORTRAIT
681 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
683 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
684 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
688 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
689 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
692 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
694 _pCameraInfoPanel->SetDrawPopupTimer(false);
696 _pCameraInfoPanel->Invalidate(true);
699 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
700 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
702 if (regVal == DISABLE_GUIDELINE)
713 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
714 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
716 MakeSettingPopupTab(false);
720 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
721 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
723 if (isInitCameraStaus)
725 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
726 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
728 if (isRunStartPreviewThread)
730 r = RunStartPreviewThread();
731 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
733 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
737 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
738 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
740 _pCameraPresentationModel->StartPreview(&bufferinfo);
743 _pCameraPresentationModel->SetContinuousAutoFocus();
745 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
747 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
749 SetCameraSettingsDevice();
752 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
754 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
756 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
757 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
760 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
761 isCharging = _pCameraPresentationModel->IsCharging();
763 AppLogDebug("batteryLevel = %d", batteryLevel);
764 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
766 if (isCharging == false)
772 CheckBatteryStatus();
778 CameraForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
780 AppLogDebug("ENTER");
781 __isTimerRunning = false;
783 _pCameraPresentationModel->SetTimerEnabled(false);
785 _pCameraPresentationModel->SetIntervalTimerRun(false);
787 __resolutionChange = false;
789 __isToggleCameraDirection = false;
791 __isOrientationChanged = false;
793 __isProhibitionTouchEvent = false;
795 OnHelpCloseTimerExpired();
799 MakeSettingPopupTab(false);
805 if (_isUsedTimerCaptured == true)
809 _isUsedTimerCaptured = false;
811 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
813 _pCameraInfoPanel->SetDrawPopupTimer(false);
815 _pCameraInfoPanel->Invalidate(true);
819 if (_pCameraInfoPanel->GetDrawExposure() == true)
821 _pCameraInfoPanel->SetDrawExposure(false);
829 RemoveControl(__pOverlayPanel);
830 __pOverlayPanel = null;
833 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
838 CameraForm::Update(void)
840 AppLogDebug("ENTER");
841 Bitmap* pThumbnailBitmap = null;
842 Bitmap* pRotateBitmap = null;
843 Bitmap* pBitmap = null;
844 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
845 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
846 result r = E_SUCCESS;
848 HideUiActionButton();
850 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
852 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
854 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
856 if (pThumbnailBitmap == null)
858 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
860 _pThumbnailPanel->SetShowState(true);
867 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
869 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
870 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
872 r = pRotateBitmap->Scale(dimScaleSize);
873 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
875 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
876 delete pRotateBitmap;
877 pRotateBitmap = null;
885 AppLogDebug("CameraForm::Update :: Not thummail");
887 _pThumbnailPanel->SetShowState(false);
888 _pThumbnailPanel->Draw();
889 _pThumbnailPanel->Show();
891 __pThumbnailButton->SetShowState(true);
892 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
894 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
895 TryCatch(pBitmap != null, , "pBitmap is null");
897 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
902 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
903 TryCatch(pBitmap != null, , "pBitmap is null");
905 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
910 __pThumbnailButton->Draw();
911 __pThumbnailButton->Show();
921 delete pRotateBitmap;
922 pRotateBitmap = null;
927 CameraForm::OnCapuredPerform(void)
929 AppLogDebug("ENTER");
930 result r = E_SUCCESS;
931 Point currentPosition;
932 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
933 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
934 int guideLineEnable = 0;
935 BufferInfo bufferinfo;
936 Bitmap* pThumbnailBitmap = null;
937 Bitmap* pRotateBitmap = null;
939 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
940 // TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
941 if (pThumbnailBitmap == null)
943 AppLogDebug("OnCapuredPerform::pThumbnailBitmap = null");
945 _pThumbnailPanel->SetShowState(true);
950 if (__dir == ORIENTATION_STATUS_PORTRAIT
951 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
953 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
954 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
958 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
959 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
962 pRotateBitmap = RotationImageN(pThumbnailBitmap, IMAGE_ROTATION_0);
963 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
965 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
966 TryCatch(r == E_SUCCESS, , "pRotateBitmap::Scale() fail[%s]", GetErrorMessage(r));
968 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
969 _pThumbnailPanel->SetDrawSliderImg();
971 delete pRotateBitmap;
972 pRotateBitmap = null;
975 if (__formStatusFrameDeattivated)
977 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED after CAMERA_ACTION_EVENT_CAPTURED event");
981 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
982 _pAppTimer->Cancel();
984 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
985 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
987 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
988 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
990 _pCameraPresentationModel->StartPreview(&bufferinfo);
992 _pCameraPresentationModel->SetContinuousAutoFocus();
995 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
996 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
998 if (guideLineEnable == DISABLE_GUIDELINE)
1000 r = DrawMarker(false);
1004 r = DrawMarker(true);
1006 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
1012 _isUsedTimerCaptured = false;
1016 AppLogDebug("EXIT");
1022 delete pRotateBitmap;
1023 pRotateBitmap = null;
1030 CameraForm::OnCameraActionPerformed(CameraActionEvent event)
1032 AppLogDebug("ENTER");
1033 result r = E_SUCCESS;
1035 AppLogDebug("OnCameraActionPerformed - event %d", event);
1038 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1040 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1041 DrawFocus(CAMERA_FOCUS_READY);
1045 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1047 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1048 DrawFocus(CAMERA_FOCUS_READY);
1050 TryReturnVoid(_pTouchAutoFocusTimer != null, "_pTouchAutoFocusTimer is null");
1051 _pTouchAutoFocusTimer->Cancel();
1053 r = _pTouchAutoFocusTimer->Start(CAMERA_TIMER_2_SEC);
1054 TryReturnVoid(r == E_SUCCESS, "Faled Start Timer[%s]", GetErrorMessage(r));
1058 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1060 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1061 DrawFocus(CAMERA_FOCUS_FAIL);
1065 case CAMERA_ACTION_EVENT_CAMERA_PREVIEWED:
1067 AppLogDebug("CAMERA_ACTION_EVENT_CAMERA_PREVIEWED.");
1071 case CAMERA_ACTION_EVENT_CAPTURED:
1073 AppLogDebug("CAMERA_ACTION_EVENT_CAPTURED");
1074 int requestType = 0;
1075 BufferInfo bufferinfo;
1076 bool isCharging = false;
1077 BatteryLevel batteryLevel;
1079 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1081 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1083 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1085 AppLogDebug("Camera Captured after TerminateApp");
1086 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1087 pCameraApp->SetFrameEnabled(false);
1089 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1090 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1092 _pCameraPresentationModel->StartPreview(&bufferinfo);
1094 __isProhibitionTouchEvent = true;
1097 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1104 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1105 isCharging = _pCameraPresentationModel->IsCharging();
1107 AppLogDebug("batteryLevel = %d", batteryLevel);
1108 AppLogDebug("isCharging = %d", isCharging);
1110 if (isCharging == false)
1112 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1115 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1121 case CAMERA_ACTION_EVENT_ERROR_OCCURRED:
1123 AppLogDebug("CAMERA_ACTION_EVENT_ERROR_OCCURRED.");
1125 result r = E_SUCCESS;
1126 BufferInfo bufferinfo;
1128 if (__pBatteryState != null)
1130 __pBatteryState->SetShowState(true);
1131 __pBatteryState->Draw();
1132 __pBatteryState->Show();
1135 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1137 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1138 _pCameraPresentationModel->StopCamera();
1140 r = _pCameraPresentationModel->InitializeCamera();
1141 TryReturnVoid(r == E_SUCCESS, "InitializeCamera [%s]", GetErrorMessage(r));
1143 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1144 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1146 _pCameraPresentationModel->StartPreview(&bufferinfo);
1147 _pCameraPresentationModel->SetContinuousAutoFocus();
1152 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1154 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1155 bool isEnabled = false;
1156 bool isInitCameraStaus = false;
1157 bool isCharging = false;
1158 BatteryLevel batteryLevel = BATTERY_FULL;
1159 long long int mem = 0;
1161 __formStatusFrameDeattivated = false;
1163 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1164 isEnabled = pCameraApp->IsFrameEnabled();
1166 if (isEnabled == false)
1168 pCameraApp->SetFrameEnabled(true);
1171 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1172 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1174 if (isInitCameraStaus == false)
1176 AppLogDebug("InitCamera is fail");
1181 mem = CmUtility::GetAvailableMemory();
1182 AppLogDebug("Available memory is : %lld", mem);
1184 if (_pCameraPresentationModel->IsCameraPoweredOn())
1186 result r = E_SUCCESS;
1187 BufferInfo bufferinfo;
1188 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED:CameraPoweredOn");
1190 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1192 AppLogDebug("Camera State is CAMERA_STATE_ERROR");
1193 _pCameraPresentationModel->StopCamera();
1195 r = _pCameraPresentationModel->InitializeCamera();
1196 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
1198 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1199 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1201 _pCameraPresentationModel->StartPreview(&bufferinfo);
1202 _pCameraPresentationModel->SetContinuousAutoFocus();
1204 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1205 isCharging = _pCameraPresentationModel->IsCharging();
1207 AppLogDebug("batteryLevel = %d", batteryLevel);
1209 if(mem < MIN_MEMORY_NEEDED)
1211 ShowMemoryFullPopup();
1215 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1217 if (isCharging == false)
1219 ShowLowBatteryPopup();
1224 if (CheckCallStatus())
1231 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED");
1233 if (!CheckCallStatus())
1235 GetCameraToForeground();
1238 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1239 isCharging = _pCameraPresentationModel->IsCharging();
1241 AppLogDebug("batteryLevel = %d", batteryLevel);
1242 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1244 if (isCharging == false)
1246 ShowLowBatteryPopup();
1251 CheckBatteryStatus();
1254 HideUiActionButton();
1257 if (_pThumbnailPanel != null)
1259 _pThumbnailPanel->DeleteOldBitmap();
1266 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
1268 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
1269 bool isInitCameraStaus = false;
1271 __formStatusFrameDeattivated = true;
1273 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1274 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
1276 if (isInitCameraStaus == false)
1278 AppLogDebug("InitCamera is fail");
1282 MakeSettingPopupTab(false);
1284 HideUiActionButton();
1287 if (_pThumbnailPanel != null)
1289 _pThumbnailPanel->DeleteOldBitmap();
1296 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1298 _pResetPopUp->SetShowState(false);
1301 if (_isUsedTimerCaptured == true)
1305 _isUsedTimerCaptured = false;
1307 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1309 _pCameraInfoPanel->SetDrawPopupTimer(false);
1311 _pCameraInfoPanel->Invalidate(true);
1314 SendCameraToBackground();
1318 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
1320 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
1322 ShowCameraFailPopup();
1326 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
1328 if (CheckCallStatus())
1330 AppLogDebug("Preview Fail And InCall");
1334 if (_pCameraPresentationModel->GetStartPreviewException())
1336 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
1338 ShowCameraFailPopup();
1343 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
1345 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
1346 bool isCharging = false;
1347 BatteryLevel batteryLevel;
1349 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1350 isCharging = _pCameraPresentationModel->IsCharging();
1352 AppLogDebug("batteryLevel = %d", batteryLevel);
1353 AppLogDebug("isCharging = %d", isCharging);
1355 if (isCharging == false)
1357 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1359 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
1361 if ((_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURING
1362 || _pCameraPresentationModel->GetCameraState() == CAMERA_STATE_CAPTURED)
1363 && __isTimerRunning == false)
1365 AppLogDebug("CAPTURING or CAPTURED");
1366 ShowLowBatteryPopup();
1372 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1377 CheckBatteryStatus();
1382 CheckBatteryStatus();
1387 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
1389 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
1391 _batteryStatus = GetCurrentBatteryState();
1393 AppLogDebug("_batteryStatus = %d", _batteryStatus);
1395 CheckBatteryStatus();
1399 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
1401 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
1403 int requestType = 0;
1405 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1407 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
1409 AppLogDebug("Camera Captured after TerminateApp()");
1412 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1416 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1420 OnTimerCapturePause();
1431 AppLogDebug("EXIT");
1435 CameraForm::InitSettingMenuPanel(void)
1437 AppLogDebug("ENTER");
1438 result r = E_SUCCESS;
1439 int cameraCount = 0;
1441 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
1442 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
1444 __pSettingPanel->AddTouchEventListener(*this);
1445 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
1447 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
1448 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
1449 _pFlashButton->AddTouchEventListener(*this);
1451 _pFlashButton->SetActionId(IDA_BUTTON_CAMERA_FLASH);
1452 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
1453 _pFlashButton->AddActionEventListener(*this);
1455 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
1456 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
1457 _pSelfShotButton->AddTouchEventListener(*this);
1459 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMERA_SELF);
1460 _pSelfShotButton->AddActionEventListener(*this);
1462 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
1463 TryCatch(_pSettingButton != null, r = E_SYSTEM, "pSettingButton is null");
1464 _pSettingButton->AddTouchEventListener(*this);
1466 _pSettingButton->SetActionId(IDA_BUTTON_CAMERA_SETTING);
1467 _pSettingButton->AddActionEventListener(*this);
1469 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
1470 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
1471 __pSettingLine->AddTouchEventListener(*this);
1473 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
1474 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
1475 _pQuickSettingButton->AddTouchEventListener(*this);
1477 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMERA_QUICK_SETTING);
1478 _pQuickSettingButton->AddActionEventListener(*this);
1480 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
1481 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
1483 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
1484 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
1485 _pWhiteBalanceButton->AddTouchEventListener(*this);
1486 _pWhiteBalanceButton->AddActionEventListener(*this);
1488 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
1489 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
1491 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
1492 _pExposureValueButton->AddTouchEventListener(*this);
1493 _pExposureValueButton->AddActionEventListener(*this);
1495 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
1496 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
1497 _pCloseButton->AddTouchEventListener(*this);
1499 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
1500 _pCloseButton->AddActionEventListener(*this);
1502 r = UpdateUiPanelIcon();
1503 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateSetUiPanelIcon() - fail[%s]", GetErrorMessage(r));
1505 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
1506 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
1507 if (cameraCount > SUPPORTED_CAMERA_NUM)
1509 _pSelfShotButton->SetEnabled(true);
1513 _pSelfShotButton->SetEnabled(false);
1515 AppLogDebug("EXIT");
1519 _pFlashButton = null;
1520 _pSelfShotButton = null;
1521 _pSettingButton = null;
1522 __pSettingLine = null;
1523 _pQuickSettingButton = null;
1524 _pWhiteBalanceButton = null;
1525 _pExposureValueButton = null;
1526 _pCloseButton = null;
1532 CameraForm::OnTouchModeSwitch(void)
1534 AppLogDebug("ENTER");
1535 result r = E_SUCCESS;
1537 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
1539 SceneManager* pSceneManager = SceneManager::GetInstance();
1540 AppAssert(pSceneManager);
1542 AppLogDebug("GoForward to IDSCN_CAMCORDER!!!");
1544 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1545 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
1547 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMCORDER));
1548 TryReturnVoid(r == E_SUCCESS, "SceneManager GoForward[%s]", GetErrorMessage(r));
1552 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
1554 AppLogDebug("EXIT");
1558 CameraForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
1560 AppLogDebug("ENTER");
1561 result r = E_SUCCESS;
1563 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
1564 if (__dir == ORIENTATION_STATUS_PORTRAIT
1565 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1567 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1568 _closeTimerValue = UNIT_VALUE_ZERO;
1570 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1571 _pExposureCloseTimer->Cancel();
1573 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1574 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1578 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
1579 _closeTimerValue = UNIT_VALUE_ZERO;
1581 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1582 _pExposureCloseTimer->Cancel();
1584 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1585 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1587 AppLogDebug("EXIT");
1591 CameraForm::OnTouchLaunchImageview(void)
1593 AppLogDebug("ENTER");
1594 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
1595 String fullFileName = L"";
1597 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
1599 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
1601 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
1603 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
1605 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1607 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1609 if (fullFileName == L"")
1611 AppLogDebug("file do not found");
1615 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
1622 AppLogDebug("LaunchImageview");
1623 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
1625 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
1627 if (fullFileName == L"")
1629 AppLogDebug("file do not found");
1637 AppLogDebug("EXIT");
1641 CameraForm::OnTimerCapturePause(void)
1643 AppLogDebug("ENTER");
1644 if (__isTimerRunning == true)
1646 if (_pPopupTimer != null)
1648 _pPopupTimer->Cancel();
1650 delete _pPopupTimer;
1651 _pPopupTimer = null;
1654 _timeCount = INDEX_UNIT_ZERO;
1656 if (_isUsedTimerCaptured == true)
1658 __isTimerRunning = false;
1660 _pCameraPresentationModel->SetIntervalTimerRun(false);
1662 _isUsedTimerCaptured = false;
1664 if (_pIntervalValueTimer != null)
1666 _pIntervalValueTimer->Cancel();
1668 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
1670 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
1672 _pCameraInfoPanel->Invalidate(true);
1674 _pCameraInfoPanel->SetDrawPopupTimer(false);
1676 _pCameraInfoPanel->Invalidate(true);
1681 AppLogDebug("EXIT");
1685 CameraForm::OnTouchDoHidePopup(void)
1687 AppLogDebug("ENTER");
1688 bool doHidePopup = false;
1690 if (_pListViewCameraTabMainMenu != null)
1692 if (_pListViewCameraTabMainMenu->GetShowState() == true)
1698 if (_pListViewGeneralTabMainMenu != null)
1700 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
1706 if (_pListFlashMainMenu != null)
1708 if (_pListFlashMainMenu->GetShowState() == true)
1714 if (_pListWbMainMenu != null)
1716 if (_pListWbMainMenu->GetShowState() == true)
1722 if (_pListViewCameraTabSubMenu != null)
1724 if (_pListViewCameraTabSubMenu->GetShowState() == true)
1730 if (_pListViewGeneralTabSubMenu != null)
1732 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
1738 if (_pCameraInfoPanel->GetDrawExposure() == true)
1740 doHidePopup = false;
1743 AppLogDebug("EXIT");
1748 CameraForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1750 AppLogDebug("ENTER");
1751 result r = E_SUCCESS;
1752 String controlName = L"";
1754 if (_appControlActionCompleted)
1756 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1760 controlName = source.GetName();
1762 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1764 AppLogDebug("OnTouchPressed return");
1768 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1769 _pAppTimer->Cancel();
1771 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
1772 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
1774 if (_pCameraInfoPanel->GetDrawExposure() == true)
1776 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1777 _pExposureCloseTimer->Cancel();
1779 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
1780 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
1782 AppLogDebug("EXIT");
1786 CameraForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1788 AppLogDebug("ENTER");
1789 String controlName = source.GetName();
1791 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1793 AppLogDebug("OnTouchLongPressed return");
1797 if ((controlName.Equals(String(IDS_ACTION_UI_PANEL_CAPTURE_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1799 AppLogDebug("OnTouchLongPressed Action");
1800 if (source.Equals(*__pShutterButton) == true)
1802 _pCameraPresentationModel->SetContinuousAutoFocus();
1805 AppLogDebug("EXIT");
1809 CameraForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1811 AppLogDebug("ENTER");
1812 String controlName = L"";
1813 int checkActivePanel = -1;
1814 bool doHidePopup = false;
1816 if (_appControlActionCompleted)
1818 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1821 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
1822 controlName = source.GetName();
1824 if ((__isProhibitionTouchEvent == true) && (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET))
1826 AppLogDebug("OnTouchReleased return");
1830 if (_pCameraInfoPanel->GetDrawExposure() == true)
1832 if (source.Equals(*__pShutterButton) == true)
1834 _closeTimerValue = 0;
1836 if (_pExposureCloseTimer)
1838 _pExposureCloseTimer->Cancel();
1841 _pCameraInfoPanel->SetDrawExposure(false);
1847 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1849 OnTouchDrawExposure(currentPosition);
1854 doHidePopup = OnTouchDoHidePopup();
1855 AppLogDebug("doHidePopup = %d", doHidePopup);
1857 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
1859 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
1861 DrawTouchAutoFocus(currentPosition);
1866 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
1867 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
1869 if (_pCameraInfoGeneralSubPanel != null)
1871 if (_pCameraInfoGeneralSubPanel->GetShowState())
1873 checkActivePanel = 0;
1876 if (_pCameraInfoSubPanel != null)
1878 if (_pCameraInfoSubPanel->GetShowState())
1880 checkActivePanel = 1;
1884 if (checkActivePanel != -1)
1886 if (checkActivePanel == 0)
1888 _pCameraInfoGeneralSubPanel->SetShowState(false);
1892 _pCameraInfoSubPanel->SetShowState(false);
1902 if (source.Equals(*__pCameraSettingLable) == true)
1904 CheckCameraSettingLabel();
1907 if (source.Equals(*__pGeneralSettingLable) == true)
1909 CheckGeneralSettingLabel();
1912 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
1913 && _pThumbnailPanel->GetShowState() == true
1914 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1915 && _pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED
1918 if (source.Equals(*_pThumbnailPanel) == true)
1920 AppLogDebug("Touch Thumbnail button");
1921 OnTouchLaunchImageview();
1925 if (_pCameraInfoPanel->GetDrawExposure() == true)
1927 HideExposurePanel();
1929 AppLogDebug("EXIT");
1933 CameraForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1935 AppLogDebug("ENTER");
1936 String controlName = L"";
1937 result r = E_SUCCESS;
1939 if (_appControlActionCompleted)
1941 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
1945 controlName = source.GetName();
1947 if ((controlName.Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
1949 OnTouchModeSwitch();
1953 if (_pCameraInfoPanel->GetDrawExposure() == true)
1955 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
1957 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
1958 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
1959 _closeTimerValue = 0;
1961 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
1962 _pExposureCloseTimer->Cancel();
1965 AppLogDebug("EXIT");
1969 CameraForm::OnAppTimerExpired(void)
1971 AppLogDebug("ENTER");
1972 result r = E_SUCCESS;
1973 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1977 _pCameraPresentationModel->StopCamera();
1979 r = SendAppControlResult(pCameraApp->GetRequestId());
1980 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
1981 AppLogDebug("EXIT");
1985 CameraForm::OnPreviewFailPopupTimerExpired(void)
1987 AppLogDebug("ENTER");
1988 if (CheckCallStatus())
1990 AppLogDebug("Preview Fail And InCall");
1994 ShowCameraFailPopup();
1995 AppLogDebug("EXIT");
1999 CameraForm::OnCaptureStartTimerExpired(void)
2001 AppLogDebug("ENTER");
2002 result r = E_SUCCESS;
2003 int timerInterval = 0;
2005 if (_pCaptureStartTimer)
2007 _pCaptureStartTimer->Cancel();
2010 timerInterval = GetTimerIntervalValue();
2014 _isUsedTimerCaptured = true;
2016 r = SetTimerIntervalValue(timerInterval);
2017 TryReturnVoid(r == E_SUCCESS, "SetTimerIntervalValue() fail[%s]", GetErrorMessage(r));
2021 r = DrawTimerPopup();
2022 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
2023 AppLogDebug("EXIT");
2027 CameraForm::OnTouchAutoFocusTimerExpired(void)
2029 AppLogDebug("ENTER");
2030 _pCameraPresentationModel->SetContinuousAutoFocus();
2032 _pTouchAutoFocusTimer->Cancel();
2033 AppLogDebug("EXIT");
2037 CameraForm::OnPopupTimerExpired(void)
2039 AppLogDebug("ENTER");
2040 if (_pCameraPresentationModel->IsPreviewState() == true)
2044 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
2046 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
2048 _pCameraInfoPanel->Invalidate(true);
2050 AppLogDebug("_timeCount=%d", _timeCount);
2052 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
2057 AppLogDebug("EXIT");
2061 CameraForm::OnIntervalValueTimerExpired(void)
2063 AppLogDebug("ENTER");
2064 result r = E_SUCCESS;
2065 bool focusSupport = false;
2066 int selfPortraitEnable = 0;
2068 if (_isUsedTimerCaptured == true)
2070 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
2072 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
2074 _pCameraInfoPanel->Invalidate(true);
2076 _pCameraInfoPanel->SetDrawPopupTimer(false);
2078 _pCameraInfoPanel->Invalidate(true);
2082 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2083 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
2085 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2087 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
2091 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
2094 if (focusSupport == true && r == E_SUCCESS)
2096 _pCameraInfoPanel->SetDrawMarkerFocus(true);
2098 DrawFocus(CAMERA_FOCUS_NOT_READY);
2102 _pCameraInfoPanel->SetDrawMarkerFocus(false);
2104 _pCameraInfoPanel->Invalidate(true);
2110 _pCameraPresentationModel->SetTimerEnabled(true);
2111 _pCameraPresentationModel->Capture();
2113 __isTimerRunning = false;
2115 _pCameraPresentationModel->SetIntervalTimerRun(false);
2117 if (__pBatteryState)
2119 __pBatteryState->SetShowState(true);
2120 __pBatteryState->Draw();
2121 __pBatteryState->Show();
2127 AppLogDebug("EXIT");
2131 CameraForm::OnExposureCloseTimerExpired(void)
2133 AppLogDebug("ENTER");
2136 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
2138 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
2140 if (_pCameraInfoPanel->GetDrawExposure() == true)
2142 _pCameraInfoPanel->SetDrawExposure(false);
2148 _closeTimerValue = 0;
2150 _pExposureCloseTimer->Cancel();
2152 AppLogDebug("EXIT");
2156 CameraForm::OnChargingCompletedTimerExpired(void)
2158 AppLogDebug("ENTER");
2159 Bitmap* pBitmap = null;
2160 result r = E_SUCCESS;
2162 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2164 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2166 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2170 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2175 if (_chargingCount % DIVIDE_BY_TWO)
2177 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
2181 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
2183 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2185 if (_chargingCount >= BATTERY_STATE_20)
2187 _chargingCount = INDEX_UNIT_ZERO;
2191 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2192 __pBatteryState->Invalidate(true);
2194 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2195 AppLogDebug("_chargingCount = %d", _chargingCount);
2196 AppLogDebug("_blinkCount = %d", _blinkCount);
2201 AppLogDebug("EXIT");
2205 AppLogDebug("EXIT - CATCH");
2210 CameraForm::OnChargingTimerExpired(void)
2212 AppLogDebug("ENTER");
2213 Bitmap* pBitmap = null;
2214 result r = E_SUCCESS;
2215 int maxChargingCnt = 0;
2216 int batteryLevel = 0;
2217 Battery::GetCurrentLevelInPercentage(batteryLevel);
2219 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2221 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2223 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
2227 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
2230 AppLogDebug("batteryLevel = %d", batteryLevel);
2234 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2235 AppLogDebug("_chargingCount = %d", _chargingCount);
2237 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
2239 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
2243 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
2245 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2247 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
2249 AppLogDebug("maxCount = %d", maxChargingCnt);
2251 if (maxChargingCnt >= BATTERY_STATE_20)
2253 _chargingCount = INDEX_UNIT_ZERO;
2256 __pBatteryState->SetBackgroundBitmap(*pBitmap);
2257 __pBatteryState->Invalidate(true);
2262 AppLogDebug("EXIT");
2266 AppLogDebug("EXIT - CATCH");
2271 CameraForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
2273 AppLogDebug("ENTER");
2274 if (timer.Equals(*_pAppTimer))
2276 AppLogDebug("_pAppTimer");
2277 OnAppTimerExpired();
2279 else if (timer.Equals(*_pCaptureStartTimer))
2281 AppLogDebug("_pCaptureStartTimer");
2282 OnCaptureStartTimerExpired();
2284 else if (timer.Equals(*_pTouchAutoFocusTimer))
2286 AppLogDebug("_pTouchAutoFocusTimer");
2287 OnTouchAutoFocusTimerExpired();
2289 else if (timer.Equals(*_pPopupTimer))
2291 AppLogDebug("_pPopupTimer");
2292 OnPopupTimerExpired();
2294 else if (timer.Equals(*_pIntervalValueTimer))
2296 AppLogDebug("_pIntervalValueTimer");
2297 OnIntervalValueTimerExpired();
2298 StartInitChargingTimer();
2300 else if (timer.Equals(*_pHelpCloseTimer))
2302 AppLogDebug("__pHelpCloseTimer");
2303 OnHelpCloseTimerExpired();
2305 else if (timer.Equals(*_pExposureCloseTimer))
2307 AppLogDebug("_pExposureCloseTimer");
2308 OnExposureCloseTimerExpired();
2310 else if (timer.Equals(*_pChargingTimer))
2312 result r = E_SUCCESS;
2313 AppLogDebug("_pChargingTimer");
2314 bool isCharging = false;
2316 _batteryStatus = GetCurrentBatteryState();
2317 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2319 isCharging = _pCameraPresentationModel->IsCharging();
2323 if (_batteryStatus == BATTERY_STATE_20)
2325 _chargingCount = INDEX_UNIT_ZERO;
2327 _blinkCount = INDEX_UNIT_ZERO;
2329 _pChargingTimer->Cancel();
2331 StartInitChargingCompletedTimer();
2335 r = OnChargingTimerExpired();
2340 _chargingCount = INDEX_UNIT_ZERO;
2342 _blinkCount = INDEX_UNIT_ZERO;
2344 _pChargingTimer->Cancel();
2346 if (_batteryStatus == BATTERY_STATE_20)
2348 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
2350 StartInitChargingCompletedTimer();
2354 else if (timer.Equals(*_pChargingCompletedTimer))
2356 result r = E_SUCCESS;
2357 AppLogDebug("__pChargingCompletedTimer");
2358 bool isCharging = false;
2360 isCharging = _pCameraPresentationModel->IsCharging();
2362 _batteryStatus = GetCurrentBatteryState();
2363 AppLogDebug("_batteryStatus = %d", _batteryStatus);
2365 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
2367 if (_blinkCount == INDEX_UNIT_TWENTY)
2369 AppLogDebug("__pChargingCompletedTimer cancel");
2371 _chargingCount = INDEX_UNIT_ZERO;
2373 _blinkCount = INDEX_UNIT_ZERO;
2375 _pChargingCompletedTimer->Cancel();
2377 CheckBatteryStatus();
2381 AppLogDebug("OnChargingCompletedTimerExpired");
2383 r = OnChargingCompletedTimerExpired();
2388 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
2390 _chargingCount = INDEX_UNIT_ZERO;
2392 _blinkCount = INDEX_UNIT_ZERO;
2394 _pChargingCompletedTimer->Cancel();
2396 CheckBatteryStatus();
2399 else if (timer.Equals(*_pPreviewFailPopupTimer))
2401 AppLogDebug("__pPreviewFailPopupTimer");
2402 _pPreviewFailPopupTimer->Cancel();
2404 if (_pCameraPresentationModel->GetStartPreviewException())
2406 OnPreviewFailPopupTimerExpired();
2411 AppLogDebug("Not expire");
2413 AppLogDebug("EXIT");
2417 CameraForm::InitActionMenuPanel(void)
2419 AppLogDebug("ENTER");
2420 result r = E_SUCCESS;
2421 Rectangle rectThumbnailButton;
2422 Rectangle rectAccessibility;
2423 Rectangle clientArea = GetClientAreaBounds();
2425 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
2426 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
2428 __pActionPanel->AddTouchEventListener(*this);
2429 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
2431 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2433 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2434 || __dir == ORIENTATION_STATUS_PORTRAIT)
2436 if (clientArea.height == DISPLAY_WVGA)
2438 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2442 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2447 if (clientArea.width == DISPLAY_WVGA)
2449 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
2453 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
2457 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
2458 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
2459 __pBatteryState->AddTouchEventListener(*this);
2460 __pBatteryState->SetShowState(true);
2462 __pCameraSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
2463 TryCatch(__pCameraSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
2464 __pCameraSetting->SetActionId(IDA_BUTTON_SETTING_CAMERA);
2465 __pCameraSetting->AddActionEventListener(*this);
2466 __pCameraSetting->SetShowState(false);
2468 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
2469 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
2470 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
2471 __pGeneralSetting->AddActionEventListener(*this);
2472 __pGeneralSetting->SetShowState(false);
2474 __pCameraSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
2475 TryCatch(__pCameraSettingLable != null, r = E_SYSTEM, "__pCameraSettingLable is null");
2476 __pCameraSettingLable->AddTouchEventListener(*this);
2477 __pCameraSettingLable->SetShowState(false);
2479 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
2480 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
2481 __pGeneralSettingLable->AddTouchEventListener(*this);
2482 __pGeneralSettingLable->SetShowState(false);
2484 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
2485 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
2486 __pCameraIconLabel->AddTouchEventListener(*this);
2488 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
2489 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
2491 __pSwButton->SetName(IDS_ACTION_UI_CAMERA_MODE);
2492 __pSwButton->AddTouchEventListener(*this);
2493 __pSwButton->AddKeyEventListener(*this);
2495 __pSwButton->GetAccessibilityContainer()->AddAccessibilityListener(*this);
2497 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
2498 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
2499 __pCamcoderIconLabel->AddTouchEventListener(*this);
2501 __pShutterButton = static_cast<Button*>(GetControl(L"IDC_SHUTTER_BUTTON"));
2502 TryCatch(__pShutterButton != null, r = E_SYSTEM, "__pShutterButton is null");
2504 __pShutterButton->SetActionId(IDA_BUTTON_CAMERA_SHUTTER);
2505 __pShutterButton->SetName(IDS_ACTION_UI_PANEL_CAPTURE_NAME);
2506 __pShutterButton->AddActionEventListener(*this);
2507 __pShutterButton->AddTouchEventListener(*this);
2509 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
2511 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2512 || __dir == ORIENTATION_STATUS_PORTRAIT)
2514 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
2515 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
2517 rectAccessibility = Rectangle(rectThumbnailButton.x - 25,rectThumbnailButton.y - 22,rectThumbnailButton.width - 7,
2518 rectThumbnailButton.height - 10);
2522 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
2523 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
2526 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
2527 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
2528 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
2530 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
2531 _pThumbnailPanel->AddTouchEventListener(*this);
2532 _pThumbnailPanel->AddKeyEventListener(*this);
2534 //_pThumbnailPanel->SetUpdateListener(this);
2536 AddControl(_pThumbnailPanel);
2537 AddOrientationEventListener(*_pThumbnailPanel);
2539 _pAccessibilityElement = new AccessibilityElement();
2540 r = _pAccessibilityElement->Construct(rectAccessibility, L"Thumbnail Panel");
2541 _pAccessibilityElement->SetLabel(L"Thumbnail Panel");
2543 _pAccessibilityElement->SetBounds(rectAccessibility);
2544 _pThumbnailPanel->GetAccessibilityContainer()->AddElement(*_pAccessibilityElement);
2546 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
2547 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
2548 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMERA_THUMBNAIL);
2549 __pThumbnailButton->AddActionEventListener(*this);
2550 __pThumbnailButton->AddTouchEventListener(*this);
2551 __pThumbnailButton->SetShowState(false);
2553 r = UpdateUiActionPanelIcon();
2554 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() is fail[%s]", GetErrorMessage(r));
2556 AppLogDebug("EXIT");
2560 __pCameraIconLabel = null;
2561 __pCamcoderIconLabel = null;
2562 __pBatteryState = null;
2564 __pShutterButton = null;
2565 __pThumbnailButton = null;
2566 __pCameraSetting = null;
2567 __pGeneralSetting = null;
2568 __pCameraSettingLable = null;
2569 __pGeneralSettingLable = null;
2571 delete _pThumbnailPanel;
2572 _pThumbnailPanel = null;
2578 CameraForm::UpdateUiPanelIcon(void)
2580 AppLogDebug("ENTER");
2581 result r = E_SUCCESS;
2582 Bitmap* pBitmap = null;
2583 Bitmap* pBitmapRotate = null;
2584 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
2587 ImageRotationType rotationType = IMAGE_ROTATION_0;
2589 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2591 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2592 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2594 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2596 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2597 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2599 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2600 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2602 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2603 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2605 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2610 delete pBitmapRotate;
2611 pBitmapRotate = null;
2613 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2614 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2616 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2617 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2619 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2624 delete pBitmapRotate;
2625 pBitmapRotate = null;
2627 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2629 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2631 if (value == true && r == E_SUCCESS)
2633 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2634 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2638 case FLASH_MODE_OFF:
2640 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2641 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2643 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2644 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2646 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2651 delete pBitmapRotate;
2652 pBitmapRotate = null;
2654 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2655 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2657 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2658 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2660 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2665 delete pBitmapRotate;
2666 pBitmapRotate = null;
2672 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2673 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2675 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2676 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2678 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2683 delete pBitmapRotate;
2684 pBitmapRotate = null;
2686 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2687 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2689 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2690 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2692 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2697 delete pBitmapRotate;
2698 pBitmapRotate = null;
2702 case FLASH_MODE_AUTO:
2704 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2705 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2707 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2708 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2710 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2715 delete pBitmapRotate;
2716 pBitmapRotate = null;
2718 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2719 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2721 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2722 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2724 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2729 delete pBitmapRotate;
2730 pBitmapRotate = null;
2740 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2741 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2743 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2744 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2746 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2747 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2749 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2754 delete pBitmapRotate;
2755 pBitmapRotate = null;
2757 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2759 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2761 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2762 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2764 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2769 delete pBitmapRotate;
2770 pBitmapRotate = null;
2774 _pFlashButton->Invalidate(true);
2775 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2777 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2779 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2781 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2783 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2785 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2787 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2788 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2790 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2795 delete pBitmapRotate;
2796 pBitmapRotate = null;
2798 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2800 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2802 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2804 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2806 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2808 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2809 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2811 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2816 delete pBitmapRotate;
2817 pBitmapRotate = null;
2819 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2821 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2825 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2827 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2829 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2830 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2832 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2837 delete pBitmapRotate;
2838 pBitmapRotate = null;
2840 if (__dir == ORIENTATION_STATUS_LANDSCAPE
2841 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
2843 rotationType = IMAGE_ROTATION_270;
2846 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2848 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2849 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2851 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2852 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2854 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2859 delete pBitmapRotate;
2860 pBitmapRotate = null;
2862 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2863 TryCatch(pBitmap != null, r = E_SYSTEM, "Setting::pBitmap is null");
2865 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2866 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Setting::pBitmapRotate is null");
2868 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2873 delete pBitmapRotate;
2874 pBitmapRotate = null;
2876 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2878 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2879 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2881 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2882 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2884 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2889 delete pBitmapRotate;
2890 pBitmapRotate = null;
2892 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2894 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2895 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2897 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2902 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2903 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2905 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2910 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2912 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2914 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2918 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2923 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2924 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2926 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2931 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2932 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2934 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2941 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2942 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2944 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2949 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2950 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2952 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2958 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2960 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2961 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2963 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2965 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2966 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2968 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2973 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2975 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2976 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2978 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2979 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2981 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2982 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2987 delete pBitmapRotate;
2988 pBitmapRotate = null;
2990 AppLogDebug("EXIT");
2994 if (pBitmap != null)
3004 CameraForm::UpdateUiActionPanelIcon(void)
3006 AppLogDebug("ENTER");
3007 result r = E_SUCCESS;
3008 Bitmap* pBitmap = null;
3009 Bitmap* pBitmapRotate = null;
3010 ImageRotationType rotationType = IMAGE_ROTATION_0;
3011 Point ptShutterIcon;
3012 Point ptModeChangeButton;
3013 Rectangle rectThumbnailButton;
3015 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
3017 if (__dir == ORIENTATION_STATUS_PORTRAIT
3018 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3020 rotationType = IMAGE_ROTATION_90;
3021 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD, Y_ACTION_PANEL_SHUTTER_ICON_PORTRAIT_HD);
3022 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
3024 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
3025 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
3027 rotationType = IMAGE_ROTATION_0;
3028 ptShutterIcon = Point(X_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD, Y_ACTION_PANEL_SHUTTER_ICON_LANDSCAPE_HD);
3029 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
3032 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
3033 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraIconLabel::pBitmap is null");
3035 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
3040 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
3041 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3043 pBitmapRotate = RotationImageN(pBitmap, rotationType);
3044 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
3046 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3047 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3051 delete pBitmapRotate;
3052 pBitmapRotate = null;
3054 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
3055 TryCatch(pBitmap != null, r = E_SYSTEM, "SwButton::pBitmap is null");
3057 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
3061 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
3062 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderIconLabel::pBitmap is null");
3064 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
3069 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3070 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3072 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3073 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3078 delete pBitmapRotate;
3079 pBitmapRotate = null;
3081 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
3082 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3084 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3085 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3090 delete pBitmapRotate;
3091 pBitmapRotate = null;
3093 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
3094 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
3096 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3097 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
3102 delete pBitmapRotate;
3103 pBitmapRotate = null;
3105 if (__dir == ORIENTATION_STATUS_PORTRAIT
3106 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3108 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL);
3109 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3113 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_NORMAL_LAND);
3114 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3117 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3118 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3120 __pShutterButton->SetNormalBackgroundBitmap(*pBitmapRotate);
3125 delete pBitmapRotate;
3126 pBitmapRotate = null;
3128 if (__dir == ORIENTATION_STATUS_PORTRAIT
3129 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3131 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS);
3132 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3136 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_PRESS_LAND);
3137 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3140 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3141 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ShutterButton::pBitmapRotate is null");
3143 __pShutterButton->SetPressedBackgroundBitmap(*pBitmapRotate);
3147 delete pBitmapRotate;
3148 pBitmapRotate = null;
3150 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SHUTTER_ICON);
3151 TryCatch(pBitmap != null, r = E_SYSTEM, "ShutterButton::pBitmap is null");
3153 __pShutterButton->SetNormalBitmap(ptShutterIcon, *pBitmap);
3158 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3159 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3161 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
3166 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
3167 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
3169 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
3174 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMERA);
3175 TryCatch(pBitmap != null, r = E_SYSTEM, "CameraSetting::pBitmap is null");
3177 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3178 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CameraSetting::pBitmapRotate is null");
3180 __pCameraSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3181 __pCameraSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3186 delete pBitmapRotate;
3187 pBitmapRotate = null;
3189 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
3190 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
3192 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
3193 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
3195 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
3196 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
3201 delete pBitmapRotate;
3202 pBitmapRotate = null;
3204 AppLogDebug("EXIT");
3208 if (pBitmap != null)
3218 CameraForm::SetTimerIntervalValue(int timerIntervalValue)
3220 AppLogDebug("ENTER");
3221 result r = E_SUCCESS;
3223 AppLogDebug("timerIntervalValue = %d", timerIntervalValue);
3225 switch (timerIntervalValue)
3227 case SETTING_TIMER_CAPTURE_0_SEC:
3232 case SETTING_TIMER_CAPTURE_2_SEC:
3234 _pIntervalValueTimer->Cancel();
3236 r = _pIntervalValueTimer->Start(CAMERA_TIMER_2_SEC);
3237 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3241 case SETTING_TIMER_CAPTURE_5_SEC:
3243 _pIntervalValueTimer->Cancel();
3245 r = _pIntervalValueTimer->Start(CAMERA_TIMER_5_SEC);
3246 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3250 case SETTING_TIMER_CAPTURE_10_SEC:
3252 _pIntervalValueTimer->Cancel();
3254 r = _pIntervalValueTimer->Start(CAMERA_TIMER_10_SEC);
3255 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
3261 AppLogDebug("timer Invaild element id");
3266 AppLogDebug("EXIT");
3274 CameraForm::SetExifOrientation(int deviceOrientation)
3276 AppLogDebug("ENTER");
3277 result r = E_SUCCESS;
3279 r = _pCameraPresentationModel->SetExifOrientation(deviceOrientation);
3280 AppLogDebug("SetExifOrientation : deviceOrientation = %d, fail[%s]", deviceOrientation, GetErrorMessage(r));
3281 AppLogDebug("EXIT");
3285 CameraForm::StartCaptured(void)
3287 AppLogDebug("ENTER");
3288 result r = E_SUCCESS;
3289 int timerInterval = 0;
3291 timerInterval = GetTimerIntervalValue();
3293 switch (timerInterval)
3295 case SETTING_TIMER_CAPTURE_0_SEC:
3297 _isUsedTimerCaptured = false;
3299 __isTimerRunning = false;
3301 _pCameraPresentationModel->SetIntervalTimerRun(false);
3303 _pIntervalValueTimer->Cancel();
3305 _pCameraPresentationModel->Capture();
3307 StartInitChargingTimer();
3311 case SETTING_TIMER_CAPTURE_2_SEC:
3313 case SETTING_TIMER_CAPTURE_5_SEC:
3315 case SETTING_TIMER_CAPTURE_10_SEC:
3317 __isTimerRunning = true;
3319 if (__pBatteryState)
3321 __pBatteryState->SetShowState(false);
3322 __pBatteryState->Draw();
3323 __pBatteryState->Show();
3326 _pCameraPresentationModel->SetIntervalTimerRun(true);
3330 if (_pCameraInfoPanel != null)
3332 _pCameraInfoPanel->SetDrawIndicator(false);
3333 _pCameraInfoPanel->Invalidate(true);
3336 if (_isUsedTimerCaptured == false)
3338 _pCaptureStartTimer->Cancel();
3340 if (_pCameraInfoPanel != null)
3342 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3343 _pCameraInfoPanel->Invalidate(true);
3346 r = _pCaptureStartTimer->Start(CAMERA_TIMER_1_SEC);
3347 TryReturnVoid(r == E_SUCCESS, "_pCaptureStartTimer start fail[%s]", GetErrorMessage(r));
3355 AppLogDebug("EXIT");
3359 CameraForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
3361 AppLogDebug("ENTER");
3362 result r = E_SUCCESS;
3363 int selfPortraitEnable = 0;
3364 int guideLineEnable = 0;
3367 case IDA_BUTTON_CAMERA_FLASH:
3369 int selfPortraitEnable = 0;
3370 result r = E_SUCCESS;
3372 bool isCharging = false;
3373 BatteryLevel batteryLevel;
3375 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
3376 isCharging = _pCameraPresentationModel->IsCharging();
3378 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3379 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3381 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3383 AppLogDebug("FLASEH OFF!!!");
3387 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3389 if (value == true && r == E_SUCCESS)
3391 if (batteryLevel == BATTERY_LOW && isCharging == false)
3396 AppResource* pAppResource = null;
3398 pAppResource = Application::GetInstance()->GetAppResource();
3399 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
3401 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
3403 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
3404 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
3405 msgBox.ShowAndWait(result);
3414 AppLogDebug("FLASEH OFF!!!");
3420 case IDA_BUTTON_CAMERA_SELF:
3422 int selfPortraitEnable = 0;
3423 result r = E_SUCCESS;
3425 int cameraCount = 0;
3427 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
3429 AppLogDebug("Camera Preview is not");
3433 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
3434 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
3436 if (cameraCount < SUPPORTED_CAMERA_NUM)
3438 AppLogDebug("The physical direction of the camera is not exit");
3442 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3443 TryReturnVoid(r == E_SUCCESS, "Faled to get value to registry[%s]", GetErrorMessage(r));
3444 MakeSettingPopupTab(false);
3448 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3450 AppLogDebug("PRIMARY -> SECONDARY");
3452 __isToggleCameraDirection = true;
3454 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3455 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3457 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
3458 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3460 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
3461 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3464 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
3466 AppLogDebug("SECONDARY -> PRIMARY");
3467 int primaryFlashValue = FLASH_MODE_OFF;
3468 __isToggleCameraDirection = true;
3470 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3471 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3473 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3474 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3476 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
3477 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3479 if (value == true && r == E_SUCCESS)
3481 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
3482 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3486 UpdateUiPanelIcon();
3487 MakePreviewResolutionList(true);
3488 MakeCaptrueResolutionList(true);
3491 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3492 _pFlashButton->Invalidate(true);
3494 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
3495 _pSelfShotButton->Invalidate(true);
3497 __isToggleCameraDirection = false;
3501 case IDA_BUTTON_CAMERA_SETTING:
3503 result r = E_SUCCESS;
3505 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3506 _pAppTimer->Cancel();
3508 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3509 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3511 UpdateUiPanelIcon();
3517 case IDA_BUTTON_CLOSE_SETTING:
3519 result r = E_SUCCESS;
3521 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3522 _pAppTimer->Cancel();
3524 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3525 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3531 case IDA_BUTTON_CAMERA_QUICK_SETTING:
3533 result r = E_SUCCESS;
3535 int selfPortraitEnable = 0;
3537 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3538 _pAppTimer->Cancel();
3540 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3541 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3543 MakeCameraTabSettingPopup();
3545 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3547 if (_pListViewCameraTabMainMenu != null)
3549 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3551 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
3555 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
3558 if (__pCaptureResolutionList != null)
3560 if (!(__pCaptureResolutionList->GetCount()>1) || r != E_SUCCESS)
3562 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
3567 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
3570 if (__pIsoList != null)
3572 if (!(__pIsoList->GetCount()>1))
3574 _pListViewCameraTabMainMenu->SetItemEnabled(1,false);
3579 _pListViewCameraTabMainMenu->SetItemEnabled(1,false);
3586 case IDA_BUTTON_SETTING_CAMERA:
3588 result r = E_SUCCESS;
3590 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3591 _pAppTimer->Cancel();
3593 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3594 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3596 if (_pListViewGeneralTabMainMenu)
3598 _pListViewGeneralTabMainMenu->SetShowState(false);
3601 if (_pListViewGeneralTabSubMenu)
3603 _pListViewGeneralTabSubMenu->SetShowState(false);
3606 MakeCameraTabSettingPopup();
3610 case IDA_BUTTON_SETTING_GENERAL:
3612 result r = E_SUCCESS;
3614 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3615 _pAppTimer->Cancel();
3617 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3618 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3620 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
3622 if (_pListViewCameraTabMainMenu)
3624 _pListViewCameraTabMainMenu->SetShowState(false);
3627 if (_pListViewCameraTabSubMenu)
3629 _pListViewCameraTabSubMenu->SetShowState(false);
3632 MakeGeneralTabSettingPopup();
3636 case IDA_BUTTON_CAMERA_EV:
3638 result r = E_SUCCESS;
3639 bool exposureValue = false;
3640 bool brighnesstValue = false;
3641 int selfPortraitEnable = 0;
3642 int adjustValue = 0;
3644 if (_pCameraInfoPanel->GetDrawExposure() == true)
3646 AppLogDebug("Draw is Exposure status");
3650 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3651 _pAppTimer->Cancel();
3653 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3654 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3656 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3657 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3659 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3660 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3662 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3664 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
3668 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
3671 if (exposureValue == true && r == E_SUCCESS)
3673 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3675 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
3676 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3678 AppLogDebug("adjustValue = %d", adjustValue);
3680 _pCameraPresentationModel->SetExposure(adjustValue);
3682 MakeSettingPopupTab(false);
3686 r = CreateExposureSlider();
3687 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3689 r = DrawExposureSlider();
3690 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3694 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3696 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3700 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
3703 if (brighnesstValue == true && r == E_SUCCESS)
3705 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
3707 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
3708 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3710 AppLogDebug("adjustValue = %d", adjustValue);
3712 _pCameraPresentationModel->SetBrightness(adjustValue);
3714 MakeSettingPopupTab(false);
3718 r = CreateExposureSlider();
3719 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
3721 r = DrawExposureSlider();
3722 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3726 AppLogDebug("Exposure do not support");
3732 case IDA_BUTTON_CAMERA_WB:
3734 result r = E_SUCCESS;
3735 int selfPortraitEnable = 0;
3737 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
3738 _pAppTimer->Cancel();
3740 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
3741 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
3743 if (_pCameraInfoPanel->GetDrawExposure() == true)
3745 _closeTimerValue = 0;
3747 if (_pExposureCloseTimer)
3749 _pExposureCloseTimer->Cancel();
3752 _pCameraInfoPanel->SetDrawExposure(false);
3756 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3757 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
3759 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3761 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
3765 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
3770 SetWhiteBalancePopop();
3774 AppLogDebug("WB is not support");
3779 case IDA_BUTTON_CAMERA_BACK:
3781 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
3782 result r = E_SUCCESS;
3784 r = BackButtonPerformed();
3785 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
3792 AppLogDebug("ResetPopup : MSGBOX_RESULT_YES");
3794 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3796 _pResetPopUp->SetShowState(false);
3799 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
3800 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3802 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
3804 r = DrawMarker(false);
3805 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
3807 SetGuideLine(SUBMENU_MODE_OFF);
3810 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
3811 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
3813 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
3815 RestoreDefaultSetting();
3817 r = RestorePrimaryResolution();
3818 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3822 BufferInfo bufferinfo;
3824 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
3826 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3827 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
3829 r = ToggleCameraDirection(CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
3830 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
3832 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
3833 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
3835 _pCameraPresentationModel->StartPreview(&bufferinfo);
3837 _pCameraPresentationModel->SetContinuousAutoFocus();
3839 MakePreviewResolutionList(true);
3841 MakeCaptrueResolutionList(true);
3845 RestoreSecondaryResolution();
3846 TryReturnVoid(r == E_SUCCESS, "RestoreResolutionDefault() fail(%s)", GetErrorMessage(r));
3848 RestoreDefaultSetting();
3851 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3852 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
3854 MakeSettingPopupTab(false);
3858 r = UpdateUiPanelIcon();
3859 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
3861 r = SetScreenOverlayHelpTimer();
3862 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
3864 r = DrawScreenOverlayHelp();
3865 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
3867 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
3868 _pFlashButton->Invalidate(true);
3875 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
3877 _pResetPopUp->SetShowState(false);
3879 MakeSettingPopupTab(false);
3880 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
3885 case IDA_BUTTON_CAMERA_SHUTTER:
3887 MakeSettingPopupTab(false);
3888 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
3897 AppLogDebug("EXIT");
3901 CameraForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
3903 AppLogDebug("ENTER");
3904 if (_appControlActionCompleted)
3906 AppLogDebug("EXIT - App Terminate");
3909 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
3910 AppLogDebug("EXIT");
3914 CameraForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
3916 AppLogDebug("ENTER");
3917 bool isExistThumbnail = false;
3918 Bitmap* pBitmap = null;
3919 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
3921 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3923 if (isExistThumbnail == false)
3925 AppLogDebug("Thumbnail is not found");
3927 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
3929 _pThumbnailPanel->SetShowState(false);
3930 _pThumbnailPanel->Draw();
3931 _pThumbnailPanel->Show();
3933 __pThumbnailButton->SetShowState(true);
3935 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3936 TryReturnVoid(pBitmap != null, "pBitmap is null");
3938 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
3943 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
3944 TryReturnVoid(pBitmap != null, "pBitmap is null");
3946 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
3951 __pThumbnailButton->Draw();
3952 __pThumbnailButton->Show();
3959 AppLogDebug("pThumbnailBitmap is not null");
3961 AppLogDebug("EXIT");
3965 CameraForm::Initialize(void)
3967 AppLogDebug("ENTER");
3968 result r = E_SUCCESS;
3970 Construct(L"IDL_CAMERA_FORM");
3972 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
3973 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
3975 AppLogDebug("EXIT");
3983 CameraForm::InitAppTimer(void)
3985 AppLogDebug("ENTER");
3986 _pAppTimer = new (std::nothrow) Timer();
3987 _pAppTimer->Construct(*this);
3988 AppLogDebug("EXIT");
3992 CameraForm::InitChargingTimer(void)
3994 AppLogDebug("ENTER");
3995 _pChargingTimer = new (std::nothrow) Timer();
3996 _pChargingTimer->Construct(*this);
3997 AppLogDebug("EXIT");
4001 CameraForm::InitChargingCompletedTimer(void)
4003 AppLogDebug("ENTER");
4004 _pChargingCompletedTimer = new (std::nothrow) Timer();
4005 _pChargingCompletedTimer->Construct(*this);
4006 AppLogDebug("EXIT");
4010 CameraForm::InitPreviewFailPopupTimer(void)
4012 AppLogDebug("ENTER");
4013 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
4014 _pPreviewFailPopupTimer->Construct(*this);
4015 AppLogDebug("EXIT");
4019 CameraForm::InitIntervalValueTimer(void)
4021 AppLogDebug("ENTER");
4022 _pIntervalValueTimer = new (std::nothrow) Timer();
4023 _pIntervalValueTimer->Construct(*this);
4024 AppLogDebug("EXIT");
4028 CameraForm::InitCaptureStartTimer(void)
4030 AppLogDebug("ENTER");
4031 _pCaptureStartTimer = new (std::nothrow) Timer();
4032 _pCaptureStartTimer->Construct(*this);
4033 AppLogDebug("EXIT");
4037 CameraForm::InitTouchAutoFocusStartTimer(void)
4039 AppLogDebug("ENTER");
4040 _pTouchAutoFocusTimer = new (std::nothrow) Timer();
4041 _pTouchAutoFocusTimer->Construct(*this);
4042 AppLogDebug("EXIT");
4046 CameraForm::StartInitAppTimer(void)
4048 AppLogDebug("ENTER");
4049 result r = E_SUCCESS;
4051 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4053 _pAppTimer->Cancel();
4055 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4056 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4057 AppLogDebug("EXIT");
4061 CameraForm::StartPreviewFailPopupTimer(void)
4063 AppLogDebug("ENTER");
4064 result r = E_SUCCESS;
4066 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4068 _pPreviewFailPopupTimer->Cancel();
4070 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4071 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4072 AppLogDebug("EXIT");
4076 CameraForm::StartInitChargingCompletedTimer(void)
4078 AppLogDebug("ENTER");
4079 result r = E_SUCCESS;
4080 bool isCharging = false;
4082 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4084 isCharging = _pCameraPresentationModel->IsCharging();
4086 _batteryStatus = GetCurrentBatteryState();
4087 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4089 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4091 if (_pChargingCompletedTimer)
4093 _pChargingCompletedTimer->Cancel();
4100 r = DrawBatteryLevelFull();
4101 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4103 AppLogDebug("EXIT");
4106 _chargingCount = INDEX_UNIT_ZERO;
4108 if (_batteryStatus == BATTERY_STATE_20)
4110 if (_pChargingCompletedTimer)
4112 _pChargingCompletedTimer->Cancel();
4114 r = _pChargingCompletedTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4115 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4120 if (_pChargingCompletedTimer)
4122 _pChargingCompletedTimer->Cancel();
4128 CheckBatteryStatus();
4130 AppLogDebug("EXIT");
4134 CameraForm::StartInitChargingTimer(void)
4136 AppLogDebug("ENTER");
4137 result r = E_SUCCESS;
4138 bool isCharging = false;
4140 TryReturnVoid(_pChargingTimer != null, "_pChargingTimer is null");
4142 isCharging = _pCameraPresentationModel->IsCharging();
4144 _chargingCount = INDEX_UNIT_ZERO;
4148 if (_pChargingTimer)
4150 _pChargingTimer->Cancel();
4152 r = _pChargingTimer->StartAsRepeatable(CAMERA_CHARGING_TIMER);
4153 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4158 if (_pChargingTimer)
4160 _pChargingTimer->Cancel();
4163 AppLogDebug("EXIT");
4167 CameraForm::ToggleCameraDirection(int direction)
4169 AppLogDebug("ENTER");
4170 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4171 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4172 result r = E_SUCCESS;
4174 Point currentPosition;
4175 BufferInfo bufferinfo;
4176 bool isInitCameraStaus = false;
4178 if (_pAppTimer != null)
4180 _pAppTimer->Cancel();
4182 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
4183 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
4186 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4188 AppLogDebug("FRONT");
4189 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
4191 else if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
4193 AppLogDebug("BACK");
4194 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_SNAPSHOT, CameraPresentationModel::CAMERA_DIRECTION_BACK);
4196 TryCatch(r == E_SUCCESS, , "__pCamcorderPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
4198 dim = _pCameraPresentationModel->GetPreviewResolution();
4199 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
4201 AppLogDebug("__screenMode [%d]", __screenMode);
4203 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
4205 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
4209 r = SetScreenMode(__screenMode, true);
4211 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
4213 if (__dir == ORIENTATION_STATUS_PORTRAIT
4214 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4216 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
4217 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
4221 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
4222 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
4227 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
4228 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
4230 if (isInitCameraStaus)
4232 SetCameraSettingsDevice();
4235 AppLogDebug("EXIT");
4243 CameraForm::MakePreviewResolutionList(bool remakeList = false)
4245 AppLogDebug("ENTER");
4246 Dimension dimResolution;
4247 IList* pTempList = null;
4248 String* pItemString = null;
4250 result r = E_SUCCESS;
4253 Dimension dimension;
4254 Dimension tempDimention(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
4255 int previewResolutionIdx = 0;
4259 if (__pPreviewResolutionList)
4261 __pPreviewResolutionList->RemoveAll(true);
4264 delete __pPreviewResolutionList;
4265 __pPreviewResolutionList = null;
4268 if (__pPreviewResolutionList == null)
4270 __pPreviewResolutionList = new (std::nothrow) ArrayList();
4271 r = __pPreviewResolutionList->Construct();
4272 TryCatch(r == E_SUCCESS, , "__pPreviewResolutionList construct fail[%s]", GetErrorMessage(r));
4274 pTempList = _pCameraPresentationModel->GetPreviewResolutionList();
4275 TryCatch(pTempList != null, , "GetPreviewResolutionList() return null");
4276 tot = pTempList->GetCount();
4279 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4281 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4283 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d", dimResolution.width, dimResolution.height);
4285 pItemString = new (std::nothrow) String(tempString);
4286 TryCatch(pItemString != null, , "pItemString is null");
4288 __pPreviewResolutionList->Add(*pItemString);
4290 AppLogDebug("GetPreviewResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4292 if (dimResolution == tempDimention)
4294 previewResolutionIdx = idx;
4300 AppLogDebug("Not Support CaptureResolution");
4303 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(previewResolutionIdx)));
4306 __previewResolutionWidth = dimResolution.width;
4307 __previewResolutionHeight = dimResolution.height;
4309 AppLogDebug("previewResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4311 AppLogDebug("EXIT");
4315 if (__pPreviewResolutionList)
4317 __pPreviewResolutionList->RemoveAll(true);
4319 delete __pPreviewResolutionList;
4320 __pPreviewResolutionList = null;
4325 CameraForm::MakeCaptrueResolutionList(bool remakeList = false)
4327 AppLogDebug("ENTER");
4328 Dimension dimPreviewResolution;
4329 Dimension dimResolution;
4330 IList* pTempList = null;
4331 String* pItemString = null;
4333 result r = E_SUCCESS;
4336 int resolutionRatio = 0;
4340 if (__pCaptureResolutionList)
4342 __pCaptureResolutionList->RemoveAll(true);
4345 delete __pCaptureResolutionList;
4346 __pCaptureResolutionList = null;
4349 if (__pCaptureResolutionList == null)
4351 __pCaptureResolutionList = new (std::nothrow) ArrayList();
4352 r = __pCaptureResolutionList->Construct();
4353 TryCatch(r == E_SUCCESS, , "__pCaptureResolutionList construct fail[%s]", GetErrorMessage(r));
4355 pTempList = _pCameraPresentationModel->GetCaptureResolutionList();
4356 TryCatch(pTempList != null, , "GetCaptureResolutionList() return null");
4357 tot = pTempList->GetCount();
4360 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4362 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4364 if (dimResolution.width >= __previewResolutionWidth && dimResolution.height >= __previewResolutionHeight)
4366 resolutionRatio = (dimResolution.width * MULTIPLY_BY_TEN) / (dimResolution.height);
4368 if (resolutionRatio > NORMAL_MODE_RATIO)
4370 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(16:9)", dimResolution.width, dimResolution.height);
4374 tempString.Format(STRING_BUFFER_SIZE, L"%dX%d(4:3)", dimResolution.width, dimResolution.height);
4377 pItemString = new (std::nothrow) String(tempString);
4378 TryCatch(pItemString != null, , "pItemString is null");
4380 __pCaptureResolutionList->Add(*pItemString);
4382 AppLogDebug("GetCaptureResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4388 AppLogDebug("Not Support CaptureResolution");
4392 AppLogDebug("EXIT");
4396 if (__pCaptureResolutionList)
4398 __pCaptureResolutionList->RemoveAll(true);
4400 delete __pCaptureResolutionList;
4401 __pCaptureResolutionList = null;
4406 CameraForm::MakeIsoList(bool remakeList = false)
4408 AppLogDebug("ENTER");
4409 IList* pTempList = null;
4410 String* pItemString = null;
4412 result r = E_SUCCESS;
4416 const mchar* isoMap[] =
4434 __pIsoList->RemoveAll(true);
4441 if (__pIsoList == null)
4443 __pIsoList = new (std::nothrow) ArrayList();
4444 r = __pIsoList->Construct();
4445 TryCatch(r == E_SUCCESS, , "__pIsoList construct fail[%s]", GetErrorMessage(r));
4447 pTempList = _pCameraPresentationModel->GetIsoList();
4448 TryCatch(pTempList != null, , "GetIsoList() return null");
4449 tot = pTempList->GetCount();
4452 for (idx = 0; idx < tot; idx++)
4454 Tizen::Base::Integer* isoObj = (Tizen::Base::Integer*) pTempList->GetAt(idx);
4456 int isoType = isoObj ? isoObj->ToInt() : -INDEX_UNIT_ONE;
4458 if (isoType > 0 && isoType < MAX_ISO_COUNT)
4460 pItemString = new (std::nothrow) String(isoMap[isoType]);
4461 TryCatch(pItemString != null, , "pItemString is null");
4463 AppLogDebug("ISO return is = %d VALUE = %ls", isoType, pItemString->GetPointer());
4464 __pIsoList->Add(*pItemString);
4468 AppLogDebug("isoType out of range");
4474 AppLogDebug("EXIT");
4480 __pIsoList->RemoveAll(true);
4488 CameraForm::MakeSettingPopupTab(bool isShow)
4490 AppLogDebug("ENTER");
4493 if (__pCameraSetting)
4495 __pCameraSetting->SetShowState(true);
4496 __pCameraSetting->Invalidate(true);
4499 if (__pCameraSettingLable)
4501 __pCameraSettingLable->SetShowState(true);
4502 __pCameraSettingLable->Invalidate(true);
4505 if (__pGeneralSetting)
4507 __pGeneralSetting->SetShowState(true);
4508 __pGeneralSetting->Invalidate(true);
4511 if (__pGeneralSettingLable)
4513 __pGeneralSettingLable->SetShowState(true);
4514 __pGeneralSettingLable->Invalidate(true);
4519 if (__pCameraSetting)
4521 __pCameraSetting->SetShowState(false);
4522 __pCameraSetting->Invalidate(true);
4525 if (__pCameraSettingLable)
4527 __pCameraSettingLable->SetShowState(false);
4528 __pCameraSettingLable->Invalidate(true);
4531 if (__pGeneralSetting)
4533 __pGeneralSetting->SetShowState(false);
4534 __pGeneralSetting->Invalidate(true);
4537 if (__pGeneralSettingLable)
4539 __pGeneralSettingLable->SetShowState(false);
4540 __pGeneralSettingLable->Invalidate(true);
4543 AppLogDebug("EXIT");
4547 CameraForm::MakeCameraTabSettingPopup(void)
4549 AppLogDebug("ENTER");
4550 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4551 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4554 MakePreviewResolutionList(true);
4556 MakeCaptrueResolutionList(false);
4562 _pCameraInfoPanel->SetDrawExposure(false);
4564 if (__dir == ORIENTATION_STATUS_PORTRAIT
4565 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4567 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4568 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN - 1);
4572 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4573 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE- H_SETTING_MENU_LIST_MARGIN);
4576 MakeCameraTabMenuString();
4577 SetCameraTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
4578 MakeSettingPopupTab(true);
4580 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
4581 _pCameraInfoPanel->Invalidate(true);
4582 if (_pListViewCameraTabMainMenu == null)
4584 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
4585 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4587 _pListViewCameraTabMainMenu->SetItemProvider(*this);
4588 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
4589 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
4593 _pListViewCameraTabMainMenu->SetShowState(true);
4594 _pListViewCameraTabMainMenu->SetBounds(rectList);
4596 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
4598 _pListViewCameraTabMainMenu->UpdateList();
4599 AppLogDebug("EXIT");
4603 CameraForm::MakeGeneralTabSettingPopup(void)
4605 AppLogDebug("ENTER");
4606 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
4607 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
4610 _pCameraInfoPanel->SetDrawExposure(false);
4612 if (__dir == ORIENTATION_STATUS_PORTRAIT
4613 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4615 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
4616 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT + 2);
4620 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE + Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
4621 W_SETTING_MENU_LIST_LANDSCAPE+3, H_SETTING_MENU_LIST_LANDSCAPE + 2);
4624 MakeGeneralTabMenuString();
4625 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
4626 MakeSettingPopupTab(true);
4628 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
4629 _pCameraInfoPanel->Invalidate(true);
4631 if (_pListViewGeneralTabMainMenu == null)
4633 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
4634 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
4636 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
4637 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
4638 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
4642 _pListViewGeneralTabMainMenu->SetShowState(true);
4643 _pListViewGeneralTabMainMenu->SetBounds(rectList);
4646 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
4647 _pListViewGeneralTabMainMenu->UpdateList();
4648 AppLogDebug("EXIT");
4652 CameraForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4654 AppLogDebug("ENTER");
4655 AppLogDebug("EXIT");
4659 CameraForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4661 AppLogDebug("ENTER");
4662 result r = E_SUCCESS;
4664 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4666 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4668 _currentSettingsMenuIndex = index;
4669 r = ProcessCameraTabMainListPopup(index);
4670 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4673 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4675 r = ProcessCameraTabSubListPopup(index);
4676 TryReturnVoid(r == E_SUCCESS, "ProcessCameraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4678 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4680 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4682 _currentSettingsMenuIndex = index;
4683 r = ProcessGeneraTabMainListPopup(index);
4684 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4687 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4689 r = ProcessGeneraTabSubListPopup(index);
4690 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4692 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4694 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4696 r = ProcessFlashListPopup(index);
4697 UpdateUiPanelIcon();
4698 TryReturnVoid(r == E_SUCCESS, "ProcessMainListPopup() fail[%s]", GetErrorMessage(r));
4701 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4703 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4705 r = SubListPopupWhiteBalanceMode(index);
4706 TryReturnVoid(r == E_SUCCESS, "SubListPopupWhiteBalanceMode() fail[%s]", GetErrorMessage(r));
4712 AppLogDebug("OnListViewItemStateChanged is not make");
4714 AppLogDebug("EXIT");
4718 CameraForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4720 AppLogDebug("ENTER");
4721 AppLogDebug("EXIT");
4725 CameraForm::CreateItem(int index, int itemWidth)
4727 AppLogDebug("ENTER");
4728 CustomItem* pItem = null;
4729 bool createSubMenu = false;
4730 bool createGenSubMenu = false;
4731 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
4732 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
4733 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
4734 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
4735 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
4736 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
4737 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
4738 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
4741 if (_pListViewCameraTabSubMenu)
4743 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4745 createSubMenu = true;
4746 pItem = CreateCameraTabSubMenuItem(index, itemWidth);
4750 AppLogDebug("CreateCameraTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4755 AppLogDebug("EXIT");
4761 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4763 if (createSubMenu == false)
4765 pItem = CreateCameraTabMainMenuItem(index, itemWidth);
4769 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4774 AppLogDebug("EXIT");
4780 if (_pListViewGeneralTabSubMenu)
4782 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4784 createGenSubMenu = true;
4785 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4789 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4794 AppLogDebug("EXIT");
4800 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4802 if (createGenSubMenu == false)
4804 AppLogDebug("CreateGeneralTabMainMenuItem");
4805 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4809 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4814 AppLogDebug("EXIT");
4820 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4822 pItem = CreateFlashMainMenuItem(index, itemWidth);
4826 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListFlashMainMenu");
4831 AppLogDebug("EXIT");
4836 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4838 pItem = CreateWhiteBalanceItem(index, itemWidth);
4842 AppLogDebug("CreateCameraTabMainMenuItem of pItem is null - _pListWbMainMenu");
4847 AppLogDebug("EXIT");
4852 AppLogDebug("EXIT");
4857 CameraForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4859 AppLogDebug("ENTER");
4863 AppLogDebug("EXIT");
4868 CameraForm::GetItemCount(void)
4870 AppLogDebug("ENTER");
4871 if (_pListViewCameraTabSubMenu)
4873 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4875 AppLogDebug("EXIT");
4876 return GetCameraTabSettingSubMenuCount();
4880 if (_pListViewCameraTabMainMenu)
4882 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4884 AppLogDebug("EXIT");
4885 return GetCameraTabSettingMainMenuCount();
4889 if (_pListViewGeneralTabSubMenu)
4891 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4893 AppLogDebug("EXIT");
4894 return GetGeneralTabSettingSubMenuCount();
4898 if (_pListViewGeneralTabMainMenu)
4900 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4902 AppLogDebug("EXIT");
4903 return GetGeneralTabSettingMainMenuCount();
4907 if (_pListFlashMainMenu)
4909 AppLogDebug("EXIT");
4910 return GetCameraTabSettingMainMenuCount();
4913 if (_pListWbMainMenu)
4915 AppLogDebug("EXIT");
4916 return GetCameraTabSettingMainMenuCount();
4919 AppLogDebug("EXIT");
4924 CameraForm::GetGeneralTabSettingMainMenuCount(void) const
4926 AppLogDebug("ENTER");
4927 AppLogDebug("EXIT");
4928 return __generalTabMainMenuCount;
4932 CameraForm::SetGeneralTabSettingMainMenuCount(int count)
4934 AppLogDebug("ENTER");
4935 __generalTabMainMenuCount = count;
4936 AppLogDebug("EXIT");
4940 CameraForm::GetGeneralTabSettingSubMenuCount(void) const
4942 AppLogDebug("ENTER");
4943 AppLogDebug("EXIT");
4944 return __generalTabSubMenuCount;
4948 CameraForm::SetGeneralTabSettingSubMenuCount(int count)
4950 AppLogDebug("ENTER");
4951 __generalTabSubMenuCount = count;
4952 AppLogDebug("EXIT");
4955 inline GeneralTabSubMenuContent
4956 CameraForm::GetGeneralTabSettingSubMenuMode(void) const
4958 AppLogDebug("ENTER");
4959 AppLogDebug("EXIT");
4960 return __generalTabSettingMode;
4964 CameraForm::SetSettingGenSubMenuMode(const GeneralTabSubMenuContent mode)
4966 AppLogDebug("ENTER");
4967 AppLogDebug("EXIT");
4968 __generalTabSettingMode = mode;
4972 CameraForm::SetGeneralTabSubMenuListviewState(const int menuCount, const GeneralTabSubMenuContent mode)
4974 AppLogDebug("ENTER");
4975 SetGeneralTabSettingSubMenuCount(menuCount);
4976 SetSettingGenSubMenuMode(mode);
4977 AppLogDebug("EXIT");
4981 CameraForm::GetCameraTabSettingMainMenuCount(void) const
4983 AppLogDebug("ENTER");
4984 AppLogDebug("EXIT");
4985 return __cameraTabMainMenuCount;
4989 CameraForm::SetCameraTabSettingMainMenuCount(int count)
4991 AppLogDebug("ENTER");
4992 __cameraTabMainMenuCount = count;
4993 AppLogDebug("EXIT");
4997 CameraForm::GetCameraTabSettingSubMenuCount(void) const
4999 AppLogDebug("ENTER");
5000 AppLogDebug("EXIT");
5001 return __cameraTabSubMenuCount;
5005 CameraForm::SetCameraTabSettingSubMenuCount(int count)
5007 AppLogDebug("ENTER");
5008 __cameraTabSubMenuCount = count;
5009 AppLogDebug("EXIT");
5012 inline CameraTabSubMenuContent
5013 CameraForm::GetCameraTabSettingSubMenuMode(void) const
5015 AppLogDebug("ENTER");
5016 AppLogDebug("EXIT");
5017 return __cameraTabSettingMode;
5021 CameraForm::SetCameraTabSettingSubMenuMode(const CameraTabSubMenuContent mode)
5023 AppLogDebug("ENTER");
5024 AppLogDebug("EXIT");
5025 __cameraTabSettingMode = mode;
5029 CameraForm::SetCameraTabSubMenuListviewState(const int menuCount, const CameraTabSubMenuContent mode)
5031 AppLogDebug("ENTER");
5032 SetCameraTabSettingSubMenuCount(menuCount);
5033 SetCameraTabSettingSubMenuMode(mode);
5034 AppLogDebug("EXIT");
5038 CameraForm::SetMenuTitle(Canvas* pCanvas, const String& str, const int fntSize)
5040 AppLogDebug("ENTER");
5045 result r = E_SUCCESS;
5046 String listName = L"";
5048 TryCatch(pCanvas != null, r = E_SYSTEM, "pCanvas is null");
5050 if (_pListViewCameraTabSubMenu)
5052 listRect = _pListViewCameraTabSubMenu->GetBounds();
5054 else if (_pListViewCameraTabMainMenu)
5056 listRect = _pListViewCameraTabMainMenu->GetBounds();
5057 listName = _pListViewCameraTabMainMenu->GetName();
5059 else if (_pListFlashMainMenu)
5061 listRect = _pListFlashMainMenu->GetBounds();
5062 listName = _pListFlashMainMenu->GetName();
5064 else if (_pListWbMainMenu)
5066 listRect = _pListWbMainMenu->GetBounds();
5067 listName = _pListWbMainMenu->GetName();
5069 else if (_pListViewGeneralTabSubMenu)
5071 listRect = _pListViewGeneralTabSubMenu->GetBounds();
5073 else if (_pListViewGeneralTabMainMenu)
5075 listRect = _pListViewGeneralTabMainMenu->GetBounds();
5076 listName = _pListViewGeneralTabMainMenu->GetName();
5079 pFnt = new (std::nothrow) Font();
5080 pFnt->Construct(FONT_STYLE_PLAIN, fntSize);
5082 r = pFnt->GetTextExtent(str, str.GetLength(), dim);
5083 TryCatch(pFnt != null, , "pFnt GetTextExtent() fail[%s]", GetErrorMessage(r));
5085 r = pCanvas->SetFont(*pFnt);
5086 TryCatch(pFnt != null, , "pCanvas SetFont() fail[%s]", GetErrorMessage(r));
5088 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
5090 point.x = (listRect.width / DIVIDE_BY_TWO) - (dim.width / DIVIDE_BY_TWO);
5091 point.y = (H_SETTING_MENU_PANEL_TITLE / DIVIDE_BY_TWO) - (dim.height / DIVIDE_BY_TWO);
5093 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5095 if (__dir == ORIENTATION_STATUS_PORTRAIT
5096 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5098 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_PORTRAIT;
5100 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
5101 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
5103 point.y += H_SETTING_MENU_TITLE_TOP_MARGIN_LANDSCAPE;
5106 else if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)))
5108 point.y += H_FLASH_MODE_TITLE_TOP_MARGIN;
5110 if (__dir == ORIENTATION_STATUS_PORTRAIT
5111 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5113 point.x += X_FLASH_MODE_LIST_START_POS_PORTRAIT;
5117 r = pCanvas->DrawText(point, str);
5118 TryCatch( r == E_SUCCESS, , "pCanvas DrawText() fail[%s]", GetErrorMessage(r));
5123 AppLogDebug("EXIT");
5134 CameraForm::GetTimerIntervalValue(void) const
5136 AppLogDebug("ENTER");
5137 result r = E_SUCCESS;
5138 int timerInterval = 0;
5140 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
5141 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
5143 AppLogDebug("EXIT");
5144 return timerInterval;
5151 CameraForm::SetGuideLine(int guideLineEnable)
5153 AppLogDebug("ENTER");
5154 result r = E_SUCCESS;
5156 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
5157 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
5158 AppLogDebug("EXIT");
5162 CameraForm::RestoreDefaultSetting(void)
5164 AppLogDebug("ENTER");
5165 result r = E_SUCCESS;
5166 int selfPortraitEnable = 0;
5167 bool exposureValue = false;
5168 bool brighnesstValue = false;
5169 int adjustValue = 0;
5171 r = _pCameraPresentationModel->ResetCameraSettingsRegistry();
5172 TryCatch(r == E_SUCCESS, ,"ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
5174 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5175 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5177 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5179 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5183 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5186 if (exposureValue == true && r == E_SUCCESS)
5188 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5189 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5191 AppLogDebug("adjustValue = %d", adjustValue);
5193 _pCameraPresentationModel->SetExposure(adjustValue);
5197 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5199 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5203 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5206 if (brighnesstValue == true && r == E_SUCCESS)
5208 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5209 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5211 AppLogDebug("adjustValue = %d", adjustValue);
5213 _pCameraPresentationModel->SetBrightness(adjustValue);
5217 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5219 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5223 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5228 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5230 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5234 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5236 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5238 AppLogDebug("adjustValue = %d", adjustValue);
5240 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5243 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5245 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_FLASH_MODE);
5249 r = _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
5250 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5255 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_FLASH_MODE);
5259 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(CAMERA_FLASH_MODE_OFF));
5260 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5264 AppLogDebug("EXIT");
5268 AppLogDebug("EXIT - CATCH");
5273 CameraForm::RestorePrimaryResolution(void)
5275 AppLogDebug("ENTER");
5276 result r = E_SUCCESS;
5277 IList* pList = null;
5278 IList* pCaptureResolutionList = null;
5279 int resolutionCnt = 0;
5280 bool wideMode = false;
5281 int resolutionIndex = 0;
5282 int resolutionRatio = 0;
5283 Dimension resolutionDim;
5284 Dimension captureResolutionDim;
5285 BufferInfo bufferinfo;
5287 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5288 _pAppTimer->Cancel();
5290 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5291 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5293 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5295 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5297 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5299 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5301 if (resolutionRatio > NORMAL_MODE_RATIO)
5305 SetOverlayPanelWideMode(true);
5307 SetOverlayRendererRotation();
5313 SetOverlayPanelNormalMode(true);
5315 SetOverlayRendererRotation();
5318 _pCameraPresentationModel->KeepScreenOnState(true, false);
5320 _pCameraPresentationModel->StopCamera();
5322 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
5323 TryCatch(r == E_SUCCESS, , "SetMode fail[%s]", GetErrorMessage(r));
5325 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5327 resolutionCnt = pList->GetCount();
5329 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5331 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5333 __captureResolutionWidth = captureResolutionDim.width;
5335 __captureResolutionHeight = captureResolutionDim.height;
5337 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5339 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5341 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5342 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo start fail[%s]", GetErrorMessage(r));
5344 _pCameraPresentationModel->StartPreview(&bufferinfo);
5346 _pCameraPresentationModel->SetContinuousAutoFocus();
5348 if (wideMode == true)
5350 __pOverlayPanel->AddTouchEventListener(*this);
5352 HidePanel(true, true);
5354 __screenMode = SCREEN_MODE_FULL;
5358 __pOverlayPanel->RemoveTouchEventListener(*this);
5360 HidePanel(false, true);
5362 __screenMode = SCREEN_MODE_NORMAL;
5365 AppLogDebug("EXIT");
5369 __screenMode = SCREEN_MODE_NORMAL;
5375 CameraForm::RestoreSecondaryResolution(void)
5377 AppLogDebug("ENTER");
5378 result r = E_SUCCESS;
5379 IList* pList = null;
5380 IList* pCaptureResolutionList = null;
5381 int resolutionCnt = 0;
5382 bool wideMode = false;
5383 int resolutionIndex = 0;
5384 int resolutionRatio = 0;
5385 Dimension resolutionDim;
5386 Dimension captureResolutionDim;
5388 TryCatch(_pAppTimer != null, , "_pAppTimer is null");
5389 _pAppTimer->Cancel();
5391 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
5392 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5394 pCaptureResolutionList = _pCameraPresentationModel->GetCaptureResolutionList();
5396 resolutionIndex = pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
5398 resolutionDim = *(static_cast<Dimension*>(pCaptureResolutionList->GetAt(resolutionIndex)));
5400 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
5402 if (resolutionRatio > NORMAL_MODE_RATIO)
5411 pList = _pCameraPresentationModel->GetCaptureResolutionList();
5413 resolutionCnt = pList->GetCount();
5415 captureResolutionDim = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - INDEX_UNIT_ONE)));
5417 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", captureResolutionDim.width, captureResolutionDim.height);
5419 __captureResolutionWidth = captureResolutionDim.width;
5421 __captureResolutionHeight = captureResolutionDim.height;
5423 _pCameraPresentationModel->SetCaptureResolution(captureResolutionDim);
5425 __primaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5427 __secondaryCurrentResolutionIndex = INDEX_UNIT_ZERO;
5429 if (wideMode == true)
5431 __pOverlayPanel->AddTouchEventListener(*this);
5433 HidePanel(true, true);
5435 __screenMode = SCREEN_MODE_FULL;
5439 __pOverlayPanel->RemoveTouchEventListener(*this);
5441 HidePanel(false, true);
5443 __screenMode = SCREEN_MODE_NORMAL;
5446 AppLogDebug("EXIT");
5454 CameraForm::DrawMarker(bool useGuidline)
5456 AppLogDebug("ENTER");
5457 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5458 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5459 result r = E_SUCCESS;
5461 if (__dir == ORIENTATION_STATUS_PORTRAIT
5462 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5464 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5465 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5469 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5470 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5475 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5479 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5481 _pCameraInfoPanel->Invalidate(true);
5483 AppLogDebug("EXIT");
5488 CameraForm::DrawFocus(int focusMode)
5490 AppLogDebug("ENTER");
5491 int selfPortraitEnable = 0;
5492 bool focusSupport = false;
5493 result r = E_SUCCESS;
5494 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5495 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5497 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5498 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5500 if (__dir == ORIENTATION_STATUS_PORTRAIT
5501 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5503 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5504 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5508 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5509 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5512 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5514 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5518 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
5521 if (focusSupport == true && r == E_SUCCESS)
5523 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5525 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5526 _pCameraInfoPanel->Invalidate(true);
5530 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5531 _pCameraInfoPanel->Invalidate(true);
5534 AppLogDebug("EXIT");
5542 CameraForm::DrawTimerPopup(void)
5544 AppLogDebug("ENTER");
5545 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5546 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5547 result r = E_SUCCESS;
5549 if (__dir == ORIENTATION_STATUS_PORTRAIT
5550 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5552 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
5553 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5557 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
5558 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5561 _pCameraInfoPanel->SetDrawPopupTimer(true);
5562 _pCameraInfoPanel->Invalidate(true);
5566 AppLogDebug("EXIT");
5571 CameraForm::SetFlashPopop(void)
5573 AppLogDebug("ENTER");
5574 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5575 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5576 MakeSettingPopupTab(false);
5579 if (__dir == ORIENTATION_STATUS_PORTRAIT
5580 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5582 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5583 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5587 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5588 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5591 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5592 _pCameraInfoPanel->Invalidate(true);
5593 SetCameraTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5595 if (_pListFlashMainMenu == null)
5597 _pListFlashMainMenu = new (std::nothrow) ListView();
5598 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5600 _pListFlashMainMenu->SetItemProvider(*this);
5601 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5602 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5606 _pListFlashMainMenu->SetBounds(rectList);
5607 _pListFlashMainMenu->SetShowState(true);
5609 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5611 _pListFlashMainMenu->UpdateList();
5612 AppLogDebug("EXIT");
5616 CameraForm::SetWhiteBalancePopop(void)
5618 AppLogDebug("ENTER");
5619 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5620 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5621 MakeSettingPopupTab(false);
5624 if (__dir == ORIENTATION_STATUS_PORTRAIT
5625 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5627 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5628 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5632 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5633 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5636 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5637 _pCameraInfoPanel->Invalidate(true);
5638 SetCameraTabSettingMainMenuCount(MAX_WHITE_BALANCE_MENU_COUNT);
5640 if (_pListWbMainMenu == null)
5642 _pListWbMainMenu = new (std::nothrow) ListView();
5643 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5645 _pListWbMainMenu->SetItemProvider(*this);
5646 _pListWbMainMenu->AddListViewItemEventListener(*this);
5647 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5651 _pListWbMainMenu->SetBounds(rectList);
5652 _pListWbMainMenu->SetShowState(true);
5654 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5656 _pListWbMainMenu->UpdateList();
5657 AppLogDebug("EXIT");
5661 CameraForm::ProcessFlashListPopup(int index)
5663 AppLogDebug("ENTER");
5664 Rectangle rectPanel;
5666 String strTitle = L"";
5667 String listName = L"";
5668 Bitmap* pBitmapNormal = null;
5669 Bitmap* pBitmapPress = null;
5670 result r = E_SUCCESS;
5671 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5673 AppLogDebug("Sub Menu (%d)", index);
5676 int selfPortraitEnable = 0;
5678 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5679 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5681 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5682 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5684 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5686 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5688 regVal = SUBMENU_MODE_OFF;
5689 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5690 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5691 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5695 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5697 if (value == true && r == E_SUCCESS)
5699 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5703 case SUBMENU_MODE_OFF:
5705 regVal = SUBMENU_MODE_OFF;
5706 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5707 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5708 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5712 case SUBMENU_MODE_ON:
5714 regVal = SUBMENU_MODE_ON;
5715 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5716 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5717 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5721 case SUBMENU_MODE_AUTO:
5723 regVal = SUBMENU_MODE_AUTO;
5724 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5725 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5726 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5736 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5738 regVal = SUBMENU_MODE_OFF;
5739 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5740 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5741 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5745 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(index));
5746 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5748 _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5750 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5752 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5754 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5755 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5757 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5759 delete pBitmapNormal;
5760 pBitmapNormal = null;
5762 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5763 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5765 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5767 delete pBitmapPress;
5768 pBitmapPress = null;
5774 SetCameraTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5775 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5779 AppLogDebug("EXIT");
5783 AppLogDebug("Catch:");
5788 CameraForm::ProcessCameraTabMainListPopup(int index)
5790 AppLogDebug("ENTER");
5791 Rectangle rectPanel;
5793 String strTitle = L"";
5794 String listName = L"";
5795 bool resetPanel = false;
5796 int subPanelItemCount = 0;
5798 int captureResolutionCount = 0;
5799 result r = E_SUCCESS;
5800 bool drawPopup = true;
5802 listName = _pListViewCameraTabMainMenu->GetName();
5804 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
5805 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
5807 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5809 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5811 _pCameraInfoSubPanel->SetShowState(false);
5812 _pCameraInfoSubPanel->RemoveControl(_pListViewCameraTabSubMenu);
5813 _pListViewCameraTabSubMenu = null;
5814 RemoveControl(_pCameraInfoSubPanel);
5815 _pCameraInfoSubPanel = null;
5817 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5822 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
5824 int selfPortraitEnable = 0;
5826 AppLogDebug("Set ISO");
5829 int isoCnt = __pIsoList->GetCount() -1;
5831 subPanelItemCount = isoCnt;
5832 if (subPanelItemCount> 5)
5838 int X_Panel = X_SUBMENU_ISO_MODE_PANEL;
5839 int Y_Panel = Y_SUBMENU_ISO_MODE_PANEL;
5840 int W_Panel = W_SUBMENU_ISO_MODE_PANEL;
5841 int H_Panel = Y_SUBMENU_ISO_MODE_LIST + (isoCnt * H_SUBMENU_ISO_MODE_PANEL_MARGIN);
5843 int X_List = X_SUBMENU_ISO_MODE_LIST;
5844 int Y_List = Y_SUBMENU_ISO_MODE_LIST;
5845 int W_List = W_SUBMENU_ISO_MODE_LIST;
5846 int H_List = (isoCnt * H_SUBMENU_ISO_MODE_LIST_MARGIN);
5848 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel + 20);
5849 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5851 pAppResource->GetString(IDS_CAM_BODY_ISO, strTitle);
5852 SetCameraTabSubMenuListviewState(isoCnt, CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE);
5856 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5857 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
5859 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5861 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
5865 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
5870 AppLogDebug("Support ISO");
5874 r = _pCameraPresentationModel->SetValue(ISO_VALUE, REG_DEFAULT_VAULE_ZERO);
5875 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
5882 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
5884 if (__pCaptureResolutionList)
5886 captureResolutionCount = __pCaptureResolutionList->GetCount();
5888 subPanelItemCount = captureResolutionCount;
5889 if (subPanelItemCount > 5)
5894 if (captureResolutionCount > 1)
5896 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5897 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL;
5898 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5899 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captureResolutionCount * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5901 int X_List = X_SUBMENU_WB_MODE_LIST;
5902 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5903 int W_List = W_SUBMENU_WB_MODE_LIST;
5904 int H_List = (captureResolutionCount * W_SUBMENU_WB_MODE_LIST_MARGIN);
5906 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5907 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5909 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5910 SetCameraTabSubMenuListviewState(captureResolutionCount, CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE);
5916 AppLogDebug("captrueResolutionCnt count is %d",captureResolutionCount);
5923 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5924 AppLogDebug("Invaild index");
5932 if (__dir == ORIENTATION_STATUS_PORTRAIT
5933 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5935 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5936 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5940 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5944 rectList.height = rectList.height - 40 - (subPanelItemCount-5)*72;
5945 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
5947 rectPanel.height = rectPanel.height - 100;
5950 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
5952 rectPanel.height = rectPanel.height - 198;
5953 rectList.height = rectList.height - 20;
5958 if (_pCameraInfoSubPanel == null)
5960 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5961 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5963 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5964 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5966 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5967 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5968 AddOrientationEventListener(*this);
5969 AddControl(_pCameraInfoSubPanel);
5970 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5973 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5974 _pCameraInfoPanel->Invalidate(true);
5975 _pCameraInfoSubPanel->Invalidate(true);
5977 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5978 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5980 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5981 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5982 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5984 _pListViewCameraTabSubMenu->UpdateList();
5988 AppLogDebug("EXIT");
5992 if (_pCameraInfoSubPanel)
5994 RemoveControl(_pCameraInfoSubPanel);
5995 SetCameraTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMERA_TAB_SUB_MENU_CONTENT_MAX);
5999 delete _pListViewCameraTabSubMenu;
6002 _pCameraInfoSubPanel = null;
6003 _pListViewCameraTabSubMenu = null;
6009 CameraForm::ProcessCameraTabSubListPopup(int index)
6011 AppLogDebug("ENTER");
6012 String strRegKey = IDS_INIT_REG_KEY;
6013 result r = E_SUCCESS;
6014 int selfPortraitEnable = 0;
6015 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
6017 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6018 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6020 idx = GetCameraTabSettingSubMenuMode();
6024 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
6026 r = SubListPopupIsoMode(index);
6027 TryCatch(r == E_SUCCESS, , "SubListPopupIsoMode() fail[%s]", GetErrorMessage(r));
6031 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
6033 r = SubListPopupResolutionMode(index);
6034 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
6042 if (_pListViewCameraTabSubMenu)
6044 if (_pCameraInfoSubPanel != null)
6046 _pCameraInfoSubPanel->SetShowState(false);
6048 _pListViewCameraTabSubMenu->SetShowState(false);
6050 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6051 _pListViewCameraTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6054 _pCameraInfoPanel->Invalidate(true);
6056 AppLogDebug("EXIT");
6066 CameraForm::ProcessGeneraTabMainListPopup(int index)
6068 AppLogDebug("ENTER");
6069 Rectangle rectPanel;
6071 String strTitle = L"";
6072 String listName = L"";
6074 result r = E_SUCCESS;
6075 bool drawPopup = true;
6077 listName = _pListViewGeneralTabMainMenu->GetName();
6079 AppResource* pAppResource = Application::GetInstance()->GetAppResource();
6080 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
6082 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
6084 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
6086 _pCameraInfoGeneralSubPanel->SetShowState(false);
6087 _pCameraInfoGeneralSubPanel->RemoveControl(_pListViewGeneralTabSubMenu);
6088 _pListViewGeneralTabSubMenu = null;
6089 RemoveControl(_pCameraInfoGeneralSubPanel);
6090 _pCameraInfoGeneralSubPanel = null;
6092 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6097 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6099 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
6100 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
6101 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL - 12);
6102 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
6103 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
6104 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
6108 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6110 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
6111 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
6113 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
6114 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL - 8);
6115 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
6116 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
6120 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6122 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
6123 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
6124 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL - 8);
6125 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
6126 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
6127 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
6131 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6135 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
6137 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
6140 if (_pResetPopUp == null)
6142 _pResetPopUp = new (std::nothrow) Popup();
6143 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
6144 _pResetPopUp->SetPropagatedKeyEventListener(this);
6145 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
6150 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
6151 TryCatch(_pYes != null, , "Reset Popup not created!");
6152 _pYes->SetActionId(IDA_BTN_YES);
6153 _pYes->AddActionEventListener(*this);
6154 _pYes->SetShowState(true);
6159 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
6160 TryCatch(_pNo != null, , "Reset Popup not created!");
6161 _pNo->SetActionId(IDA_BTN_NO);
6162 _pNo->AddActionEventListener(*this);
6163 _pNo->SetShowState(true);
6164 _pResetPopUp->Show();
6167 _pResetPopUp->SetShowState(true);
6168 _pResetPopUp->Invalidate(true);
6169 _pResetPopUp->Show();
6173 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6175 result r = E_SUCCESS;
6177 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
6178 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6180 r = SetScreenOverlayHelpTimer();
6181 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6183 r = DrawScreenOverlayHelp();
6184 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6188 MakeSettingPopupTab(false);
6197 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6198 AppLogDebug("Invaild index");
6206 if (__dir == ORIENTATION_STATUS_PORTRAIT
6207 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6209 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
6210 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
6214 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
6217 if (_pCameraInfoGeneralSubPanel == null)
6219 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
6220 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
6222 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
6223 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
6225 if (index == GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
6226 index == GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
6227 index == GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
6229 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
6231 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
6232 AddOrientationEventListener(*this);
6233 AddControl(_pCameraInfoGeneralSubPanel);
6234 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
6237 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
6238 _pCameraInfoPanel->Invalidate(true);
6239 _pCameraInfoGeneralSubPanel->Invalidate(true);
6241 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
6242 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
6244 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
6245 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
6246 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
6248 _pListViewGeneralTabSubMenu->UpdateList();
6252 AppLogDebug("EXIT");
6256 if (_pCameraInfoGeneralSubPanel)
6258 RemoveControl(_pCameraInfoGeneralSubPanel);
6259 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, GENERAL_TAB_SUB_MENU_CONTENT_MAX);
6263 delete _pListViewGeneralTabSubMenu;
6266 _pCameraInfoGeneralSubPanel = null;
6267 _pListViewGeneralTabSubMenu = null;
6269 AppLogDebug("EXIT - CATCH");
6274 CameraForm::ProcessGeneraTabSubListPopup(int index)
6276 AppLogDebug("ENTER");
6277 String strRegKey = IDS_INIT_REG_KEY;
6278 result r = E_SUCCESS;
6279 int selfPortraitEnable = 0;
6280 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6282 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6283 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6285 idx = GetGeneralTabSettingSubMenuMode();
6289 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6291 r = SubListPopupTimerMode(index);
6292 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6296 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6298 r = SubListPopupGuidelineMode(index);
6299 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6303 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6305 SubListPopupStorageTypeMode(index);
6309 case GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6314 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6323 if (_pListViewGeneralTabSubMenu)
6325 if (_pCameraInfoGeneralSubPanel != null)
6327 _pCameraInfoGeneralSubPanel->SetShowState(false);
6329 _pListViewGeneralTabSubMenu->SetShowState(false);
6331 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6332 _pListViewGeneralTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6335 _pCameraInfoPanel->Invalidate(true);
6336 AppLogDebug("EXIT");
6340 MakeSettingPopupTab(false);
6347 CameraForm::StartPopupTimer(void)
6349 AppLogDebug("ENTER");
6350 result r = E_SUCCESS;
6351 int timerInterval = 0;
6355 _pPopupTimer = new (std::nothrow) Timer();
6357 _pPopupTimer->Construct(*this);
6359 r = _pPopupTimer->StartAsRepeatable(CAMERA_TIMER_1_SEC);
6360 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6362 timerInterval = GetTimerIntervalValue();
6364 switch (timerInterval)
6366 case SETTING_TIMER_CAPTURE_2_SEC:
6368 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6372 case SETTING_TIMER_CAPTURE_5_SEC:
6374 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6378 case SETTING_TIMER_CAPTURE_10_SEC:
6380 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6388 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6389 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6390 _pCameraInfoPanel->Invalidate(true);
6392 AppLogDebug("EXIT");
6396 delete _pPopupTimer;
6397 _pPopupTimer = null;
6403 CameraForm::StopPopupTimer(void)
6405 AppLogDebug("ENTER");
6406 result r = E_SUCCESS;
6407 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6409 r = _pPopupTimer->Cancel();
6411 delete _pPopupTimer;
6412 _pPopupTimer = null;
6414 AppLogDebug("EXIT");
6422 CameraForm::SetCameraSettingsDevice(void)
6424 AppLogDebug("ENTER");
6429 result r = E_SUCCESS;
6430 int selfPortraitEnable = 0;
6431 bool exposureValue = false;
6432 bool brighnesstValue = false;
6433 int updatedIndex = 0;
6435 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6436 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6438 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6440 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6444 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6447 if (exposureValue == true && r == E_SUCCESS)
6449 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6450 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6452 _pCameraPresentationModel->SetExposure(exposure);
6456 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6458 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6462 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6465 if (brighnesstValue == true && r == E_SUCCESS)
6467 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
6468 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
6470 _pCameraPresentationModel->SetBrightness(brightness);
6474 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6476 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
6480 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
6485 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
6486 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
6490 updatedIndex = isoIndex + 2;
6494 updatedIndex = isoIndex + 3;
6496 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
6499 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6501 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
6505 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
6510 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6512 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
6516 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
6519 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6521 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
6523 AppLogDebug("EXIT");
6527 CameraForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
6529 AppLogDebug("ENTER");
6530 Bitmap* pBitmap = null;
6531 ByteBuffer* pSrcByteBuff = null;
6532 ByteBuffer dstByteBuff;
6533 BufferInfo buffInfo;
6534 result r = E_SUCCESS;
6538 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
6540 if (rotationType == IMAGE_ROTATION_0)
6542 pBitmap = new (std::nothrow) Bitmap();
6543 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
6544 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6546 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
6550 dim.width = pSrcBitmap->GetWidth();
6551 dim.height = pSrcBitmap->GetHeight();
6553 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
6555 r = dstByteBuff.Construct(size);
6556 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6558 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
6559 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6561 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
6562 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
6564 dim.width = buffInfo.width;
6565 dim.height = buffInfo.height;
6567 size = buffInfo.pitch * buffInfo.height;
6569 pSrcByteBuff = new (std::nothrow) ByteBuffer();
6570 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
6572 r = pSrcByteBuff->Construct(size);
6573 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6575 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
6576 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6578 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
6579 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
6581 r = pSrcBitmap->Unlock();
6582 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
6584 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
6585 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
6587 if (rotationType == IMAGE_ROTATION_90
6588 || rotationType == IMAGE_ROTATION_270)
6590 dim.width = buffInfo.height;
6591 dim.height = buffInfo.width;
6595 dim.width = buffInfo.width;
6596 dim.height = buffInfo.height;
6599 pBitmap = new (std::nothrow) Bitmap();
6600 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
6601 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6603 delete pSrcByteBuff;
6604 pSrcByteBuff = null;
6606 AppLogDebug("EXIT");
6610 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
6611 if (pSrcByteBuff != null)
6613 delete pSrcByteBuff;
6614 pSrcByteBuff = null;
6617 if (pBitmap != null) //Prevent issue fix.
6625 CameraForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
6627 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
6628 result r = E_SUCCESS;
6629 int adjustEntryValue = 0;
6630 int currentEntryValue = 0;
6632 bool exposureValue = false;
6633 bool brighnesstValue = false;
6634 int selfPortraitEnable = 0;
6635 bool IsSliderAdjustValue = false;
6637 if (__dir == ORIENTATION_STATUS_PORTRAIT
6638 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6640 step = movableValidRect.width / maxEntryValue;
6641 if (currentPosition.x > movableValidRect.x)
6643 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
6645 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6646 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6647 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
6649 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
6654 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
6657 IsSliderAdjustValue = true;
6661 IsSliderAdjustValue = false;
6666 step = movableValidRect.height / maxEntryValue;
6667 if (currentPosition.y > movableValidRect.y)
6669 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
6670 IsSliderAdjustValue = true;
6674 IsSliderAdjustValue = false;
6678 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6679 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6681 if (entryName.Equals(String(EXPOSURE_VALUE)))
6683 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6685 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6689 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6692 if (exposureValue == true && r == E_SUCCESS)
6694 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
6695 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6699 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6701 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6705 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6708 if (brighnesstValue == true && r == E_SUCCESS)
6710 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
6711 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6715 AppLogDebug("currentEntryValue = %d , adjustEntryValue = %d", currentEntryValue, adjustEntryValue);
6716 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
6718 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6720 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6724 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6727 if (exposureValue == true && r == E_SUCCESS)
6729 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
6730 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6734 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6736 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6740 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6743 if (brighnesstValue == true && r == E_SUCCESS)
6745 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
6746 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6750 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6752 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6756 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6759 if (exposureValue == true && r == E_SUCCESS)
6761 _pCameraPresentationModel->SetExposure(adjustEntryValue);
6765 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6767 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6771 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6774 if (brighnesstValue == true && r == E_SUCCESS)
6776 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
6780 AppLogDebug("Exposure do not support");
6786 AppLogDebug("EXIT");
6794 CameraForm::CreateExposureSlider(void)
6796 AppLogDebug("ENTER");
6797 result r = E_SUCCESS;
6799 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
6801 _closeTimerValue = 0;
6802 _pExposureCloseTimer = new (std::nothrow) Timer();
6803 _pExposureCloseTimer->Construct(*this);
6805 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
6806 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
6808 _pCameraInfoPanel->SetDrawExposure(true);
6809 _pCameraInfoPanel->Invalidate(true);
6811 AppLogDebug("EXIT");
6815 delete _pExposureCloseTimer;
6816 _pExposureCloseTimer = null;
6822 CameraForm::DrawExposureSlider(void)
6824 AppLogDebug("ENTER");
6825 Point buttonPosition;
6826 result r = E_SUCCESS;
6827 Rectangle rectSlider;
6830 int selfPortraitEnable = 0;
6831 bool exposureValue = false;
6832 bool brighnesstValue = false;
6834 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6835 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6837 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6839 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6843 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6846 if (exposureValue == true && r == E_SUCCESS)
6848 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6849 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6850 AppLogDebug("Exposure value %d", exposure);
6854 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6856 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6860 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6863 if (brighnesstValue == true && r == E_SUCCESS)
6865 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
6866 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6867 AppLogDebug("Exposure value %d", exposure);
6871 if (__dir == ORIENTATION_STATUS_PORTRAIT
6872 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6874 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6875 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6876 step = rectSlider.width / MAX_CAMERA_EXPOSURE_VALUE;
6878 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + rectSlider.x;
6879 buttonPosition.y = rectSlider.y;
6880 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
6884 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
6885 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
6886 step = rectSlider.height / MAX_CAMERA_EXPOSURE_VALUE;
6888 buttonPosition.x = rectSlider.x;
6889 buttonPosition.y = (step * exposure) + rectSlider.y;
6890 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
6893 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
6894 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6896 AppLogDebug("EXIT");
6904 CameraForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
6906 AppLogDebug("ENTER");
6907 result r = E_SUCCESS;
6908 Point buttonPosition;
6909 Rectangle rectSlider;
6910 float adjustedXvalue = 0;
6911 int adjustedXinInt = 0;
6913 bool IsSliderRectValid = false;
6915 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
6917 if (__dir == ORIENTATION_STATUS_PORTRAIT
6918 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6920 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_PORTRAIT, Y_EXPOSURE_PANEL_SIDER_PORTRAIT,
6921 W_EXPOSURE_PANEL_SIDER_PORTRAIT, H_EXPOSURE_PANEL_SIDER_PORTRAIT);
6924 case DRAW_INITIALIZED:
6926 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6927 buttonPosition.y = currentPosition.y;
6928 IsSliderRectValid = true;
6934 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6936 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6938 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6939 buttonPosition.y = rectSlider.y;
6940 IsSliderRectValid = true;
6941 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
6943 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6944 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SIDER_PORTRAIT;
6946 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6947 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
6949 if ((adjustedXvalue - adjustedXinInt) != 0)
6951 adjustedXinInt = adjustedXinInt+1;
6954 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
6956 buttonPosition.x = X_EXPOSURE_PANEL_SIDER_PORTRAIT + adjustedXinInt;
6957 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
6958 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6959 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6964 IsSliderRectValid = false;
6971 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
6973 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
6975 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
6976 buttonPosition.y = rectSlider.y;
6977 IsSliderRectValid = true;
6978 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
6979 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
6984 IsSliderRectValid = false;
6987 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
6989 IsSliderRectValid = false;
7000 rectSlider = Rectangle(X_EXPOSURE_PANEL_SIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SIDER_LANDSCAPE,
7001 W_EXPOSURE_PANEL_SIDER_LANDSCAPE, H_EXPOSURE_PANEL_SIDER_LANDSCAPE);
7004 case DRAW_INITIALIZED:
7006 buttonPosition.x = currentPosition.x;
7007 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7008 IsSliderRectValid = true;
7014 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
7016 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
7018 buttonPosition.x = rectSlider.x;
7019 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7020 IsSliderRectValid = true;
7021 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7022 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7027 IsSliderRectValid = false;
7034 if ((currentPosition.x >= rectSlider.x) && (currentPosition.x <= (rectSlider.x + rectSlider.width)))
7036 if ((currentPosition.y >= rectSlider.y) && (currentPosition.y <= (rectSlider.y + rectSlider.height)))
7038 buttonPosition.x = rectSlider.x;
7039 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7040 IsSliderRectValid = true;
7041 r = SetSliderAdjustValue(currentPosition, rectSlider, EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7042 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7047 IsSliderRectValid = false;
7050 if ((buttonPosition.y % FRAME_SKIP) != INDEX_UNIT_ZERO)
7052 IsSliderRectValid = false;
7062 if (IsSliderRectValid)
7064 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
7065 _pCameraInfoPanel->Invalidate(true);
7068 AppLogDebug("EXIT");
7076 CameraForm::ShowExposureSlider(void)
7078 AppLogDebug("ENTER");
7079 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7080 bool exposureValue = false;
7081 bool brighnesstValue = false;
7082 result r = E_SUCCESS;
7084 if (_pExposureCloseTimer)
7086 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7087 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7089 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7093 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7095 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7099 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7102 if (exposureValue == true && r == E_SUCCESS)
7104 r = CreateExposureSlider();
7105 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7107 r = DrawExposureSlider();
7108 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7112 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7114 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7118 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7121 if (brighnesstValue == true && r == E_SUCCESS)
7123 r = CreateExposureSlider();
7124 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7126 r = DrawExposureSlider();
7127 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7132 AppLogDebug("EXIT");
7136 CameraForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7138 AppLogDebug("ENTER");
7139 result r = E_SUCCESS;
7140 bool modified = false;
7141 bool isValidRect = false;
7142 Dimension dimRendererSize;
7144 if (__screenMode == SCREEN_MODE_NORMAL)
7146 Dimension dim = Dimension(0, 0);
7147 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7148 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7149 Rectangle clientRect = GetClientAreaBounds();
7150 bool isToCompensated = false;
7152 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7153 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7155 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7157 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7158 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7162 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7163 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7168 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7170 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7171 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7175 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7176 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7180 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7182 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7183 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7185 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7186 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7188 if (modified == true)
7190 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7193 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7194 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7196 if (evaluateBoundsRect.height == rect.height)
7198 isToCompensated = false;
7202 isToCompensated = true;
7207 if (evaluateBoundsRect.width == rect.width)
7209 isToCompensated = false;
7213 isToCompensated = true;
7217 r = __pOverlayPanel->SetBounds(rect);
7218 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7219 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7221 if (isToCompensated == true)
7223 AppLogDebug("isToCompensated = true");
7225 rect = __pOverlayPanel->GetBounds();
7226 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7228 r = __pOverlayPanel->SetBounds(rect);
7229 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7230 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7233 dimRendererSize = __pOverlayPanel->GetSize();
7234 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7235 __pOverlayPanel->SetRenderSize(dimRendererSize);
7239 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7240 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7241 Rectangle clientRect = GetClientAreaBounds();
7242 bool isToCompensated = false;
7244 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7245 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7247 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7249 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7253 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7258 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7260 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7264 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7268 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7270 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7271 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7273 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7274 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7276 if (modified == true)
7278 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7281 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7282 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7284 if (evaluateBoundsRect.height == rect.height)
7286 isToCompensated = false;
7290 isToCompensated = true;
7295 if (evaluateBoundsRect.width == rect.width)
7297 isToCompensated = false;
7301 isToCompensated = true;
7305 r = __pOverlayPanel->SetBounds(rect);
7306 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7307 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7309 if (isToCompensated == true)
7311 AppLogDebug("isToCompensated = true");
7312 rect = __pOverlayPanel->GetBounds();
7313 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7315 r = __pOverlayPanel->SetBounds(rect);
7316 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7317 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7320 dimRendererSize = __pOverlayPanel->GetSize();
7321 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7322 __pOverlayPanel->SetRenderSize(dimRendererSize);
7324 AppLogDebug("EXIT");
7328 CameraForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7330 AppLogDebug("ENTER");
7331 result r = E_SUCCESS;
7332 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7333 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7334 Rectangle clientRect = GetClientAreaBounds();
7335 BufferInfo bufferinfo;
7336 String listName = L"";
7337 int selfPortraitEnable = CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY;
7338 int guideLineEnable = DISABLE_GUIDELINE;
7340 if (_appControlActionCompleted)
7342 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7344 if (__dir != orientationStatus)
7346 __dir = orientationStatus;
7347 __deviceOrientation = orientationStatus;
7352 if (__dir != orientationStatus)
7354 __isOrientationChanged = true;
7356 if (_pAppTimer != null)
7358 _pAppTimer->Cancel();
7360 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
7362 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7363 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7365 SetOverlayPanelOrientationChanged(orientationStatus);
7367 if (__pOverlayPanel)
7369 switch (orientationStatus)
7371 case ORIENTATION_STATUS_PORTRAIT:
7373 AppLogDebug("PORTRAIT");
7374 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7378 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7380 AppLogDebug("PORTRAIT_REVERSE");
7381 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7385 case ORIENTATION_STATUS_LANDSCAPE:
7387 AppLogDebug("LANDSCAPE");
7388 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7392 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7394 AppLogDebug("LANDSCAPE_REVERSE");
7395 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7404 if (__screenMode == SCREEN_MODE_FULL)
7406 HidePanel(true, true);
7409 __dir = orientationStatus;
7410 __deviceOrientation = orientationStatus;
7412 AppLogDebug("__dir = %d", __dir);
7413 _pCameraPresentationModel->SetOrientation(__dir);
7415 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7416 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7418 if (guideLineEnable == DISABLE_GUIDELINE)
7427 UpdateUiPanelIcon();
7428 UpdateUiActionPanelIcon();
7429 OnHelpCloseTimerExpired();
7431 if (__isTimerRunning)
7433 if (_pHelpCloseTimer)
7435 _pHelpCloseTimer->Cancel();
7437 delete _pHelpCloseTimer;
7438 _pHelpCloseTimer = null;
7441 HideScreenOverlayHelp();
7444 if (_pListViewCameraTabMainMenu != null)
7446 listName = _pListViewCameraTabMainMenu->GetName();
7447 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7453 if (_pListViewGeneralTabMainMenu != null)
7455 listName = _pListViewGeneralTabMainMenu->GetName();
7456 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7462 if (_pListFlashMainMenu != null)
7464 listName = _pListFlashMainMenu->GetName();
7466 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME))&& _pListFlashMainMenu->GetShowState() == true)
7472 if (_pListWbMainMenu != null)
7474 listName = _pListWbMainMenu->GetName();
7476 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME))&& _pListWbMainMenu->GetShowState() == true)
7482 if (_pListViewCameraTabSubMenu != null)
7484 if (_pListViewCameraTabSubMenu->GetShowState() == true)
7490 if (_pListViewGeneralTabSubMenu != null)
7492 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
7497 if (_pCameraInfoPanel->GetDrawExposure() == true)
7499 _pCameraInfoPanel->SetDrawExposure(false);
7502 MakeSettingPopupTab(false);
7505 __isOrientationChanged = false;
7507 AppLogDebug("EXIT");
7511 CameraForm::HidePopup(void)
7513 AppLogDebug("ENTER");
7514 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
7516 if (_pListViewCameraTabSubMenu)
7518 if (_pCameraInfoSubPanel != null)
7520 _pCameraInfoSubPanel->SetShowState(false);
7523 _pListViewCameraTabSubMenu->SetShowState(false);
7526 if (_pListViewCameraTabMainMenu)
7528 _pListViewCameraTabMainMenu->SetShowState(false);
7531 if (_pListFlashMainMenu)
7533 _pListFlashMainMenu->SetShowState(false);
7536 if (_pListWbMainMenu)
7538 _pListWbMainMenu->SetShowState(false);
7541 if (_pListViewGeneralTabSubMenu)
7543 if (_pCameraInfoGeneralSubPanel != null)
7545 _pCameraInfoGeneralSubPanel->SetShowState(false);
7547 _pListViewGeneralTabSubMenu->SetShowState(false);
7550 if (_pListViewGeneralTabMainMenu)
7552 _pListViewGeneralTabMainMenu->SetShowState(false);
7555 _pCameraInfoPanel->SetDrawExposure(false);
7556 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7557 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7558 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7559 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7561 if (__isOrientationChanged)
7563 __isOrientationChanged = false;
7564 _pCameraInfoPanel->Invalidate(true);
7568 _pCameraInfoPanel->Draw();
7569 _pCameraInfoPanel->Show();
7571 __resolutionChange = false;
7572 AppLogDebug("EXIT");
7576 CameraForm::CheckStorageInfo(void)
7578 AppLogDebug("ENTER");
7579 result r = E_SUCCESS;
7580 MessageBox messageBox;
7582 String strTemp = L"";
7583 int remainedNum = 0;
7585 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
7586 AppLogDebug("CheckStorageInfo remainedNum = %d", remainedNum);
7588 if (remainedNum == STORAGE_VALUE_ZERO)
7590 if (__lowMemoryCapacity == false)
7592 __lowMemoryCapacity = true;
7593 __isMemoryFull = false;
7594 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);
7596 else if (__lowMemoryCapacity == true)
7598 __isMemoryFull = true;
7599 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
7601 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
7603 r = messageBox.ShowAndWait(result);
7604 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
7608 case MSGBOX_RESULT_OK:
7610 if (__lowMemoryCapacity == true)
7612 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7613 _pCameraInfoPanel->SetStorageTitle(strTemp);
7614 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7615 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7616 _pCameraInfoPanel->Invalidate(true);
7619 if (__isMemoryFull == true)
7621 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
7622 _pCameraInfoPanel->SetStorageTitle(strTemp);
7623 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
7624 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
7625 _pCameraInfoPanel->Invalidate(true);
7633 //r = TerminateApp();
7634 //TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
7638 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
7640 _pCameraInfoPanel->SetStorageTitle(strTemp);
7641 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
7642 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
7643 _pCameraInfoPanel->Invalidate(true);
7646 SetExifOrientation(__deviceOrientation);
7650 AppLogDebug("EXIT");*/
7654 CameraForm::AppControlRequestHideButton(void)
7656 AppLogDebug("ENTER");
7657 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7658 const IMap* pArguments = pApp->GetAppControlArguments();
7659 if (pArguments == null)
7661 AppLogDebug("pAllowSwtich is null");
7662 if (__pCameraIconLabel)
7664 __pCameraIconLabel->SetShowState(true);
7667 if (__pCamcoderIconLabel)
7669 __pCamcoderIconLabel->SetShowState(true);
7674 __pSwButton->SetShowState(true);
7679 AppLogDebug("pAllowSwitch is not null");
7680 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7681 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7683 AppLogDebug("ALLOW_SWITCH_TRUE");
7685 if (__isTimerRunning)
7687 if (__pCameraIconLabel)
7689 __pCameraIconLabel->SetShowState(false);
7692 if (__pCamcoderIconLabel)
7694 __pCamcoderIconLabel->SetShowState(false);
7699 __pSwButton->SetShowState(false);
7704 if (__pCameraIconLabel)
7706 __pCameraIconLabel->SetShowState(true);
7709 if (__pCamcoderIconLabel)
7711 __pCamcoderIconLabel->SetShowState(true);
7716 __pSwButton->SetShowState(true);
7722 AppLogDebug("ALLOW_SWITCH_FALSE");
7723 if (__pCameraIconLabel)
7725 __pCameraIconLabel->SetShowState(false);
7728 if (__pCamcoderIconLabel)
7730 __pCamcoderIconLabel->SetShowState(false);
7735 __pSwButton->SetShowState(false);
7739 AppLogDebug("EXIT");
7743 CameraForm::HideUiActionButton(void)
7745 AppLogDebug("ENTER");
7746 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7748 AppControlRequestHideButton();
7752 if (__pCameraIconLabel)
7754 __pCameraIconLabel->SetShowState(true);
7757 if (__pCamcoderIconLabel)
7759 __pCamcoderIconLabel->SetShowState(true);
7764 __pSwButton->SetShowState(true);
7767 AppLogDebug("EXIT");
7771 CameraForm::HideUiPanel(bool state)
7773 AppLogDebug("ENTER");
7776 _pFlashButton->SetShowState(false);
7777 _pSelfShotButton->SetShowState(false);
7778 _pSettingButton->SetShowState(false);
7779 __pSettingLine->SetShowState(false);
7781 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7783 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
7784 const IMap* pArguments = pApp->GetAppControlArguments();
7785 if (pArguments == null)
7787 AppLogDebug("pArguments is null");
7788 if (__pCameraIconLabel)
7790 __pCameraIconLabel->SetShowState(false);
7793 if (__pCamcoderIconLabel)
7795 __pCamcoderIconLabel->SetShowState(false);
7800 __pSwButton->SetShowState(false);
7805 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
7806 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
7808 if (__isTimerRunning)
7810 if (__pCameraIconLabel)
7812 __pCameraIconLabel->SetShowState(false);
7815 if (__pCamcoderIconLabel)
7817 __pCamcoderIconLabel->SetShowState(false);
7822 __pSwButton->SetShowState(false);
7827 if (__pCameraIconLabel)
7829 __pCameraIconLabel->SetShowState(true);
7832 if (__pCamcoderIconLabel)
7834 __pCamcoderIconLabel->SetShowState(true);
7839 __pSwButton->SetShowState(true);
7845 AppLogDebug("ALLOW_SWITCH_FALSE");
7846 if (__pCameraIconLabel)
7848 __pCameraIconLabel->SetShowState(false);
7851 if (__pCamcoderIconLabel)
7853 __pCamcoderIconLabel->SetShowState(false);
7858 __pSwButton->SetShowState(false);
7865 if (__isTimerRunning)
7867 __pCameraIconLabel->SetShowState(false);
7868 __pCamcoderIconLabel->SetShowState(false);
7869 __pSwButton->SetShowState(false);
7873 __pCameraIconLabel->SetShowState(true);
7874 __pCamcoderIconLabel->SetShowState(true);
7875 __pSwButton->SetShowState(true);
7880 _pQuickSettingButton->SetShowState(false);
7881 _pWhiteBalanceButton->SetShowState(false);
7882 _pExposureValueButton->SetShowState(false);
7883 _pCloseButton->SetShowState(false);
7884 __pShutterButton->SetShowState(false);
7885 __pThumbnailButton->SetShowState(false);
7886 _pThumbnailPanel->SetShowState(false);
7888 if (__screenMode == SCREEN_MODE_NORMAL)
7890 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7891 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
7896 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7898 if (__pThumbnailButton)
7900 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
7902 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
7903 SetControlAlwaysOnTop(*__pThumbnailButton, false);
7907 if (_pThumbnailPanel)
7909 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
7911 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
7912 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
7916 _pFlashButton->SetShowState(false);
7917 _pSelfShotButton->SetShowState(true);
7918 _pSettingButton->SetShowState(true);
7919 __pSettingLine->SetShowState(true);
7920 _pQuickSettingButton->SetShowState(false);
7921 _pWhiteBalanceButton->SetShowState(false);
7922 _pExposureValueButton->SetShowState(false);
7923 _pCloseButton->SetShowState(false);
7925 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
7927 AppControlRequestHideButton();
7931 __pCameraIconLabel->SetShowState(true);
7932 __pCamcoderIconLabel->SetShowState(true);
7933 __pSwButton->SetShowState(true);
7936 __pShutterButton->SetShowState(true);
7937 __pThumbnailButton->SetShowState(true);
7938 _pThumbnailPanel->SetShowState(true);
7940 if (__screenMode == SCREEN_MODE_NORMAL)
7942 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7943 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
7947 if (__screenMode == SCREEN_MODE_FULL)
7956 AppLogDebug("EXIT");
7960 CameraForm::HideUiSettingMenu(void)
7962 AppLogDebug("ENTER");
7963 if (_pCameraInfoPanel)
7965 _pCameraInfoPanel->SetDrawExposure(false);
7966 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7967 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7968 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7969 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7972 if (_pListViewCameraTabSubMenu)
7974 if (_pCameraInfoSubPanel != null)
7976 _pCameraInfoSubPanel->SetShowState(false);
7979 _pListViewCameraTabSubMenu->SetShowState(false);
7982 if (_pListViewCameraTabMainMenu)
7984 _pListViewCameraTabMainMenu->SetShowState(false);
7987 if (_pListFlashMainMenu)
7989 _pListFlashMainMenu->SetShowState(false);
7992 if (_pListWbMainMenu)
7994 _pListWbMainMenu->SetShowState(false);
7997 if (_pListViewGeneralTabSubMenu)
7999 if (_pCameraInfoGeneralSubPanel != null)
8001 _pCameraInfoGeneralSubPanel->SetShowState(false);
8003 _pListViewGeneralTabSubMenu->SetShowState(false);
8006 if (_pListViewGeneralTabMainMenu)
8008 _pListViewGeneralTabMainMenu->SetShowState(false);
8010 AppLogDebug("EXIT");
8014 CameraForm::HideUiQuickMenu(void)
8016 AppLogDebug("ENTER");
8017 if (_pSelfShotButton != null)
8019 _pSelfShotButton->SetShowState(true);
8020 _pSelfShotButton->Invalidate(true);
8023 if (_pSettingButton != null)
8025 _pSettingButton->SetShowState(true);
8026 _pSettingButton->Invalidate(true);
8029 if (__pSettingLine != null)
8031 __pSettingLine->SetShowState(true);
8032 __pSettingLine->Invalidate(true);
8035 if (_pCameraInfoPanel != null)
8037 _pCameraInfoPanel->SetDrawIndicator(true);
8038 _pCameraInfoPanel->Invalidate(true);
8041 if (_pFlashButton != null)
8043 _pFlashButton->SetShowState(false);
8044 _pFlashButton->Invalidate(true);
8047 if (_pQuickSettingButton != null)
8049 _pQuickSettingButton->SetShowState(false);
8050 _pQuickSettingButton->Invalidate(true);
8053 if (_pWhiteBalanceButton != null)
8055 _pWhiteBalanceButton->SetShowState(false);
8056 _pWhiteBalanceButton->Invalidate(true);
8059 if (_pExposureValueButton != null)
8061 _pExposureValueButton->SetShowState(false);
8062 _pExposureValueButton->Invalidate(true);
8065 if (_pCloseButton != null)
8067 _pCloseButton->SetShowState(false);
8068 _pCloseButton->Invalidate(true);
8070 AppLogDebug("EXIT");
8074 CameraForm::ShowUiQuickMenu(void)
8076 AppLogDebug("ENTER");
8077 if (_pCameraInfoPanel != null)
8079 _pCameraInfoPanel->SetDrawIndicator(false);
8080 _pCameraInfoPanel->Invalidate(true);
8083 if (_pSelfShotButton != null)
8085 _pSelfShotButton->SetShowState(false);
8086 _pSelfShotButton->Invalidate(true);
8089 if (_pSettingButton != null)
8091 _pSettingButton->SetShowState(false);
8092 _pSettingButton->Invalidate(true);
8095 if (__pSettingLine != null)
8097 __pSettingLine->SetShowState(false);
8098 __pSettingLine->Invalidate(true);
8101 if (_pFlashButton != null)
8103 _pFlashButton->SetShowState(true);
8104 _pFlashButton->Invalidate(true);
8107 if (_pQuickSettingButton != null)
8109 _pQuickSettingButton->SetShowState(true);
8110 _pQuickSettingButton->Invalidate(true);
8113 if (_pWhiteBalanceButton != null)
8115 _pWhiteBalanceButton->SetShowState(true);
8116 _pWhiteBalanceButton->Invalidate(true);
8119 if (_pExposureValueButton != null)
8121 _pExposureValueButton->SetShowState(true);
8122 _pExposureValueButton->Invalidate(true);
8125 if (_pCloseButton != null)
8127 _pCloseButton->SetShowState(true);
8128 _pCloseButton->Invalidate(true);
8130 AppLogDebug("EXIT");
8134 CameraForm::SetCameraMode(bool isWideMode)
8136 AppLogDebug("ENTER");
8137 result r = E_SUCCESS;
8138 Dimension normalMode(PREVIEW_RESOLOTION_WIDTH, PREVIEW_RESOLOTION_HEIGHT);
8139 Dimension resolutionDim;
8140 Dimension captureResolutionDim;
8141 IList* pList = null;
8142 int previewResolutionSize = 0;
8143 int resolutionCnt = 0;
8144 int resolutionRatio = 0;
8146 int tempResolutionIndex = 0;
8148 int selfPortraitEnable = 0;
8149 BufferInfo bufferinfo;
8151 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
8152 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8154 if (isWideMode == true)
8156 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8160 resolutionCnt = pList->GetCount();
8162 if (resolutionCnt > 0)
8164 for (index = 0; index < resolutionCnt; index++)
8166 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8168 resolutionRatio = (resolutionDim.width * MULTIPLY_BY_TEN) / (resolutionDim.height);
8170 if (resolutionRatio > NORMAL_MODE_RATIO)
8177 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(count - INDEX_UNIT_ONE)));
8178 __previewResolutionWidth = resolutionDim.width;
8179 __previewResolutionHeight = resolutionDim.height;
8183 __previewResolutionWidth = PREVIEW_RESOLOTION_WIDTH;
8184 __previewResolutionHeight = PREVIEW_RESOLOTION_HEIGHT;
8187 AppLogDebug("Wide Mode W[%d] x H[%d]", resolutionDim.width, resolutionDim.height);
8189 _pCameraPresentationModel->SetPreviewResolution(resolutionDim);
8193 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8194 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
8196 _pCameraPresentationModel->SetPreviewResolution(normalMode);
8198 __previewResolutionWidth = normalMode.width;
8199 __previewResolutionHeight = normalMode.height;
8201 AppLogDebug("Normal Mode W[%d] x H[%d]", normalMode.width, normalMode.height);
8203 if (__isToggleCameraDirection)
8205 pList = _pCameraPresentationModel->GetPreviewResolutionList();
8207 resolutionCnt = pList->GetCount();
8209 AppLogDebug("pList resolutionCnt = %d", resolutionCnt);
8211 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8213 captureResolutionDim.width = __captureResolutionWidth;
8215 captureResolutionDim.height = __captureResolutionHeight;
8217 if (resolutionCnt > 0)
8219 for (index = 0; index < resolutionCnt; index++)
8221 resolutionDim = *(static_cast<Dimension*>(pList->GetAt(index)));
8223 if (resolutionDim == captureResolutionDim)
8225 tempResolutionIndex = index;
8227 AppLogDebug("primary captureResolutionDim == W:%d H:%d for index = %d", resolutionDim.width, resolutionDim.height, index);
8231 __primaryCurrentResolutionIndex = resolutionCnt - tempResolutionIndex;
8234 AppLogDebug("__primaryCurrentResolutionIndex = %d", __primaryCurrentResolutionIndex);
8238 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
8239 __captureResolutionWidth = captureResolutionDim.width;
8240 __captureResolutionHeight = captureResolutionDim.height;
8242 AppLogDebug("secondary captureResolutionDim : w->%d x h->%d", captureResolutionDim.width, captureResolutionDim.height);
8247 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8248 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
8250 _pCameraPresentationModel->StartPreview(&bufferinfo);
8252 _pCameraPresentationModel->SetContinuousAutoFocus();
8254 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8256 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8257 AppLogDebug("EXIT");
8261 CameraForm::SetOverlayRendererRotation(void)
8263 AppLogDebug("ENTER");
8264 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8268 case ORIENTATION_STATUS_PORTRAIT:
8270 AppLogDebug("ORIENTATION_STATUS_PORTRAIT");
8271 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8275 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8277 AppLogDebug("ORIENTATION_STATUS_PORTRAIT_REVERSE");
8278 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8282 case ORIENTATION_STATUS_LANDSCAPE:
8284 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE");
8285 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8289 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8291 AppLogDebug("ORIENTATION_STATUS_LANDSCAPE_REVERSE");
8292 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8299 AppLogDebug("EXIT");
8303 CameraForm::CreateOverlayRegion(Rectangle rect)
8305 AppLogDebug("ENTER");
8306 result r = E_SUCCESS;
8308 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8309 r = __pOverlayPanel->Construct(rect);
8310 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8311 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8313 r = AddControl(__pOverlayPanel);
8314 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8315 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8317 __pOverlayPanel->AddTouchEventListener(*this);
8319 AppLogDebug("EXIT");
8323 RemoveControl(__pOverlayPanel);
8324 __pOverlayPanel = null;
8325 AppLogDebug("EXIT - CATCH");
8330 CameraForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8332 AppLogDebug("ENTER");
8333 bool modified = false;
8334 bool isValidRect = false;
8335 Dimension dim = Dimension(0, 0);
8336 bool isToCompensated = false;
8337 Dimension dimRendererSize;
8338 result r = E_SUCCESS;
8340 if (destroyOverlay == true)
8342 if (__pOverlayPanel)
8344 __pOverlayPanel->RemoveTouchEventListener(*this);
8345 RemoveControl(__pOverlayPanel);
8346 __pOverlayPanel = null;
8349 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8350 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8352 if (isWideMode == false)
8354 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8355 r = GetLastResult();
8359 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8360 r = GetLastResult();
8362 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8363 TryReturn(r == E_SUCCESS, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(r));
8365 if (modified == true)
8367 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8370 if (__dir == ORIENTATION_STATUS_PORTRAIT
8371 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8373 if (evaluateBoundsRect.height == rect.height)
8375 isToCompensated = false;
8379 isToCompensated = true;
8384 if (evaluateBoundsRect.width == rect.width)
8386 isToCompensated = false;
8390 isToCompensated = true;
8394 r = CreateOverlayRegion(rect);
8395 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8397 if (isToCompensated == true)
8399 AppLogDebug("isToCompensated = true");
8401 rect = __pOverlayPanel->GetBounds();
8402 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8404 r = __pOverlayPanel->SetBounds(rect);
8405 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8408 dimRendererSize = __pOverlayPanel->GetSize();
8409 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8411 __pOverlayPanel->SetRenderSize(dimRendererSize);
8415 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8417 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8418 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8420 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8421 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8423 if (modified == true)
8425 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8428 if (__dir == ORIENTATION_STATUS_PORTRAIT
8429 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8431 if (evaluateBoundsRect.height == rect.height)
8433 isToCompensated = false;
8437 isToCompensated = true;
8442 if (evaluateBoundsRect.width == rect.width)
8444 isToCompensated = false;
8448 isToCompensated = true;
8452 r = __pOverlayPanel->SetBounds(rect);
8453 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8454 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8456 if (isToCompensated == true)
8458 rect = __pOverlayPanel->GetBounds();
8459 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8461 r = __pOverlayPanel->SetBounds(rect);
8462 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8463 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8466 dimRendererSize = __pOverlayPanel->GetSize();
8467 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8468 __pOverlayPanel->SetRenderSize(dimRendererSize);
8470 AppLogDebug("EXIT");
8474 RemoveControl(__pOverlayPanel);
8475 __pOverlayPanel = null;
8476 AppLogDebug("EXIT - CATCH");
8481 CameraForm::SetOverlayPanelNormalMode(bool isRemoved)
8483 AppLogDebug("ENTER");
8484 result r = E_SUCCESS;
8485 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8486 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
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 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8495 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8499 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8500 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8505 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8507 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8508 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8512 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8513 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8517 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8518 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8519 AppLogDebug("EXIT");
8523 CameraForm::SetOverlayPanelWideMode(bool isRemoved)
8525 AppLogDebug("ENTER");
8526 result r = E_SUCCESS;
8527 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8528 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8529 Rectangle clientRect = GetClientAreaBounds();
8531 if (__dir == ORIENTATION_STATUS_PORTRAIT
8532 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8534 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8536 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8540 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8545 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8547 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8551 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8555 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8556 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8557 AppLogDebug("EXIT");
8561 CameraForm::SetControlAlwaysOnTopPanel(void)
8563 AppLogDebug("ENTER");
8564 if (__pSettingPanel)
8566 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
8568 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
8569 SetControlAlwaysOnTop(*__pSettingPanel, true);
8575 if (IsControlAlwaysOnTop(__pActionPanel) == false)
8577 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
8578 SetControlAlwaysOnTop(*__pActionPanel, true);
8584 if (IsControlAlwaysOnTop(_pFlashButton) == false)
8586 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
8587 SetControlAlwaysOnTop(*_pFlashButton, true);
8591 if (_pSelfShotButton)
8593 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
8595 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8596 SetControlAlwaysOnTop(*_pSelfShotButton, true);
8600 if (_pSettingButton)
8602 if (IsControlAlwaysOnTop(_pSettingButton) == false)
8604 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
8605 SetControlAlwaysOnTop(*_pSettingButton, true);
8611 if (IsControlAlwaysOnTop(__pSettingLine) == false)
8613 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
8614 SetControlAlwaysOnTop(*__pSettingLine, true);
8618 if (__pCameraIconLabel)
8620 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
8622 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
8623 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
8627 if (__pCamcoderIconLabel)
8629 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
8631 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
8632 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
8636 if (_pQuickSettingButton)
8638 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
8640 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
8641 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
8645 if (_pWhiteBalanceButton)
8647 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
8649 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
8650 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
8654 if (_pExposureValueButton)
8656 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
8658 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
8659 SetControlAlwaysOnTop(*_pExposureValueButton, true);
8665 if (IsControlAlwaysOnTop(_pCloseButton) == false)
8667 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
8668 SetControlAlwaysOnTop(*_pCloseButton, true);
8672 if (__pBatteryState)
8674 if (IsControlAlwaysOnTop(__pBatteryState) == false)
8676 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
8677 SetControlAlwaysOnTop(*__pBatteryState, true);
8683 if (IsControlAlwaysOnTop(__pSwButton) == false)
8685 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
8686 SetControlAlwaysOnTop(*__pSwButton, true);
8691 if (__pShutterButton)
8693 if (IsControlAlwaysOnTop(__pShutterButton) == false)
8695 AppLogDebug("IsControlAlwaysOnTop __pShutterButton");
8696 SetControlAlwaysOnTop(*__pShutterButton, true);
8700 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
8702 if (__pThumbnailButton)
8704 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
8706 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8707 SetControlAlwaysOnTop(*__pThumbnailButton, false);
8711 if (_pThumbnailPanel)
8713 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
8715 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8716 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
8722 if (__pThumbnailButton)
8724 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
8726 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
8727 SetControlAlwaysOnTop(*__pThumbnailButton, true);
8731 if (_pThumbnailPanel)
8733 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
8735 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
8736 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
8741 if (_pHelpGoToGallery)
8743 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
8745 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
8746 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
8750 if (_pHelpGoToGalleryText)
8752 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
8754 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
8755 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
8759 if (_pHelpSwitchCamera)
8761 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
8763 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
8764 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
8768 if (_pHelpSwitchCameraText)
8770 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
8772 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
8773 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
8777 if (_pHelpQuickSetting)
8779 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
8781 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
8782 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
8786 if (_pHelpQuickSettingText)
8788 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
8790 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
8791 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
8795 if (_pHelpRecordVideo)
8797 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
8799 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
8800 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
8804 if (_pHelpRecordVideoText)
8806 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
8808 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
8809 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
8815 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
8817 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
8818 SetControlAlwaysOnTop(*_pHelpShutter, true);
8822 if (_pHelpShutterText)
8824 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
8826 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
8827 SetControlAlwaysOnTop(*_pHelpShutterText, true);
8831 if (__pCameraSetting)
8833 if (IsControlAlwaysOnTop(__pCameraSetting) == false)
8835 AppLogDebug("IsControlAlwaysOnTop __pCameraSetting");
8836 SetControlAlwaysOnTop(*__pCameraSetting, true);
8840 if (__pCameraSettingLable)
8842 if (IsControlAlwaysOnTop(__pCameraSettingLable) == false)
8844 AppLogDebug("IsControlAlwaysOnTop __pCameraSettingLable");
8845 SetControlAlwaysOnTop(*__pCameraSettingLable, true);
8849 if (__pGeneralSetting)
8851 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
8853 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
8854 SetControlAlwaysOnTop(*__pGeneralSetting, true);
8858 if (__pGeneralSettingLable)
8860 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
8862 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
8863 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
8866 AppLogDebug("EXIT");
8870 CameraForm::HidePanel(bool isWideMode, bool isInvalidated)
8872 AppLogDebug("ENTER");
8873 result r = E_SUCCESS;
8875 SetControlAlwaysOnTopPanel();
8877 if (isWideMode == true)
8879 AppLogDebug("Wide MODE");
8881 if (__pSettingPanel)
8883 r = __pSettingPanel->SetShowState(false);
8884 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8889 r = __pActionPanel->SetShowState(false);
8890 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8895 AppLogDebug("Normal MODE");
8897 if (__pSettingPanel)
8899 r = __pSettingPanel->SetShowState(true);
8900 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8905 r = __pActionPanel->SetShowState(true);
8906 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
8910 if (isInvalidated == true)
8919 AppLogDebug("EXIT");
8923 CameraForm::SetScreenMode(const ScreenMode mode, bool destory)
8925 AppLogDebug("ENTER");
8926 result r = E_SUCCESS;
8928 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8932 case SCREEN_MODE_NORMAL:
8934 if (destory == true)
8936 if (__screenMode != mode)
8938 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8939 _pAppTimer->Cancel();
8941 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8942 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8944 _pCameraPresentationModel->KeepScreenOnState(true, false);
8946 _pCameraPresentationModel->StopCamera();
8950 if (__isToggleCameraDirection || __resolutionChange)
8952 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8953 _pAppTimer->Cancel();
8955 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
8956 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8958 _pCameraPresentationModel->KeepScreenOnState(true, false);
8960 _pCameraPresentationModel->StopCamera();
8964 SetOverlayPanelNormalMode(true);
8966 SetOverlayRendererRotation();
8968 if (__screenMode != mode)
8970 SetCameraMode(false);
8974 if (__isToggleCameraDirection || __resolutionChange)
8976 SetCameraMode(false);
8980 __screenMode = SCREEN_MODE_NORMAL;
8984 SetOverlayPanelNormalMode(false);
8986 SetOverlayRendererRotation();
8988 __screenMode = SCREEN_MODE_NORMAL;
8991 if (__pOverlayPanel != null)
8993 __pOverlayPanel->RemoveTouchEventListener(*this);
8996 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8997 HidePanel(false, false);
9001 case SCREEN_MODE_FULL:
9003 if (destory == true)
9005 if (__screenMode != mode)
9007 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
9008 _pAppTimer->Cancel();
9010 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9011 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
9013 _pCameraPresentationModel->KeepScreenOnState(true, false);
9015 _pCameraPresentationModel->StopCamera();
9019 if (__isToggleCameraDirection || __resolutionChange)
9021 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
9022 _pAppTimer->Cancel();
9024 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9025 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
9027 _pCameraPresentationModel->KeepScreenOnState(true, false);
9029 _pCameraPresentationModel->StopCamera();
9033 SetOverlayPanelWideMode(true);
9035 SetOverlayRendererRotation();
9037 if (__screenMode != mode)
9039 SetCameraMode(true);
9043 if (__isToggleCameraDirection || __resolutionChange)
9045 SetCameraMode(true);
9049 __screenMode = SCREEN_MODE_FULL;
9053 SetOverlayPanelWideMode(false);
9055 SetOverlayRendererRotation();
9057 __screenMode = SCREEN_MODE_FULL;
9060 if (__pOverlayPanel != null)
9062 __pOverlayPanel->AddTouchEventListener(*this);
9065 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
9066 HidePanel(true, false);
9074 AppLogDebug("EXIT");
9078 _pCameraInfoPanel->SetOverlayPanelMode(SCREEN_MODE_NORMAL);
9079 __screenMode = SCREEN_MODE_NORMAL;
9085 CameraForm::BackButtonPerformed(void)
9087 AppLogDebug("ENTER");
9088 result r = E_SUCCESS;
9090 if (_pHelpGoToGallery->GetShowState() == true)
9092 AppLogDebug("EXIT - Screen Overlay Help");
9093 OnHelpCloseTimerExpired();
9097 if (_pCameraPresentationModel->GetPreviewState() == false)
9099 AppLogDebug("EXIT - StartPreview do not call");
9103 if (_pCameraInfoPanel->GetDrawExposure() == true)
9105 HideExposurePanel();
9109 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9111 r = PressBackButton();
9112 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
9116 if (__isTimerRunning == true)
9118 OnTimerCapturePause();
9124 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
9129 AppLogDebug("EXIT");
9133 AppLogDebug("EXIT - CATCH");
9138 CameraForm::PressBackButton(void)
9140 AppLogDebug("ENTER");
9141 result r = E_SUCCESS;
9143 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9145 AppLogDebug("PressBackButton >> Back to the App");
9147 if (_pCameraPresentationModel->GetCameraState()!= CAMERA_STATE_CAPTURED)
9149 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
9153 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
9156 AppLogDebug("EXIT");
9161 CameraForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
9163 AppLogDebug("ENTER");
9164 result r = E_SUCCESS;
9165 bool focusSupport = false;
9166 int selfPortraitEnable = 0;
9168 if (__isTimerRunning == false)
9170 AppLogDebug("__isTimerRunning:false");
9172 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9173 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9175 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9177 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9181 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9184 if (focusSupport == true && r == E_SUCCESS)
9186 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9187 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9188 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9189 _pCameraInfoPanel->Invalidate(true);
9193 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9194 _pCameraInfoPanel->Invalidate(true);
9196 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
9200 AppLogDebug("__isTimerRunning:true");
9202 AppLogDebug("EXIT");
9206 CameraForm::DoCapture(void)
9208 AppLogDebug("ENTER");
9209 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9211 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9212 _pAppTimer->Cancel();
9216 _timeCount = INDEX_UNIT_ZERO;
9217 _pPopupTimer->Cancel();
9220 if (_pExposureCloseTimer)
9222 _pExposureCloseTimer->Cancel();
9225 if (_pCameraInfoPanel->GetDrawExposure() == true)
9227 _pCameraInfoPanel->SetDrawExposure(false);
9231 if (_pTouchAutoFocusTimer)
9233 _pTouchAutoFocusTimer->Cancel();
9236 if (_pChargingTimer)
9238 _pChargingTimer->Cancel();
9243 _pCameraInfoPanel->CheckAvailableStorageSpace();
9245 AppLogDebug("EXIT");
9249 CameraForm::SetUri(const Tizen::Base::String& uri)
9251 AppLogDebug("ENTER");
9252 AppLogDebug("[URI] %ls", uri.GetPointer());
9253 __uri = String(uri);
9254 AppLogDebug("EXIT");
9258 CameraForm::SetMime(const Tizen::Base::String& mime)
9260 AppLogDebug("ENTER");
9261 AppLogDebug("[MIME] %ls", mime.GetPointer());
9262 __mime = String(mime);
9263 AppLogDebug("EXIT");
9266 const Tizen::Base::String&
9267 CameraForm::GetUri(void) const
9269 AppLogDebug("ENTER");
9270 AppLogDebug("EXIT");
9274 const Tizen::Base::String&
9275 CameraForm::GetMime(void) const
9277 AppLogDebug("ENTER");
9278 AppLogDebug("EXIT");
9283 CameraForm::LaunchImageview(void)
9285 AppLogDebug("ENTER");
9286 result r = E_SUCCESS;
9287 const String* filePath = null;
9288 String listIndex = L"";
9289 String* temp = null;
9295 _timeCount = INDEX_UNIT_ZERO;
9296 _pPopupTimer->Cancel();
9299 if (_pExposureCloseTimer)
9301 _pExposureCloseTimer->Cancel();
9306 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
9307 pExtraData->Construct();
9309 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9310 pArrayList->Construct();
9312 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9313 pContentPathList->Construct();
9315 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9316 if (pContentPathList == null)
9320 AppLogDebug("EXIT - pContentPathList is null");
9324 loopCount = _pCameraPresentationModel->GetContentCount();
9325 for (index = 0; index < loopCount; ++index)
9327 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
9328 AppLogDebug("filePath = %ls", filePath->GetPointer());
9329 pArrayList->Add(new (std::nothrow) String(*filePath));
9332 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
9333 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
9335 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
9336 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
9339 SetMime(MIME_TYPE_VALUE_IMAGE);
9341 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
9342 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
9344 loopCount = pArrayList->GetCount();
9345 for (int i = 0; i < loopCount; ++i)
9347 temp = static_cast<String*>(pArrayList->GetAt(i));
9348 AppLog("print temp(%ls)", temp->GetPointer());
9350 AppLogDebug("EXIT");
9354 CameraForm::InDrawFocus(void)
9356 AppLogDebug("ENTER");
9357 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9358 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9359 Rectangle clientRect = GetClientAreaBounds();
9360 result r = E_SUCCESS;
9361 int selfPortraitEnable = 0;
9362 Point currentPosition;
9363 bool focusSupport = false;
9365 if (__dir == ORIENTATION_STATUS_PORTRAIT
9366 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9368 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9369 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9370 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9371 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9375 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9376 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9377 currentPosition.x = (rect.width / DIVIDE_BY_TWO);
9378 currentPosition.y = (rect.height / DIVIDE_BY_TWO);
9381 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9382 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9384 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9386 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9390 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9393 if (focusSupport == true && r == E_SUCCESS)
9395 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9396 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9397 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9401 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9402 _pCameraInfoPanel->Draw();
9403 _pCameraInfoPanel->Show();
9405 AppLogDebug("EXIT");
9409 CameraForm::GetCameraToForeground(void)
9411 AppLogDebug("ENTER");
9412 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9413 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9414 Rectangle clientRect = GetClientAreaBounds();
9415 result r = E_SUCCESS;
9416 Dimension previewResolutionDim;
9417 Dimension captureResolutionDim;
9418 int previewResolutionSize = 0;
9419 BufferInfo bufferinfo;
9421 __isLockScreenMode = false;
9423 _pCameraPresentationModel->KeepScreenOnState(true, false);
9425 StartInitAppTimer();
9427 StartPreviewFailPopupTimer();
9429 _batteryStatus = GetCurrentBatteryState();
9430 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
9432 StartInitChargingTimer();
9434 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9435 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
9439 previewResolutionDim = _pCameraPresentationModel->GetPreviewResolution();
9440 AppLogDebug("CameraForm::GetPreviewResolution(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9442 __previewResolutionWidth = previewResolutionDim.width;
9443 __previewResolutionHeight = previewResolutionDim.height;
9445 captureResolutionDim = _pCameraPresentationModel->GetCaptureResolution();
9446 AppLogDebug("CameraForm::captureResolutionDim(W:%d, H:%d)", previewResolutionDim.width, previewResolutionDim.height);
9448 AppLogDebug("__screenMode [%d]", __screenMode);
9450 r = SetScreenMode(__screenMode, false);
9451 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
9453 if (__dir == ORIENTATION_STATUS_PORTRAIT
9454 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9456 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9460 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9465 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
9466 TryReturnVoid(r == E_SUCCESS, "Write Reg fail[%s]", GetErrorMessage(r));
9468 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9469 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9471 _pCameraPresentationModel->StartPreview(&bufferinfo);
9473 _pCameraPresentationModel->SetContinuousAutoFocus();
9475 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
9477 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
9479 SetCameraSettingsDevice();
9480 AppLogDebug("EXIT");
9484 CameraForm::SendCameraToBackground(void)
9486 AppLogDebug("ENTER");
9487 if (__isTimerRunning == true)
9490 _timeCount = INDEX_UNIT_ZERO;
9491 __isTimerRunning = false;
9492 _pCameraPresentationModel->SetTimerEnabled(false);
9493 _pCameraPresentationModel->SetIntervalTimerRun(false);
9494 _isUsedTimerCaptured = false;
9496 if (_pIntervalValueTimer != null)
9498 _pIntervalValueTimer->Cancel();
9501 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9502 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9503 _pCameraInfoPanel->SetDrawPopupTimer(false);
9504 _pCameraInfoPanel->Invalidate(true);
9508 if (_pAppTimer != null)
9510 _pAppTimer->Cancel();
9513 if (_pChargingTimer != null)
9516 _pChargingTimer->Cancel();
9519 if (_pChargingCompletedTimer != null)
9523 _pChargingCompletedTimer->Cancel();
9526 if (_pPreviewFailPopupTimer != null)
9528 _pPreviewFailPopupTimer->Cancel();
9531 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9532 _pCameraInfoPanel->Invalidate(true);
9536 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
9537 _pCameraPresentationModel->StopCamera();
9538 _pCameraPresentationModel->KeepScreenOnState(false, true);
9540 AppLogDebug("EXIT");
9544 CameraForm::DrawThumbnail(void)
9546 AppLogDebug("ENTER");
9547 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9549 if (__pThumbnailButton)
9551 __pThumbnailButton->SetShowState(true);
9552 __pThumbnailButton->Draw();
9553 __pThumbnailButton->Show();
9556 if (_pThumbnailPanel)
9558 _pThumbnailPanel->SetShowState(false);
9559 _pThumbnailPanel->Draw();
9560 _pThumbnailPanel->Show();
9565 if (__pThumbnailButton)
9567 __pThumbnailButton->SetShowState(false);
9568 __pThumbnailButton->Draw();
9569 __pThumbnailButton->Show();
9572 if (_pThumbnailPanel)
9574 _pThumbnailPanel->SetShowState(true);
9575 _pThumbnailPanel->Draw();
9576 _pThumbnailPanel->Show();
9579 AppLogDebug("EXIT");
9583 CameraForm::SetCameraErrorOccurred(void)
9585 AppLogDebug("ENTER");
9586 result r = E_SUCCESS;
9587 Point currentPosition;
9588 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9589 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9590 int guideLineEnable = 0;
9591 BufferInfo bufferinfo;
9593 if (__dir == ORIENTATION_STATUS_PORTRAIT
9594 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9596 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT,
9597 W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
9601 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE,
9602 W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9605 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9606 _pAppTimer->Cancel();
9608 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9609 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9611 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
9612 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
9614 _pCameraPresentationModel->StartPreview(&bufferinfo);
9616 _pCameraPresentationModel->SetContinuousAutoFocus();
9618 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
9619 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
9621 if (guideLineEnable == DISABLE_GUIDELINE)
9634 _isUsedTimerCaptured = false;
9635 AppLogDebug("EXIT");
9639 CameraForm::SetScreenOverlayHelpTimer(void)
9641 AppLogDebug("ENTER");
9642 result r = E_SUCCESS;
9643 int overlayHelpEnable = 0;
9645 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9646 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9648 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
9650 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
9652 _pHelpCloseTimer = new (std::nothrow) Timer();
9653 _pHelpCloseTimer->Construct(*this);
9655 r = _pHelpCloseTimer->Start(CAMERA_SCREEN_OVERLAY_HELP_TIMER_VALUE);
9656 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
9659 AppLogDebug("EXIT");
9663 delete _pHelpCloseTimer;
9664 _pHelpCloseTimer = null;
9666 AppLogDebug("EXIT - CATCH");
9671 CameraForm::DrawScreenOverlayHelp(void)
9673 AppLogDebug("ENTER");
9674 Bitmap* pBitmap = null;
9675 result r = E_SUCCESS;
9676 int overlayHelpEnable = 0;
9677 bool checkAppControlSwitch = false;
9678 //AppResource* pAppResource = null;
9680 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
9681 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
9682 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
9683 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
9684 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
9685 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
9686 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
9687 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
9688 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
9689 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
9691 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
9692 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
9694 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
9696 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
9698 HideScreenOverlayHelp();
9702 //pAppResource = Application::GetInstance()->GetAppResource();
9703 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
9705 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
9707 _pHelpGoToGallery->SetShowState(true);
9708 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9709 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9710 _pHelpGoToGalleryText->SetShowState(true);
9713 _pHelpSwitchCamera->SetShowState(true);
9714 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9715 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9716 _pHelpSwitchCameraText->SetShowState(true);
9718 _pHelpQuickSetting->SetShowState(true);
9719 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9720 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9721 _pHelpQuickSettingText->SetShowState(true);
9724 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9726 checkAppControlSwitch = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetAppControlSwitch();
9730 checkAppControlSwitch = true;
9733 if (checkAppControlSwitch)
9735 _pHelpRecordVideo->SetShowState(true);
9736 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9737 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9738 _pHelpRecordVideoText->SetShowState(true);
9741 _pHelpShutter->SetShowState(true);
9742 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
9743 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
9744 _pHelpShutterText->SetShowState(true);
9746 if (__dir == ORIENTATION_STATUS_PORTRAIT
9747 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9749 _pHelpGoToGalleryText->Invalidate(true);
9750 _pHelpSwitchCameraText->Invalidate(true);
9751 _pHelpQuickSettingText->Invalidate(true);
9752 _pHelpRecordVideoText->Invalidate(true);
9753 _pHelpShutterText->Invalidate(true);
9755 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9756 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9758 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9759 _pHelpGoToGallery->Invalidate(true);
9764 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9765 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9767 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9768 _pHelpSwitchCamera->Invalidate(true);
9773 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
9774 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9776 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9777 _pHelpQuickSetting->Invalidate(true);
9782 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
9783 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9785 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9786 _pHelpRecordVideo->Invalidate(true);
9791 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
9792 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9794 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9795 _pHelpShutter->Invalidate(true);
9800 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
9801 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9808 _pHelpGoToGalleryText->Invalidate(true);
9809 _pHelpSwitchCameraText->Invalidate(true);
9810 _pHelpQuickSettingText->Invalidate(true);
9811 _pHelpRecordVideoText->Invalidate(true);
9812 _pHelpShutterText->Invalidate(true);
9814 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9815 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9817 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
9818 _pHelpGoToGallery->Invalidate(true);
9823 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
9824 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9826 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
9827 _pHelpSwitchCamera->Invalidate(true);
9832 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
9833 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9835 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
9836 _pHelpQuickSetting->Invalidate(true);
9841 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9842 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9844 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
9845 _pHelpRecordVideo->Invalidate(true);
9850 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
9851 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9853 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
9854 _pHelpShutter->Invalidate(true);
9859 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
9860 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9867 AppLogDebug("EXIT");
9871 AppLogDebug("EXIT - CATCH");
9876 CameraForm::CheckCameraSettingLabel(void)
9878 AppLogDebug("ENTER");
9879 if (__pCameraSettingLable)
9881 result r = E_SUCCESS;
9883 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9884 _pAppTimer->Cancel();
9886 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9887 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9889 if (_pListViewGeneralTabMainMenu)
9891 _pListViewGeneralTabMainMenu->SetShowState(false);
9894 if (_pListViewGeneralTabSubMenu)
9896 _pListViewGeneralTabSubMenu->SetShowState(false);
9899 MakeCameraTabSettingPopup();
9901 AppLogDebug("Exit");
9905 CameraForm::CheckGeneralSettingLabel(void)
9907 AppLogDebug("ENTER");
9908 if(__pGeneralSettingLable)
9910 result r = E_SUCCESS;
9912 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
9913 _pAppTimer->Cancel();
9915 r = _pAppTimer->Start(CAMERA_TIMER_LIMIT);
9916 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
9918 if (_pListViewCameraTabMainMenu)
9920 _pListViewCameraTabMainMenu->SetShowState(false);
9922 if (_pListViewCameraTabSubMenu)
9924 _pListViewCameraTabSubMenu->SetShowState(false);
9927 MakeGeneralTabSettingPopup();
9929 AppLogDebug("Exit");
9933 CameraForm::DrawBatteryLevelFull(void)
9935 AppLogDebug("ENTER");
9936 Bitmap* pBitmap = null;
9937 result r = E_SUCCESS;
9939 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9941 if (__dir == ORIENTATION_STATUS_PORTRAIT
9942 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9944 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9948 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9951 _batteryStatus = BATTERY_STATE_20;
9953 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
9954 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
9956 __pBatteryState->SetBackgroundBitmap(*pBitmap);
9957 __pBatteryState->Invalidate(true);
9962 AppLogDebug("EXIT");
9966 AppLogDebug("EXIT - CATCH");
9971 CameraForm::CheckBatteryStatus(void)
9973 AppLogDebug("ENTER");
9974 Bitmap* pBitmap = null;
9975 result r = E_SUCCESS;
9976 int batteryLevel = 0;
9977 bool isCharging = false;
9979 Battery::IsCharging(isCharging);
9980 Battery::GetCurrentLevelInPercentage(batteryLevel);
9982 AppLogDebug("isCharging = %d", isCharging);
9983 AppLogDebug("batteryLevel = %d", batteryLevel);
9985 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
9987 if (__dir == ORIENTATION_STATUS_PORTRAIT
9988 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
9990 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
9994 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
9999 _batteryStatus = GetCurrentBatteryState();
10000 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
10002 int currentImage = GetCurrentBatteryImage();
10004 AppLogDebug("currentImage = %d", currentImage);
10006 pBitmap = ResourceManager::GetBitmapN(currentImage);
10008 StartInitChargingTimer();
10012 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
10014 _batteryStatus = BATTERY_STATE_20;
10016 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
10018 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
10020 _batteryStatus = BATTERY_STATE_19;
10022 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
10024 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
10026 _batteryStatus = BATTERY_STATE_18;
10028 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
10030 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
10032 _batteryStatus = BATTERY_STATE_17;
10034 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
10036 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
10038 _batteryStatus = BATTERY_STATE_16;
10040 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
10042 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
10044 _batteryStatus = BATTERY_STATE_15;
10046 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
10048 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
10050 _batteryStatus = BATTERY_STATE_14;
10052 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
10054 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
10056 _batteryStatus = BATTERY_STATE_13;
10058 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
10060 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
10062 _batteryStatus = BATTERY_STATE_12;
10064 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
10066 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
10068 _batteryStatus = BATTERY_STATE_11;
10070 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
10072 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
10074 _batteryStatus = BATTERY_STATE_10;
10076 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
10078 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
10080 _batteryStatus = BATTERY_STATE_9;
10082 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
10084 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
10086 _batteryStatus = BATTERY_STATE_8;
10088 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
10090 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
10092 _batteryStatus = BATTERY_STATE_7;
10094 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
10096 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
10098 _batteryStatus = BATTERY_STATE_6;
10100 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
10102 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
10104 _batteryStatus = BATTERY_STATE_5;
10106 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
10108 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
10110 _batteryStatus = BATTERY_STATE_4;
10112 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
10114 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
10116 _batteryStatus = BATTERY_STATE_3;
10118 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
10120 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
10122 _batteryStatus = BATTERY_STATE_2;
10124 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
10126 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
10128 _batteryStatus = BATTERY_STATE_1;
10130 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
10132 else if (batteryLevel == BATT_LEVEL_VALUE_00)
10134 _batteryStatus = BATTERY_STATE_0;
10136 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
10139 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10141 AppLogDebug("_batteryStatus = %d", _batteryStatus);
10143 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10144 __pBatteryState->Invalidate(true);
10149 AppLogDebug("EXIT");
10153 AppLogDebug("EXIT - CATCH");
10158 CameraForm::CancelTimer(void)
10160 AppLogDebug("ENTER");
10161 if (_pAppTimer != null)
10163 _pAppTimer->Cancel();
10166 if (_pIntervalValueTimer != null)
10168 _pIntervalValueTimer->Cancel();
10171 if (_pCaptureStartTimer != null)
10173 _pCaptureStartTimer->Cancel();
10176 if (_pTouchAutoFocusTimer != null)
10178 _pTouchAutoFocusTimer->Cancel();
10183 _pPopupTimer->Cancel();
10186 if (_pExposureCloseTimer)
10188 _pExposureCloseTimer->Cancel();
10191 if (_pHelpCloseTimer)
10193 _pHelpCloseTimer->Cancel();
10196 if (_pChargingTimer)
10198 _chargingCount = INDEX_UNIT_ZERO;
10200 _pChargingTimer->Cancel();
10203 if (_pChargingCompletedTimer != null)
10205 _chargingCount = 0;
10207 _pChargingCompletedTimer->Cancel();
10210 if (_pPreviewFailPopupTimer != null)
10212 _pPreviewFailPopupTimer->Cancel();
10214 AppLogDebug("EXIT");
10218 CameraForm::MakeCameraTabMenuString(void)
10220 AppLogDebug("ENTER");
10223 result r = E_SUCCESS;
10224 AppResource* pAppResource = null;
10226 if (__pSettingMenuString == null)
10228 pAppResource = Application::GetInstance()->GetAppResource();
10229 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10231 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
10233 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
10235 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10237 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10238 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
10241 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
10242 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
10244 pAppResource->GetString(IDS_CAM_BODY_ISO, tmpString);
10245 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_01] = tmpString;
10246 pAppResource->GetString(IDS_CAM_BODY_AUTO, tmpString);
10247 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_02] = tmpString;
10248 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_03] = IDS_MENU_ISO_50;
10249 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_04] = IDS_MENU_ISO_100;
10250 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_05] = IDS_MENU_ISO_200;
10251 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_06] = IDS_MENU_ISO_400;
10252 __pSettingMenuString[CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE][MENU_IDX_07] = IDS_MENU_ISO_800;
10254 AppLogDebug("EXIT");
10258 if (__pSettingMenuString)
10260 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
10262 if (__pSettingMenuString[idx])
10264 delete [] __pSettingMenuString[idx];
10265 __pSettingMenuString[idx] = null;
10273 delete [] __pSettingMenuString;
10274 __pSettingMenuString = null;
10281 CameraForm::MakeGeneralTabMenuString(void)
10283 AppLogDebug("ENTER");
10286 result r = E_SUCCESS;
10287 AppResource* pAppResource = null;
10289 if (__pSettingGeneralMenuString == null)
10291 pAppResource = Application::GetInstance()->GetAppResource();
10292 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10294 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
10296 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
10298 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10300 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
10301 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
10304 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
10305 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
10307 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10308 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
10309 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
10310 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
10311 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
10312 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
10313 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
10314 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
10316 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
10317 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
10318 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
10319 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
10320 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
10321 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
10323 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
10324 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
10325 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
10326 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
10327 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
10328 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
10330 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
10331 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
10333 pAppResource->GetString(IDS_MENU_OVERLAY_HELP_VALUE, tmpString);
10334 __pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
10335 //__pSettingGeneralMenuString[GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
10337 AppLogDebug("EXIT");
10341 if (__pSettingGeneralMenuString)
10343 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
10345 if (__pSettingGeneralMenuString[idx])
10347 delete [] __pSettingGeneralMenuString[idx];
10348 __pSettingGeneralMenuString[idx] = null;
10356 delete [] __pSettingGeneralMenuString;
10357 __pSettingGeneralMenuString = null;
10364 CameraForm::RunStartPreviewThread(void)
10366 AppLogDebug("ENTER");
10367 result r = E_SUCCESS;
10369 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
10370 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10372 __pCameraStarterThread = CameraStarterThread::GetInstance();
10373 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
10375 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
10376 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10378 r = __pCameraStarterThread->Start();
10379 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
10381 AppLogDebug("EXIT");
10385 ShowCameraFailPopup();
10387 AppLogDebug("EXIT - CATCH");
10392 CameraForm::SubListPopupTimerMode(int index)
10394 AppLogDebug("ENTER");
10395 result r = E_SUCCESS;
10398 __settingTimeInterval = index;
10401 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
10402 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10404 _pCameraInfoPanel->SetTimerType(regVal);
10405 _pCameraInfoPanel->Invalidate(true);
10407 AppLogDebug("EXIT");
10411 AppLogDebug("EXIT - CATCH");
10416 CameraForm::SubListPopupIsoMode(int index)
10418 AppLogDebug("ENTER");
10419 result r = E_SUCCESS;
10421 int selfPortraitEnable = 0;
10422 int updatedIndex = 0;
10424 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10425 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10427 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10429 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10433 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10436 if (r == E_SUCCESS)
10440 updatedIndex = index + 2;
10444 updatedIndex = index + 3;
10446 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)updatedIndex);
10449 __settingIsoIndex = index;
10450 regVal = __settingIsoIndex;
10452 r = _pCameraPresentationModel->SetValue(ISO_VALUE, regVal);
10453 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10455 AppLogDebug("EXIT");
10459 AppLogDebug("EXIT - CATCH");
10464 CameraForm::SubListPopupWhiteBalanceMode(int index)
10466 AppLogDebug("ENTER");
10467 result r = E_SUCCESS;
10469 String strRegKey = IDS_INIT_REG_KEY;
10470 int selfPortraitEnable = 0;
10472 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10473 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10475 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10477 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
10481 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
10484 if (r == E_SUCCESS)
10486 r = _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
10488 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10490 __settingWhiteBalance = index;
10491 regVal = __settingWhiteBalance;
10493 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10495 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
10496 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10500 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
10501 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10504 AppLogDebug("regVal = %d",regVal);
10506 AppLogDebug("EXIT");
10510 AppLogDebug("EXIT - CATCH");
10515 CameraForm::SubListPopupGuidelineMode(int index)
10517 AppLogDebug("ENTER");
10518 int value = SUBMENU_MODE_OFF;
10519 result r = E_SUCCESS;
10521 String strRegKey = IDS_INIT_REG_KEY;
10525 case SUBMENU_MODE_OFF:
10527 AppLogDebug("Setting - Guideline = off");
10528 value = SUBMENU_MODE_OFF;
10530 r = DrawMarker(false);
10531 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10535 case SUBMENU_MODE_ON:
10537 AppLogDebug("Setting - Guideline = on");
10538 value = SUBMENU_MODE_ON;
10540 r = DrawMarker(true);
10541 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
10549 SetGuideLine(value);
10552 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
10553 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10555 AppLogDebug("EXIT");
10559 AppLogDebug("EXIT - CATCH");
10564 CameraForm::SubListPopupOverlayHelpMode(int index)
10566 AppLogDebug("ENTER");
10567 int value = SUBMENU_MODE_OFF;
10568 result r = E_SUCCESS;
10570 String strRegKey = IDS_INIT_REG_KEY;
10574 case SUBMENU_MODE_OFF:
10576 value = SUBMENU_MODE_OFF;
10580 case SUBMENU_MODE_ON:
10582 value = SUBMENU_MODE_ON;
10592 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
10593 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10595 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
10597 r = SetScreenOverlayHelpTimer();
10598 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
10600 r = DrawScreenOverlayHelp();
10601 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
10603 AppLogDebug("EXIT");
10607 AppLogDebug("EXIT - CATCH");
10612 CameraForm::SubListPopupResolutionMode(int index)
10614 AppLogDebug("ENTER");
10615 IList* pList = _pCameraPresentationModel->GetCaptureResolutionList();
10616 int resolutionCnt = 0;
10617 BufferInfo bufferinfo;
10618 int resolutionRatio = 0;
10619 result r = E_SUCCESS;
10621 int selfPortraitEnable = 0;
10623 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10627 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
10628 Dimension dimCaptureResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
10630 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10631 AppLogDebug("SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE :: __captureResolution(W:%d, H:%d)", __captureResolutionWidth, __captureResolutionHeight);
10633 if ((__captureResolutionWidth == dimCaptureResolution.width ) && (__captureResolutionHeight == dimCaptureResolution.height))
10635 AppLogDebug("CAPTURE RESOLUTION Same");
10639 _pCameraPresentationModel->StopPreview();
10641 _pCameraPresentationModel->SetCaptureResolution(dimCaptureResolution);
10643 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10645 r = _pCameraPresentationModel->SetValue(PRIMARY_RESOLUTION_INDEX,index);
10646 AppLogDebug("result is %s",GetErrorMessage(r));
10650 r = _pCameraPresentationModel->SetValue(SECONDARY_RESOLUTION_INDEX,index);
10653 AppLogDebug("dimCaptureResolution(W:%d, H:%d)", dimCaptureResolution.width, dimCaptureResolution.height);
10655 resolutionRatio = (dimCaptureResolution.width * MULTIPLY_BY_TEN) / (dimCaptureResolution.height);
10657 AppLogDebug("resolutionRatio (W:%d)", resolutionRatio);
10659 __resolutionChange = true;
10661 __captureResolutionWidth = dimCaptureResolution.width;
10663 __captureResolutionHeight = dimCaptureResolution.height;
10665 if (resolutionRatio > NORMAL_MODE_RATIO)
10667 r = SetScreenMode(SCREEN_MODE_FULL, true);
10671 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
10673 TryCatch(r == E_SUCCESS, , "SetScreenMode fail[%s]", GetErrorMessage(r));
10675 AppLogDebug("__screenMode [%d]", __screenMode);
10679 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10681 __primaryCurrentResolutionIndex = index;
10682 regVal = __primaryCurrentResolutionIndex;
10686 __secondaryCurrentResolutionIndex = index;
10687 regVal = __secondaryCurrentResolutionIndex;
10689 __resolutionChange = false;
10691 AppLogDebug("EXIT");
10695 AppLogDebug("EXIT - CATCH");
10700 CameraForm::SubListPopupStorageTypeMode(int index)
10702 AppLogDebug("ENTER");
10703 int storage = STORAGE_TYPE_PHONE;
10704 String filePath = L"";
10705 result r = E_SUCCESS;
10709 case SUBMENU_STORAGE_TYPE_PHONE:
10711 AppLogDebug("Setting - Storage type = Phone");
10712 storage = STORAGE_TYPE_PHONE;
10713 SetStorageType(storage);
10717 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
10719 AppLogDebug("Setting - Storage type = card");
10720 storage = STORAGE_TYPE_MEMORYCARD;
10722 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
10724 SetStorageType(storage);
10728 storage = SUBMENU_STORAGE_TYPE_PHONE;
10729 AppLogDebug("Setting - don't draw t-flash icon");
10736 AppLogDebug("Setting - Storage, Invaild element id");
10741 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
10745 _pCameraInfoPanel->SetStorageType(storage);
10746 _pCameraInfoPanel->Invalidate(true);
10748 if (__pFileEventManager == null)
10750 __pFileEventManager = new (std::nothrow) FileEventManager();
10751 r = __pFileEventManager->Construct(*this);
10752 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10755 filePath = _pCameraPresentationModel->GetfilePath(storage);
10756 AppLogDebug("filePath %ls", filePath.GetPointer());
10759 if (File::IsFileExist(__pFileEventPath))
10761 __pFileEventManager->RemovePath(__pFileEventPath);
10764 if (File::IsFileExist(filePath))
10766 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
10767 __pFileEventPath = filePath;
10769 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
10770 AppLogDebug("EXIT");
10774 CameraForm::CreateCameraTabMainMenuItem(int index, int itemWidth)
10776 AppLogDebug("ENTER");
10777 CustomItem* pItem = null;
10778 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
10779 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
10781 result r = E_SUCCESS;
10784 int cameraResolutionCount = 0;
10785 int storageType = STORAGE_TYPE_PHONE;
10786 String listName = L"";
10787 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS,
10788 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
10790 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE,
10791 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
10793 int selfPortraitEnable = 0;
10794 String strTmp = L"";
10796 pItem = new (std::nothrow) CustomItem();
10797 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
10799 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
10800 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
10802 elementId = (index * MENU_TWO_ELEMENT);
10804 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10805 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10807 strTmp = __pSettingMenuString[index][0];
10809 if (strTmp.GetLength())
10811 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
10813 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10815 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
10817 if (r == E_SUCCESS)
10819 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10820 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10829 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10830 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10833 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10835 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
10837 if (r == E_SUCCESS)
10839 if (__pCaptureResolutionList != null)
10841 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10844 if (cameraResolutionCount > 1)
10846 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10855 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10856 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10861 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);
10862 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10867 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10868 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10873 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10875 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
10877 if (r == E_SUCCESS && __pIsoList->GetCount()>1)
10879 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10880 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10890 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10891 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10894 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10896 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
10898 if (r == E_SUCCESS)
10900 cameraResolutionCount = 0;
10901 if (__pCaptureResolutionList != null)
10903 cameraResolutionCount = __pCaptureResolutionList->GetCount();
10906 if (cameraResolutionCount > 1)
10908 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10918 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
10919 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10924 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);
10925 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10930 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
10931 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
10936 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
10937 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10939 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
10941 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
10942 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
10943 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
10946 if (index == CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE)
10948 if (__pCaptureResolutionList)
10950 int idx = __pCaptureResolutionList->GetCount() - INDEX_UNIT_ONE;
10953 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10955 AppLogDebug("CAM_SELF_PORTRAIT_MODE_PRIMARY");
10956 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
10959 if (__primaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10961 __primaryCurrentResolutionIndex = __primaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10963 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10967 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__primaryCurrentResolutionIndex)));
10974 AppLogDebug("CAM_SELF_PORTRAIT_MODE_SECONDARY");
10975 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
10977 if (__secondaryCurrentResolutionIndex == INDEX_UNIT_ONE)
10979 __secondaryCurrentResolutionIndex = __secondaryCurrentResolutionIndex - INDEX_UNIT_ONE;
10981 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10985 strTmp = *(static_cast<String*>(__pCaptureResolutionList->GetAt(__secondaryCurrentResolutionIndex)));
10991 else if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
10995 int idx = __pIsoList->GetCount() - INDEX_UNIT_ONE;
10996 if (idx >= INDEX_UNIT_ZERO)
10998 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11000 if (regVal == INDEX_UNIT_ZERO)
11002 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11006 strTmp = *(static_cast<String*>(__pIsoList->GetAt(regVal)));
11012 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11017 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11022 if (strTmp.GetLength())
11024 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11026 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11028 if (__pIsoList != null)
11030 if (__pIsoList->GetCount() >1)
11032 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);
11033 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11037 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11042 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11047 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11052 if (index == CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE)
11054 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11056 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
11060 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
11063 if (r == E_SUCCESS)
11065 cameraResolutionCount = 0;
11066 if (__pCaptureResolutionList != null)
11068 cameraResolutionCount = __pCaptureResolutionList->GetCount();
11071 if (cameraResolutionCount > 1)
11073 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11077 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);
11082 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11087 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11090 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11091 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11094 AppLogDebug("EXIT");
11101 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11102 AppLogDebug("EXIT - CATCH");
11107 CameraForm::CreateCameraTabSubMenuItem(int index, int itemWidth)
11109 AppLogDebug("ENTER");
11110 CustomItem* pItem = null;
11111 Bitmap* pBitmap = null;
11112 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11113 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11114 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11115 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11116 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11117 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11118 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11119 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11120 AppResource* pAppResource = null;
11122 result r = E_SUCCESS;
11125 CameraTabSubMenuContent idx = CAMERA_TAB_SUB_MENU_CONTENT_MAX;
11127 pItem = new (std::nothrow) CustomItem();
11128 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11130 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11131 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11133 pAppResource = Application::GetInstance()->GetAppResource();
11134 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11136 idx = GetCameraTabSettingSubMenuMode();
11139 case CAMERA_TAB_SUB_MENU_CONTENT_ISO_MODE:
11141 ResourceId resId = RESOURCE_ID_ISO_AUTO;
11145 case SUBMENU_ISO_AUTO:
11147 resId = RESOURCE_ID_ISO_AUTO;
11151 case SUBMENU_ISO_100:
11153 resId = RESOURCE_ID_ISO_100;
11157 case SUBMENU_ISO_200:
11159 resId = RESOURCE_ID_ISO_200;
11163 case SUBMENU_ISO_400:
11165 resId = RESOURCE_ID_ISO_400;
11169 case SUBMENU_ISO_800:
11171 resId = RESOURCE_ID_ISO_800;
11179 String arrString[] =
11188 r = _pCameraPresentationModel->GetValue(ISO_VALUE, regVal);
11189 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11194 if (__pIsoList->GetCount() > index)
11196 if (index == regVal)
11198 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11202 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11205 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11206 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11211 AppLogDebug("ISO index return is = %d", index);
11213 if (index == INDEX_UNIT_ZERO)
11215 pAppResource->GetString(arrString[index], str);
11219 str = *(static_cast<String*>(__pIsoList->GetAt(index)));
11223 pBitmap = ResourceManager::GetBitmapN(resId);
11224 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11226 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11227 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11233 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);
11234 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11240 case CAMERA_TAB_SUB_MENU_CONTENT_CAPTURE_RESOLUTION_MODE:
11242 int selfPortraitEnable = 0;
11244 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11245 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11248 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY )
11250 r = _pCameraPresentationModel->GetValue(PRIMARY_RESOLUTION_INDEX, __primaryCurrentResolutionIndex);
11251 AppLogDebug("resolution index is %d",__primaryCurrentResolutionIndex);
11252 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11256 r = _pCameraPresentationModel->GetValue(SECONDARY_RESOLUTION_INDEX, __secondaryCurrentResolutionIndex);
11257 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11260 if (__pCaptureResolutionList)
11263 if (__pCaptureResolutionList->GetCount() > index)
11265 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11267 if (index == __primaryCurrentResolutionIndex)
11269 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11273 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11278 if (index == __secondaryCurrentResolutionIndex)
11280 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11284 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11288 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11289 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11296 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11297 AppLogDebug("str = %ls", str.GetPointer());
11298 if (str.Equals(String(PHOTO_SIZE_3264_2488)))
11300 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11302 else if (str.Equals(String(PHOTO_SIZE_3264_2176)))
11304 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11306 else if (str.Equals(String(PHOTO_SIZE_3264_1836)))
11308 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_6M); // 8M
11310 else if (str.Equals(String(PHOTO_SIZE_2048_1536)))
11312 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11314 else if (str.Equals(String(PHOTO_SIZE_2048_1152)))
11316 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_2M); // 3.2M
11318 else if (str.Equals(String(PHOTO_SIZE_1280_720)))
11320 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.9M
11322 else if (str.Equals(String(PHOTO_SIZE_640_480)))
11324 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11328 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_PHOTO_SIZE_0_3M); // 0.3M
11330 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11332 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11333 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11338 str = *(static_cast<String*>(__pCaptureResolutionList->GetAt(index)));
11341 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);
11342 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11352 AppLogDebug("EXIT");
11362 AppLogDebug("pItem is null or not SettingMainMenu/FlashMenu");
11363 AppLogDebug("EXIT - CATCH");
11368 CameraForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11370 AppLogDebug("ENTER");
11371 CustomItem* pItem = null;
11372 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11373 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11374 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11375 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11376 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11377 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11378 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11379 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11381 result r = E_SUCCESS;
11384 String listName = L"";
11385 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11386 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11388 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11389 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11390 int selfPortraitEnable = 0;
11391 String strTmp = L"";
11393 String arrRegStringSuppor[] =
11398 OVERLAY_HELP_ENABLE,
11401 pItem = new (std::nothrow) CustomItem();
11402 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11404 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11405 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11407 elementId = (index * MENU_TWO_ELEMENT);
11409 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11410 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11412 strTmp = __pSettingGeneralMenuString[index][0];
11415 if (strTmp.GetLength())
11417 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11418 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11421 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11423 int storageType = STORAGE_TYPE_PHONE;
11425 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11426 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11428 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11430 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11431 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11432 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11435 r = _pCameraPresentationModel->GetValue(arrRegStringSuppor[index], regVal);
11436 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11438 AppLogDebug("Setting Main Menu");
11439 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11440 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11442 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11446 if (strTmp.GetLength())
11448 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11449 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11451 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11452 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11456 AppLogDebug("EXIT");
11463 AppLogDebug("EXIT - CATCH");
11468 CameraForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
11470 AppLogDebug("ENTER");
11471 CustomItem* pItem = null;
11472 Bitmap* pBitmap = null;
11473 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11474 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11475 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON_ZERO, Y_SETTING_SUBMENU_ICON,
11476 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11477 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11478 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11479 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11480 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11481 AppResource* pAppResource = null;
11483 result r = E_SUCCESS;
11487 GeneralTabSubMenuContent idx = GENERAL_TAB_SUB_MENU_CONTENT_MAX;
11489 pItem = new (std::nothrow) CustomItem();
11490 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11492 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11493 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11495 pAppResource = Application::GetInstance()->GetAppResource();
11496 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11498 idx = GetGeneralTabSettingSubMenuMode();
11501 case GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
11503 ResourceId resId = RESOURCE_ID_TIMER_OFF;
11507 case SETTING_TIMER_CAPTURE_0_SEC:
11509 resId = RESOURCE_ID_TIMER_OFF;
11513 case SETTING_TIMER_CAPTURE_2_SEC:
11515 resId = RESOURCE_ID_TIMER_2SEC;
11519 case SETTING_TIMER_CAPTURE_5_SEC:
11521 resId = RESOURCE_ID_TIMER_5SEC;
11525 case SETTING_TIMER_CAPTURE_10_SEC:
11527 resId = RESOURCE_ID_TIMER_10SEC;
11535 String arrString[] =
11538 IDS_CAM_BODY_2_SEC,
11539 IDS_CAM_BODY_5_SEC,
11540 IDS_CAM_BODY_10_SEC,
11543 pAppResource->GetString(arrString[index], tmpString);
11545 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
11546 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11548 if (index == regVal)
11550 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11554 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11556 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11558 elementId = (index * MENU_TWO_ELEMENT);
11560 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11561 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11564 pBitmap = ResourceManager::GetBitmapN(resId);
11566 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11567 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11568 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11573 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);
11574 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11578 case GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
11580 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
11584 case SUBMENU_GUIDELINE_OFF:
11586 resId = RESOURCE_ID_GUIDELINE_OFF;
11590 case SUBMENU_GUIDELINE_ON:
11592 resId = RESOURCE_ID_GUIDELINE_ON;
11600 elementId = (index * MENU_TWO_ELEMENT);
11602 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
11603 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11605 if (index == regVal)
11607 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11611 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11613 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11615 if (index == SUBMENU_MODE_OFF)
11617 str = IDS_CAM_BODY_OFF;
11621 str = IDS_CAM_BODY_ON;
11624 pAppResource->GetString(str, tmpString);
11626 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11627 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11634 pBitmap = ResourceManager::GetBitmapN(resId);
11635 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11637 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11638 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11644 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);
11645 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11649 case GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
11651 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
11655 case SUBMENU_MODE_OFF:
11657 resId = RESOURCE_ID_STORAGE_PHONE;
11661 case SUBMENU_MODE_ON:
11663 resId = RESOURCE_ID_STORAGE_CARD;
11671 elementId = (index * MENU_TWO_ELEMENT);
11673 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
11674 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11676 if (index == regVal)
11678 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11682 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11684 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11686 if (index == STORAGE_TYPE_PHONE)
11688 str = IDS_CAM_BODY_PHONE;
11692 str = IDS_CAM_OPT_MEMORY_CARD;
11695 pAppResource->GetString(str, tmpString);
11697 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11698 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11704 pBitmap = ResourceManager::GetBitmapN(resId);
11705 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11707 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11708 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11715 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
11717 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
11719 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);
11723 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);
11728 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);
11730 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11734 case GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
11743 AppLogDebug("EXIT");
11753 AppLogDebug("EXIT - CATCH");
11758 CameraForm::CreateFlashMainMenuItem(int index, int itemWidth)
11760 AppLogDebug("ENTER");
11761 CustomItem* pItem = null;
11762 Bitmap* pBitmap = null;
11763 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11764 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11765 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11766 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11767 String listName = L"";
11768 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11769 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11770 AppResource* pAppResource = null;
11772 result r = E_SUCCESS;
11775 bool value = false;
11776 int selfPortraitEnable = 0;
11778 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11780 String arrString[] =
11787 pItem = new (std::nothrow) CustomItem();
11788 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11790 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11791 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11793 pAppResource = Application::GetInstance()->GetAppResource();
11794 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11796 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11797 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11799 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11801 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11803 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11804 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11806 if (flashMode != FLASH_MODE_OFF)
11808 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11809 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11814 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11816 if (value == true && r == E_SUCCESS)
11818 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11822 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11824 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11825 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11827 if (flashMode != FLASH_MODE_OFF)
11829 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11830 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11835 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11836 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11840 case SUBMENU_MODE_OFF:
11842 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
11846 case SUBMENU_MODE_ON:
11848 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11852 case SUBMENU_MODE_AUTO:
11854 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
11862 pAppResource->GetString(arrString[index], tmpString);
11864 if (index == regVal)
11866 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11870 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11872 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11874 elementId = (index * MENU_TWO_ELEMENT);
11876 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11877 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11883 pBitmap = ResourceManager::GetBitmapN(resId);
11884 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11886 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11887 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11894 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11896 if (value == true && r == E_SUCCESS)
11898 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11899 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11903 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);
11904 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11907 AppLogDebug("EXIT");
11917 AppLogDebug("EXIT - CATCH");
11922 CameraForm::CreateWhiteBalanceItem(int index, int itemWidth)
11924 AppLogDebug("ENTER");
11925 CustomItem* pItem = null;
11926 Bitmap* pBitmap = null;
11927 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11928 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11929 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11930 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11931 String listName = L"";
11932 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11933 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11935 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11936 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11938 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11939 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11940 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11941 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11942 AppResource* pAppResource = null;
11944 result r = E_SUCCESS;
11947 int selfPortraitEnable = 0;
11948 ResourceId resId = RESOURCE_ID_WB_AWB;
11950 String arrString[] =
11953 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
11954 IDS_CAM_BODY_FLUORESCENT,
11955 IDS_CAM_BODY_DAYLIGHT,
11956 IDS_CAM_BODY_CLOUDY,
11959 pItem = new (std::nothrow) CustomItem();
11960 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11962 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11963 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11965 pAppResource = Application::GetInstance()->GetAppResource();
11966 TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
11968 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11969 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11971 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11973 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
11974 if (r != E_SUCCESS)
11976 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, REG_DEFAULT_VAULE_ZERO);
11978 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
11979 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11983 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
11984 if (r != E_SUCCESS)
11986 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, REG_DEFAULT_VAULE_ZERO);
11988 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
11989 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11992 AppLogDebug("regVal = %d", regVal);
11998 resId = RESOURCE_ID_WB_AWB;
12002 case MODE_WHITEBALANCE_INCANDESCENT:
12004 resId = RESOURCE_ID_WB_DAYLIGHT;
12008 case MODE_FLUORESCENT:
12010 resId = RESOURCE_ID_WB_CLOUDY;
12014 case MODE_DAYLIGHT:
12016 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12022 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12030 pAppResource->GetString(arrString[index], tmpString);
12032 if (index == regVal)
12034 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12038 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12040 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12042 elementId = (index * MENU_THREE_ELEMENT);
12044 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12045 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12051 pBitmap = ResourceManager::GetBitmapN(resId);
12052 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12054 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12055 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12061 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);
12062 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12064 AppLogDebug("EXIT");
12074 AppLogDebug("EXIT - CATCH");
12079 CameraForm::UpdatePopUp(void)
12081 bool doHidePopup = false;
12082 MakeSettingPopupTab(false);
12084 doHidePopup = OnTouchDoHidePopup();
12085 AppLogDebug("doHidePopup = %d", doHidePopup);
12093 CameraForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
12095 AppLogDebug("ENTER");
12096 int checkActivePanel=-1;
12098 bool timerEnabled = _pCameraPresentationModel->GetTimerEnabled();
12100 if (!__isTimerRunning && !timerEnabled)
12102 if ((_pListViewCameraTabMainMenu!= null && _pListViewCameraTabMainMenu->GetShowState()) ||
12103 (_pListViewGeneralTabMainMenu!= null && _pListViewGeneralTabMainMenu->GetShowState()) )
12105 checkActivePanel = 0;
12108 if (_pListFlashMainMenu != null && _pListFlashMainMenu->GetShowState())
12110 checkActivePanel = 1;
12113 if (_pListWbMainMenu != null && _pListWbMainMenu->GetShowState())
12115 checkActivePanel = 2;
12118 if (_pCameraInfoSubPanel!=null && _pCameraInfoSubPanel->GetShowState())
12120 checkActivePanel = 3;
12123 if (_pCameraInfoGeneralSubPanel!=null && _pCameraInfoGeneralSubPanel->GetShowState())
12125 checkActivePanel = 4;
12128 if (checkActivePanel != -1)
12130 switch (checkActivePanel)
12138 _pCameraInfoSubPanel->SetShowState(false);
12141 _pCameraInfoGeneralSubPanel->SetShowState(false);
12149 BackButtonPerformed();
12152 AppLogDebug("Exit");
12156 CameraForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12158 //Empty Implementation
12162 CameraForm::OnKeyPressed(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12164 //Empty Implementation
12168 CameraForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12170 AppLogDebug("Enter %d", keyCode);
12174 if ((source.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12176 OnTouchModeSwitch();
12181 if ((source.GetName().Equals(String(IDS_THUMBNAIL_PANLE_NAME))))
12183 OnTouchLaunchImageview();
12190 AppLogDebug("Exit");
12194 CameraForm::OnAccessibilityActionPerformed (const Control &control, const AccessibilityElement &element)
12196 AppLogDebug("Enter");
12197 AppLogDebug("control name is %ls",control.GetName().GetPointer());
12199 if ((control.GetName().Equals(String(IDS_ACTION_UI_CAMERA_MODE))))
12201 OnTouchModeSwitch();
12203 AppLogDebug("Exit");
12207 CameraForm::OnAccessibilityFocusIn (const Control &control, const AccessibilityElement &element)
12209 AppLogDebug("Enter");
12210 AppLogDebug("Exit");
12214 CameraForm::OnAccessibilityFocusOut (const Control &control, const AccessibilityElement &element)
12216 AppLogDebug("Enter");
12217 AppLogDebug("Exit");
12221 CameraForm::OnAccessibilityScreenReaderStatusChanged (const Control &control, const AccessibilityElement &element, AccessibilityScreenReaderStatus status)
12223 AppLogDebug("Enter");
12224 AppLogDebug("Exit");
12228 CameraForm::OnKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
12230 AppLogDebug("Enter");
12235 CameraForm::OnKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
12237 AppLogDebug("Enter");
12238 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
12239 KeyCode currentKeyCode = keyEventInfo.GetKeyCode();
12241 switch (currentKeyCode)
12246 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
12248 _pResetPopUp->SetShowState(false);
12260 CameraForm::OnPreviewKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
12262 AppLogDebug("Enter");
12267 CameraForm::OnPreviewKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
12269 AppLogDebug("Enter");
12273 Tizen::Ui::Controls::CustomItem*
12274 CameraForm::GetEnrichedTextCustomItem(int elementId,int itemWidth,const Tizen::Base::String& strTmp)
12276 EnrichedText* pCurrentEnrichedText = null;
12277 TextElement* pCurrentTextElement = null;
12278 CustomItem* pItem = null;
12280 result r = E_SUCCESS;
12282 Rectangle disabledTitle = Rectangle(X_SETTING_MENU_CONTESTS -20, Y_SETTING_MENU_CONTESTS + 10, W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
12284 AppLogDebug("string is %ls",strTmp.GetPointer());
12285 pItem = new (std::nothrow) CustomItem();
12286 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12288 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12289 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12291 pCurrentEnrichedText = new EnrichedText();
12292 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
12294 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
12295 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12297 pCurrentTextElement = new TextElement();
12298 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
12300 r = pCurrentTextElement->Construct(strTmp);
12301 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12303 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
12304 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
12305 pCurrentTextElement->SetFont(currentFont);
12307 pCurrentEnrichedText->Add(*pCurrentTextElement);
12309 r = pItem->AddElement(disabledTitle,elementId, *pCurrentEnrichedText);
12310 AppLogDebug("Add element is %s",GetErrorMessage(r));
12312 pCurrentEnrichedText->RemoveAll(true);
12313 delete pCurrentEnrichedText;
12314 AppLogDebug("Exit");
12323 if (pCurrentEnrichedText != null)
12325 pCurrentEnrichedText->RemoveAll(true);
12326 delete pCurrentEnrichedText;
12329 if (pCurrentTextElement != null)
12331 delete pCurrentTextElement;
12337 CameraForm::AddEnrichTextCustomItem(Tizen::Ui::Controls::CustomItem* pItem, int elementId,int itemWidth,const Tizen::Base::String& strTmp)
12339 Rectangle disabledDescrition = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -20, Y_SETTING_MENU_CONTENTS_VALUE + 10,W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
12340 EnrichedText* pCurrentEnrichedText = null;
12341 TextElement* pCurrentTextElement = null;
12343 result r = E_SUCCESS;
12345 AppLogDebug("string is %ls",strTmp.GetPointer());
12347 pCurrentEnrichedText = new EnrichedText();
12348 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
12350 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
12351 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12353 pCurrentTextElement = new TextElement();
12354 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
12356 r = pCurrentTextElement->Construct(strTmp);
12357 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12359 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
12360 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
12361 pCurrentTextElement->SetFont(currentFont);
12362 pCurrentEnrichedText->Add(*pCurrentTextElement);
12364 r = pItem->AddElement(disabledDescrition,elementId, *pCurrentEnrichedText);
12365 pCurrentEnrichedText->RemoveAll(true);
12366 delete pCurrentEnrichedText;
12370 if (pCurrentEnrichedText != null)
12372 pCurrentEnrichedText->RemoveAll(true);
12373 delete pCurrentEnrichedText;
12376 if (pCurrentTextElement != null)
12378 delete pCurrentTextElement;
12384 CameraForm::OnUpdateView()
12386 OnTouchLaunchImageview();