#include <string>
#include <assert.h>
#include <algorithm>
-
#define LOG_TAG "ISE_DEFAULT"
#include <dlog.h>
-
+#include <inputmethod_internal.h>
using namespace std;
#define CANDIDATE_EDJ_FILE_PATH RESDIR"/edje/candidate-multiline.edj"
#endif
static bool _item_click = true;
+
extern CONFIG_VALUES g_config_values;
+extern CSCLUI *g_ui;
static void
_mouse_down(void *data, Evas *e,
void
EflMultiLineCandidate::item_pressed(Evas_Object *item)
{
+#ifdef _TV
+ m_candidates_item.clear();
+ g_ui->enable_highlight_ui(TRUE);
+ m_highlight_mode = false;
+#endif
+
const char *str = edje_object_part_text_get(
item, "candidate");
evas_object_show(m_candidateMoreScrollerBg);
evas_object_show(m_candidateMoreScroller);
evas_object_show(m_candidateMoreTable);
-
MultiEventDesc desc;
desc.type = MultiEventDesc::CANDIDATE_MORE_VIEW_SHOW;
m_candidateFontSize = 37*m_screenRatio;
m_stringWidthCalObj = evas_object_text_add(m_window);
evas_object_text_font_set(m_stringWidthCalObj, m_candidateFontName.c_str(), m_candidateFontSize);
+#ifdef _TV
+ m_focused_candidate_index = 0;
+ m_highlight_mode = false;
+#endif
}
EflMultiLineCandidate::~EflMultiLineCandidate()
EflMultiLineCandidate::update(const vector<string> &vec_str)
{
cur_candidates = vec_str;
+#ifdef _TV
+ m_focused_candidate_index = 0;
+ m_candidates_item.clear();
+#endif
hide_more_view();
evas_object_hide(m_candidateMoreBtn);
evas_object_hide(m_candidateCloseBtn);
elm_table_pack(m_candidateTable, item, cur_item_sum, y_start,
item_text_size.width, item_text_size.height);
cur_item_sum += item_text_size.width;
+#ifdef _TV
+ m_candidates_item.push_back(item);
+#endif
} else if (!multiline) {
multiline = true;
cur_item_sum = 0;
y_start = (CANDIDATE_WINDOW_HEIGHT*m_screenRatio - item_text_size.height)/2;
elm_table_pack(m_candidateTable, item, cur_item_sum, y_start,
item_text_size.width, item_text_size.height);
+#ifdef _TV
+ m_candidates_item.push_back(item);
+#endif
continue;
}
}
elm_table_pack(m_candidateMoreTable, item, cur_item_sum, lineCount*CANDIDATE_WINDOW_HEIGHT*m_screenRatio+y_start,
item_text_size.width, item_text_size.height);
cur_item_sum += item_text_size.width;
+#ifdef _TV
+ m_candidates_item.push_back(item);
+#endif
}
}
{
return m_floating_mode;
}
+
+#ifdef _TV
+sclu32 EflMultiLineCandidate::soft_candidate_handle_key_event(const char *keyname)
+{
+ int count = (cur_candidates.size() > 20 ? 20 : cur_candidates.size());//for fixing lagging issue of glm temporarily
+ int index = 0;
+ if (strcmp(keyname, "Right") == 0) {
+ if (m_highlight_mode) {
+ index = (m_focused_candidate_index + 1) %count;
+ Evas_Object *item = m_candidates_item[m_focused_candidate_index];
+ edje_object_signal_emit(item, "unhighlight", "bg");
+ item = m_candidates_item[index];
+ edje_object_signal_emit(item, "highlight", "bg");
+ m_focused_candidate_index = index;
+ return true;
+ } else {
+ return false;
+ }
+ } else if (strcmp(keyname, "Left") == 0) {
+ if (m_highlight_mode) {
+ index = (m_focused_candidate_index + count - 1) % count;
+ Evas_Object *item = m_candidates_item[m_focused_candidate_index];
+ edje_object_signal_emit(item, "unhighlight", "bg");
+ item = m_candidates_item[index];
+ edje_object_signal_emit(item, "highlight", "bg");
+ m_focused_candidate_index = index;
+ return true;
+ } else {
+ return false;
+ }
+ } else if (strcmp(keyname, "Up") == 0) {
+ int item_num = m_candidates_item.size();
+ if (item_num > 0) {
+ more_btn_clicked();
+ g_ui->enable_highlight_ui(FALSE);
+ Evas_Object *item = m_candidates_item[m_focused_candidate_index];
+ edje_object_signal_emit(item, "highlight", "bg");
+ m_highlight_mode = true;
+ }
+ return true;
+ } else if (strcmp(keyname, "Down") == 0) {
+ if (m_highlight_mode) {
+ int item_num = m_candidates_item.size();
+ if (item_num > 0) {
+ Evas_Object *item = m_candidates_item[m_focused_candidate_index];
+ edje_object_signal_emit(item, "unhighlight", "bg");
+ close_btn_clicked();
+ g_ui->enable_highlight_ui(TRUE);
+ m_highlight_mode = false;
+ return TRUE;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ } else if ((strcmp(keyname, "Return") == 0) || (strcmp(keyname, "Enter") == 0)) {
+ if (m_highlight_mode) {
+ ime_select_candidate(m_focused_candidate_index);
+ m_candidates_item.clear();
+ g_ui->enable_highlight_ui(TRUE);
+ m_highlight_mode = false;
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
+#endif