mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-05 19:15:32 +00:00
origin: Add interface to get emergency numbers
This commit is contained in:
parent
e3d1193f7f
commit
df9d541968
2 changed files with 42 additions and 10 deletions
|
@ -78,6 +78,19 @@ calls_origin_default_init (CallsOriginInterface *iface)
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CallsOrigin:emergency-numbers:
|
||||||
|
*
|
||||||
|
* The available emergency numbers.
|
||||||
|
*/
|
||||||
|
g_object_interface_install_property (
|
||||||
|
iface,
|
||||||
|
g_param_spec_boxed ("emergency-numbers",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
G_TYPE_STRV,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
|
||||||
signals[SIGNAL_CALL_ADDED] =
|
signals[SIGNAL_CALL_ADDED] =
|
||||||
g_signal_newv ("call-added",
|
g_signal_newv ("call-added",
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
|
@ -131,6 +144,23 @@ DEFINE_ORIGIN_GETTER (id, char *, NULL);
|
||||||
*/
|
*/
|
||||||
DEFINE_ORIGIN_GETTER (calls, GList *, NULL);
|
DEFINE_ORIGIN_GETTER (calls, GList *, NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* calls_origin_get_emergency_numbers:
|
||||||
|
* @self: a #CallsOrigin
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): The supported emergency numbers
|
||||||
|
*/
|
||||||
|
GStrv
|
||||||
|
calls_origin_get_emergency_numbers (CallsOrigin *origin)
|
||||||
|
{
|
||||||
|
GStrv numbers;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CALLS_IS_ORIGIN (origin), NULL);
|
||||||
|
|
||||||
|
g_object_get (origin, "emergency-numbers", &numbers, NULL);
|
||||||
|
return numbers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calls_origin_foreach_call:
|
* calls_origin_foreach_call:
|
||||||
* @self: a #CallsOrigin
|
* @self: a #CallsOrigin
|
||||||
|
|
|
@ -47,15 +47,17 @@ struct _CallsOriginInterface {
|
||||||
|
|
||||||
typedef void (*CallsOriginForeachCallFunc) (gpointer param, CallsCall* call, CallsOrigin* origin);
|
typedef void (*CallsOriginForeachCallFunc) (gpointer param, CallsCall* call, CallsOrigin* origin);
|
||||||
|
|
||||||
char *calls_origin_get_name (CallsOrigin *self);
|
char * calls_origin_get_name (CallsOrigin *self);
|
||||||
char *calls_origin_get_id (CallsOrigin *self);
|
char * calls_origin_get_id (CallsOrigin *self);
|
||||||
GList *calls_origin_get_calls (CallsOrigin *self);
|
GList * calls_origin_get_calls (CallsOrigin *self);
|
||||||
void calls_origin_foreach_call (CallsOrigin *self,
|
void calls_origin_foreach_call (CallsOrigin *self,
|
||||||
CallsOriginForeachCallFunc callback,
|
CallsOriginForeachCallFunc callback,
|
||||||
gpointer param);
|
gpointer param);
|
||||||
void calls_origin_dial (CallsOrigin *self,
|
void calls_origin_dial (CallsOrigin *self,
|
||||||
const char *number);
|
const char *number);
|
||||||
gboolean calls_origin_supports_protocol (CallsOrigin *self,
|
gboolean calls_origin_supports_protocol (CallsOrigin *self,
|
||||||
const char *protocol);
|
const char *protocol);
|
||||||
|
GStrv calls_origin_get_emergency_numbers (CallsOrigin *self);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue