*/
virtual void on_destroy();
+ /**
+ * @brief Low Memory Event
+ *
+ * @note This event function is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the Tizen
+ * platform Low Memory Killer kills your application to get more free memory. This event function must also release any cached data in the main
+ * memory to secure more free memory.
+ */
+ virtual void on_low_memory();
+
+ /**
+ * @brief Low Battery Event
+ *
+ * @note This event function is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the power goes
+ * off completely. This event function must also stop heavy CPU consumption or power consumption activities to save the remaining power.
+ */
+ virtual void on_low_battery();
+
+ /**
+ * @brief Region Changed Event
+ *
+ * @note This event function is responsible for refreshing the display into the new time zone.
+ */
+ virtual void on_region_changed(const char *region);
+
+ /**
+ * @brief Language Changed Event
+ *
+ * @note This event function is responsible for refreshing the display into the new language.
+ */
+ virtual void on_language_changed(const char *language);
+
private:
/**
* @brief Connect with given viewmgr.
_UI_DECLARE_PRIVATE_IMPL(ui_iface_view);
_UI_DISABLE_COPY_AND_ASSIGN(ui_iface_view);
_UI_DECLARE_FRIENDS(ui_iface_viewmgr);
+ _UI_DECLARE_FRIENDS(ui_iface_app);
};
}
void on_resume();
void on_control(app_control_h app_control);
- //
void on_low_battery(app_event_info_h event_info);
void on_low_memory(app_event_info_h event_info);
void on_region_changed(app_event_info_h event_info);
void ui_iface_app::on_lang_changed(app_event_info_h event_info)
{
- char *locale = NULL;
- system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
- elm_language_set(locale);
- free(locale);
+ char *language = NULL;
+ int ret = app_event_get_language(event_info, &language);
+ if (ret != APP_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
+ return;
+ }
+
+ if (language != NULL) {
+ elm_language_set(language);
+ ui_iface_view *view = this->impl->viewmgr->get_last_view();
+ view->on_language_changed(language);
+ free(language);
+ }
}
void ui_iface_app::on_low_memory(app_event_info_h event_info)
{
-
+ ui_iface_view *view = this->impl->viewmgr->get_last_view();
+ view->on_low_memory();
}
void ui_iface_app::on_low_battery(app_event_info_h event_info)
{
-
+ ui_iface_view *view = this->impl->viewmgr->get_last_view();
+ view->on_low_battery();
}
void ui_iface_app::on_region_changed(app_event_info_h event_info)
{
+ char *region = NULL;
+ int ret = app_event_get_region_format(event_info, ®ion);
+ if (ret != APP_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "model_app_event_get_region_format() failed. Err = %d", ret);
+ return;
+ }
+ ui_iface_view *view = this->impl->viewmgr->get_last_view();
+ view->on_region_changed(region);
}
void ui_iface_app::on_orient_changed(app_event_info_h event_info)
{
-
}
bool ui_iface_app::on_create()