#ifndef CHOICEBOX_H #define CHOICEBOX_H #include #include typedef void (*choicebox_handler_t)(Evas_Object* choicebox, int item_num, bool is_alt, void* param); typedef void (*choicebox_draw_handler_t)(Evas_Object* choicebox, Evas_Object* item, int item_num, int page_position, void* param); typedef void (*choicebox_footer_draw_handler_t)(Evas_Object* choicebox, Evas_Object* footer, int cur_page, int total_pages, void* param); /* * Choicebox uses two groups in theme file, called $group_prefix/item and * $group_prefix/footer. * * Both groups should have data item called 'min_height'. As soon as edje can * read the min size from the group, this requirement will be lifted. * * Items will be sent the following signals: * - select, for setting selected state * - deselect, for unsetting selected state * - set_even, for setting "even" variant of state, if necessary * - set_odd, for setting "odd" variant of state, if necessary * - empty, for setting "empty" variant of state, for items beyond the end of list * * Choicebox does not manipulate content of the items, providing callbacks for * this. */ Evas_Object* choicebox_new(Evas* evas, const char* theme_file, /* It sucks, do you know better way? */ const char* group_prefix, choicebox_handler_t handler, choicebox_draw_handler_t draw_handler, choicebox_footer_draw_handler_t footer_draw_handler, void* param); void choicebox_set_size(Evas_Object* e, int size); void choicebox_invalidate_item(Evas_Object* e, int item_num); /* This is mostly for keyboard handling */ void choicebox_up(Evas_Object* e); void choicebox_down(Evas_Object* e); void choicebox_pgup(Evas_Object* e); void choicebox_pgdown(Evas_Object* e); void choicebox_activate_nth_visible(Evas_Object* e, int nth, bool is_alt); void choicebox_activate_current(Evas_Object* e, bool is_alt); #endif