static void
_init_network_page()
{
	Evas_Object *win = ui_utils_view_window_get(VIEW_PTR(view));
	view.layout2 = elm_layout_add(win);
	elm_win_resize_object_add(win, view.layout2);
	evas_object_size_hint_weight_set(view.layout2,
					 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_layout_file_set(view.layout2, phoneui_theme,
			    "phoneui/settings/quick-settings/network");
	evas_object_show(view.layout2);

	view.gprs_slide = elm_check_add(win);
	elm_object_style_set(view.gprs_slide, "toggle");
	elm_object_part_content_set(view.layout2, "network-frame-auto-frame-gprs-slide", view.gprs_slide);
	evas_object_smart_callback_add(view.gprs_slide, "changed", _gprs_slide_changed_cb, NULL);
	elm_object_part_text_set(view.gprs_slide, "on", D_("Connected"));
	elm_object_part_text_set(view.gprs_slide, "off", D_("Disconnected"));
	evas_object_show(view.gprs_slide);

	view.sharing_slide = elm_check_add(win);
	elm_object_style_set(view.sharing_slide, "toggle");
	elm_object_part_content_set(view.layout2, "network-frame-auto-frame-sharing-slide", view.sharing_slide);
	evas_object_smart_callback_add(view.sharing_slide, "changed", _sharing_slide_changed_cb, NULL);
	elm_object_part_text_set(view.sharing_slide, "on", D_("Sharing"));
	elm_object_part_text_set(view.sharing_slide, "off", D_("Not sharing"));
	evas_object_show(view.sharing_slide);

	// FIXME: until we implement it
	elm_object_disabled_set(view.sharing_slide, 1);

	elm_naviframe_item_simple_push(view.pager, view.layout2);

	phoneui_info_register_and_request_pdp_context_status(_pdp_context_status_signal_cb, NULL);
}
Tab_Data *
tab_add(App_Data *ad)
{
   Tab_Data *td;

   td = calloc(1, sizeof(Tab_Data));
   if (!td) return NULL;

   td->web = elm_web_add(ad->win);
   elm_web_window_create_hook_set(td->web, _web_create_window_cb, ad);
   elm_web_inwin_mode_set(td->web, EINA_TRUE);
   evas_object_size_hint_weight_set(td->web, EVAS_HINT_EXPAND,
                                    EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(td->web, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_naviframe_item_simple_push(ad->naviframe, td->web);

   td->app = ad;
   td->tab = elm_toolbar_item_append(td->app->tabs, NULL, "New tab",
                                     _tab_clicked_cb, td);
   elm_object_item_del_cb_set(td->tab, _tb_item_del_cb);

   evas_object_data_set(td->web, "tab_data", td);

   evas_object_smart_callback_add(td->web, "title,changed", _title_changed_cb,
                                  td);
   evas_object_smart_callback_add(td->web, "uri,changed", _uri_changed_cb, td);
   evas_object_event_callback_add(td->web, EVAS_CALLBACK_FREE, _web_free_cb,
                                  td);

   elm_toolbar_item_selected_set(td->tab, EINA_TRUE);
   return td;
}
static void
_init_content_page(struct MessageNewViewData *view)
{
	Evas_Object *win, *btn;

	win = ui_utils_view_window_get(VIEW_PTR(*view));

	view->layout_content = elm_layout_add(win);
	elm_win_resize_object_add(win, view->layout_content);
	evas_object_size_hint_weight_set(view->layout_content,
					 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_layout_file_set(view->layout_content, phoneui_theme,
			    "phoneui/messages/new/content");
	evas_object_show(view->layout_content);

	edje_object_part_text_set(elm_layout_edje_get(view->layout_content),
			"content_title", D_("Enter your message"));

	view->content_entry = elm_entry_add(win);
	elm_entry_scrollable_set(view->content_entry, EINA_TRUE);
	evas_object_smart_callback_add(view->content_entry, "changed",
				       _content_changed, view);
	if (view->content != NULL) {
		elm_entry_entry_set(view->content_entry,
				    elm_entry_utf8_to_markup(view->content));
	}
	evas_object_show(view->content_entry);
	elm_object_part_content_set(view->layout_content, "content_entry", view->content_entry);
	elm_object_focus_set(view->content_entry, EINA_TRUE);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Insert"));
	evas_object_smart_callback_add(btn, "clicked",
				       _content_button_insert_clicked, view);
	elm_object_part_content_set(view->layout_content,
			       "content_button_insert", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Close"));
	evas_object_smart_callback_add(btn, "clicked",
				       _content_button_close_clicked, view);
	elm_object_part_content_set(view->layout_content,
			       "content_button_close", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Continue"));
	evas_object_smart_callback_add(btn, "clicked",
				       _content_button_continue_clicked, view);
	elm_object_part_content_set(view->layout_content,
			       "content_button_continue", btn);
	evas_object_show(btn);

	elm_naviframe_item_simple_push(view->pager, view->layout_content);
}
static void
_init_number_page(struct MessageNewViewData *view)
{
	Evas_Object *win, *btn, *ico;

	win = ui_utils_view_window_get(VIEW_PTR(*view));

	view->number[0] = '\0';
	view->number_length = 0;
	view->layout_number = elm_layout_add(view->pager);
	elm_win_resize_object_add(win, view->layout_number);
	elm_layout_file_set(view->layout_number, phoneui_theme,
			    "phoneui/messages/new/number");
	evas_object_show(view->layout_number);

	edje_object_part_text_set(elm_layout_edje_get(view->layout_number),
			"number_title", D_("Add Number"));

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Back"));
	evas_object_smart_callback_add(btn, "clicked",
				       _number_button_back_clicked, view);
	elm_object_part_content_set(view->layout_number, "number_button_back", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Add"));
	evas_object_smart_callback_add(btn, "clicked",
				       _number_button_add_clicked, view);
	elm_object_part_content_set(view->layout_number, "number_button_add", btn);
	evas_object_show(btn);

	ico = elm_icon_add(win);
	evas_object_size_hint_aspect_set(ico, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
	elm_image_file_set(ico, phoneui_theme, "icon/edit-undo");
	evas_object_show(ico);

	btn = elm_button_add(win);
	elm_object_content_set(btn, ico);
	elm_object_part_content_set(view->layout_number, "number_button_delete", btn);
	evas_object_smart_callback_add(btn, "clicked",
				       _number_button_delete_clicked, view);
	evas_object_show(btn);

	view->number_keypad = (Evas_Object *) elm_keypad_add(win);
	evas_object_smart_callback_add(view->number_keypad, "clicked",
				       _number_keypad_clicked, view);
	elm_object_part_content_set(view->layout_number, "number_keypad",
			       view->number_keypad);
	evas_object_show(view->number_keypad);

	elm_naviframe_item_simple_push(view->pager, view->layout_number);
}
static void
_content_button_insert_clicked(void *data, Evas_Object *obj, void *event_info)
{
	(void) obj;
	(void) event_info;

	Evas_Object *win, *btn;

	struct MessageNewViewData *view = (struct MessageNewViewData *)data;
	win = ui_utils_view_window_get(VIEW_PTR(*view));

	if (view->layout_contacts) {
	//	elm_naviframe_item_simple_promote(view->pager, view->layout_contacts);
	}
	else {
		_init_contacts_page(view);
	}

	view->contact_list_data.layout = view->layout_contacts;
	contact_list_add(&view->contact_list_data);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Back"));
	evas_object_smart_callback_add(btn, "clicked",
				       _insert_contacts_button_back_clicked, view);
	elm_object_part_content_set(view->layout_contacts, "contacts_button_back", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Add"));
	evas_object_smart_callback_add(btn, "clicked",
				       _insert_contacts_button_add_clicked, view);
	elm_object_part_content_set(view->layout_contacts, "contacts_button_add", btn);
	evas_object_show(btn);

	contact_list_fill(&view->contact_list_data);
	elm_naviframe_item_simple_push(view->pager, view->layout_contacts);
}
static void
_init_contacts_page(struct MessageNewViewData *view)
{
	Evas_Object *win, *btn;

	win = ui_utils_view_window_get(VIEW_PTR(*view));

	view->layout_contacts = elm_layout_add(view->pager);
	elm_win_resize_object_add(win, view->layout_contacts);
	elm_layout_file_set(view->layout_contacts, phoneui_theme,
			    "phoneui/messages/new/contacts");
	evas_object_show(view->layout_contacts);

	edje_object_part_text_set(elm_layout_edje_get(view->layout_contacts),
			"contacts_title", D_("Add Contact"));

	view->contact_list_data.layout = view->layout_contacts;
	contact_list_add(&view->contact_list_data);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Back"));
	evas_object_smart_callback_add(btn, "clicked",
				       _contacts_button_back_clicked, view);
	elm_object_part_content_set(view->layout_contacts, "contacts_button_back", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Add"));
	evas_object_smart_callback_add(btn, "clicked",
				       _contacts_button_add_clicked, view);
	elm_object_part_content_set(view->layout_contacts, "contacts_button_add", btn);
	evas_object_show(btn);

	contact_list_fill(&view->contact_list_data);
	elm_naviframe_item_simple_push(view->pager, view->layout_contacts);
}
int phone_log_view_init()
{
	g_debug("Initializing the phonelog screen");
	Evas_Object *win;
	int ret;
	//char buf[PATH_MAX];

	ret = ui_utils_view_init(VIEW_PTR(view), ELM_WIN_BASIC, D_("Phonelog"),
			NULL, _hide_cb, NULL);

	if (ret) {
		g_critical("Failed to init phonelog view");
		return ret;
	}

	win = ui_utils_view_window_get(VIEW_PTR(view));
	ui_utils_view_delete_callback_set(VIEW_PTR(view), _delete_cb);

	ui_utils_view_layout_set(VIEW_PTR(view), phoneui_theme,
				 "phoneui/phonelog/phonelog");
	elm_theme_extension_add(NULL, phoneui_theme);

	view.pager = elm_naviframe_add(win);
	ui_utils_view_swallow(VIEW_PTR(view), "pager", view.pager);
	evas_object_show(view.pager);

	view.list_in = _add_genlist(win);
	elm_naviframe_item_simple_push(view.pager, view.list_in);
	view.list_out = _add_genlist(win);
	elm_naviframe_item_simple_push(view.pager, view.list_out);
	view.list_all = _add_genlist(win);
	elm_naviframe_item_simple_push(view.pager, view.list_all);
	view.list_missed = _add_genlist(win);
	elm_naviframe_item_simple_push(view.pager, view.list_missed);

	itc.item_style = "phonelog";
	itc.func.text_get = gl_text_get;
	itc.func.content_get = gl_content_get;
	itc.func.state_get = gl_state_get;
	itc.func.del = gl_del;

	view.toolbar = elm_toolbar_add(win);
	ui_utils_view_swallow(VIEW_PTR(view), "toolbar", view.toolbar);
	elm_toolbar_homogeneous_set(view.toolbar, 1);
	elm_toolbar_shrink_mode_set(view.toolbar, ELM_TOOLBAR_SHRINK_NONE);
	elm_toolbar_align_set(view.toolbar, 0.0);
	elm_toolbar_icon_size_set(view.toolbar, 16);
	evas_object_size_hint_weight_set(view.toolbar, 0.0, 0.0);
	evas_object_size_hint_align_set(view.toolbar, EVAS_HINT_FILL, 0.0);

	elm_toolbar_item_append(view.toolbar, "icon/phonelog-incoming", D_("received"),
			     _toolbar_changed, view.list_in);

	elm_toolbar_item_append(view.toolbar, "icon/phonelog-outgoing", D_("outgoing"),
			     _toolbar_changed, view.list_out);

	view.toolbar_missed = elm_toolbar_item_append(view.toolbar, "icon/phonelog-missed",
						   D_("missed"),
						   _toolbar_changed,
						   view.list_missed);

	elm_toolbar_item_append(view.toolbar, "icon/phonelog-all", D_("all"), _toolbar_changed,
			     view.list_all);

	evas_object_show(view.toolbar);
	elm_toolbar_item_selected_set(view.toolbar_missed, EINA_TRUE);

	view.calls = g_ptr_array_new();

	view.count = 25; // FIXME: make the limit configurable !!! */
	phoneui_utils_calls_get(&view.count,_get_callback, NULL);

	phoneui_info_register_call_changes(_call_changed_handler, NULL);
	phoneui_info_register_contact_changes(_contact_changed_handler, NULL);

	return 0;
}
Example #8
0
File: pager.c Project: Limsik/e17
void
create_pager(Evas_Object *parent, Evas_Object *pg, Pginfo *info,
		Measurements_Lists *ml)
{
   Evas_Object *ed, *converters_list, *layout;
   pg = elm_naviframe_add(parent);
   elm_win_resize_object_add(parent, pg);
   evas_object_size_hint_weight_set(pg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(pg, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(pg);
   info->pager = pg;

   /*main page*/
   layout = elm_layout_add(parent);
   if (!elm_layout_file_set(layout, PACKAGE_DATA_DIR "/default.edj", "main"))
     {
	DBG("Can't load Edje Layout %s", PACKAGE_DATA_DIR "/default.edj");
	return;
     }
   evas_object_show(layout);
   elm_naviframe_item_simple_push(pg, layout);
   info->pg1 = layout;

   converters_list = elm_list_add(parent);
   elm_object_part_content_set(layout, "converters_list", converters_list);
   evas_object_size_hint_weight_set(converters_list,
					EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_fill_set(converters_list,
					EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(converters_list);
   populate_converters_list(converters_list, info);

   /* distance conerter*/
   layout = elm_layout_add(parent);
   if (!elm_layout_file_set(layout, PACKAGE_DATA_DIR "/default.edj",
				"distance_converter"))
     {
	DBG("Can't load Edje Layout %s", PACKAGE_DATA_DIR "/default.edj");
	return;
     }
   evas_object_show(layout);
   ed = elm_layout_edje_get(layout);
   edje_object_part_text_set(ed, "equal", "");
   edje_object_part_text_set(ed, "input", "");
   edje_object_part_text_set(ed, "output", "");

   ml->list_in = elm_list_add(parent);
   elm_object_part_content_set(layout, "measurements_in", ml->list_in);
   evas_object_size_hint_weight_set(ml->list_in,
					EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_fill_set(ml->list_in,
					EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(ml->list_in);
   populate_measurements_list_in(ml->list_in, ed, info);

   ml->list_out = elm_list_add(parent);
   elm_object_part_content_set(layout, "measurements_out", ml->list_out);
   evas_object_size_hint_weight_set(ml->list_out,
					EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_fill_set(ml->list_out,
					EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(ml->list_out);
   populate_measurements_list_out(ml->list_out, ed, info);

   /* Set callback functions */
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_1",
					on_number_button_clicked, "1");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_2",
					on_number_button_clicked, "2");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_3",
					on_number_button_clicked, "3");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_4",
					on_number_button_clicked, "4");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_5",
					on_number_button_clicked, "5");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_6",
					on_number_button_clicked, "6");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_7",
					on_number_button_clicked, "7");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_8",
					on_number_button_clicked, "8");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_9",
					on_number_button_clicked, "9");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_0",
					on_number_button_clicked, "0");
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_clear",
					on_number_button_clear, ml);
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "bt_enter",
					on_number_button_enter, ml);
   edje_object_signal_callback_add(ed, "mouse,clicked,1", "back",
					 back_page_1, info);
   elm_naviframe_item_simple_push(pg, layout);
   info->pg2 = layout;
   elm_naviframe_item_simple_promote(info->pager, info->pg1);
}
Example #9
0
void
flickr_sync_update(Enlil_Album *album)
{
   Enlil_Album_Data *album_data = enlil_album_user_data_get(album);
   Evas_Object *fr, *tb2, *lbl, *bt, *sep, *pb, *pager;
   Evas_Object *inwin = album_data->netsync.inwin.win;
   Evas_Object *tb = album_data->netsync.inwin.tb;
   int i = 0;
   Eina_List *l;
   Enlil_Photo *photo;
   int nb_photos;
   char buf[1024];

   if (album_data->netsync.inwin.fr) evas_object_del(
                                                     album_data->netsync.inwin.fr);

   //
   fr = elm_frame_add(inwin);
   album_data->netsync.inwin.fr = fr;
   elm_object_text_set(fr, D_("Synchronise an album with flickr"));
   evas_object_size_hint_weight_set(fr, 1.0, 1.0);
   evas_object_size_hint_align_set(fr, -1.0, -1.0);
   evas_object_show(fr);
   elm_table_padding_set(tb, 1, 1);
   elm_table_pack(tb, fr, 0, 0, 3, 1);

   tb2 = elm_table_add(inwin);
   evas_object_size_hint_weight_set(tb2, 1.0, 0.0);
   evas_object_size_hint_align_set(tb2, -1.0, 1.0);
   elm_table_padding_set(tb2, 15, 5);
   evas_object_show(tb2);
   elm_object_content_set(fr, tb2);
   //

   if (album_data->netsync.album_netsync_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the flickr album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt1 = bt;
      elm_object_text_set(bt, D_("Update"));
      evas_object_smart_callback_add(bt, "clicked", _netsync_notuptodate_cb,
                                     album);
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_notinnetsync)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("The album is not in Flickr."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt2 = bt;
      elm_object_text_set(bt, D_("Add the album in Flickr"));
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _album_notinnetsync_cb,
                                     album);
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_local_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the local album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt3 = bt;
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _local_notuptodate_cb,
                                     album);
      elm_object_text_set(bt, D_("Update"));
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.photos_notinlocal)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Some photos are not in the local album."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      pager = elm_naviframe_add(inwin);
      album_data->netsync.inwin.notinlocal.pager = pager;
      evas_object_size_hint_align_set(pager, 0.5, 0.5);
      evas_object_size_hint_weight_set(pager, 1.0, 0.0);
      evas_object_show(pager);
      elm_table_pack(tb2, pager, 1, i, 1, 1);
      elm_object_style_set(pager, "fade_invisible");

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.notinlocal.bt = bt;
      album_data->netsync.inwin.bt4 = bt;
      evas_object_size_hint_align_set(bt, -1.0, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);
      elm_object_text_set(bt, D_("Download Them All"));
      evas_object_smart_callback_add(bt, "clicked", _photos_notinlocal_cb,
                                     album);
      evas_object_show(bt);
      elm_naviframe_item_simple_push(pager, bt);

      pb = elm_progressbar_add(inwin);
      album_data->netsync.inwin.notinlocal.pb = pb;
      evas_object_size_hint_align_set(pb, -1.0, 0.5);
      evas_object_size_hint_weight_set(pb, 1.0, 0.0);
      elm_progressbar_pulse_set(pb, EINA_TRUE);
      elm_object_text_set(pb, D_("Downloads in progress ..."));
      evas_object_show(pb);
      elm_naviframe_item_simple_push(pager, pb);
      evas_object_size_hint_max_set(pb, 0, 0);

      if (album_data->netsync.inwin.notinlocal.is_updating)
      {
         elm_progressbar_pulse(pb, EINA_TRUE);
         elm_naviframe_item_simple_promote(pager, pb);
      }
      else
         elm_naviframe_item_simple_promote(pager, bt);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   nb_photos = 0;
   EINA_LIST_FOREACH(enlil_album_photos_get(album), l, photo)
   {
      Enlil_Photo_Data *photo_data = enlil_photo_user_data_get(photo);
      if (photo_data && photo_data->netsync.state == PHOTO_FLICKR_NOTINFLICKR)
      {
         nb_photos++;
      }
   }
EAPI_MAIN int
elm_main(int argc, char *argv[])
{
   Evas_Object *win, *bg, *box, *box2, *btn, *ic, *url, *naviframe, *tabs, *web;
   Evas *e;
   Evas_Modifier_Mask ctrl_mask;
   App_Data *ad;

   if (!elm_need_web())
     return -1;

   ad = calloc(1, sizeof(App_Data));
   if (!ad) return -1;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_add(NULL, "example-web", ELM_WIN_BASIC);
   elm_win_autodel_set(win, EINA_TRUE);

   e = evas_object_evas_get(win);
   ctrl_mask = evas_key_modifier_mask_get(e, "Control");
   if (!evas_object_key_grab(win, "f", ctrl_mask, 0, EINA_TRUE))
     fprintf(stderr, "Could not grab trigger for search dialog\n");

   evas_object_smart_callback_add(win, "delete,request", _win_del_request_cb,
                                  ad);
   evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN,
                                  _win_search_trigger_cb, ad);
   evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _win_free_cb, ad);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   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);

   url = elm_entry_add(win);
   elm_entry_single_line_set(url, EINA_TRUE);
   elm_entry_scrollable_set(url, EINA_TRUE);
   evas_object_size_hint_weight_set(url, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(url, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, url);
   evas_object_show(url);

   evas_object_smart_callback_add(url, "activated", _url_activated_cb, ad);

   box2 = elm_box_add(win);
   elm_box_horizontal_set(box2, EINA_TRUE);
   elm_object_part_content_set(url, "icon", box2);
   elm_entry_icon_visible_set(url, EINA_FALSE);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.back = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "arrow_left");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_back_cb, ad);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.refresh = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "refresh");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_refresh_cb, ad);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.fwd = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "arrow_right");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_fwd_cb, ad);

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

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "file");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _add_tab_cb, ad);

   tabs = elm_toolbar_add(win);
   elm_toolbar_align_set(tabs, 0.0);
   elm_toolbar_select_mode_set(tabs, ELM_OBJECT_SELECT_MODE_ALWAYS);
   elm_toolbar_homogeneous_set(tabs, EINA_FALSE);
   elm_toolbar_shrink_mode_set(tabs, ELM_TOOLBAR_SHRINK_MENU);
   evas_object_size_hint_weight_set(tabs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(tabs, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box2, tabs);
   evas_object_show(tabs);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   evas_object_smart_callback_add(btn, "clicked", _close_tab_cb, ad);

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "close");
   elm_object_part_content_set(btn, "icon", ic);

   naviframe = elm_naviframe_add(win);
   evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, naviframe);
   evas_object_show(naviframe);

   elm_toolbar_menu_parent_set(tabs, naviframe);

   web = elm_web_add(win);
   elm_web_window_create_hook_set(web, _web_create_window_cb, ad);
   elm_web_history_enabled_set(web, EINA_FALSE);
   evas_object_size_hint_weight_set(web, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(web, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_naviframe_item_simple_push(naviframe, web);

   default_content_set(web);

   ad->win = win;
   ad->main_box = box;
   ad->naviframe = naviframe;
   ad->url = url;
   ad->default_web = web;
   ad->tabs = tabs;
   ad->close_tab = btn;

   evas_object_resize(win, 480, 640);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Example #11
0
/* ad-hoc network
  .-box-------------------------------------------------------------------.
  | .-scroller----------------------------------------------------------. |
  | | .-table---------------------------------------------------------. | |
  | | | Crate an Ad-Hoc Network                                       | | |
  | | | ESSID:                  [...................................] | | |
  | | | IP:                     [...................................] | | |
  | | | Channel:                [...................................] | | |
  | | | [] Activate Internet Connection Sharing                       | | |
  | | | [] Use Encryption (WEP only)                                  | | |
  | | | Key:                    [...................................] | | |
  | | `---------------------------------------------------------------' | |
  | `-------------------------------------------------------------------' |
  | .-box---------------------------------------------------------------. |
  | |                                                    [Cancel]  [OK] | |
  | `-------------------------------------------------------------------' |
  `-----------------------------------------------------------------------'
*/
void
wicd_adhoc(void)
{
    Evas_Object *bx, *sc, *tb, *ob, *bx2;

    bx = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx, EINA_FALSE);
    elm_box_horizontal_set(bx, EINA_FALSE);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(bx);
    wicdelm->adhoc.page = bx;

    sc = elm_scroller_add(wicdelm->win);
    elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE);
    elm_scroller_policy_set(sc
        , ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
    evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
    elm_box_pack_end(bx, sc);
    evas_object_show(sc);

    // table
    tb = elm_table_add(wicdelm->win);
    elm_table_homogeneous_set(tb, EINA_FALSE);
    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
    elm_object_content_set(sc, tb);
    evas_object_show(tb);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "<b>Create an Ad-Hoc Network</b>");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 0, 2, 1);
    evas_object_show(ob);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "ESSID:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 1, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 1, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.essid = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "IP:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 2, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 2, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.ip = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Channel:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 3, 1, 1);
    evas_object_show(ob);
    ob = elm_slider_add(wicdelm->win);
    elm_slider_min_max_set(ob, 1.0, 14.0);
    elm_slider_indicator_format_set(ob, "%02.0f");
    elm_slider_unit_format_set(ob, "%02.0f");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 3, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "delay,changed", _changed_cb, NULL);
    wicdelm->adhoc.channel = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "Share Internet");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 4, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.shareInternet = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "WEP Encryption");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 5, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.useEncryption = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Key:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 6, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 6, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.key = ob;

    bx2 = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx2, EINA_TRUE);
    elm_box_horizontal_set(bx2, EINA_TRUE);
    evas_object_size_hint_align_set(bx2, 1.0, 1.0);
    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
    elm_box_pack_end(bx, bx2);
    evas_object_show(bx2);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Cancel");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _cancel_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Ok");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _ok_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    wicdelm->adhoc.item = elm_naviframe_item_simple_push(wicdelm->naviframe, bx);
}
static void
_init_profiles_power_page()
{
	Evas_Object *win = ui_utils_view_window_get(VIEW_PTR(view));
	view.layout1 = elm_layout_add(win);
	elm_win_resize_object_add(win, view.layout1);
	evas_object_size_hint_weight_set(view.layout1,
					 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_layout_file_set(view.layout1, phoneui_theme,
			    "phoneui/settings/quick-settings/profile-power");
	evas_object_show(view.layout1);

	view.airplane_slide = elm_check_add(win);
	elm_object_style_set(view.airplane_slide, "toggle");
	elm_object_part_content_set(view.layout1, "profiles-frame-airplane-slide", view.airplane_slide);
	evas_object_smart_callback_add(view.airplane_slide, "changed",
				       _airplane_slide_changed_cb, NULL);
	evas_object_show(view.airplane_slide);

	view.dimming_slide = elm_check_add(win);
	elm_object_style_set(view.dimming_slide, "toggle");
	elm_object_part_content_set(view.layout1, "power-frame-auto-frame-dimming-slide", view.dimming_slide);
	evas_object_smart_callback_add(view.dimming_slide, "changed",
				       _dimming_slide_changed_cb, NULL);
	evas_object_show(view.dimming_slide);

	view.suspend_slide = elm_check_add(win);
	elm_object_style_set(view.suspend_slide, "toggle");

	elm_object_part_content_set(view.layout1, "power-frame-auto-frame-suspend-slide", view.suspend_slide);
	evas_object_smart_callback_add(view.suspend_slide, "changed",
				       _suspend_slide_changed_cb, NULL);
	evas_object_show(view.suspend_slide);

	elm_object_part_text_set(view.suspend_slide, "on", D_("Forbid"));
	elm_object_part_text_set(view.suspend_slide, "off", D_("Allow"));
	elm_object_part_text_set(view.dimming_slide, "on", D_("Forbid"));
	elm_object_part_text_set(view.dimming_slide, "off", D_("Allow"));

	view.profiles_combo = elm_hoversel_add(win);
	elm_object_part_content_set(view.layout1, "profiles-frame-profiles-combo", view.profiles_combo);
	elm_hoversel_hover_parent_set(view.profiles_combo, win);
	evas_object_show(view.profiles_combo);
	evas_object_smart_callback_add(view.profiles_combo, "selected", _profile_selected_cb, NULL);

	view.button_lock = elm_button_add(win);
	elm_object_text_set(view.button_lock, D_("Lock"));
	elm_object_part_content_set(view.layout1, "power-frame-lock-button", view.button_lock);
	evas_object_smart_callback_add(view.button_lock, "clicked",
				       _button_lock_clicked_cb, NULL);
	evas_object_show(view.button_lock);

	view.button_suspend = elm_button_add(win);
	elm_object_text_set(view.button_suspend, D_("Suspend"));
	elm_object_part_content_set(view.layout1, "power-frame-suspend-button", view.button_suspend);
	evas_object_smart_callback_add(view.button_suspend, "clicked",
				       _button_suspend_clicked_cb, NULL);
	evas_object_show(view.button_suspend);

	view.button_shutdown = elm_button_add(win);
	elm_object_text_set(view.button_shutdown, D_("Shutdown"));
	elm_object_part_content_set(view.layout1, "power-frame-shutdown-button", view.button_shutdown);
	evas_object_smart_callback_add(view.button_shutdown, "clicked",
				       _button_shutdown_clicked_cb, NULL);
	evas_object_show(view.button_shutdown);

	elm_naviframe_item_simple_push(view.pager, view.layout1);

	/* Disabled until we get the list + current profile. */
	elm_object_disabled_set(view.profiles_combo, EINA_TRUE);
	phoneui_utils_sound_profile_list(_profiles_list_cb, NULL);

	phoneui_utils_resources_get_resource_policy("CPU", _cpu_get_policy_cb, NULL);
	phoneui_utils_resources_get_resource_policy("Display", _display_get_policy_cb, NULL);
	phoneui_utils_get_offline_mode(_get_offline_mode_cb, NULL);

	/*Register to all signals*/
	phoneui_info_register_and_request_profile_changes(_profile_changed_signal_cb, NULL);
	phoneui_info_register_and_request_resource_status(_resource_changed_signal_cb, NULL);
}
static void
_init_recipient_page(struct MessageNewViewData *view)
{
	Evas_Object *win, *btn;

	win = ui_utils_view_window_get(VIEW_PTR(*view));

	view->layout_recipients = elm_layout_add(view->pager);
	elm_win_resize_object_add(win, view->layout_recipients);
	elm_layout_file_set(view->layout_recipients, phoneui_theme,
			    "phoneui/messages/new/recipients");
	evas_object_show(view->layout_recipients);

	edje_object_part_text_set(elm_layout_edje_get(view->layout_recipients),
			"recipients_title", D_("Define Recipients"));

	view->list_recipients = elm_genlist_add(win);
	elm_genlist_mode_set(view->list_recipients, ELM_LIST_LIMIT);
	evas_object_size_hint_align_set(view->list_recipients, 0.0, 0.0);
	evas_object_size_hint_weight_set(view->list_recipients,
					 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_object_scale_set(view->list_recipients, 1.0);
	elm_object_part_content_set(view->layout_recipients, "recipients_list",
			       view->list_recipients);
	itc.item_style = "contact";
	itc.func.text_get = gl_text_get;
	itc.func.content_get = gl_content_get;
	itc.func.state_get = NULL;
	itc.func.del = gl_del;
	evas_object_show(view->list_recipients);

	g_ptr_array_foreach(view->recipients, _process_recipient, view);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Back"));
	evas_object_smart_callback_add(btn, "clicked",
				       _recipients_button_back_clicked, view);
	elm_object_part_content_set(view->layout_recipients,
			       "recipients_button_back", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Contact"));
	evas_object_smart_callback_add(btn, "clicked",
				       _recipients_button_add_contact_clicked,
				       view);
	elm_object_part_content_set(view->layout_recipients,
			       "recipients_button_add_contact", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Number"));
	evas_object_smart_callback_add(btn, "clicked",
				       _recipients_button_add_number_clicked,
				       view);
	elm_object_part_content_set(view->layout_recipients,
			       "recipients_button_add_number", btn);
	evas_object_show(btn);

	btn = elm_button_add(win);
	elm_object_text_set(btn, D_("Send"));
	evas_object_smart_callback_add(btn, "clicked",
				       _recipients_button_send_clicked, view);
	elm_object_part_content_set(view->layout_recipients,
			       "recipients_button_send", btn);
	evas_object_show(btn);

	elm_naviframe_item_simple_push(view->pager, view->layout_recipients);
}