void HideScreenOverlayHelp(void);
result DrawScreenOverlayHelp(void);
result TerminateApp(void);
+ void RemoveAllEventListener(void);
private:
CameraPresentationModel* __pCamcorderPresentationModel;
AppLaunchType GetAppLaunchType(void) const;
void OnTimerCapturePause(void);
result TerminateApp(void);
+ void RemoveAllEventListener(void);
private:
CameraPresentationModel* __pCameraPresentationModel;
result SetExifOrientation(int orientation);
void KeepScreenOnState(bool keepOn, bool dimming);
- void SetPresentationChangedEventListener(ICameraEventListner* pObserverListener);
+ void AddPresentationChangedEventListener(ICameraEventListner& pObserverListener);
+ void RemovePresentationChangedEventListener(ICameraEventListner* pObserverListener);
void CallOnPresentationModeChanged(CameraActionEvent event);
bool GetOnVideoRecorderStopped(void);
extern const unsigned int COLOR_SETTING_UNDER_LINE;
extern const unsigned int COLOR_TITLE;
extern const unsigned int COLOR_TIMER_TEXT;
+extern const unsigned int COLOR_SCREEN_OVERLAY_HELP_TEXT;
+
extern const int FONT_SIZE_CANCEL_CONFIRM;
extern const int FONT_SIZE_CANCEL_BUTTON;
+extern const int FONT_SIZE_SCREEN_OVERLAY_HELP;
+
extern const unsigned int COLOR_DELETE_BUTTON_NORMAL;
extern const unsigned int COLOR_DELETE_BUTTON_PRESSED;
extern const unsigned int COLOR_DELETE_BUTTON_TEXT;
extern const wchar_t* IDS_CAM_BODY_CANCEL_RECORDING_Q;
extern const wchar_t* IDS_COM_SK_OK;
extern const wchar_t* IDS_COM_POP_CANCEL;
+extern const wchar_t* IDS_HELP_GOTO_GALLERY;
+extern const wchar_t* IDS_HELP_SWITCH_CAMERA;
+extern const wchar_t* IDS_HELP_QUICK_SETTINGT;
+extern const wchar_t* IDS_HELP_CAPTURE_IMAGE;
+extern const wchar_t* IDS_HELP_RECORD_VIDEO;
+extern const wchar_t* IDS_HELP_RECORDER;
+extern const wchar_t* IDS_HELP_SHUTTER;
+extern const wchar_t* IDS_HELP_GOTO_GALLERY;
+extern const wchar_t* IDS_HELP_GOTO_PREVIOUS_SCREEN;
#endif // _CM_TYPES_H_
\ No newline at end of file
__pCamcorderPresentationModel->KeepScreenOnState(false, true);
+ __pCamcorderPresentationModel->RemovePresentationChangedEventListener(null);
+
__pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
__lowMemoryCapacity = false;
__isCapacityBelow = false;
+ RemoveAllEventListener();
+
r = __pCamcorderPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
delete __pFileEventManager;
- RemoveOrientationEventListener(*this);
-
AppLogDebug("EXIT");
return r;
}
return;
}
- RemoveTouchEventListener(*this);
if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
{
r = PressBackButton();
{
requestType = __pCamcorderPresentationModel->GetAppControlRequestType();
- RemoveOrientationEventListener(*this);
- RemoveTouchEventListener(*this);
-
switch (requestType)
{
case CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED:
__AppControlActionCompleted = true;
+ RemoveAllEventListener();
+
DeleteTimer();
__blinkCount = 0;
StartInitChargingTimer();
- __pCamcorderPresentationModel->SetPresentationChangedEventListener(this);
+ __pCamcorderPresentationModel->AddPresentationChangedEventListener(*this);
__pCamcorderPresentationModel->KeepScreenOnState(true, false);
AppLogDebug("ENTER");
__timeCount = 0;
- __pIntervalValueTimer->Cancel();
-
+ if (__pIntervalValueTimer)
+ {
+ __pIntervalValueTimer->Cancel();
+ }
__doRecording = false;
if (__pPopupTimer)
__pCameraInfoPanel->Invalidate(true);
}
+ AppLogDebug("OnCameraActionPerformed - event %d", event);
switch (event)
{
case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
pCameraApp->SetFrameEnabled(false);
- RemoveTouchEventListener(*this);
-
r = TerminateApp();
AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
}
Bitmap* pBitmap = null;
result r = E_SUCCESS;
int overlayHelpEnable = 0;
+ //AppResource* pAppResource = null;
+ String ovelayHelpStr = L"";
TryCatch(__pHelpGoToGallery != null, r = E_FAILURE, "__pHelpGoToGallery is null");
TryCatch(__pHelpGoToGalleryText != null, r = E_FAILURE, "__pHelpGoToGalleryText is null");
}
else
{
+ //pAppResource = Application::GetInstance()->GetAppResource();
+ //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
+
__pHelpGoToGallery->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
+ ovelayHelpStr = L"GO to Gallery";
+ __pHelpGoToGalleryText->SetText(ovelayHelpStr);
+ __pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpGoToGalleryText->SetShowState(true);
+
__pHelpSwitchCamera->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
+ ovelayHelpStr = L"Switch camera";
+ __pHelpSwitchCameraText->SetText(ovelayHelpStr);
+ __pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpSwitchCameraText->SetShowState(true);
+
__pHelpQuickSetting->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
+ ovelayHelpStr = L"Quick Settings";
+ __pHelpQuickSettingText->SetText(ovelayHelpStr);
+ __pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpQuickSettingText->SetShowState(true);
+
__pHelpRecordVideo->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_RECORD_VIDEO", ovelayHelpStr);
+ ovelayHelpStr = L"Record video";
+ __pHelpRecordVideoText->SetText(ovelayHelpStr);
+ __pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpRecordVideoText->SetShowState(true);
+
__pHelpShutter->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_RECORDER", ovelayHelpStr);
+ ovelayHelpStr = L"Recorder";
+ __pHelpShutterText->SetText(ovelayHelpStr);
+ __pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpShutterText->SetShowState(true);
+
__pHelpGoToPreviousScreen->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_GOTO_PREVIOUS_SCREEN", ovelayHelpStr);
+ ovelayHelpStr = L"Go to Previous Screen";
+ __pHelpGoToPreviousScreenText->SetText(ovelayHelpStr);
+ __pHelpGoToPreviousScreenText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpGoToPreviousScreenText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpGoToPreviousScreenText->SetShowState(true);
if (__dir == ORIENTATION_STATUS_PORTRAIT
delete pCancelButton;
pCancelButton = null;
return E_FAILURE;
+}
+
+void
+CamcorderForm::RemoveAllEventListener(void)
+{
+ AppLogDebug("ENTER");
+ RemoveOrientationEventListener(*this);
+ RemoveTouchEventListener(*this);
+ RemoveKeyEventListener(*this);
+ AppLogDebug("EXIT");
}
\ No newline at end of file
__pCameraPresentationModel->KeepScreenOnState(false, true);
+ __pCameraPresentationModel->RemovePresentationChangedEventListener(null);
+
__pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
+ RemoveAllEventListener();
+
r = __pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
delete __pFileEventManager;
- RemoveOrientationEventListener(*this);
-
AppLogDebug("EXIT");
return r;
}
StartInitChargingTimer();
- __pCameraPresentationModel->SetPresentationChangedEventListener(this);
+ __pCameraPresentationModel->AddPresentationChangedEventListener(*this);
__pCameraPresentationModel->KeepScreenOnState(true, false);
AppLogDebug("ENTER");
result r = E_SUCCESS;
+ AppLogDebug("OnCameraActionPerformed - event %d", event);
switch (event)
{
case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
pCameraApp->SetFrameEnabled(false);
- RemoveTouchEventListener(*this);
-
r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
return;
}
- RemoveTouchEventListener(*this);
if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
{
r = PressBackButton();
{
requestType = __pCameraPresentationModel->GetAppControlRequestType();
- RemoveOrientationEventListener(*this);
- RemoveTouchEventListener(*this);
-
switch (requestType)
{
case CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED:
result r = E_SUCCESS;
CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
+ RemoveAllEventListener();
+
__AppControlActionCompleted = true;
DeleteTimer();
Bitmap* pBitmap = null;
result r = E_SUCCESS;
int overlayHelpEnable = 0;
+ String ovelayHelpStr = L"";
+ //AppResource* pAppResource = null;
TryCatch(__pHelpGoToGallery != null, r = E_FAILURE, "__pHelpGoToGallery is null");
TryCatch(__pHelpGoToGalleryText != null, r = E_FAILURE, "__pHelpGoToGalleryText is null");
}
else
{
+ //pAppResource = Application::GetInstance()->GetAppResource();
+ //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
+
__pHelpGoToGallery->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
+ ovelayHelpStr = L"GO to Gallery";
+ __pHelpGoToGalleryText->SetText(ovelayHelpStr);
+ __pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpGoToGalleryText->SetShowState(true);
+
__pHelpSwitchCamera->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
+ ovelayHelpStr = L"Switch camera";
+ __pHelpSwitchCameraText->SetText(ovelayHelpStr);
+ __pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpSwitchCameraText->SetShowState(true);
+
__pHelpQuickSetting->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
+ ovelayHelpStr = L"Quick Settings";
+ __pHelpQuickSettingText->SetText(ovelayHelpStr);
+ __pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpQuickSettingText->SetShowState(true);
+
__pHelpRecordVideo->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_CAPTURE_IMAGE", ovelayHelpStr);
+ ovelayHelpStr = L"Capture image";
+ __pHelpRecordVideoText->SetText(ovelayHelpStr);
+ __pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpRecordVideoText->SetShowState(true);
+
__pHelpShutter->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_SHUTTER", ovelayHelpStr);
+ ovelayHelpStr = L"Shutter";
+ __pHelpShutterText->SetText(ovelayHelpStr);
+ __pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpShutterText->SetShowState(true);
+
__pHelpGoToPreviousScreen->SetShowState(true);
+ //pAppResource->GetString(L"IDS_HELP_GOTO_PREVIOUS_SCREEN", ovelayHelpStr);
+ ovelayHelpStr = L"Go to Previous Screen";
+ __pHelpGoToPreviousScreenText->SetText(ovelayHelpStr);
+ __pHelpGoToPreviousScreenText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+ __pHelpGoToPreviousScreenText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
__pHelpGoToPreviousScreenText->SetShowState(true);
if (__dir == ORIENTATION_STATUS_PORTRAIT
AppLogDebug("EXIT - CATCH");
return null;
+}
+
+void
+CameraForm::RemoveAllEventListener(void)
+{
+ AppLogDebug("ENTER");
+ RemoveOrientationEventListener(*this);
+ RemoveTouchEventListener(*this);
+ RemoveKeyEventListener(*this);
+ AppLogDebug("EXIT");
}
\ No newline at end of file
}
void
-CameraPresentationModel::SetPresentationChangedEventListener(ICameraEventListner* pObserverListener)
+CameraPresentationModel::AddPresentationChangedEventListener(ICameraEventListner& pObserverListener)
+{
+ AppLogDebug("ENTER");
+ __pCameraListener = &pObserverListener;
+ AppLogDebug("EXIT");
+}
+
+void
+CameraPresentationModel::RemovePresentationChangedEventListener(ICameraEventListner* pObserverListener)
{
AppLogDebug("ENTER");
__pCameraListener = pObserverListener;
CameraPresentationModel::CallOnPresentationModeChanged(CameraActionEvent event)
{
AppLogDebug("ENTER");
- __pCameraListener->OnCameraActionPerformed(event);
+ AppLogDebug("CallOnPresentationModeChanged - event = %d", event);
+ if (__pCameraListener != null)
+ {
+ __pCameraListener->OnCameraActionPerformed(event);
+ }
AppLogDebug("EXIT");
}
CameraPresentationModel::SetDeviceManagerEventListner(void)
{
AppLogDebug("ENTER");
- DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+ result r = E_SUCCESS;
+
+ r = DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+ AppLogDebug("AddDeviceEventListener [%s] fail", GetErrorMessage(r));
AppLogDebug("EXIT");
}
CameraPresentationModel::RemoveDeviceManagerEventListner(void)
{
AppLogDebug("ENTER");
- DeviceManager::RemoveAllDeviceEventListeners();
+ result r = E_SUCCESS;
+
+ r = DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+ AppLogDebug("RemoveDeviceManagerEventListner [%s] fail", GetErrorMessage(r));
AppLogDebug("EXIT");
}
const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<128, 128, 128>::Value;
const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<0, 192, 255>::Value;
const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
+const unsigned int COLOR_SCREEN_OVERLAY_HELP_TEXT = Color32<255, 255, 255>::Value;
const unsigned int COLOR_CANCEL_BUTTON_TEXT = Color32<0, 0, 0>::Value;
const unsigned int COLOR_CANCEL_BUTTON_NORMAL = Color32<255, 255, 255>::Value;
const int FONT_SIZE_CANCEL_CONFIRM = 42;
const int FONT_SIZE_CANCEL_BUTTON = 36;
+const int FONT_SIZE_SCREEN_OVERLAY_HELP = 32;
const int X_THUMBNAIL_IMG_PANEL_LANDSCAPE = 26;
const int Y_THUMBNAIL_IMG_PANEL_LANDSCAPE = 590;
const wchar_t* IDS_CAM_BODY_CANCEL_RECORDING_Q = L"IDS_CAM_BODY_CANCEL_RECORDING_Q";
const wchar_t* IDS_COM_SK_OK = L"IDS_COM_SK_OK";
const wchar_t* IDS_COM_POP_CANCEL = L"IDS_COM_POP_CANCEL";
+const wchar_t* IDS_HELP_GOTO_GALLERY = L"IDS_HELP_GOTO_GALLERY";
+const wchar_t* IDS_HELP_SWITCH_CAMERA = L"IDS_HELP_SWITCH_CAMERA";
+const wchar_t* IDS_HELP_QUICK_SETTINGT = L"IDS_HELP_QUICK_SETTINGT";
+const wchar_t* IDS_HELP_CAPTURE_IMAGE = L"IDS_HELP_CAPTURE_IMAGE";
+const wchar_t* IDS_HELP_RECORD_VIDEO = L"IDS_HELP_RECORD_VIDEO";
+const wchar_t* IDS_HELP_RECORDER = L"IDS_HELP_RECORDER";
+const wchar_t* IDS_HELP_SHUTTER = L"IDS_HELP_SHUTTER";
+const wchar_t* IDS_HELP_GOTO_PREVIOUS_SCREEN = L"IDS_HELP_GOTO_PREVIOUS_SCREEN";
\ No newline at end of file