1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-13 16:07:36 +00:00

ui-call-data: Add proxy properties for CallsCall

TODO: This could do with some tests
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-01-31 16:22:22 +01:00
parent dd8cc08649
commit 1d364eafda

View file

@ -32,6 +32,8 @@
enum {
PROP_0,
PROP_CALL,
PROP_INBOUND,
PROP_PROTOCOL,
PROP_DISPLAY_NAME,
PROP_ID,
PROP_STATE,
@ -151,6 +153,24 @@ calls_ui_call_data_get_active_time (CuiCall *call_data)
}
static gboolean
calls_ui_call_data_get_inbound (CallsUiCallData *self)
{
g_assert (CALLS_IS_UI_CALL_DATA (self));
return calls_call_get_inbound (self->call);
}
static const char *
calls_ui_call_data_get_protocol (CallsUiCallData *self)
{
g_assert (CALLS_IS_UI_CALL_DATA (self));
return calls_call_get_protocol (self->call);
}
static void
calls_ui_call_data_accept (CuiCall *call_data)
{
@ -358,6 +378,14 @@ calls_ui_call_data_get_property (GObject *object,
g_value_set_object (value, self->call);
break;
case PROP_INBOUND:
g_value_set_boolean (value, calls_ui_call_data_get_inbound (self));
break;
case PROP_PROTOCOL:
g_value_set_string (value, calls_ui_call_data_get_protocol (self));
break;
case PROP_DISPLAY_NAME:
g_value_set_string (value, calls_ui_call_data_get_display_name (cui_call));
break;
@ -430,6 +458,24 @@ calls_ui_call_data_class_init (CallsUiCallDataClass *klass)
g_object_class_install_property (object_class, PROP_CALL, props[PROP_CALL]);
props[PROP_INBOUND] =
g_param_spec_boolean ("inbound",
"Inbound",
"Whether the call is inbound",
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_INBOUND, props[PROP_INBOUND]);
props[PROP_PROTOCOL] =
g_param_spec_string ("protocol",
"Protocol",
"The protocol for the call, e.g. tel, sip",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_PROTOCOL, props[PROP_PROTOCOL]);
g_object_class_override_property (object_class, PROP_ID, "id");
props[PROP_ID] = g_object_class_find_property (object_class, "id");