/**@brief SCL Notification to ISEs */
typedef enum _SCLUINotiType {
- SCL_UINOTITYPE_POPUP_OPEN,
- SCL_UINOTITYPE_POPUP_CLOSE,
- SCL_UINOTITYPE_POPUP_CLOSE_TIMEOUT, // The layout of popup window will be passed as etc_info data
+ SCL_UINOTITYPE_POPUP_OPENING,
+ SCL_UINOTITYPE_POPUP_OPENED,
+ SCL_UINOTITYPE_POPUP_CLOSING,
+ SCL_UINOTITYPE_POPUP_CLOSED,
SCL_UINOTITYPE_GESTURE_FLICK,
SCL_UINOTITYPE_SHIFT_STATE_CHANGE,
SCL_UINOTITYPE_INPUT_MODE_CHANGE,
SclUIEventDesc *ui_event_desc;
};
-struct SclNotiPopupOpenDesc : SclNotiDesc {
+struct SclNotiPopupOpeningDesc : SclNotiDesc {
const char *input_mode;
-}; // SCL_UINOTITYPE_POPUP_OPEN
+}; // SCL_UINOTITYPE_POPUP_OPENING
-struct SclNotiPopupCloseDesc : SclNotiDesc {
+struct SclNotiPopupOpenedDesc : SclNotiDesc {
+ sclwindow window;
const char *input_mode;
-}; // SCL_UINOTITYPE_POPUP_CLOSE
+}; // SCL_UINOTITYPE_POPUP_OPENED
-struct SclNotiPopupCloseTimeoutDesc : SclNotiDesc {
+struct SclNotiPopupClosingDesc : SclNotiDesc {
+ sclwindow window;
const char *input_mode;
-}; // SCL_UINOTITYPE_POPUP_CLOSE_TIMEOUT
+ sclboolean timed_out;
+}; // SCL_UINOTITYPE_POPUP_CLOSING
+
+struct SclNotiPopupClosedDesc : SclNotiDesc {
+ sclwindow window;
+ const char *input_mode;
+ sclboolean timed_out;
+}; // SCL_UINOTITYPE_POPUP_CLOSED
struct SclNotiGestureFlickDesc : SclNotiDesc {
SCLDragType drag_type;
const sclchar* get_input_mode();
/**
+ * @brief This API request SCL library to change the given popup window's input mode
+ * @param[in] window the handle for the popup window that we want to change the input mode
+ * @param[in] input_mode the name of the desired input mode
+ * @return non-zero value is returned when successful
+ */
+ sclboolean set_popup_input_mode(sclwindow window, const sclchar *input_mode);
+
+ /**
+ * @brief This API retrieves the current input mode
+ * @param[in] window the handle for the popup window that we want to retrieve the input mode
+ * @return a string pointer that indicates the name of current input mode
+ */
+ const sclchar* get_popup_input_mode(sclwindow window);
+
+ /**
* @brief This API request SCL library to suspend screen updates
* @param[in] pend whether to suspend screen updates
*/
sclboolean set_input_mode(const sclchar *input_mode);
const sclchar* get_input_mode();
+ sclboolean set_popup_input_mode(sclwindow window, const sclchar *input_mode);
+ const sclchar* get_popup_input_mode(sclwindow window);
void set_update_pending(sclboolean pend);
}
switch (coordinate->popup_type) {
case POPUP_TYPE_BTN_PRESS_POPUP_DRAG: {
- SclNotiPopupOpenDesc desc;
+ SclNotiPopupOpeningDesc desc;
desc.ui_event_desc = &key_event_desc;
desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
- if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPEN, &desc)) {
+ if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
sclint popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
SCLDisplayMode display_mode = context->get_display_mode();
/* FIXME */
SclWindowOpener opener;
opener.window = window;
opener.key = key_index;
- windows->open_popup(opener,
+
+ sclwindow popup_window = windows->open_popup(opener,
popupRect,
popup_input_mode,
popupLayoutId,
sclres_input_mode_configure[popup_input_mode].timeout
);
+ SclNotiPopupOpenedDesc opened_desc;
+ opened_desc.ui_event_desc = &key_event_desc;
+ opened_desc.input_mode = desc.input_mode;
+ opened_desc.window = popup_window;
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
windows->hide_window(windows->get_magnifier_window());
/* FIXME : The parent key should be turned back to NORMAL state when RELEASED,
in case of POPUP_TYPE_BTN_PRESS_POPUP_DRAG type. Temporariliy setting NORMAL here. */
popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
- SclNotiPopupOpenDesc desc;
+ SclNotiPopupOpeningDesc desc;
desc.ui_event_desc = &key_event_desc;
desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
- if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPEN, &desc)) {
+ if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
sclint popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
SCLDisplayMode display_mode = context->get_display_mode();
/* FIXME */
SclWindowOpener opener;
opener.window = window;
opener.key = key_index;
- windows->open_popup(
+
+ sclwindow popup_window = windows->open_popup(
opener,
popupRect,
popup_input_mode,
sclres_input_mode_configure[popup_input_mode].timeout
);
+ SclNotiPopupOpenedDesc opened_desc;
+ opened_desc.ui_event_desc = &key_event_desc;
+ opened_desc.input_mode = desc.input_mode;
+ opened_desc.window = popup_window;
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
windows->hide_window(windows->get_magnifier_window());
_play_tts_for_input_mode_name(popup_input_mode);
ret = TRUE;
SCLDragState dragstate = context->get_cur_drag_state(touch_id);
sclint popup_input_mode = NOT_USED;
- SclNotiPopupOpenDesc desc;
+ SclNotiPopupOpeningDesc desc;
desc.ui_event_desc = &key_event_desc;
if (scl_check_arrindex(dragstate, SCL_DRAG_STATE_MAX)) {
desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
}
}
- if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPEN, &desc)) {
+ if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
SCLDisplayMode display_mode = context->get_display_mode();
/* FIXME */
SclWindowOpener opener;
opener.window = window;
opener.key = key_index;
- windows->open_popup(
+
+ sclwindow popup_window = windows->open_popup(
opener,
popupRect,
popup_input_mode,
sclres_input_mode_configure[popup_input_mode].timeout
);
+ SclNotiPopupOpenedDesc opened_desc;
+ opened_desc.ui_event_desc = &key_event_desc;
+ opened_desc.input_mode = desc.input_mode;
+ opened_desc.window = popup_window;
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
windows->hide_window(windows->get_magnifier_window());
_play_tts_for_input_mode_name(popup_input_mode);
}
sclwindow popup_window = SCLWINDOW_INVALID;
- SclNotiPopupOpenDesc desc;
+ SclNotiPopupOpeningDesc desc;
desc.ui_event_desc = NULL;
desc.input_mode = SCL_LAYOUT_AUTOPOPUP_NAME;
if (SCL_EVENT_PASS_ON ==
- handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPEN, &desc)) {
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
/* Currently, window does not support virtual window */
SclWindowOpener opener;
opener.window = window;
opener.key = keyIndex;
+
popup_window = windows->open_popup(
opener,
rect,
FALSE,
FALSE
);
+
+ SclNotiPopupOpenedDesc opened_desc;
+ opened_desc.ui_event_desc = NULL;
+ opened_desc.input_mode = desc.input_mode;
+ opened_desc.window = popup_window;
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
}
windows->hide_window(windows->get_magnifier_window());
}
break;
case SCL_TIMER_POPUP_TIMEOUT: {
- SclNotiPopupCloseTimeoutDesc desc;
+ SclNotiPopupClosingDesc desc;
desc.ui_event_desc = NULL;
desc.input_mode = NULL;
+ desc.timed_out = TRUE;
+
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
if (windows && sclres_manager) {
}
}
- if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_CLOSE_TIMEOUT, &desc)) {
+ if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_CLOSING, &desc)) {
windows->close_all_popups();
+
+ SclNotiPopupClosedDesc closed_desc;
+ closed_desc.ui_event_desc = desc.ui_event_desc;
+ closed_desc.input_mode = desc.input_mode;
+ closed_desc.timed_out = desc.timed_out;
+ handler->on_event_notification(SCL_UINOTITYPE_POPUP_CLOSED, &desc);
}
events->destroy_timer(id);
return FALSE;
}
/**
+ * Returns the current input mode
+ */
+const sclchar*
+CSCLUI::get_input_mode()
+{
+ const sclchar *ret = NULL;
+
+ if (m_impl) {
+ ret = m_impl->get_input_mode();
+ }
+
+ return ret;
+}
+
+/**
+ * Sets the given popup window's input mode to the given mode
+ * @Usage
+ * gCore->set_input_mode("INPUT_MODE_SYMBOL");
+ */
+sclboolean
+CSCLUI::set_popup_input_mode(sclwindow window, const sclchar *input_mode)
+{
+ sclboolean ret = FALSE;
+
+ if (m_impl) {
+ ret = m_impl->set_popup_input_mode(window, input_mode);
+ }
+
+ return ret;
+}
+
+/**
+ * Returns the given popup window's input mode
+ */
+const sclchar*
+CSCLUI::get_popup_input_mode(sclwindow window)
+{
+ const sclchar *ret = NULL;
+
+ if (m_impl) {
+ ret = m_impl->get_popup_input_mode(window);
+ }
+
+ return ret;
+}
+
+
+/**
* Sets the current rotation
*/
sclboolean
}
/**
- * Returns the current input mode
- */
-const sclchar*
-CSCLUI::get_input_mode()
-{
- const sclchar *ret = NULL;
-
- if (m_impl) {
- ret = m_impl->get_input_mode();
- }
-
- return ret;
-}
-
-
-
-/**
* Sets a private key to the current context
* The other properties except given parameters will keep to the orginal value.
* @Usage
}
/**
+ * Returns the current input mode
+ */
+const sclchar*
+CSCLUIImpl::get_input_mode()
+{
+ SCL_DEBUG();
+
+ const sclchar *ret = NULL;
+ if (m_initialized) {
+ CSCLContext *context = CSCLContext::get_instance();
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ if (context && sclres_manager) {
+ scl8 inputmode_id = context->get_input_mode();
+ ret = sclres_manager->get_inputmode_name(inputmode_id);
+ }
+ }
+ return ret;
+}
+
+
+/**
+ * Sets the given popup window's input mode to the given mode
+ * @Usage
+ * gCore->set_input_mode("INPUT_MODE_SYMBOL");
+ */
+sclboolean
+CSCLUIImpl::set_popup_input_mode(sclwindow window, const sclchar *input_mode)
+{
+ SCL_DEBUG();
+ SCL_DEBUG_ELAPASED_TIME_START();
+
+ sclboolean ret = FALSE;
+
+ if (m_initialized) {
+ CSCLWindows *windows = CSCLWindows::get_instance();
+ CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+ CSCLContext *context = CSCLContext::get_instance();
+
+ scl8 mode = NOT_USED;
+ sclshort layout = NOT_USED;
+ SclWindowContext *winctx = NULL;
+
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ if (sclres_manager && windows && context) {
+ SCLDisplayMode display_mode = context->get_display_mode();
+ PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
+ mode = sclres_manager->get_inputmode_id(input_mode);
+ winctx = windows->get_window_context(window);
+ if (sclres_input_mode_configure &&
+ scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) &&
+ scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+ layout = sclres_manager->get_layout_id(sclres_input_mode_configure[mode].layouts[display_mode]);
+ }
+ }
+
+ if (cache && windows && winctx) {
+ if (mode != NOT_USED && mode != winctx->inputmode && layout != NOT_USED) {
+ winctx->inputmode = mode;
+ winctx->layout = layout;
+ cache->recompute_layout(window);
+ windows->update_window(window);
+ ret = TRUE;
+ }
+ }
+ }
+
+ SCL_DEBUG_ELAPASED_TIME_END();
+ return ret;
+}
+
+/**
+ * Returns the given window's input mode
+ */
+const sclchar*
+CSCLUIImpl::get_popup_input_mode(sclwindow window)
+{
+ SCL_DEBUG();
+
+ const sclchar *ret = NULL;
+
+ if (m_initialized) {
+ CSCLWindows *windows = CSCLWindows::get_instance();
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ if (windows && sclres_manager) {
+ SclWindowContext *winctx = windows->get_window_context(window);
+ if (winctx) {
+ if (scl_check_arrindex(winctx->inputmode, MAX_SCL_INPUT_MODE)) {
+ ret = sclres_manager->get_inputmode_name(winctx->inputmode);
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+/**
* Sets the current rotation
*/
sclboolean
}
/**
- * Returns the current input mode
- */
-const sclchar*
-CSCLUIImpl::get_input_mode()
-{
- SCL_DEBUG();
-
- const sclchar *ret = NULL;
- if (m_initialized) {
- CSCLContext *context = CSCLContext::get_instance();
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- if (context && sclres_manager) {
- scl8 inputmode_id = context->get_input_mode();
- ret = sclres_manager->get_inputmode_name(inputmode_id);
- }
- }
- return ret;
-}
-
-
-
-/**
* Sets a private key to the current context
* The other properties except given parameters will keep to the orginal value.
* @Usage
}
}
- sclwindow window = create_window(opener, geometry, inputmode, layout, popup_type, is_virtual, img_offset_x, img_offset_y, timeout);
+ window = create_window(opener, geometry, inputmode, layout, popup_type, is_virtual, img_offset_x, img_offset_y, timeout);
events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
if (timeout > 0) {
events->create_timer(SCL_TIMER_POPUP_TIMEOUT, timeout, layout);