it depends on the existence of a window, which is done by gui.c.
This commit is in preparation to create a new libofono-efl-utils to be
used by dialer and other applications.
{
Callscreen *ctx = data;
- dial(ctx->disconnected.number);
+ gui_dial(ctx->disconnected.number);
_popup_close(ctx, NULL, NULL);
}
void *event_inf __UNUSED__)
{
const char *number = data;
- dial(number);
+ gui_dial(number);
}
static void _on_item_click(void *data, Evas_Object *obj __UNUSED__,
return contact_search(contacts, number, type);
}
+static void _dial_reply(void *data, OFono_Error err,
+ OFono_Call *call __UNUSED__)
+{
+ char *number = data;
+
+ if (err != OFONO_ERROR_NONE) {
+ char buf[1024];
+ const char *msg = ofono_error_message_get(err);
+ snprintf(buf, sizeof(buf), "Could not call %s: %s",
+ number, msg);
+ gui_simple_popup("Error", buf);
+ }
+
+ free(number);
+}
+
+OFono_Pending *gui_dial(const char *number)
+{
+ char *copy = strdup(number);
+ return ofono_dial(copy, NULL, _dial_reply, copy);
+}
+
Evas_Object *gui_layout_add(Evas_Object *parent, const char *style)
{
Evas_Object *layout = elm_layout_add(parent);
EINA_SAFETY_ON_NULL_RETURN(number);
EINA_SAFETY_ON_FALSE_RETURN(*number != '\0');
- dial(number);
+ gui_dial(number);
}
static void _on_clicked(void *data __UNUSED__, Evas_Object *o __UNUSED__,
#define _EFL_OFONO_GUI_H__ 1
#include "contacts.h"
+#include "ofono.h"
Evas_Object *gui_layout_add(Evas_Object *parent, const char *style);
Contact_Info *gui_contact_search(const char *number, const char **type);
+OFono_Pending *gui_dial(const char *number);
+
#endif
const char *number = data;
INF("call %s", number);
- dial(number);
+ gui_dial(number);
elm_genlist_item_selected_set(it, EINA_FALSE);
}
const char *number = eina_strbuf_string_get(ctx->number);
INF("call %s", number);
- dial(number);
+ gui_dial(number);
eina_stringshare_replace(&(ctx->last), number);
eina_strbuf_reset(ctx->number);
_number_display(ctx);
}
return icon;
}
-
-static void _dial_reply(void *data, OFono_Error err,
- OFono_Call *call __UNUSED__)
-{
- char *number = data;
-
- if (err != OFONO_ERROR_NONE) {
- char buf[1024];
- const char *msg = ofono_error_message_get(err);
- snprintf(buf, sizeof(buf), "Could not call %s: %s",
- number, msg);
- gui_simple_popup("Error", buf);
- }
-
- free(number);
-}
-
-OFono_Pending *dial(const char *number)
-{
- char *copy = strdup(number);
- return ofono_dial(copy, NULL, _dial_reply, copy);
-}
#define MONTH ((DAY) * 30)
#define YEAR ((MONTH) *12)
-#include "ofono.h"
-
char *phone_format(const char *number);
char *date_format(time_t date);
Evas_Object *picture_icon_get(Evas_Object *parent, const char *picture);
-OFono_Pending *dial(const char *number);
-
#endif