2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <app_preference.h>
18 #include <Elementary.h>
23 #include <vconf-keys.h>
26 #include "w-input-selector.h"
28 #define RECENT_EMOJI_LIST "recent_emoji_list"
30 #define EMOTICON_CNT 180
33 extern App_Data* app_data;
35 static int is_content_reuse_on = 0;
40 vector <int> recent_emoji_list;
47 static Elm_Object_Item *it_emoticon_empty = NULL;
48 static Elm_Object_Item *it_emoticon_recent_group = NULL;
49 static Elm_Object_Item *it_emoticon_emoji_group = NULL;
50 static Elm_Object_Item *it_last = NULL;
52 static Elm_Genlist_Item_Class *itc_emoticon = NULL;
54 #define INITAL_ITEM_UNIT 24
55 #define LOADING_ITEM_UNIT 27
56 static int loading_done_for_item = 0;
57 Ecore_Timer *lazy_loading_timer_for_items = NULL;
59 #define INITAL_CONTENT_UNIT 51
60 #define LOADING_CONTENT_UNIT 9
61 static int loading_done_for_contents = 0;
62 Ecore_Timer *lazy_loading_timer_for_contents = NULL;
65 typedef struct emoticon_content
72 static emoticon_content_s emoticon_contents_pool[EMOTICON_CNT] = { 0, };
73 static emoticon_content_s emoticon_recents_pool[RECENT_CNT] = { 0, };
76 Emoticon emoticon_info[EMOTICON_CNT] = {
260 static Eina_Bool _custom_back_cb(void *data, Elm_Object_Item *it)
262 _back_to_genlist_for_selector();
267 //---------------------------------------------------------------------------------------//
269 static Eina_Bool _custom_back_cb2(void *data, Elm_Object_Item *it)
271 PRINTFUNC(DLOG_DEBUG, "");
273 if (is_content_reuse_on) {
276 if (lazy_loading_timer_for_items != NULL) {
277 ecore_timer_del(lazy_loading_timer_for_items);
278 lazy_loading_timer_for_items = NULL;
281 if (lazy_loading_timer_for_contents != NULL) {
282 ecore_timer_del(lazy_loading_timer_for_contents);
283 lazy_loading_timer_for_contents = NULL;
286 //Recent EMOTICONS : the recent emoiton need to be updated whenever emoticon view is generated, so deleted here.
287 for (i=0;i< RECENT_CNT;i++)
289 if (emoticon_recents_pool[i].used == 0 && emoticon_recents_pool[i].content) {
290 evas_object_del(emoticon_recents_pool[i].content);
292 emoticon_recents_pool[i].content = NULL;
296 _back_to_genlist_for_selector();
301 void get_recent_emoticons(vector <int> &emoticon_list)
303 int ret = PREFERENCE_ERROR_NONE;
306 ret = preference_get_string(RECENT_EMOJI_LIST, &str);
307 if (PREFERENCE_ERROR_NONE != ret) {
308 PRINTFUNC(DLOG_ERROR, "preference_get_string error!(%d)", ret);
311 emoticon_list.clear();
313 PRINTFUNC(DLOG_DEBUG, "str = %s", str);
317 tok = strtok(str, ",");
318 while (tok != NULL) {
319 PRINTFUNC(DLOG_DEBUG, "tok = %s", tok);
320 emoticon_list.push_back(strtol(tok, (char **)NULL, 10));
321 tok = strtok(NULL, ",");
331 void set_recent_emoticons(vector <int> &emoticon_list, int val)
334 int ret = PREFERENCE_ERROR_NONE;
336 if (emoticon_list.size() > 0) {
337 for (i = 0; i < emoticon_list.size(); i++) {
338 PRINTFUNC(DLOG_DEBUG, "%d == %d", emoticon_list.at(i), val);
340 if (emoticon_list.at(i) == val) {
341 emoticon_list.erase(emoticon_list.begin()+i);
346 if (emoticon_list.size() >= RECENT_CNT) {
347 emoticon_list.erase(emoticon_list.end());
351 emoticon_list.insert(emoticon_list.begin(), val);
354 char str[10] = {0, };
356 for (i = 0; i < emoticon_list.size(); i++) {
357 snprintf(str, sizeof(str), "%d", emoticon_list.at(i));
359 if (i+1 != emoticon_list.size())
363 PRINTFUNC(DLOG_DEBUG, "%s", stored.c_str());
365 ret = preference_set_string(RECENT_EMOJI_LIST, stored.c_str());
366 if (PREFERENCE_ERROR_NONE != ret) {
367 PRINTFUNC(DLOG_ERROR, "preference_set_string error!(%d)", ret);
371 static void _emoticon_item_clicked_cb(void *data, Evas_Object * obj, void *event_info)
373 int index = (int)data;
375 PRINTFUNC(DLOG_DEBUG, "index = %d", index);
377 // store in recents list
378 set_recent_emoticons(recent_emoji_list, index);
381 const Eina_Unicode unicode_event[2] = { emoticon_info[index].code, 0 };
382 char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
384 reply_to_sender_by_callback((const char*)utf_8, "emoticon");
386 PRINTFUNC(SECURE_DEBUG, "[%d]%s", index, utf_8);
393 Evas_Object* get_emoticon_button(Evas_Object* parent, int index){
397 Evas_Object* btn = elm_button_add(parent);
398 elm_object_style_set(btn, "emoticon");
399 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
400 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
403 const Eina_Unicode unicode_event[2] = { emoticon_info[index].code, 0 };
404 char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
405 elm_object_part_text_set(btn, "elm.text", utf_8);
410 evas_object_layer_set(btn, 32000);
412 evas_object_smart_callback_add(btn, "clicked", _emoticon_item_clicked_cb, (void *)index);
417 Evas_Object* get_recent_emoticon_button(Evas_Object* parent, int index){
421 Evas_Object* btn = elm_button_add(parent);
422 elm_object_style_set(btn, "emoticon");
423 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
424 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
427 const Eina_Unicode unicode_event[2] = { emoticon_info[recent_emoji_list.at(index)].code, 0 };
428 char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
429 elm_object_part_text_set(btn, "elm.text", utf_8);
431 evas_object_data_set(btn, "index", (void*) recent_emoji_list.at(index));
436 evas_object_layer_set(btn, 32000);
437 evas_object_smart_callback_add(btn, "clicked", _emoticon_item_clicked_cb, (void*) recent_emoji_list.at(index));
442 static void _emoticon_gl_lang_changed(void *data, Evas_Object *obj, void *event_info)
444 elm_genlist_realized_items_update(obj);
447 static char * __emoticon_gl_text_get(void *data, Evas_Object *obj, const char *part)
449 //PRINTFUNC(DLOG_DEBUG,"part = %s", part);
451 const char* str = (const char*) data;
455 if (!strcmp(part, "elm.text")) {
456 //PRINTFUNC(DLOG_DEBUG,"str = %s", str);
457 return strdup(gettext(str));
462 static void _emoticon_gl_content_unswallowed_cb(void *data, Evas_Object *obj, void *event_info)
464 Elm_Object_Item *it = (Elm_Object_Item *)event_info;
466 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(it);
468 // PRINTFUNC(DLOG_DEBUG,"%s - stype[%s]", __func__, itc->item_style);
469 if (!strcmp(itc->item_style, "3button_flat")) {
470 int index = (int)elm_object_item_data_get(it);
471 //PRINTFUNC(DLOG_DEBUG,"it = %p", it);
472 PRINTFUNC(DLOG_DEBUG, "index = %d %d %d", index, index+1, index+2);
474 if (index < EMOTICON_CNT) {
475 emoticon_contents_pool[index].used = 0;
477 if (index + 1 < EMOTICON_CNT) {
478 emoticon_contents_pool[index+1].used = 0;
480 if (index + 2 < EMOTICON_CNT) {
481 emoticon_contents_pool[index+2].used = 0;
483 } else if (!strcmp(itc->item_style, "3button_flat_recent")) {
484 int index = (int)elm_object_item_data_get(it);
485 //PRINTFUNC(DLOG_DEBUG,"index = %d",index);
487 if (index < recent_emoji_list.size()) {
488 emoticon_recents_pool[index].used = 0;
490 if (index + 1 < recent_emoji_list.size()) {
491 emoticon_recents_pool[index+1].used = 0;
493 if (index + 2 < recent_emoji_list.size()) {
494 emoticon_recents_pool[index+2].used = 0;
499 static Evas_Object * __emoticon_gl_recent_content_get(void *data, Evas_Object *obj, const char *part)
501 if (is_content_reuse_on) {
502 int index = (int)data;
505 //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
506 if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
507 if (!strcmp(part, "elm.icon.1")) {
508 if (index >= recent_emoji_list.size()) return NULL;
510 } else if (!strcmp(part, "elm.icon.2")) {
511 if (index + 1 >= recent_emoji_list.size()) return NULL;
512 new_index = index + 1;
513 } else if (!strcmp(part, "elm.icon.3")) {
514 if (index + 2 >= recent_emoji_list.size()) return NULL;
515 new_index = index + 2;
518 Evas_Object* btn = NULL;
519 btn = (Evas_Object*)emoticon_recents_pool[new_index].content;
520 emoticon_recents_pool[new_index].used = 1;
522 } else if (!strcmp(part, "base")) {
523 Evas_Object* btn = elm_button_add(obj);
524 elm_object_style_set(btn, "ime/transparent");
528 int index = (int)data;
531 // PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
532 if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
533 if (!strcmp(part, "elm.icon.1")) {
534 if (index >= recent_emoji_list.size()) return NULL;
536 } else if (!strcmp(part, "elm.icon.2")) {
537 if (index + 1 >= recent_emoji_list.size()) return NULL;
538 new_index = index + 1;
539 } else if (!strcmp(part, "elm.icon.3")) {
540 if (index + 2 >= recent_emoji_list.size()) return NULL;
541 new_index = index + 2;
543 return get_recent_emoticon_button(obj, new_index);
544 } else if (!strcmp(part, "base")) {
545 Evas_Object* btn = elm_button_add(obj);
546 elm_object_style_set(btn, "ime/transparent");
553 static Evas_Object * __emoticon_gl_emoticon_content_get(void *data, Evas_Object *obj, const char *part)
555 //PRINTFUNC(DLOG_DEBUG,"%s", __func__);
557 if (is_content_reuse_on) {
558 int index = (int)data;
561 if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
562 if (!strcmp(part, "elm.icon.1")) {
563 if (index >= EMOTICON_CNT) return NULL;
565 } else if (!strcmp(part, "elm.icon.2")) {
566 if (index + 1 >= EMOTICON_CNT) return NULL;
567 new_index = index + 1;
568 } else if (!strcmp(part, "elm.icon.3")) {
569 if (index + 2 >= EMOTICON_CNT) return NULL;
570 new_index = index + 2;
573 Evas_Object* btn = NULL;
574 btn = (Evas_Object*)emoticon_contents_pool[new_index].content;
575 emoticon_contents_pool[new_index].used = 1;
577 char utf_8[10] = {0, };
578 snprintf(utf_8, sizeof(utf_8), "%d", new_index);
579 elm_object_part_text_set(btn, "elm.text", strdup(utf_8));
582 const Eina_Unicode unicode_event[2] = { emoticon_info[new_index].code, 0 };
583 char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
584 elm_object_part_text_set(btn, "elm.text", utf_8);
585 evas_object_data_set(btn, "index", (void*)new_index);
592 } else if (!strcmp(part, "base")) {
593 Evas_Object* btn = elm_button_add(obj);
594 elm_object_style_set(btn, "ime/transparent");
598 int index = (int)data;
601 if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
602 if (!strcmp(part, "elm.icon.1")) {
603 if (index >= EMOTICON_CNT) return NULL;
605 } else if (!strcmp(part, "elm.icon.2")) {
606 if (index + 1 >= EMOTICON_CNT) return NULL;
607 new_index = index + 1;
608 } else if (!strcmp(part, "elm.icon.3")) {
609 if (index + 2 >= EMOTICON_CNT) return NULL;
610 new_index = index + 2;
612 return get_emoticon_button(obj, new_index);
613 } else if (!strcmp(part, "base")) {
614 Evas_Object* btn = elm_button_add(obj);
615 elm_object_style_set(btn, "ime/transparent");
623 void _create_reusable_recents(Evas_Object *parent)
626 PRINTFUNC(DLOG_ERROR, "parent is null");
631 for (i = 0; i < recent_emoji_list.size(); i++ ) {
632 emoticon_recents_pool[i].index = i;
633 emoticon_recents_pool[i].content = get_recent_emoticon_button(parent, i);
634 emoticon_recents_pool[i].used = 0;
638 static Eina_Bool _lazy_loader_cb_for_contents(void *data)
640 Evas_Object *gl = (Evas_Object *)data;
642 PRINTFUNC(DLOG_ERROR, "gl is null");
643 lazy_loading_timer_for_contents = NULL;
644 return ECORE_CALLBACK_CANCEL;
647 if (loading_done_for_contents == EMOTICON_CNT) {
648 PRINTFUNC(DLOG_DEBUG, "lazy loading contents done");
649 lazy_loading_timer_for_contents = NULL;
650 return ECORE_CALLBACK_CANCEL;
654 if (loading_done_for_contents + LOADING_CONTENT_UNIT > EMOTICON_CNT) {
655 loading_top = EMOTICON_CNT;
657 loading_top = loading_done_for_contents + LOADING_CONTENT_UNIT;
660 PRINTFUNC(DLOG_DEBUG, "_lazy_loader_cb_for_contents loading_done = %d", loading_done_for_contents);
663 for (i = loading_done_for_contents; i < loading_top; i++) {
664 emoticon_contents_pool[i].index = i;
665 emoticon_contents_pool[i].used = 0;
667 if (emoticon_contents_pool[i].content == NULL) { // reusable
668 emoticon_contents_pool[i].content = get_emoticon_button(gl, i);
672 loading_done_for_contents = loading_top;
674 return ECORE_CALLBACK_RENEW;
677 void create_reusable_button(Evas_Object *parent)
680 PRINTFUNC(DLOG_ERROR, "parent is null");
683 loading_done_for_contents = INITAL_CONTENT_UNIT;
686 for (i = 0; i < INITAL_CONTENT_UNIT; i++ ) {
687 emoticon_contents_pool[i].index = i;
688 emoticon_contents_pool[i].used = 0;
690 if (emoticon_contents_pool[i].content == NULL) { // reusable
691 emoticon_contents_pool[i].content = get_emoticon_button(parent, i);
695 lazy_loading_timer_for_contents = ecore_timer_add(0.25, _lazy_loader_cb_for_contents, (void *)parent);
698 static Eina_Bool _lazy_loader_cb_for_items(void *data)
700 Evas_Object *gl = (Evas_Object *)data;
702 PRINTFUNC(DLOG_ERROR, "gl is null");
703 lazy_loading_timer_for_items = NULL;
704 return ECORE_CALLBACK_CANCEL;
707 if (loading_done_for_item == EMOTICON_CNT) {
708 PRINTFUNC(DLOG_DEBUG, "lazy loading item done");
709 //elm_genlist_realized_items_update(gl);
710 elm_genlist_item_class_free(itc_emoticon);
711 lazy_loading_timer_for_items = NULL;
713 return ECORE_CALLBACK_CANCEL;
717 if (loading_done_for_item + LOADING_ITEM_UNIT > EMOTICON_CNT) {
718 loading_top = EMOTICON_CNT;
720 loading_top = loading_done_for_item + LOADING_ITEM_UNIT;
723 if (loading_top > loading_done_for_contents) {
724 PRINTFUNC(DLOG_DEBUG, "Wait for content loading");
725 return ECORE_CALLBACK_RENEW;
727 PRINTFUNC(DLOG_DEBUG, "_lazy_loader_cb_for_items loading_done_for_item = %d", loading_done_for_item);
730 for (i = loading_done_for_item; i < loading_top; i++ ) {
732 elm_genlist_item_append(gl, itc_emoticon, (void*)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)i);
735 loading_done_for_item = loading_top;
736 return ECORE_CALLBACK_RENEW;
739 void _create_reusable_contents(Evas_Object *gl){
741 PRINTFUNC(DLOG_ERROR, "gl is null");
745 loading_done_for_item = INITAL_ITEM_UNIT;
747 for (i = 0; i < INITAL_ITEM_UNIT; i++ ) {
749 elm_genlist_item_append(gl, itc_emoticon, (void*)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)i);
752 lazy_loading_timer_for_items = ecore_timer_add(0.1, _lazy_loader_cb_for_items, (void *)gl);
755 Evas_Object* _create_emoticon_genlist(void* data)
757 PRINTFUNC(DLOG_DEBUG, "%s", __func__);
758 App_Data* ad = (App_Data*) data;
762 Evas_Object* genlist = elm_genlist_add(ad->naviframe);
766 Evas_Object* circle_object_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface);
767 eext_circle_object_genlist_scroller_policy_set(circle_object_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
768 evas_object_data_set(genlist, "circle", (void *) circle_object_genlist);
769 eext_rotary_object_event_activated_set(circle_object_genlist, EINA_TRUE);
771 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
772 evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
773 evas_object_show(genlist);
775 Elm_Object_Item *nf_emoticon_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, genlist, "empty");
777 elm_naviframe_item_pop_cb_set(nf_emoticon_item, _custom_back_cb2, ad);
779 evas_object_smart_callback_add(genlist, "language,changed", _emoticon_gl_lang_changed, genlist);
781 if (is_content_reuse_on) {
782 evas_object_smart_callback_add(genlist, "content,unswallowed", _emoticon_gl_content_unswallowed_cb, NULL);
788 void _update_emoticon_items(void *data)
790 PRINTFUNC(DLOG_DEBUG, "%s", __func__);
791 Evas_Object* gl = (Evas_Object*) data;
796 Elm_Object_Item *it = NULL;
797 Elm_Object_Item *first_it = NULL;
799 Elm_Genlist_Item_Class * itc_dummy = elm_genlist_item_class_new();
800 itc_dummy->item_style = "title";
801 itc_dummy->func.text_get = NULL;
802 itc_dummy->func.content_get = NULL;
803 itc_dummy->func.state_get = NULL;
804 itc_dummy->func.del = NULL;
806 Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new();
808 itc_group->item_style = "groupindex";
809 itc_group->func.text_get = __emoticon_gl_text_get;
810 itc_group->func.content_get = NULL;
811 itc_group->func.state_get = NULL;
812 itc_group->func.del = NULL;
814 Elm_Genlist_Item_Class *itc_recent = elm_genlist_item_class_new();
815 if (is_content_reuse_on) {
816 // itc_recent->content_reusable = EINA_TRUE;
818 itc_recent->item_style = "3button_flat_recent";
819 itc_recent->func.text_get = NULL;
820 itc_recent->func.content_get = __emoticon_gl_recent_content_get;
821 itc_recent->func.state_get = NULL;
822 itc_recent->func.del = NULL;
824 itc_emoticon = elm_genlist_item_class_new();
825 if (is_content_reuse_on) {
826 // itc_emoticon->content_reusable = EINA_TRUE;
828 itc_emoticon->item_style = "3button_flat";
829 itc_emoticon->func.text_get = NULL;
830 itc_emoticon->func.content_get = __emoticon_gl_emoticon_content_get;
831 itc_emoticon->func.state_get = NULL;
832 itc_emoticon->func.del = NULL;
834 // dummy title for empty space
835 it_emoticon_empty = elm_genlist_item_append(gl, itc_dummy, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
837 if (recent_emoji_list.size() > 0) {
838 if (is_content_reuse_on) {
839 _create_reusable_recents(gl);
843 it_emoticon_recent_group = elm_genlist_item_append(gl, itc_group, (void*)"IDS_IME_HEADER_RECENT_M_RECETLY_SENT_EMOJIS_ABB", NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)2);
844 elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
845 if (first_it == NULL)
846 first_it = it_emoticon_recent_group;
848 PRINTFUNC(DLOG_DEBUG, "size = %d", recent_emoji_list.size());
850 for (i=0;i < recent_emoji_list.size();i=i+3)
852 it = elm_genlist_item_append(gl, itc_recent, (void*)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)i);
857 it_emoticon_emoji_group = elm_genlist_item_append(gl, itc_group, (void*)"IDS_IME_HEADER_EMOJIS_ABB", NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)2);
858 elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
859 if (first_it == NULL)
860 first_it = it_emoticon_emoji_group;
862 if (is_content_reuse_on) {
863 _create_reusable_contents(gl);
866 for (i=0;i< EMOTICON_CNT;i=i+3) {
867 it = elm_genlist_item_append(gl, itc_emoticon, (void*)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void *)i);
870 elm_genlist_item_class_free(itc_emoticon);
872 it = elm_genlist_item_next_get(first_it);
873 const Elm_Genlist_Item_Class *itc_temp = elm_genlist_item_item_class_get(it);
874 if (itc_temp == itc_group) {
875 it = elm_genlist_item_next_get(it);
877 elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
879 elm_genlist_item_class_free(itc_recent);
880 elm_genlist_item_class_free(itc_group);
881 elm_genlist_item_class_free(itc_dummy);
884 void ise_show_emoticon_list(void *data)
886 App_Data* ad = (App_Data*) data;
890 it_emoticon_empty = NULL;
891 it_emoticon_recent_group = NULL;
892 it_emoticon_emoji_group = NULL;
895 get_recent_emoticons(recent_emoji_list);
897 Evas_Object* emoticon_list = NULL;
899 emoticon_list = _create_emoticon_genlist(ad);
901 if (is_content_reuse_on) {
902 create_reusable_button(ad->naviframe); // button object need to survive even if genlist is deleted.
904 _update_emoticon_items(emoticon_list);