/**
 * @brief Negative test case of ug_init elm_scroller_policy_get()
 */
static void utc_UIFW_elm_scroller_policy_get_func_02(void)
{
	Elm_Scroller_Policy *policy_h;
	Elm_Scroller_Policy *policy_v;

	// Current return type of this API is "Void"
	elm_scroller_policy_get(NULL, policy_h, policy_v);

	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]: TC_02, [TYPE]: Negative, [RESULT]: PASS, Getting the scroller scrollbar policy has failed.");

}
/**
 * @brief Positive test case of elm_scroller_policy_get()
 */
static void utc_UIFW_elm_scroller_policy_get_func_01(void)
{
	Elm_Scroller_Policy policy_h;
	Elm_Scroller_Policy policy_v;

	Evas_Object *test_scroller = NULL;

	test_scroller = elm_scroller_add(main_win);

	// Current return type of this API is "Void"
	elm_scroller_policy_get(test_scroller, &policy_h, &policy_v);

	switch(policy_h)
	{
		case ELM_SCROLLER_POLICY_AUTO:
		case ELM_SCROLLER_POLICY_ON:
		case ELM_SCROLLER_POLICY_OFF:
		case ELM_SCROLLER_POLICY_LAST:
			{
				switch(policy_v)
				{
					case ELM_SCROLLER_POLICY_AUTO:
					case ELM_SCROLLER_POLICY_ON:
					case ELM_SCROLLER_POLICY_OFF:
					case ELM_SCROLLER_POLICY_LAST:
						tet_result(TET_PASS);
						tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: PASS, Get the scroller scrollbar policy.");
						break;
					default:
						tet_result(TET_FAIL);
						tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: FAIL, Getting the scroller scrollbar policy has failed.");

				}
			}
			break;
		default:
			tet_result(TET_FAIL);
			tet_infoline("[[ TET_MSG ]]::[ID]: TC_01, [TYPE]: Positive, [RESULT]: FAIL, Getting the scroller scrollbar policy has failed.");

	}

}
Ejemplo n.º 3
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
    Evas_Object *win, *box, *hbox;
    Evas_Object *list, *btn;
    int i;

    win = elm_win_util_standard_add("genlist", "Genlist - simple");
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    elm_win_autodel_set(win, EINA_TRUE);

    box = elm_box_add(win);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, box);
    evas_object_show(box);

    list = elm_genlist_add(win);

    if (!_itc)
    {
        _itc = elm_genlist_item_class_new();
        _itc->item_style = "default";
        _itc->func.text_get = _item_label_get;
        _itc->func.content_get = _item_content_get;
        _itc->func.state_get = NULL;
        _itc->func.del = NULL;
    }

    Eina_Bool hbounce, vbounce, always, no_sel;
    Elm_Scroller_Policy hp, vp;
    Elm_Object_Select_Mode sel_mode;

    always = no_sel = EINA_FALSE;
    sel_mode = elm_genlist_select_mode_get(list);
    if (sel_mode == ELM_OBJECT_SELECT_MODE_ALWAYS)
        always = EINA_TRUE;
    else if (sel_mode == ELM_OBJECT_SELECT_MODE_NONE)
        no_sel = EINA_TRUE;

    printf("default values:\n");
    printf("always select: %d\n", always);
    elm_scroller_bounce_get(list, &hbounce, &vbounce);
    printf("bounce - horizontal: %d, vertical: %d\n", hbounce, vbounce);
    printf("homogeneous: %d\n", elm_genlist_homogeneous_get(list));
    printf("horizontal mode: %d\n", elm_genlist_mode_get(list));
    printf("longpress timeout: %0.3f\n",
           elm_genlist_longpress_timeout_get(list));
    printf("multi selection: %d\n", elm_genlist_multi_select_get(list));
    printf("no selection mode: %d\n", no_sel);
    elm_scroller_policy_get(list, &hp, &vp);
    printf("scroller policy - horizontal: %d, vertical: %d\n", hp, vp);
    printf("block count: %d\n", elm_genlist_block_count_get(list));
    printf("\n");

    elm_scroller_bounce_set(list, EINA_FALSE, EINA_FALSE);
    elm_genlist_homogeneous_set(list, EINA_FALSE);
    elm_genlist_mode_set(list, ELM_LIST_LIMIT);
    elm_genlist_multi_select_set(list, EINA_TRUE);
    elm_genlist_select_mode_set(list, ELM_OBJECT_SELECT_MODE_DEFAULT);
    elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
    elm_genlist_longpress_timeout_set(list, 0.5);
    elm_genlist_block_count_set(list, 16);

    for (i = 0; i < N_ITEMS; i++)
    {
        elm_genlist_item_append(list, _itc,
                                (void *)(long)i, NULL,
                                ELM_GENLIST_ITEM_NONE,
                                _item_sel_cb, NULL);
    }

    evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, list);
    evas_object_show(list);

    hbox = elm_box_add(win);
    elm_box_horizontal_set(hbox, EINA_TRUE);
    evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
    evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, hbox);
    evas_object_show(hbox);

    btn = elm_button_add(win);
    elm_object_text_set(btn, "Show status");
    evas_object_size_hint_weight_set(btn, 0, 0);
    evas_object_size_hint_align_set(btn, 0.5, 0.5);
    evas_object_smart_callback_add(btn, "clicked", _show_status_cb, list);
    elm_box_pack_end(hbox, btn);
    evas_object_show(btn);

    btn = elm_button_add(win);
    elm_object_text_set(btn, "Realize");
    evas_object_size_hint_weight_set(btn, 0, 0);
    evas_object_size_hint_align_set(btn, 0.5, 0.5);
    evas_object_smart_callback_add(btn, "clicked", _realize_cb, list);
    elm_box_pack_end(hbox, btn);
    evas_object_show(btn);

    evas_object_resize(win, 200, 320);
    evas_object_show(win);

    elm_run();
    elm_shutdown();

    return 0;
}