2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 * @file eail-explorer-ui.c
23 * @brief EAIL Explorer UI implementation
28 #include "eail-explorer-ui.h"
29 #include "eail-explorer-tr.h"
30 #include "eail-browser.h"
33 /** @brief action_cb_struct Struct for action callbacks */
34 action_cb_struct *acs = NULL;
39 * Cleans memory by free action cb struct
45 eina_list_free(acs->list);
52 * @brief Refreshes explorer layout
54 * Use elm_toolbar_item_selected_set() twice to refresh layout
56 * @param toolbar Toolbar object
60 void refresh_layout(Evas_Object *toolbar)
62 Elm_Object_Item *tb_item = elm_toolbar_first_item_get(toolbar);
65 elm_toolbar_item_selected_set(tb_item, EINA_FALSE);
66 elm_toolbar_item_selected_set(tb_item, EINA_TRUE);
70 tb_item = elm_toolbar_first_item_get(toolbar);
71 elm_toolbar_item_selected_set(tb_item, EINA_TRUE);
76 * @brief checks whether an object is part of EAIL-Explorer
78 * Check is performed by getting the role and name from AtkObject
80 * @param obj AtkObject which is checked
82 * @return true when the object is part of EAIL-Explorer, false otherwise
84 Eina_Bool _is_part_of_eail_explorer(AtkObject *obj)
86 if(!obj || ATK_ROLE_APPLICATION == atk_object_get_role(obj))
89 AtkObject *atk_window = obj;
90 while(ATK_ROLE_WINDOW != atk_object_get_role(atk_window))
91 atk_window = atk_object_get_parent(atk_window);
93 const char *name = atk_object_get_name(atk_window);
94 if(name && !strcmp(name, EAIL_EXPLORER))
100 void _print_desc_on_entry(void *data, Evas_Object *obj, void *event_info)
102 action_cb_struct *acs = (action_cb_struct*)data;
107 Evas_Object *entry = eina_list_nth(acs->list, 1);
108 Elm_Object_Item *it = (Elm_Object_Item*)event_info;
110 const Eina_List *list = elm_list_items_get(eina_list_nth(acs->list, 0));
113 EINA_LIST_FOREACH(list, l, list_data)
117 const char *desc = atk_action_get_description(ATK_ACTION(acs->atk_obj), i);
118 elm_entry_entry_set(entry, desc);
125 void _fill_action_list(void *data)
127 action_cb_struct *acs = (action_cb_struct*)data;
132 Evas_Object *list = eina_list_nth(acs->list, 0);
133 AtkObject *obj = acs->atk_obj;
134 int counter = atk_action_get_n_actions(ATK_ACTION(obj));
135 elm_list_clear(list);
137 for(i = 0; i < counter; ++i)
139 const char *desc = atk_action_get_description(ATK_ACTION(obj), i);
142 elm_list_item_append(list, atk_action_get_name(ATK_ACTION(obj), i), NULL, NULL, _print_desc_on_entry, acs);
146 char *action_name_with_desc = NULL;
147 if(asprintf(&action_name_with_desc, "%s [%s]", atk_action_get_name(ATK_ACTION(obj), i), desc) < 0)
149 EINA_LOG_ERR(ERR_MEMORY);
150 elm_list_item_append(list, atk_action_get_name(ATK_ACTION(obj), i), NULL, NULL, _print_desc_on_entry, acs);
154 elm_list_item_append(list, action_name_with_desc, NULL, NULL, _print_desc_on_entry, acs);
155 free(action_name_with_desc);
163 * @brief Callback function for Button click in Action Layout
165 * The callback is called when the Action label for button is clicked.
166 * The callback performs the action selected in the given action list.
168 * @param data Data passed to callback, action_cb_struct
170 * @param event_info UNUSED
174 void _action_cb(void *data, Evas_Object *obj, void *event_info)
176 action_cb_struct *acs = (action_cb_struct*)data;
181 Evas_Object *eo = eina_list_nth(acs->list, 0);
182 Elm_Object_Item *it = elm_list_selected_item_get(eo);
188 const Eina_List *list = elm_list_items_get(eo);
191 EINA_LIST_FOREACH(list, l, list_data)
195 atk_action_do_action(ATK_ACTION(acs->atk_obj), i);
196 expand_browser(acs->atk_obj);
203 void _set_action_desc(void *data, Evas_Object *obj, void *event_info)
205 action_cb_struct *acs = (action_cb_struct*)data;
210 Evas_Object *eo = eina_list_nth(acs->list, 0);
211 Elm_Object_Item *it = elm_list_selected_item_get(eo);
216 Evas_Object *entry = eina_list_nth(acs->list, 1);
217 const char *desc = elm_entry_entry_get(entry);
218 if(!desc || !strcmp(desc, ""))
222 const Eina_List *list = elm_list_items_get(eina_list_nth(acs->list, 0));
226 EINA_LIST_FOREACH(list, l, list_data)
230 atk_action_set_description(ATK_ACTION(acs->atk_obj), i, desc);
231 _fill_action_list(acs);
239 * @brief Prints all avaiable actions for given AtkObject.
241 * Function prints all avaiable actions for given Accessible Object
242 * and register callback for click on button.
244 * @param eo Actions Layout object
245 * @param obj AtkObject which currently has focus
246 * @param parent Main Layout Object
248 void print_actions(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
252 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
256 eina_list_free(acs->list);
260 int actions_counter = atk_action_get_n_actions(ATK_ACTION(obj));
261 Evas_Object *action_list = elm_object_part_content_get(eo, "elm.editor.name.list");
262 Evas_Object *entry = elm_object_part_content_get(eo, "elm.editor.name.entry");
263 elm_entry_entry_set(entry, NULL);
264 if (asprintf(&c,"%d", actions_counter) < 0 )
265 EINA_LOG_ERR(ERR_ACTION);
266 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), c);
269 acs->list = eina_list_append(acs->list, action_list);
270 acs->list = eina_list_append(acs->list, entry);
271 _fill_action_list(acs);
273 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _action_cb);
274 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _action_cb, acs);
275 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _set_action_desc);
276 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _set_action_desc, acs);
278 elm_object_part_content_set(parent, "elm.layout", eo);
279 evas_object_show(eo);
284 * @brief prepares Action interface view
286 * Function prepares action Layout by adding all
287 * the used objects to layout and setting object labels
289 * @param parent Evas_Object wich represent Parent Layout
291 * @return Evas_Object representing Action Layout
293 Evas_Object* prepare_layout_action(Evas_Object *parent)
295 Evas_Object *eo = elm_layout_add(parent);
296 elm_layout_file_set(eo, EDJ_PATH_ACT, "explorer/action");
298 Evas_Object *lb1, *separator, *button, *list, *entry, *button2;
300 lb1 = elm_label_add(eo);
301 list = elm_list_add(eo);
302 elm_list_multi_select_set(list, EINA_FALSE);
303 separator = elm_separator_add(eo);
304 button = elm_button_add(eo);
305 button2 = elm_button_add(eo);
306 entry = elm_entry_add(eo);
307 elm_entry_single_line_set(entry, EINA_TRUE);
308 elm_entry_scrollable_set(entry, EINA_TRUE);
309 elm_object_part_text_set(entry, "guide", ACTION_DESC);
310 elm_object_text_set(button, DO_ACTION);
311 elm_object_text_set(button2, SET);
312 elm_separator_horizontal_set(separator, EINA_FALSE);
313 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
314 elm_object_part_content_set(eo, "elm.editor.name.list", list);
315 elm_object_part_content_set(eo, "elm.editor.name.button", button);
316 elm_object_part_content_set(eo, "elm.separator.1", separator);
317 elm_object_part_content_set(eo, "elm.editor.name.entry", entry);
318 elm_object_part_content_set(eo, "elm.editor.name.button2", button2);
320 evas_object_color_set(separator, 1, 1, 1, 255);
321 elm_object_part_text_set(eo, "text1", NUM_OF_ACTIONS);
322 elm_object_part_text_set(eo, "text2", ACC_DESC);
323 elm_object_part_text_set(eo, "text3", SET_DESC);
324 elm_label_slide_duration_set(lb1, 3);
325 elm_object_style_set(lb1, "slide_bounce");
331 * @brief callback for resize event
333 * Callback called when resize button on component layout is clicked,
334 * resize on focused object is performed with paramenters received from
337 * @param data action_cb_struct which has values from entries in layout
339 * @param event_info UNUSED
341 void _component_resize_cb(void *data, Evas_Object *obj, void *event_info)
346 action_cb_struct *acs = (action_cb_struct*)data;
347 Evas_Object *eo1 = eina_list_nth(acs->list, 0);
348 Evas_Object *eo2 = eina_list_nth(acs->list, 1);
349 Evas_Object *lab = eina_list_nth(acs->list, 6);
351 atk_component_set_size(ATK_COMPONENT(acs->atk_obj), atoi(elm_entry_entry_get(eo1)), atoi(elm_entry_entry_get(eo2)));
353 atk_component_get_size(ATK_COMPONENT(acs->atk_obj), &width, &height);
355 if(asprintf(&size, "%s: %d, %s: %d", WIDTH, width, HEIGHT, height) < 0)
357 elm_object_text_set(lab, "Error");
361 elm_object_text_set(lab, size);
368 * @brief callback for change position event
370 * Callback called when change position button on component layout is clicked,
371 * position change on focued object is prerformed with parameters received from
374 * @param data action_cb_struct which has values from entries in layout
376 * @param event_info UNUSED
378 void _component_change_position_cb(void *data, Evas_Object *obj, void *event_info)
385 action_cb_struct *acs = (action_cb_struct*)data;
386 Evas_Object *eo1 = eina_list_nth(acs->list, 2);
387 Evas_Object *eo2 = eina_list_nth(acs->list, 3);
388 Evas_Object *lab = eina_list_nth(acs->list, 4);
389 Evas_Object *lab1 = eina_list_nth(acs->list, 5);
391 atk_component_set_position(ATK_COMPONENT(acs->atk_obj), atoi(elm_entry_entry_get(eo1)), atoi(elm_entry_entry_get(eo2)), ATK_XY_WINDOW);
393 atk_component_get_position(ATK_COMPONENT(acs->atk_obj), &s_x, &s_y, ATK_XY_SCREEN);
394 atk_component_get_position(ATK_COMPONENT(acs->atk_obj), &w_x, &w_y, ATK_XY_WINDOW);
396 if(asprintf(&s_position, "X: %d, Y: %d", s_x, s_y) < 0)
398 EINA_LOG_ERR(ERR_MEMORY);
399 elm_object_text_set(lab, "-");
403 elm_object_text_set(lab, s_position);
405 if(asprintf(&w_position, "X: %d, Y: %d", w_x, w_y) < 0)
407 EINA_LOG_ERR(ERR_MEMORY);
408 elm_object_text_set(lab1, "-");
412 elm_object_text_set(lab1, w_position);
420 * @brief prints Component layout
422 * Main function to print layout component, called when click on component
423 * label in toolbar is clicked, that function fills all entries and labels
424 * in that layout, register callbacks on objects
426 * @param eo Component Layout object
427 * @param obj AtkObject which has focus
428 * @param parent Main Layout object
430 void print_component(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
434 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
438 eina_list_free(acs->list);
447 char *s_position = NULL;
448 char *w_position = NULL;
451 char *mdi_zorder = NULL;
453 char *width_char = WIDTH;
454 char *height_char = HEIGHT;
457 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.button"), RESIZE);
458 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.button1"), CHANGE_POS);
460 atk_component_get_position(ATK_COMPONENT(obj), &s_x, &s_y, ATK_XY_SCREEN);
461 atk_component_get_position(ATK_COMPONENT(obj), &w_x, &w_y, ATK_XY_WINDOW);
462 atk_component_get_size(ATK_COMPONENT(obj), &width, &height);
463 atk_layer = atk_component_get_layer(ATK_COMPONENT(obj));
464 atk_mdi_zorder = atk_component_get_mdi_zorder(ATK_COMPONENT(obj));
465 atk_alpha = atk_component_get_alpha(ATK_COMPONENT(obj));
467 if (asprintf(&s_position,"X: %d, Y: %d", s_x, s_y) < 0)
468 EINA_LOG_ERR(ERR_SET_POSITION);
469 if (asprintf(&w_position,"X: %d, Y: %d", w_x, w_y) < 0)
470 EINA_LOG_ERR(ERR_SET_POSITION);
471 if (asprintf(&size, "%s: %d, %s: %d", width_char, width, height_char, height) < 0)
472 EINA_LOG_ERR(ERR_SET_POSITION);
473 if (asprintf(&layer, "%d", atk_layer) < 0)
474 EINA_LOG_ERR(ERR_ATK_LAYER);
475 if (asprintf(&mdi_zorder, "%i", atk_mdi_zorder) < 0)
476 EINA_LOG_ERR(ERR_MDI_ZORDER);
477 if (asprintf(&alpha, "%g", atk_alpha) < 0)
478 EINA_LOG_ERR(ERR_ATK_ALPHA);
480 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry1"));
481 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry2"));
482 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry3"));
483 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry4"));
484 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label1"));
485 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label2"));
486 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label3"));
488 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), s_position);
489 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label2"), w_position);
490 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), size);
491 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), layer);
492 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), mdi_zorder);
493 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label6"), alpha);
495 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry1"), NULL);
496 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry2"), NULL);
497 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry3"), NULL);
498 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry4"), NULL);
500 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _component_resize_cb);
501 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _component_change_position_cb);
503 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _component_resize_cb, acs);
504 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _component_change_position_cb, acs);
506 elm_object_part_content_set(parent, "elm.layout", eo);
507 evas_object_show(eo);
517 * @brief prepares Component interface view
519 * Function prepares Component Layout by adding all
520 * the used objects to layout and setting object labels
522 * @param parent Parent Layout object
524 * @return Evas_Object representing component layout
526 Evas_Object* prepare_layout_component(Evas_Object *parent)
528 Evas_Object *eo = elm_layout_add(parent);
529 elm_layout_file_set(eo, EDJ_PATH_CMP, "explorer/component");
531 Evas_Object *lb1, *lb2, *lb3, *lb4, *lb5, *lb6;
532 Evas_Object *e1, *e2, *e3, *e4, *separator;
533 Evas_Object *button, *button1;
534 Evas_Object *box1, *box2, *box3, *box4;
536 lb1 = elm_label_add(eo);
537 lb2 = elm_label_add(eo);
538 lb3 = elm_label_add(eo);
539 lb4 = elm_label_add(eo);
540 lb5 = elm_label_add(eo);
541 lb6 = elm_label_add(eo);
543 box1 = elm_box_add(eo);
544 box2 = elm_box_add(eo);
545 box3 = elm_box_add(eo);
546 box4 = elm_box_add(eo);
548 e1 = elm_entry_add(eo);
549 e2 = elm_entry_add(eo);
550 e3 = elm_entry_add(eo);
551 e4 = elm_entry_add(eo);
553 button = elm_button_add(eo);
554 button1 = elm_button_add(eo);
556 separator = elm_separator_add(eo);
558 elm_separator_horizontal_set(separator, EINA_FALSE);
560 evas_object_size_hint_weight_set(e1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
561 evas_object_size_hint_align_set(e1, EVAS_HINT_FILL, EVAS_HINT_FILL);
562 elm_entry_line_wrap_set(e1, EINA_TRUE);
563 elm_entry_scrollable_set(e1, EINA_TRUE);
564 elm_box_pack_end(box1, e1);
566 evas_object_size_hint_weight_set(e2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
567 evas_object_size_hint_align_set(e2, EVAS_HINT_FILL, EVAS_HINT_FILL);
568 elm_entry_line_wrap_set(e2, EINA_TRUE);
569 elm_entry_scrollable_set(e2, EINA_TRUE);
570 elm_box_pack_end(box2, e2);
572 evas_object_size_hint_weight_set(e3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
573 evas_object_size_hint_align_set(e3, EVAS_HINT_FILL, EVAS_HINT_FILL);
574 elm_entry_line_wrap_set(e3, EINA_TRUE);
575 elm_entry_scrollable_set(e3, EINA_TRUE);
576 elm_box_pack_end(box3, e3);
578 evas_object_size_hint_weight_set(e4, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
579 evas_object_size_hint_align_set(e4, EVAS_HINT_FILL, EVAS_HINT_FILL);
580 elm_entry_line_wrap_set(e4, EINA_TRUE);
581 elm_entry_scrollable_set(e4, EINA_TRUE);
582 elm_box_pack_end(box4, e4);
585 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
586 elm_object_part_content_set(eo, "elm.editor.name.label2", lb2);
587 elm_object_part_content_set(eo, "elm.editor.name.label3", lb3);
588 elm_object_part_content_set(eo, "elm.editor.name.label4", lb4);
589 elm_object_part_content_set(eo, "elm.editor.name.label5", lb5);
590 elm_object_part_content_set(eo, "elm.editor.name.label6", lb6);
592 elm_object_part_content_set(eo, "elm.editor.name.entry1", e1);
593 elm_object_part_content_set(eo, "elm.editor.name.entry2", e2);
594 elm_object_part_content_set(eo, "elm.editor.name.entry3", e3);
595 elm_object_part_content_set(eo, "elm.editor.name.entry4", e4);
597 elm_object_part_content_set(eo, "elm.editor.name.box1", box1);
598 elm_object_part_content_set(eo, "elm.editor.name.box2", box2);
599 elm_object_part_content_set(eo, "elm.editor.name.box3", box3);
600 elm_object_part_content_set(eo, "elm.editor.name.box4", box4);
602 elm_object_part_content_set(eo, "elm.editor.name.button", button);
603 elm_object_part_content_set(eo, "elm.editor.name.button1", button1);
605 elm_object_part_content_set(eo, "elm.separator.1", separator);
607 elm_object_part_text_set(e1, "guide", ENTER_VAL);
608 elm_object_part_text_set(e2, "guide", ENTER_VAL);
609 elm_object_part_text_set(e3, "guide", ENTER_VAL);
610 elm_object_part_text_set(e4, "guide", ENTER_VAL);
612 evas_object_color_set(separator, 1, 1, 1, 255);
614 elm_object_part_text_set(eo, "text1", POS_ON_SCREEN);
615 elm_object_part_text_set(eo, "text2", POS_IN_WIN);
616 elm_object_part_text_set(eo, "text3", SIZE);
617 elm_object_part_text_set(eo, "text4", LAYER);
618 elm_object_part_text_set(eo, "text5", MDI_ZORDER);
619 elm_object_part_text_set(eo, "text6", ALPHA);
620 elm_object_part_text_set(eo, "text7", SET_SIZE);
621 elm_object_part_text_set(eo, "text8", WIDTH);
622 elm_object_part_text_set(eo, "text9", HEIGHT);
623 elm_object_part_text_set(eo, "text10", CHANGE_POS);
624 elm_object_part_text_set(eo, "text11", X);
625 elm_object_part_text_set(eo, "text12", Y);
631 * @brief callback for set atk object name
633 * That callback function is called when "Set name" button
634 * on object layout is clicked, it set Accessible Name for
637 * @param data action_cb_struct which contains value from entry
639 * @param event_info UNUSED
641 void _set_name_obj_cb(void *data, Evas_Object *obj, void *event_info)
643 action_cb_struct *acs = (action_cb_struct*)data;
648 Evas_Object *e1 = eina_list_nth(acs->list, 0);
649 Evas_Object *e2 = eina_list_nth(acs->list, 1);
650 const char *text = elm_entry_entry_get(e2);
655 atk_object_set_name(acs->atk_obj, text);
656 elm_object_text_set(e1, atk_object_get_name(acs->atk_obj));
657 selected_item_update();
661 * @brief callback for set atk object description
663 * That callback function is called when "Set description" button
664 * on object layout is clicked, it set Accessible Description for
667 * @param data action_cb_struct which contains value from entry
669 * @param event_info UNUSED
671 void _set_desc_obj_cb(void *data, Evas_Object *obj, void *event_info)
673 action_cb_struct *acs = (action_cb_struct*)data;
678 Evas_Object *e1 = eina_list_nth(acs->list, 2);
679 Evas_Object *e2 = eina_list_nth(acs->list, 3);
680 const char *text = elm_entry_entry_get(e2);
685 atk_object_set_description(acs->atk_obj, text);
686 elm_object_text_set(e1, atk_object_get_description(acs->atk_obj));
690 * @brief prints Object layout
692 * Main function to print object layout, called when click object label
693 * in toolbar is clicked or when focus is changed to new object,
694 * that function fills all entries and labels in that layout,
695 * register callbacks on objects
697 * @param eo Object Layout object
698 * @param obj AtkObject which has focus
699 * @param parent Main Layout object
701 void print_object(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
705 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
709 eina_list_free(acs->list);
712 AtkObject *parent_obj;
714 AtkRelationSet *relationSet;
715 AtkStateSet *stateSet;
716 Evas_Object *btn1, *btn2;
718 parent_obj = atk_object_get_parent(obj);
719 role = atk_object_get_role(obj);
720 relationSet = atk_object_ref_relation_set(obj);
721 stateSet = atk_object_ref_state_set(obj);
723 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), g_type_name(G_TYPE_FROM_INSTANCE(obj)));
724 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label2"), atk_object_get_name(obj));
725 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry1"), NULL);
729 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), g_type_name(G_TYPE_FROM_INSTANCE(parent_obj)));
730 const char *parent_name = atk_object_get_name(parent_obj);
733 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), atk_object_get_name(parent_obj));
737 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), NO_NAME);
739 if(atk_object_get_index_in_parent(obj) == -1)
741 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), INDEX_ERR);
746 if (asprintf(&c,"%d", atk_object_get_index_in_parent(obj)) < 0)
747 EINA_LOG_ERR(ERR_OBJECT_INDEX);
748 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), c);
754 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), NO_PAR);
755 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), NO_PAR);
756 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), NO_PAR);
758 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label6"), atk_role_get_name(role));
759 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label7"), atk_object_get_description(obj));
760 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry2"), NULL);
762 if (asprintf(&c,"%d", atk_object_get_n_accessible_children(obj)) < 0)
763 EINA_LOG_ERR(ERR_CHILD_COUNT);
764 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label9"),c);
766 if (atk_relation_set_get_n_relations(relationSet) != 0 )
767 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label9"), EXISTS);
769 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label9"), NOT_EXISTS);
771 if (atk_state_set_is_empty(stateSet))
773 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label10"), NO_STATES);
779 for (i = ATK_STATE_INVALID; i <= ATK_STATE_LAST_DEFINED; i++) {
780 if (atk_state_set_contains_state(stateSet, i)){
781 const char *state = atk_state_type_get_name(i);
784 if(asprintf(&states, "%s", state) < 0)
785 EINA_LOG_ERR(ERR_WRITE_STATES);
790 if(asprintf(&temp, "%s, %s", states, state) < 0)
791 EINA_LOG_ERR(ERR_WRITE_STATES);
797 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label10"), states);
801 g_object_unref(stateSet);
803 btn1 = elm_object_part_content_get(eo, "elm.editor.name.button1");
804 btn2 = elm_object_part_content_get(eo, "elm.editor.name.button2");
807 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label2"));
808 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry1"));
809 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label7"));
810 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry2"));
812 evas_object_smart_callback_add(btn1, "clicked", _set_name_obj_cb, acs);
814 evas_object_smart_callback_add(btn2, "clicked", _set_desc_obj_cb, acs);
816 elm_object_part_content_set(parent, "elm.layout", eo);
817 evas_object_show(eo);
821 * @brief prepares Object interface view
823 * Function prepares Object Layout by adding all
824 * the used objects to layout and setting object labels
826 * @param parent Parent Layout object
828 * @return Evas_Object representing Object layout
830 Evas_Object* prepare_layout_object(Evas_Object *parent)
832 Evas_Object *eo = elm_layout_add(parent);
833 elm_layout_file_set(eo, EDJ_PATH_OBJ, "explorer/object");
835 Evas_Object *lb1, *lb2, *lb3, *lb4, *lb5, *lb6, *lb7, *lb8, *lb9, *lb10;
836 Evas_Object *e3, *e9;
837 Evas_Object *separator, *btn1, *btn2;
838 Evas_Object *box1, *box2;
840 lb1 = elm_label_add(eo);
841 lb2 = elm_label_add(eo);
842 lb3 = elm_label_add(eo);
843 lb4 = elm_label_add(eo);
844 lb5 = elm_label_add(eo);
845 lb6 = elm_label_add(eo);
846 lb7 = elm_label_add(eo);
847 lb8 = elm_label_add(eo);
848 lb9 = elm_label_add(eo);
849 lb10 = elm_label_add(eo);
851 btn1 = elm_button_add(eo);
852 btn2 = elm_button_add(eo);
854 box1 = elm_box_add(eo);
855 box2 = elm_box_add(eo);
857 separator = elm_separator_add(eo);
858 elm_separator_horizontal_set(separator, EINA_FALSE);
860 e3 = elm_entry_add(eo);
861 e9 = elm_entry_add(eo);
863 evas_object_size_hint_weight_set(e3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
864 evas_object_size_hint_align_set(e3, EVAS_HINT_FILL, EVAS_HINT_FILL);
865 elm_entry_line_wrap_set(e3, EINA_TRUE);
866 elm_entry_scrollable_set(e3, EINA_TRUE);
867 elm_box_pack_end(box1, e3);
869 evas_object_size_hint_weight_set(e9, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
870 evas_object_size_hint_align_set(e9, EVAS_HINT_FILL, EVAS_HINT_FILL);
871 elm_entry_line_wrap_set(e9, EINA_TRUE);
872 elm_entry_scrollable_set(e9, EINA_TRUE);
873 elm_box_pack_end(box2, e9);
875 elm_object_part_content_set(eo, "elm.editor.name.box1", box1);
876 elm_object_part_content_set(eo, "elm.editor.name.box2", box2);
877 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
878 elm_object_part_content_set(eo, "elm.editor.name.label2", lb2);
879 elm_object_part_content_set(eo, "elm.editor.name.label3", lb3);
880 elm_object_part_content_set(eo, "elm.editor.name.label4", lb4);
881 elm_object_part_content_set(eo, "elm.editor.name.label5", lb5);
882 elm_object_part_content_set(eo, "elm.editor.name.label6", lb6);
883 elm_object_part_content_set(eo, "elm.editor.name.label7", lb7);
884 elm_object_part_content_set(eo, "elm.editor.name.label8", lb8);
885 elm_object_part_content_set(eo, "elm.editor.name.label9", lb9);
886 elm_object_part_content_set(eo, "elm.editor.name.label10", lb10);
888 elm_object_part_content_set(eo, "elm.editor.name.entry1", e3);
889 elm_object_part_content_set(eo, "elm.editor.name.entry2", e9);
891 elm_object_part_content_set(eo, "elm.editor.name.button1", btn1);
892 elm_object_part_content_set(eo, "elm.editor.name.button2", btn2);
894 elm_object_part_content_set(eo, "elm.separator.1", separator);
896 elm_entry_editable_set(e3, EINA_TRUE);
897 elm_entry_editable_set(e9, EINA_TRUE);
899 elm_entry_single_line_set(e3, EINA_TRUE);
900 elm_entry_single_line_set(e9, EINA_TRUE);
902 elm_object_part_text_set(e3, "guide", ENTER_NAME);
903 elm_object_part_text_set(e9, "guide", ENTER_DESC);
905 elm_object_part_text_set(eo, "text1", ACC_TYPE);
906 elm_object_part_text_set(eo, "text2", ACC_NAME);
907 elm_object_part_text_set(eo, "text3", ACC_NAME_TO_SET);
908 elm_object_part_text_set(eo, "text4", PAR_ACC_TYPE);
909 elm_object_part_text_set(eo, "text5", PAR_ACC_NAME);
910 elm_object_part_text_set(eo, "text6", INDEX_IN_PAR);
911 elm_object_part_text_set(eo, "text8", ACC_DESC);
912 elm_object_part_text_set(eo, "text9", ACC_DESC_TO_SET);
913 elm_object_part_text_set(eo, "text7", ACC_ROLE);
914 elm_object_part_text_set(eo, "text10", NUM_OF_CHILDREN);
915 elm_object_part_text_set(eo, "text11", NUM_OF_RELATIONS);
916 elm_object_part_text_set(eo, "text12", ACC_STATES);
918 elm_label_slide_duration_set(lb1, 3);
919 elm_label_slide_duration_set(lb2, 3);
920 elm_label_slide_duration_set(lb3, 3);
921 elm_label_slide_duration_set(lb4, 3);
922 elm_label_slide_duration_set(lb5, 3);
923 elm_label_slide_duration_set(lb6, 3);
924 elm_label_slide_duration_set(lb7, 3);
925 elm_label_slide_duration_set(lb8, 3);
926 elm_label_slide_duration_set(lb9, 3);
927 elm_label_slide_duration_set(lb10, 3);
929 elm_object_style_set(lb1, "slide_bounce");
930 elm_object_style_set(lb2, "slide_bounce");
931 elm_object_style_set(lb3, "slide_bounce");
932 elm_object_style_set(lb4, "slide_bounce");
933 elm_object_style_set(lb5, "slide_bounce");
934 elm_object_style_set(lb6, "slide_bounce");
935 elm_object_style_set(lb7, "slide_bounce");
936 elm_object_style_set(lb8, "slide_bounce");
937 elm_object_style_set(lb9, "slide_bounce");
938 elm_object_style_set(lb10, "slide_bounce");
940 elm_label_line_wrap_set(lb10, ELM_WRAP_WORD);
942 evas_object_color_set(separator, 1, 1, 1, 255);
943 elm_object_part_text_set(btn1, "default", SET_NAME);
944 elm_object_part_text_set(btn2, "default", SET_DESC);
950 * @brief changes a row's description in a table
952 * Interface table allow to set description for row,
953 * that function take description from entry after
954 * "Set description" and set Accessible row description
956 * @param data action cb struct which contains entry field from layout and atk object
957 * @param obj Layout object
958 * @param event_info UNUSED
960 void _table_change_row_desc(void *data, Evas_Object *obj, void *event_info)
962 action_cb_struct *acs = (action_cb_struct*)data;
967 Evas_Object *eo = eina_list_nth(acs->list, 0);
968 int int_row_n = atk_table_get_n_rows(ATK_TABLE(acs->atk_obj));
970 for(i = 0; i < int_row_n; ++i)
972 if(atk_table_is_row_selected(ATK_TABLE(acs->atk_obj), i))
974 atk_table_set_row_description(ATK_TABLE(acs->atk_obj), i, elm_entry_entry_get(eo));
980 * @brief changes a column's description in a table
982 * Interface table allow to set description for column,
983 * that function take description from entry after
984 * "Set description" and set Accessible column description
986 * @param data action cb struct which contains entry field from layout and atk object
987 * @param obj Layout object
988 * @param event_info UNUSED
990 void _table_change_col_desc(void *data, Evas_Object *obj, void *event_info)
992 action_cb_struct *acs = (action_cb_struct*)data;
997 Evas_Object *eo = eina_list_nth(acs->list, 1);
998 int int_col_n = atk_table_get_n_columns(ATK_TABLE(acs->atk_obj));
1000 for(i = 0; i < int_col_n; ++i)
1002 if(atk_table_is_column_selected(ATK_TABLE(acs->atk_obj), i))
1004 atk_table_set_column_description(ATK_TABLE(acs->atk_obj), i, elm_entry_entry_get(eo));
1010 * @brief selects next column in a table
1012 * That callback is called when "Next column" button is selected in
1013 * table layout, it add selection to next column.
1015 * @param data action cb struct which contains given table object
1017 * @param event_info UNUSED
1019 void _table_next_col(void *data, Evas_Object *obj, void *event_info)
1021 action_cb_struct *acs = (action_cb_struct*)data;
1026 int int_col_n = atk_table_get_n_columns(ATK_TABLE(acs->atk_obj));
1028 for(i = 0; i < int_col_n - 1; ++i)
1030 if(atk_table_is_column_selected(ATK_TABLE(acs->atk_obj), i))
1032 atk_table_add_column_selection(ATK_TABLE(acs->atk_obj), i + 1);
1036 atk_table_add_column_selection(ATK_TABLE(acs->atk_obj), 0);
1040 * @brief selects previous column in a table
1042 * That callback is called when "Previous column" button is selected in
1043 * table layout, it add selection to previous column.
1045 * @param data action cb struct which contains given table object
1047 * @param event_info UNUSED
1049 void _table_prev_col(void *data, Evas_Object *obj, void *event_info)
1051 action_cb_struct *acs = (action_cb_struct*)data;
1056 int int_col_n = atk_table_get_n_columns(ATK_TABLE(acs->atk_obj));
1058 for(i = 1; i < int_col_n; ++i)
1060 if(atk_table_is_column_selected(ATK_TABLE(acs->atk_obj), i))
1062 atk_table_add_column_selection(ATK_TABLE(acs->atk_obj), i - 1);
1066 atk_table_add_column_selection(ATK_TABLE(acs->atk_obj), int_col_n - 1);
1070 * @brief selects next row in a table
1072 * That callback is called when "Next row" button is selected in
1073 * table layout, it add selection to next row.
1075 * @param data action cb struct which contains given table object
1077 * @param event_info UNUSED
1079 void _table_next_row(void *data, Evas_Object *obj, void *event_info)
1081 action_cb_struct *acs = (action_cb_struct*)data;
1086 int int_row_n = atk_table_get_n_rows(ATK_TABLE(acs->atk_obj));
1088 for(i = 1; i < int_row_n; ++i)
1090 if(atk_table_is_row_selected(ATK_TABLE(acs->atk_obj), i))
1092 atk_table_add_row_selection(ATK_TABLE(acs->atk_obj), i - 1);
1096 atk_table_add_row_selection(ATK_TABLE(acs->atk_obj), int_row_n - 1);
1100 * @brief selects previous row in a table
1102 * That callback is called when "Previous row" button is selected in
1103 * table layout, it add selection to previous row.
1105 * @param data action cb struct which contains given table object
1107 * @param event_info UNUSED
1109 void _table_prev_row(void *data, Evas_Object *obj, void *event_info)
1111 action_cb_struct *acs = (action_cb_struct*)data;
1116 int int_row_n = atk_table_get_n_rows(ATK_TABLE(acs->atk_obj));
1118 for(i = 1; i < int_row_n; ++i)
1120 if(atk_table_is_row_selected(ATK_TABLE(acs->atk_obj), i))
1122 atk_table_add_row_selection(ATK_TABLE(acs->atk_obj), i - 1);
1126 atk_table_add_row_selection(ATK_TABLE(acs->atk_obj), int_row_n - 1);
1130 * @brief prints Table layout
1132 * Main function to print table layout, called when click on table
1133 * label in toolbar is clicked, that function fills all entries and labels
1134 * in that layout, register callbacks on objects
1136 * @param eo Table Layout object
1137 * @param obj AtkObject which has focus
1138 * @param parent Main Layout object
1140 void print_table(Evas_Object *eo, AtkObject *obj, Evas_Object *tb, Evas_Object *parent)
1144 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
1148 eina_list_free(acs->list);
1151 char *rows_n = NULL;
1152 char *cols_n = NULL;
1154 int int_row_n = atk_table_get_n_rows(ATK_TABLE(obj));
1155 int int_col_n = atk_table_get_n_columns(ATK_TABLE(obj));
1157 if (asprintf(&rows_n, "%d", int_row_n) < 0)
1158 EINA_LOG_ERR(ERR_ROW);
1159 if (asprintf(&cols_n, "%d", int_col_n) < 0)
1160 EINA_LOG_ERR(ERR_COLUMN);
1162 const char *sel_col_desc = NULL;
1163 const char *sel_row_desc = NULL;
1167 for(i = 0; i < int_row_n; ++i)
1169 if(atk_table_is_row_selected(ATK_TABLE(obj), i))
1171 sel_row_desc = atk_table_get_row_description(ATK_TABLE(obj), i);
1174 for(i = 0; i < int_col_n; ++i)
1176 if(atk_table_is_column_selected(ATK_TABLE(obj), i))
1178 sel_col_desc = atk_table_get_column_description(ATK_TABLE(obj), i);
1183 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry1"));
1184 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry2"));
1186 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _table_change_row_desc);
1187 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _table_change_col_desc);
1188 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button3"), "clicked", _table_next_col);
1189 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button4"), "clicked", _table_prev_col);
1190 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button5"), "clicked", _table_next_row);
1191 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button6"), "clicked", _table_prev_row);
1193 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _table_change_row_desc, acs);
1194 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _table_change_col_desc, acs);
1195 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button3"), "clicked", _table_next_col, acs);
1196 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button4"), "clicked", _table_prev_col, acs);
1197 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button5"), "clicked", _table_next_row, acs);
1198 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button6"), "clicked", _table_prev_row, acs);
1200 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), cols_n);
1201 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label2"), rows_n);
1202 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), sel_row_desc);
1203 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), sel_col_desc);
1205 elm_object_part_content_set(parent, "elm.layout", eo);
1206 evas_object_show(eo);
1212 * @brief prepares Table interface view
1214 * Function prepares table Layout by adding all
1215 * the used objects to layout and setting object labels
1217 * @param parent Parent Layout object
1219 * @return Evas_Object representing table layout
1221 Evas_Object* prepare_layout_table(Evas_Object *parent)
1223 Evas_Object *eo = elm_layout_add(parent);
1224 elm_layout_file_set(eo, EDJ_PATH_TBL, "explorer/table");
1226 Evas_Object *separator;
1227 Evas_Object *lb1, *lb2, *lb3, *lb4, *e1, *e2;
1228 Evas_Object *button1, *button2, *button3, *button4, *button5, *button6;
1229 Evas_Object *box1, *box2;
1231 lb1 = elm_label_add(eo);
1232 lb2 = elm_label_add(eo);
1233 lb3 = elm_label_add(eo);
1234 lb4 = elm_label_add(eo);
1236 box1 = elm_box_add(eo);
1237 box2 = elm_box_add(eo);
1239 e1 = elm_entry_add(eo);
1240 e2 = elm_entry_add(eo);
1242 button1 = elm_button_add(eo);
1243 button2 = elm_button_add(eo);
1244 button3 = elm_button_add(eo);
1245 button4 = elm_button_add(eo);
1246 button5 = elm_button_add(eo);
1247 button6 = elm_button_add(eo);
1249 separator = elm_separator_add(eo);
1250 elm_separator_horizontal_set(separator, EINA_FALSE);
1252 evas_object_size_hint_weight_set(e1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1253 evas_object_size_hint_align_set(e1, EVAS_HINT_FILL, EVAS_HINT_FILL);
1254 elm_entry_scrollable_set(e1, EINA_TRUE);
1255 elm_entry_line_wrap_set(e1, EINA_TRUE);
1256 elm_box_pack_end(box1, e1);
1258 evas_object_size_hint_weight_set(e2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1259 evas_object_size_hint_align_set(e2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1260 elm_entry_scrollable_set(e2, EINA_TRUE);
1261 elm_entry_line_wrap_set(e2, EINA_TRUE);
1262 elm_box_pack_end(box2, e2);
1264 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
1265 elm_object_part_content_set(eo, "elm.editor.name.label2", lb2);
1266 elm_object_part_content_set(eo, "elm.editor.name.label3", lb3);
1267 elm_object_part_content_set(eo, "elm.editor.name.label4", lb4);
1269 elm_object_part_content_set(eo, "elm.editor.name.entry1", e1);
1270 elm_object_part_content_set(eo, "elm.editor.name.entry2", e2);
1272 elm_object_part_content_set(eo, "elm.editor.name.box1", box1);
1273 elm_object_part_content_set(eo, "elm.editor.name.box2", box2);
1275 elm_object_part_content_set(eo, "elm.editor.name.button1", button1);
1276 elm_object_part_content_set(eo, "elm.editor.name.button2", button2);
1277 elm_object_part_content_set(eo, "elm.editor.name.button3", button3);
1278 elm_object_part_content_set(eo, "elm.editor.name.button4", button4);
1279 elm_object_part_content_set(eo, "elm.editor.name.button5", button5);
1280 elm_object_part_content_set(eo, "elm.editor.name.button6", button6);
1282 elm_object_part_content_set(eo, "elm.separator.1", separator);
1283 evas_object_color_set(separator, 1, 1, 1, 255);
1285 elm_label_slide_duration_set(lb1, 3);
1286 elm_label_slide_duration_set(lb2, 3);
1287 elm_label_slide_duration_set(lb3, 3);
1288 elm_label_slide_duration_set(lb4, 3);
1290 elm_object_style_set(lb1, "slide_bounce");
1291 elm_object_style_set(lb2, "slide_bounce");
1292 elm_object_style_set(lb3, "slide_bounce");
1293 elm_object_style_set(lb4, "slide_bounce");
1295 elm_entry_editable_set(e1, EINA_TRUE);
1296 elm_entry_editable_set(e2, EINA_TRUE);
1298 elm_entry_single_line_set(e1, EINA_TRUE);
1299 elm_entry_single_line_set(e2, EINA_TRUE);
1301 elm_object_part_text_set(e1, "guide", ENTER_DESC);
1302 elm_object_part_text_set(e2, "guide", ENTER_DESC);
1304 elm_object_text_set(button1, SET_DESC);
1305 elm_object_text_set(button2, SET_DESC);
1306 elm_object_text_set(button3, NEXT_COL);
1307 elm_object_text_set(button4, PREV_COL);
1308 elm_object_text_set(button5, NEXT_ROW);
1309 elm_object_text_set(button6, PREV_ROW);
1311 elm_object_part_text_set(eo, "text1", NUM_OF_ROWS);
1312 elm_object_part_text_set(eo, "text2", NUM_OF_COLS);
1313 elm_object_part_text_set(eo, "text3", SEL_ROW_DESC);
1314 elm_object_part_text_set(eo, "text4", SEL_COL_DESC);
1315 elm_object_part_text_set(eo, "text5", SET_SEL_ROW_DESC);
1316 elm_object_part_text_set(eo, "text6", SET_SEL_COL_DESC);
1317 elm_object_part_text_set(eo, "text7", SEL_NEXT_COL);
1318 elm_object_part_text_set(eo, "text8", SEL_PREV_COL);
1319 elm_object_part_text_set(eo, "text9", SEL_NEXT_ROW);
1320 elm_object_part_text_set(eo, "text10", SEL_PREV_ROW);
1326 * @brief selects the first element
1328 * Callback called when "select first child" button on Selection Layout is clicked,
1329 * it perform selection for the first object in object set.
1331 * @param data action_cb_stuct, which contains object with avaiable selection interface
1333 * @param event_info UNUSED
1335 void _select_first_selection(void *data, Evas_Object *obj, void *event_info)
1337 action_cb_struct *acs = (action_cb_struct*)data;
1338 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), 0);
1342 * @brief selects the last element
1344 * Callback called when "select last child" button on Selection Layout is clicked,
1345 * it perform selection for the last object in object set.
1347 * @param data data action_cb_stuct, which contains object with avaiable selection interface
1349 * @param event_info UNUSED
1351 void _select_last_selection(void *data, Evas_Object *obj, void *event_info)
1353 action_cb_struct *acs = (action_cb_struct*)data;
1354 int counter = atk_object_get_n_accessible_children(acs->atk_obj);
1355 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), counter - 1);
1359 * @brief selects the next element
1361 * Callback called when "select next child" button on Selection Layout is clicked,
1362 * it perform selection for the next object in object set.
1364 * @param data data action_cb_stuct, which contains object with avaiable selection interface
1366 * @param event_info UNUSED
1368 void _select_next_selection(void *data, Evas_Object *obj, void *event_info)
1370 action_cb_struct *acs = (action_cb_struct*)data;
1372 int counter = atk_object_get_n_accessible_children(acs->atk_obj);
1373 for(i = 0; i < counter - 1; ++i)
1375 if(atk_selection_is_child_selected(ATK_SELECTION(acs->atk_obj), i))
1377 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), i + 1);
1381 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), 0);
1385 * @brief selects the previous element
1387 * Callback called when "select previous child" button on Selection Layout is clicked,
1388 * it perform selection for the previous object in object set.
1390 * @param data data action_cb_stuct, which contains object with avaiable selection interface
1392 * @param event_info UNUSED
1394 void _select_prev_selection(void *data, Evas_Object *obj, void *event_info)
1396 action_cb_struct *acs = (action_cb_struct*)data;
1398 int counter = atk_object_get_n_accessible_children(acs->atk_obj);
1399 for(i = 1; i < counter; ++i)
1401 if(atk_selection_is_child_selected(ATK_SELECTION(acs->atk_obj), i))
1403 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), i - 1);
1407 atk_selection_add_selection(ATK_SELECTION(acs->atk_obj), counter - 1);
1411 * @brief clears the selection
1413 * Callback called when "clear selection" button on Selection Layout is clicked,
1414 * it perform selection clean for all objects in object set.
1416 * @param data action_cb_stuct, which contains object with avaiable selection interface
1418 * @param event_info UNUSED
1420 void _clear_selection(void *data, Evas_Object *obj, void *event_info)
1422 action_cb_struct *acs = (action_cb_struct*)data;
1423 atk_selection_clear_selection(ATK_SELECTION(acs->atk_obj));
1427 * @brief selects all the elements
1429 * Callback called when "select all children" button on Selection Layout is clicked,
1430 * it perform selection for the all objects in object set.
1432 * @param data action_cb_stuct, which contains object with avaiable selection interface
1434 * @param event_info UNUSED
1436 void _all_selection(void *data, Evas_Object *obj, void *event_info)
1438 action_cb_struct *acs = (action_cb_struct*)data;
1439 atk_selection_select_all_selection(ATK_SELECTION(acs->atk_obj));
1443 * @brief prints the Selection layout
1445 * Main function to print selection layout, called when click on selection
1446 * label in toolbar is clicked, that function fills all entries and labels
1447 * in that layout, register callbacks on objects
1449 * @param eo Selection Layout object
1450 * @param obj AtkObject which has focus
1451 * @param parent Main Layout object
1453 void print_selection(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
1457 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
1461 eina_list_free(acs->list);
1467 char *children = NULL;
1468 Evas_Object *lb1 = elm_object_part_content_get(eo, "elm.selection.name.label1");
1469 if (asprintf(&children,"%d", atk_selection_get_selection_count(ATK_SELECTION(obj))) < 0 )
1470 EINA_LOG_ERR(ERR_SELECTION);
1471 elm_object_text_set(lb1, children);
1473 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button1"), "clicked", _select_first_selection);
1474 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button2"), "clicked", _select_last_selection);
1475 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button3"), "clicked", _select_next_selection);
1476 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button4"), "clicked", _select_prev_selection);
1477 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button5"), "clicked", _clear_selection);
1478 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.selection.name.button6"), "clicked", _all_selection);
1480 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button1"), "clicked", _select_first_selection, acs);
1481 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button2"), "clicked", _select_last_selection, acs);
1482 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button3"), "clicked", _select_next_selection, acs);
1483 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button4"), "clicked", _select_prev_selection, acs);
1484 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button5"), "clicked", _clear_selection, acs);
1485 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.selection.name.button6"), "clicked", _all_selection, acs);
1488 elm_object_part_content_set(parent, "elm.layout", eo);
1489 evas_object_show(eo);
1494 * @brief prepares Selection interface view
1496 * Function prepares Selection Layout by adding all
1497 * the used objects to layout and setting object labels
1499 * @param parent Parent Layout object
1501 * @return Evas_Object representing Selection layout
1503 Evas_Object* prepare_layout_selection(Evas_Object *parent)
1505 Evas_Object *eo = elm_layout_add(parent);
1506 elm_layout_file_set(eo, EDJ_PATH_SEL, "explorer/selection");
1507 Evas_Object *lb1, *separator, *button1, *button2, *button3;
1508 Evas_Object *button4, *button5, *button6;
1510 lb1 = elm_label_add(eo);
1511 button1 = elm_button_add(eo);
1512 button2 = elm_button_add(eo);
1513 button3 = elm_button_add(eo);
1514 button4 = elm_button_add(eo);
1515 button5 = elm_button_add(eo);
1516 button6 = elm_button_add(eo);
1518 elm_object_text_set(button1, SEL);
1519 elm_object_text_set(button2, SEL);
1520 elm_object_text_set(button3, SEL);
1521 elm_object_text_set(button4, SEL);
1522 elm_object_text_set(button5, SEL);
1523 elm_object_text_set(button6, SEL);
1525 separator = elm_separator_add(eo);
1526 elm_separator_horizontal_set(separator, EINA_FALSE);
1528 elm_object_part_content_set(eo, "elm.selection.name.label1", lb1);
1529 elm_object_part_content_set(eo, "elm.selection.name.button1", button1);
1530 elm_object_part_content_set(eo, "elm.selection.name.button2", button2);
1531 elm_object_part_content_set(eo, "elm.selection.name.button3", button3);
1532 elm_object_part_content_set(eo, "elm.selection.name.button4", button4);
1533 elm_object_part_content_set(eo, "elm.selection.name.button5", button5);
1534 elm_object_part_content_set(eo, "elm.selection.name.button6", button6);
1535 elm_object_part_content_set(eo, "elm.separator.1", separator);
1537 evas_object_color_set(separator, 1, 1, 1, 255);
1539 elm_label_slide_duration_set(lb1, 3);
1540 elm_object_style_set(lb1, "slide_bounce");
1543 elm_object_part_text_set(eo, "text1", NUM_OF_SEL_CHLD);
1544 elm_object_part_text_set(eo, "text2", SEL_FIRST_CHILD);
1545 elm_object_part_text_set(eo, "text3", SEL_LAST_CHILD);
1546 elm_object_part_text_set(eo, "text4", SEL_NEXT_CHILD);
1547 elm_object_part_text_set(eo, "text5", SEL_PREV_CHILD);
1548 elm_object_part_text_set(eo, "text6", CLEAR_SEL);
1549 elm_object_part_text_set(eo, "text7", SEL_ALL_CHILDREN);
1555 * @brief change image description
1557 * Callback called when set image description button is clicked.
1559 * @param data action_cb_stuct, which contains object with avaiable image interface
1561 * @param event_info UNUSED
1563 void _set_desc_img_cb(void *data, Evas_Object *obj, void *event_info)
1565 action_cb_struct *acs = (action_cb_struct*)data;
1571 Evas_Object *entry = eina_list_nth(acs->list, 0);
1572 Evas_Object *label = eina_list_nth(acs->list, 1);
1574 if(atk_image_set_image_description(ATK_IMAGE(acs->atk_obj), elm_entry_entry_get(entry)))
1575 elm_object_text_set(label, atk_image_get_image_description(ATK_IMAGE(acs->atk_obj)));
1577 EINA_LOG_ERR(ERR_DESCRIPTION);
1581 * @brief prints the Image layout
1583 * Main function to print image layout, called when click on image
1584 * label in toolbar is clicked, that function fills all entries and labels
1585 * in that layout, register callbacks on objects
1587 * @param eo Image Layout object
1588 * @param obj AtkObject which has focus
1589 * @param parent Main Layout object
1591 void print_image(Evas_Object *eo, AtkObject *obj, Evas_Object *tb, Evas_Object *parent)
1595 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
1599 eina_list_free(acs->list);
1605 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry1"));
1606 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label1"));
1608 const char *description = atk_image_get_image_description(ATK_IMAGE(obj));
1611 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), description);
1615 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), NO_DESC);
1619 atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_WINDOW);
1620 char *position = NULL;
1621 if (asprintf(&position,"X: %d Y: %d", x, y) < 0)
1622 EINA_LOG_ERR(ERR_GET_POSITION);
1623 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label2"), position);
1625 atk_image_get_image_size(ATK_IMAGE(obj), &x, &y);
1627 if (asprintf(&size, "Width: %d Height: %d", x, y) < 0)
1628 EINA_LOG_ERR(ERR_GET_POSITION);
1629 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), size);
1631 const char *locale = atk_image_get_image_locale(ATK_IMAGE(obj));
1634 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), NO_LOCALE);
1638 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), locale);
1641 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _set_desc_img_cb);
1642 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _set_desc_img_cb, acs);
1644 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry1"), NULL);
1646 elm_object_part_content_set(parent, "elm.layout", eo);
1647 evas_object_show(eo);
1653 * @brief prepares Image interface view
1655 * Function prepares Image Layout by adding all
1656 * the used objects to layout and setting object labels
1658 * @param parent Parent Layout object
1660 * @return Evas_Object representing Image layout
1662 Evas_Object* prepare_layout_image(Evas_Object *parent)
1664 Evas_Object *eo = elm_layout_add(parent);
1666 elm_layout_file_set(eo, EDJ_PATH_IMG, "explorer/image");
1667 Evas_Object *lb1, *lb2, *lb3, *lb4, *separator;
1668 Evas_Object *entry, *bt;
1670 lb1 = elm_label_add(eo);
1671 lb2 = elm_label_add(eo);
1672 lb3 = elm_label_add(eo);
1673 lb4 = elm_label_add(eo);
1675 entry = elm_entry_add(eo);
1677 bt = elm_button_add(eo);
1679 separator = elm_separator_add(eo);
1680 elm_separator_horizontal_set(separator, EINA_FALSE);
1682 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
1683 elm_object_part_content_set(eo, "elm.editor.name.label2", lb2);
1684 elm_object_part_content_set(eo, "elm.editor.name.label3", lb3);
1685 elm_object_part_content_set(eo, "elm.editor.name.label4", lb4);
1686 elm_object_part_content_set(eo, "elm.separator.1", separator);
1687 elm_object_part_content_set(eo, "elm.editor.name.entry1", entry);
1688 elm_object_part_content_set(eo, "elm.editor.name.button1", bt);
1690 elm_label_slide_duration_set(lb1, 3);
1691 elm_label_slide_duration_set(lb2, 3);
1692 elm_label_slide_duration_set(lb3, 3);
1693 elm_label_slide_duration_set(lb4, 3);
1695 elm_object_style_set(lb1, "slide_bounce");
1696 elm_object_style_set(lb2, "slide_bounce");
1697 elm_object_style_set(lb3, "slide_bounce");
1698 elm_object_style_set(lb4, "slide_bounce");
1700 evas_object_color_set(separator, 1, 1, 1, 255);
1702 elm_object_part_text_set(eo, "text1", IMG_DESC);
1703 elm_object_part_text_set(eo, "text2", SET_IMG_DESC);
1704 elm_object_part_text_set(eo, "text3", IMG_POS);
1705 elm_object_part_text_set(eo, "text4", IMG_SIZE);
1706 elm_object_part_text_set(eo, "text5", IMG_LOCALE);
1708 elm_entry_editable_set(entry, EINA_TRUE);
1710 elm_entry_single_line_set(entry, EINA_TRUE);
1712 elm_entry_scrollable_set(entry, EINA_TRUE);
1714 elm_object_part_text_set(entry, "guide", ENTER_DESC);
1716 elm_object_part_text_set(bt, "default", SET_DESC);
1722 * @brief prints gvalue
1724 * That function print string from GValue object
1726 * @param val GValue object
1728 * @return GValue transformated to string
1730 char* gvalue_pprint(GValue *val)
1732 char *buffer = NULL;
1734 if(G_VALUE_HOLDS_UINT(val)) {
1735 if (asprintf(&buffer, "%d", g_value_get_uint(val)) < 0)
1736 EINA_LOG_ERR(ERR_PRINT_GVALUE);
1738 else if(G_VALUE_HOLDS_INT(val)) {
1739 if (asprintf(&buffer, "%d", g_value_get_int(val)) < 0)
1740 EINA_LOG_ERR(ERR_PRINT_GVALUE);
1742 else if(G_VALUE_HOLDS_DOUBLE(val)) {
1743 if (asprintf(&buffer, "%g", g_value_get_double(val)) < 0)
1744 EINA_LOG_ERR(ERR_PRINT_GVALUE);
1750 * @brief callback for set new value event
1752 * Callback which allows to set new value in object which has interface value,
1753 * called when "set value" button in value interface is clicked
1755 * @param data action_cb_stuct, which contains object with avaiable value interface
1757 * @param event_info UNUSED
1759 void _value_set_new_value_cb(void *data, Evas_Object *obj, void *event_info)
1761 action_cb_struct *acs = (action_cb_struct*)data;
1768 char *curr_value = NULL;
1770 Evas_Object *entry = eina_list_nth(acs->list, 0);
1771 Evas_Object *label1 = eina_list_nth(acs->list, 1);
1773 GValue gvalue = G_VALUE_INIT;
1774 GValue curr_value_temp = G_VALUE_INIT;
1776 const char *name = g_type_name(G_TYPE_FROM_INSTANCE(acs->atk_obj));
1778 if(!strcmp(name, "EailActionSlider"))
1780 g_value_init (&gvalue, G_TYPE_UINT);
1781 g_value_set_uint(&gvalue, atoi(elm_entry_entry_get(entry)));
1783 else if(!strcmp(name, "EailColorselector") || !strcmp(name, "EailClock") || !strcmp(name, "EailDatetime")
1784 || !strcmp(name, "EailCalendar"))
1786 g_value_init (&gvalue, G_TYPE_INT);
1787 g_value_set_int(&gvalue, atoi(elm_entry_entry_get(entry)));
1791 g_value_init (&gvalue, G_TYPE_DOUBLE);
1792 g_value_set_double(&gvalue, atof(elm_entry_entry_get(entry)));
1795 if(atk_value_set_current_value(ATK_VALUE(acs->atk_obj), &gvalue))
1797 atk_value_get_current_value(ATK_VALUE(acs->atk_obj), &curr_value_temp);
1799 curr_value = gvalue_pprint(&curr_value_temp);
1801 elm_object_text_set(label1, curr_value);
1805 elm_object_text_set(label1, FAIL_OCC);
1811 * @brief prints value layout
1813 * Main function to print Value layout, called when click on selection
1814 * label in toolbar is clicked, that function fills all entries and labels
1815 * in that layout, register callbacks on objects
1817 * @param eo Selection Layout object
1818 * @param obj AtkObject which has focus
1819 * @param parent Main Layout object
1821 void print_value(Evas_Object *eo, AtkObject *obj, Evas_Object *toolbar, Evas_Object *parent)
1823 GValue curr_value_temp = G_VALUE_INIT;
1824 GValue max_value_temp = G_VALUE_INIT;
1825 GValue min_value_temp = G_VALUE_INIT;
1826 GValue min_inc_temp = G_VALUE_INIT;
1828 g_value_init (&curr_value_temp, G_TYPE_DOUBLE);
1829 g_value_init (&max_value_temp, G_TYPE_DOUBLE);
1830 g_value_init (&min_value_temp, G_TYPE_DOUBLE);
1831 g_value_init (&min_inc_temp, G_TYPE_DOUBLE);
1833 char *curr_value = NULL;
1834 char *max_value = NULL;
1835 char *min_value = NULL;
1836 char *min_inc = NULL;
1840 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
1844 eina_list_free(acs->list);
1850 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.entry1"));
1851 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label1"));
1853 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _value_set_new_value_cb);
1855 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _value_set_new_value_cb, acs);
1857 atk_value_get_current_value(ATK_VALUE(obj), &curr_value_temp);
1858 atk_value_get_maximum_value(ATK_VALUE(obj), &max_value_temp);
1859 atk_value_get_minimum_value(ATK_VALUE(obj), &min_value_temp);
1860 atk_value_get_minimum_increment(ATK_VALUE(obj), &min_inc_temp);
1862 curr_value = gvalue_pprint(&curr_value_temp);
1863 max_value = gvalue_pprint(&max_value_temp);
1864 min_value = gvalue_pprint(&min_value_temp);
1865 min_inc = gvalue_pprint(&min_inc_temp);
1867 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), curr_value);
1868 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label2"), max_value);
1869 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), min_value);
1870 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), min_inc);
1877 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.entry1"), NULL);
1879 elm_object_part_content_set(parent, "elm.layout", eo);
1880 evas_object_show(eo);
1884 * @brief prepares Value interface view
1886 * Function prepares Value Layout by adding all
1887 * the used objects to layout and setting object labels
1889 * @param parent Parent Layout object
1891 * @return Evas_Object representing Value layout
1893 Evas_Object* prepare_layout_value(Evas_Object *parent)
1895 Evas_Object *eo = elm_layout_add(parent);
1897 elm_layout_file_set(eo, EDJ_PATH_VAL, "explorer/value");
1899 Evas_Object *lb1, *lb2, *lb3, *lb4, *e1, *button, *separator, *box1;
1901 lb1 = elm_label_add(eo);
1902 lb2 = elm_label_add(eo);
1903 lb3 = elm_label_add(eo);
1904 lb4 = elm_label_add(eo);
1905 box1 = elm_box_add(eo);
1906 e1 = elm_entry_add(eo);
1907 button = elm_button_add(eo);
1908 separator = elm_separator_add(eo);
1909 elm_separator_horizontal_set(separator, EINA_FALSE);
1911 evas_object_size_hint_weight_set(e1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1912 evas_object_size_hint_align_set(e1, EVAS_HINT_FILL, EVAS_HINT_FILL);
1913 elm_entry_scrollable_set(e1, EINA_TRUE);
1914 elm_entry_line_wrap_set(e1, EINA_TRUE);
1915 elm_box_pack_end(box1, e1);
1917 elm_object_part_content_set(eo, "elm.editor.name.box1", box1);
1918 elm_object_part_content_set(eo, "elm.editor.name.label1", lb1);
1919 elm_object_part_content_set(eo, "elm.editor.name.label2", lb2);
1920 elm_object_part_content_set(eo, "elm.editor.name.label3", lb3);
1921 elm_object_part_content_set(eo, "elm.editor.name.label4", lb4);
1922 elm_object_part_content_set(eo, "elm.editor.name.entry1", e1);
1923 elm_object_part_content_set(eo, "elm.separator.1", separator);
1924 elm_object_part_content_set(eo, "elm.editor.name.button", button);
1925 elm_object_text_set(button, SET_VAL);
1927 elm_entry_editable_set(e1, EINA_TRUE);
1928 elm_entry_single_line_set(e1, EINA_TRUE);
1929 elm_object_part_text_set(e1, "guide", ENTER_VAL);
1931 elm_label_slide_duration_set(lb1, 3);
1932 elm_label_slide_duration_set(lb2, 3);
1933 elm_label_slide_duration_set(lb3, 3);
1934 elm_label_slide_duration_set(lb4, 3);
1936 elm_object_style_set(lb1, "slide_bounce");
1937 elm_object_style_set(lb2, "slide_bounce");
1938 elm_object_style_set(lb3, "slide_bounce");
1939 elm_object_style_set(lb4, "slide_bounce");
1941 elm_object_part_text_set(eo, "text1", CURR_VAL);
1942 elm_object_part_text_set(eo, "text2", MAX_VAL);
1943 elm_object_part_text_set(eo, "text3", MIN_VAL);
1944 elm_object_part_text_set(eo, "text4", MIN_INC);
1945 elm_object_part_text_set(eo, "text5", SET_VAL);
1947 evas_object_color_set(separator, 1, 1, 1, 255);
1953 * @brief gets character at offset position
1955 * That callback is called when spinner value in text layout is changed
1957 * @param data action_cb_stuct, which contains object with avaiable text interface
1959 * @param event_info UNUSED
1961 void _text_get_char_at_offset(void *data, Evas_Object *obj, void *event_info)
1963 action_cb_struct *acs = (action_cb_struct*)data;
1968 Evas_Object *eo, *eo1, *eo2;
1969 eo1 = eina_list_nth(acs->list, 0);
1970 eo2 = eina_list_nth(acs->list, 1);
1971 eo = eina_list_nth(acs->list, 4);
1974 gchar *full_text = atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1);
1975 if(full_text && strlen(full_text) > (int)elm_spinner_value_get(eo2))
1977 if (asprintf(&value,"%c", atk_text_get_character_at_offset(ATK_TEXT(acs->atk_obj), (int)elm_spinner_value_get(eo2))) < 0)
1978 EINA_LOG_ERR(ERR_GET_CHAR_OFFSET);
1986 elm_object_text_set(eo1, value);
1989 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
1991 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)) - 1);
1992 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)) - 1);
1996 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
1997 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2002 * @brief selects text
2004 * Callback called when button for select text in text layout is clicked
2006 * @param data param data action_cb_stuct, which contains object with avaiable text interface
2008 * @param event_info UNUSED
2010 void _text_add_selection(void *data, Evas_Object *obj, void *event_info)
2012 action_cb_struct *acs = (action_cb_struct*)data;
2013 char *selected_regions;
2019 Evas_Object *eo1, *eo2, *lab, *eo;
2020 eo1 = eina_list_nth(acs->list, 2);
2021 eo2 = eina_list_nth(acs->list, 3);
2022 lab = eina_list_nth(acs->list, 5);
2023 eo = eina_list_nth(acs->list, 4);
2025 if(!atk_text_remove_selection(ATK_TEXT(acs->atk_obj), 0))
2027 if(!(int)elm_spinner_value_get(eo1) && !(int)elm_spinner_value_get(eo2))
2029 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2032 else if((int)elm_spinner_value_get(eo1) > (int)elm_spinner_value_get(eo2))
2034 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2037 else if((int)elm_spinner_value_get(eo1) == (int)elm_spinner_value_get(eo2))
2039 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2042 atk_text_add_selection(ATK_TEXT(acs->atk_obj), (int)elm_spinner_value_get(eo1), (int)elm_spinner_value_get(eo2));
2044 if(asprintf(&selected_regions, "%d", atk_text_get_n_selections(ATK_TEXT(acs->atk_obj))) < 0)
2046 EINA_LOG_ERR(ERR_MEMORY);
2047 elm_object_text_set(lab, FAIL_OCC);
2051 elm_object_part_text_set(obj, NULL, UNSET);
2052 elm_object_text_set(lab, selected_regions);
2057 if(asprintf(&selected_regions, "%d", atk_text_get_n_selections(ATK_TEXT(acs->atk_obj))) < 0)
2059 EINA_LOG_ERR(ERR_MEMORY);
2063 elm_object_text_set(lab, selected_regions);
2064 elm_object_part_text_set(obj, NULL, SET);
2068 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2070 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2071 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2075 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2076 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2079 free(selected_regions);
2083 * @brief prints the Text layout
2085 * Main function to print selection layout, called when click on text
2086 * label in toolbar is clicked, that function fills all entries and labels
2087 * in that layout, register callbacks on objects
2089 * @param eo Text Layout object
2090 * @param obj AtkObject which has focus
2091 * @param parent Main Layout object
2093 void print_text(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
2096 char *caret_value = NULL;
2097 char *counter = NULL;
2098 char *selected_regions = NULL;
2102 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
2106 eina_list_free(acs->list);
2112 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label2"));
2113 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.spinner"));
2114 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.spinner1"));
2115 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.spinner2"));
2116 acs->list = eina_list_append(acs->list, eo);
2117 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.label5"));
2119 if(atk_text_get_text(ATK_TEXT(obj), 0, -1))
2121 elm_object_disabled_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2122 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner"), 0, strlen(atk_text_get_text(ATK_TEXT(obj), 0, -1)) - 1);
2123 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(obj), 0, -1)));
2124 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(obj), 0, -1)));
2128 elm_object_disabled_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_TRUE);
2129 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner"), 0, 0);
2130 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2131 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2134 elm_spinner_value_set(elm_object_part_content_get(eo, "elm.editor.name.spinner"), 0);
2135 elm_spinner_value_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0);
2136 elm_spinner_value_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0);
2138 elm_entry_entry_set(elm_object_part_content_get(eo, "elm.editor.name.label1"), atk_text_get_text(ATK_TEXT(obj), 0, -1));
2140 if (asprintf(&caret_value, "%d", atk_text_get_caret_offset(ATK_TEXT(obj))) < 0)
2141 EINA_LOG_ERR(ERR_GET_CHAR_OFFSET);
2143 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label3"), caret_value);
2145 if (asprintf(&counter, "%d", atk_text_get_character_count(ATK_TEXT(obj))) < 0)
2146 EINA_LOG_ERR(ERR_CHAR_COUNT);
2148 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label4"), counter);
2150 if (asprintf(&selected_regions, "%d", atk_text_get_n_selections(ATK_TEXT(obj))) < 0)
2151 EINA_LOG_ERR(ERR_N_SELECTIONS);
2153 if(atk_text_get_n_selections(ATK_TEXT(obj)) == -1)
2155 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), FAIL_OCC);
2156 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.button"), SET);
2157 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2158 elm_object_disabled_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_TRUE);
2160 else if(atk_text_get_n_selections(ATK_TEXT(obj)) > 0)
2162 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), selected_regions);
2163 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.button"), UNSET);
2164 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_TRUE);
2168 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.label5"), selected_regions);
2169 elm_object_text_set(elm_object_part_content_get(eo, "elm.editor.name.button"), SET);
2170 elm_check_state_set(elm_object_part_content_get(eo, "elm.editor.name.button"), EINA_FALSE);
2174 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button"), "changed", _text_add_selection);
2175 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.spinner"), "changed", _text_get_char_at_offset);
2177 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button"), "changed", _text_add_selection, acs);
2178 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.spinner"), "changed", _text_get_char_at_offset, acs);
2180 elm_object_part_content_set(parent, "elm.layout", eo);
2181 evas_object_show(eo);
2184 free(selected_regions);
2187 * @brief prepares Text interface view
2189 * Function prepares text Layout by adding all
2190 * the used objects to layout and setting object labels
2192 * @param parent Parent Layout object
2194 * @return Evas_Object representing text layout
2196 Evas_Object* prepare_layout_text(Evas_Object *parent)
2198 Evas_Object *eo = elm_layout_add(parent);
2200 elm_layout_file_set(eo, EDJ_PATH_TXT, "explorer/text");
2202 Evas_Object *e1, *lb1, *lb2, *lb3, *lb4, *separator, *spinner, *spinner1, *spinner2, *box;
2203 Evas_Object *selection_check;
2205 box = elm_box_add(eo);
2206 e1 = elm_entry_add(eo);
2207 lb1 = elm_label_add(eo);
2208 lb2 = elm_label_add(eo);
2209 lb3 = elm_label_add(eo);
2210 lb4 = elm_label_add(eo);
2211 spinner = elm_spinner_add(eo);
2212 spinner1 = elm_spinner_add(eo);
2213 spinner2 = elm_spinner_add(eo);
2214 separator = elm_separator_add(eo);
2215 selection_check = elm_check_add(eo);
2217 evas_object_size_hint_weight_set(e1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2218 evas_object_size_hint_align_set(e1, EVAS_HINT_FILL, EVAS_HINT_FILL);
2219 elm_entry_scrollable_set(e1, EINA_TRUE);
2220 elm_entry_line_wrap_set(e1, EINA_TRUE);
2221 elm_box_pack_end(box, e1);
2223 elm_separator_horizontal_set(separator, EINA_FALSE);
2224 elm_object_part_content_set(eo, "elm.editor.name.box1", box);
2225 elm_object_part_content_set(eo, "elm.editor.name.label1", e1);
2226 elm_object_part_content_set(eo, "elm.editor.name.label2", lb1);
2227 elm_object_part_content_set(eo, "elm.editor.name.label3", lb2);
2228 elm_object_part_content_set(eo, "elm.editor.name.label4", lb3);
2229 elm_object_part_content_set(eo, "elm.editor.name.label5", lb4);
2230 elm_object_part_content_set(eo, "elm.editor.name.spinner", spinner);
2231 elm_object_part_content_set(eo, "elm.editor.name.spinner1", spinner1);
2232 elm_object_part_content_set(eo, "elm.editor.name.spinner2", spinner2);
2233 elm_object_part_content_set(eo, "elm.editor.name.button", selection_check);
2234 elm_object_part_content_set(eo, "elm.editor.name.separator", separator);
2236 elm_entry_editable_set(e1, EINA_FALSE);
2237 elm_object_part_text_set(e1, "guide", ENTER_VAL);
2239 elm_label_slide_duration_set(lb1, 3);
2240 elm_label_slide_duration_set(lb2, 3);
2241 elm_label_slide_duration_set(lb3, 3);
2242 elm_label_slide_duration_set(lb4, 3);
2244 elm_object_style_set(lb1, "slide_bounce");
2245 elm_object_style_set(lb2, "slide_bounce");
2246 elm_object_style_set(lb3, "slide_bounce");
2247 elm_object_style_set(lb4, "slide_bounce");
2249 evas_object_color_set(separator, 1, 1, 1, 255);
2251 elm_object_part_text_set(eo, "text1", TEXT_VAL);
2252 elm_object_part_text_set(eo, "text2", CHAR_AT_OFFSET);
2253 elm_object_part_text_set(eo, "text3", CARET_OFFSET);
2254 elm_object_part_text_set(eo, "text4", CHAR_COUNT);
2255 elm_object_part_text_set(eo, "text5", NUM_OF_SEL_REGIONS);
2256 elm_object_part_text_set(eo, "text6", OFFSET);
2257 elm_object_part_text_set(eo, "text7", START_OFFSET);
2258 elm_object_part_text_set(eo, "text8", END_OFFSET);
2259 elm_object_part_text_set(eo, "text9", SET_SEL);
2260 elm_object_part_text_set(eo, "text10", USAGE);
2268 * Called when set text button in Editable text layout is clicked.
2269 * Allows to set text for labels, entries and all other object which implements that interface.
2271 * @param data action_cb_stuct, which contains object with avaiable editable text interface
2273 * @param event_info UNUSED
2275 void _text_set_cb(void *data, Evas_Object *obj, void *event_info)
2277 action_cb_struct *acs = (action_cb_struct*)data;
2283 Evas_Object *eo1, *eo;
2284 eo1 = eina_list_nth(acs->list, 0);
2285 eo = eina_list_nth(acs->list, 3);
2287 atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(acs->atk_obj), elm_entry_entry_get(eo1));
2289 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2291 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2292 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2296 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2297 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2304 * Called when copy text button in Editable text layout is clicked.
2305 * Allows to copy text in labels, entries and all other object which implements that interface.
2307 * @param data action_cb_stuct, which contains object with avaiable text interface
2309 * @param event_info UNUSED
2311 void _text_copy_cb(void *data, Evas_Object *obj, void *event_info)
2313 action_cb_struct *acs = (action_cb_struct*)data;
2319 Evas_Object *spin, *spin1, *eo;
2320 spin = eina_list_nth(acs->list, 1);
2321 spin1 = eina_list_nth(acs->list, 2);
2322 eo = eina_list_nth(acs->list, 3);
2324 if(!atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2327 if((int)elm_spinner_value_get(spin) > strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)))
2330 if((int)elm_spinner_value_get(spin) > (int)elm_spinner_value_get(spin1))
2333 atk_editable_text_copy_text(ATK_EDITABLE_TEXT(acs->atk_obj),(int)elm_spinner_value_get(spin), (int)elm_spinner_value_get(spin1));
2335 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2337 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2338 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2342 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2343 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2350 * Called when paste text button in Editable text layout is clicked.
2351 * Allows to paste text for entries and all other object which implements that interface.
2353 * @param data action_cb_stuct, which contains object with avaiable text interface
2355 * @param event_info UNUSED
2357 void _text_paste_cb(void *data, Evas_Object *obj, void *event_info)
2359 action_cb_struct *acs = (action_cb_struct*)data;
2365 Evas_Object *spin, *eo;
2366 spin = eina_list_nth(acs->list, 1);
2367 eo = eina_list_nth(acs->list, 3);
2369 if(!atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2371 atk_editable_text_paste_text(ATK_EDITABLE_TEXT(acs->atk_obj), 0);
2372 elm_entry_entry_set(eina_list_nth(acs->list, 0), atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1));
2376 if((int)elm_spinner_value_get(spin) >= strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)))
2378 atk_editable_text_paste_text(ATK_EDITABLE_TEXT(acs->atk_obj), strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2379 elm_entry_entry_set(eina_list_nth(acs->list, 0), atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1));
2383 atk_editable_text_paste_text(ATK_EDITABLE_TEXT(acs->atk_obj),(int)elm_spinner_value_get(spin));
2386 elm_entry_entry_set(eina_list_nth(acs->list, 0), atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1));
2388 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2390 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2391 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2395 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2396 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2403 * Called when cut text button in Editable text layout is clicked.
2404 * Allows to cut text for entries and all other object which implements that interface.
2406 * @param data action_cb_stuct, which contains object with avaiable text interface
2408 * @param event_info UNUSED
2410 void _text_cut_cb(void *data, Evas_Object *obj, void *event_info)
2412 action_cb_struct *acs = (action_cb_struct*)data;
2418 Evas_Object *spin, *spin1, *eo;
2419 spin = eina_list_nth(acs->list, 1);
2420 spin1 = eina_list_nth(acs->list, 2);
2421 eo = eina_list_nth(acs->list, 3);
2423 if(!atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2426 if((int)elm_spinner_value_get(spin) > (int)elm_spinner_value_get(spin1))
2429 else if((int)elm_spinner_value_get(spin) > strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)) ||
2430 (int)elm_spinner_value_get(spin1) > strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)))
2433 atk_editable_text_cut_text(ATK_EDITABLE_TEXT(acs->atk_obj), (int)elm_spinner_value_get(spin), (int)elm_spinner_value_get(spin1));
2434 elm_entry_entry_set(eina_list_nth(acs->list, 0), atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1));
2436 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2438 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2439 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2443 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2444 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2449 * @brief prints the Editable Text layout
2451 * Main function to print selection layout, called when click on editable text
2452 * label in toolbar is clicked, that function fills all entries and labels
2453 * in that layout, register callbacks on objects
2455 * @param eo Editable Text Layout object
2456 * @param obj AtkObject which has focus
2457 * @param parent Main Layout object
2459 void print_edit_text(Evas_Object *eo, AtkObject *obj, Evas_Object *parent)
2464 acs = (action_cb_struct*)malloc(sizeof(action_cb_struct));
2468 eina_list_free(acs->list);
2474 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.e1"));
2475 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.spinner1"));
2476 acs->list = eina_list_append(acs->list, elm_object_part_content_get(eo, "elm.editor.name.spinner2"));
2477 acs->list = eina_list_append(acs->list, eo);
2479 if(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1))
2481 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2482 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, strlen(atk_text_get_text(ATK_TEXT(acs->atk_obj), 0, -1)));
2486 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner1"), 0, 0);
2487 elm_spinner_min_max_set(elm_object_part_content_get(eo, "elm.editor.name.spinner2"), 0, 0);
2490 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _text_set_cb);
2491 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _text_copy_cb);
2492 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _text_paste_cb);
2493 evas_object_smart_callback_del(elm_object_part_content_get(eo, "elm.editor.name.button3"), "clicked", _text_cut_cb);
2495 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button"), "clicked", _text_set_cb, acs);
2496 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button1"), "clicked", _text_copy_cb, acs);
2497 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button2"), "clicked", _text_paste_cb, acs);
2498 evas_object_smart_callback_add(elm_object_part_content_get(eo, "elm.editor.name.button3"), "clicked", _text_cut_cb, acs);
2500 elm_object_part_content_set(parent, "elm.layout", eo);
2501 evas_object_show(eo);
2505 * @brief prepares Editable Text interface view
2507 * Function prepares Editable Text Layout by adding all
2508 * the used objects to layout and setting object labels
2510 * @param parent Parent Layout object
2512 * @return Evas_Object representing Editable Text layout
2514 Evas_Object* prepare_layout_edit_text(Evas_Object *parent)
2516 Evas_Object *eo = elm_layout_add(parent);
2518 elm_layout_file_set(eo, EDJ_PATH_ETXT, "explorer/editable_text");
2520 Evas_Object *e1, *separator, *spinner1, *spinner2, *box;
2521 Evas_Object *set_text_button, *copy_text_button, *paste_text_button;
2522 Evas_Object *cut_text_button;
2524 box = elm_box_add(eo);
2525 e1 = elm_entry_add(eo);
2526 spinner1 = elm_spinner_add(eo);
2527 spinner2 = elm_spinner_add(eo);
2528 separator = elm_separator_add(eo);
2529 set_text_button = elm_button_add(eo);
2530 copy_text_button = elm_button_add(eo);
2531 paste_text_button = elm_button_add(eo);
2532 cut_text_button = elm_button_add(eo);
2534 evas_object_size_hint_weight_set(e1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2535 evas_object_size_hint_align_set(e1, EVAS_HINT_FILL, EVAS_HINT_FILL);
2536 elm_entry_single_line_set(e1, EINA_TRUE);
2537 elm_entry_scrollable_set(e1, EINA_TRUE);
2538 elm_entry_line_wrap_set(e1, EINA_TRUE);
2539 elm_box_pack_end(box, e1);
2541 elm_object_part_text_set(e1, "guide", ENTER_TXT);
2543 elm_separator_horizontal_set(separator, EINA_FALSE);
2544 elm_object_part_content_set(eo, "elm.editor.name.box1", box);
2545 elm_object_part_content_set(eo, "elm.editor.name.e1", e1);
2546 elm_object_part_content_set(eo, "elm.editor.name.spinner1", spinner1);
2547 elm_object_part_content_set(eo, "elm.editor.name.spinner2", spinner2);
2548 elm_object_part_content_set(eo, "elm.editor.name.button", set_text_button);
2549 elm_object_part_content_set(eo, "elm.editor.name.button1", copy_text_button);
2550 elm_object_part_content_set(eo, "elm.editor.name.button2", paste_text_button);
2551 elm_object_part_content_set(eo, "elm.editor.name.button3", cut_text_button);
2552 elm_object_part_content_set(eo, "elm.editor.name.separator", separator);
2554 elm_object_text_set(set_text_button, SET);
2555 elm_object_text_set(copy_text_button, COPY);
2556 elm_object_text_set(paste_text_button, PASTE);
2557 elm_object_text_set(cut_text_button, CUT);
2559 evas_object_color_set(separator, 1, 1, 1, 255);
2561 elm_object_part_text_set(eo, "text1", SET_TEXT);
2562 elm_object_part_text_set(eo, "text2", COPY);
2563 elm_object_part_text_set(eo, "text3", COPY_TEXT_DESCRIPTION);
2564 elm_object_part_text_set(eo, "text4", PASTE_TEXT);
2565 elm_object_part_text_set(eo, "text5", CUT_TEXT);
2566 elm_object_part_text_set(eo, "text6", START_POINT);
2567 elm_object_part_text_set(eo, "text7", END_POINT);