Change-Id: I6b6634aaa49f5034335dc4e531cd05967df3bf60
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
class ImageViewerApp
: public Tizen::App::UiApp
, public Tizen::App::IAppControlProviderEventListener
class ImageViewerApp
: public Tizen::App::UiApp
, public Tizen::App::IAppControlProviderEventListener
+ , public Tizen::System::IDeviceEventListener
, public Tizen::System::ISettingEventListener
{
public:
, public Tizen::System::ISettingEventListener
{
public:
const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
const Tizen::Base::Collection::IMap* pExtraData);
const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
const Tizen::Base::Collection::IMap* pExtraData);
+ virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+
virtual void OnSettingChanged(Tizen::Base::String& key);
void SetFrameEnabled(bool enabled);
virtual void OnSettingChanged(Tizen::Base::String& key);
void SetFrameEnabled(bool enabled);
extern const wchar_t* ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE;
extern const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE;
extern const wchar_t* ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE;
extern const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE;
+extern const wchar_t* DEVICE_STORAGE_CARD_MOUNTED;
+extern const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED;
+
#endif /* _IV_TYPES_H_ */
#endif /* _IV_TYPES_H_ */
pMainFrame->Construct();
AddFrame(*pMainFrame);
pMainFrame->Construct();
AddFrame(*pMainFrame);
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
SettingInfo::AddSettingEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
SettingInfo::AddSettingEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+ImageViewerApp::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
+{
+ AppLogDebug("ENTER");
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD
+ && (state == DEVICE_STORAGE_CARD_MOUNTED || state == DEVICE_STORAGE_CARD_UNMOUNTED))
+ {
+ UiApp::GetInstance()->Terminate();
+ }
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+void
ImageViewerApp::OnSettingChanged(String& key)
{
AppLogDebug("ENTER");
ImageViewerApp::OnSettingChanged(String& key)
{
AppLogDebug("ENTER");
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_MUSIC = L"MUSIC_VALUE";
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE = L"REPEAT_VALUE";
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE = L"SHUFFLE_VALUE";
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_MUSIC = L"MUSIC_VALUE";
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE = L"REPEAT_VALUE";
const wchar_t* ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE = L"SHUFFLE_VALUE";
+
+const wchar_t* DEVICE_STORAGE_CARD_MOUNTED = L"Mounted";
+const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED = L"Unmounted";