1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-28 14:55:26 +00:00

util: Add API to query call icon names

This can later be used in the call history or in the call details
instead of always constructing the name repeatedly in private functions.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-12-07 10:59:37 +01:00
parent bbccb7667e
commit abdb601afa
2 changed files with 27 additions and 0 deletions

View file

@ -273,3 +273,28 @@ dtmf_tone_key_is_valid (gchar key)
|| key == '#';
}
static const char * const type_icon_name[] = {
"call-arrow-outgoing-symbolic",
"call-arrow-outgoing-missed-symbolic",
"call-arrow-incoming-symbolic",
"call-arrow-incoming-missed-symbolic",
};
/**
* get_call_icon_type_name:
* @inbound: Whether the call was inbound
* @missed: Whether the call was missed
*
* Returns: (transfer null): The icon symbolic name to use in the history, etc
*/
const char *
get_call_icon_symbolic_name (gboolean inbound,
gboolean missed)
{
guint index = 0;
index = ((inbound) << 1) + missed;
return type_icon_name[index];
}

View file

@ -142,6 +142,8 @@ const char* get_protocol_from_address (const char *target);
const char* get_protocol_from_address_with_fallback (const char *target);
gboolean dtmf_tone_key_is_valid (char key);
const char *get_call_icon_symbolic_name (gboolean inbound,
gboolean missed);
G_END_DECLS