[calls] manager: Add API to query loaded providers



commit cc3a562f03ed7f4f742753e26f2817c70ea4d0a3
Author: Evangelos Ribeiro Tzaras <evangelos tzaras puri sm>
Date:   Sun Jul 4 01:41:35 2021 +0200

    manager: Add API to query loaded providers

 src/calls-manager.c | 17 +++++++++++++++++
 src/calls-manager.h |  1 +
 2 files changed, 18 insertions(+)
---
diff --git a/src/calls-manager.c b/src/calls-manager.c
index 9e500167..1e82995f 100644
--- a/src/calls-manager.c
+++ b/src/calls-manager.c
@@ -949,3 +949,20 @@ calls_manager_get_provider_names (CallsManager *self,
 
   return (const char **) g_hash_table_get_keys_as_array (self->providers, length);
 }
+
+/**
+ * calls_manager_get_providers:
+ * @self: A #CallsManager
+ *
+ * Get the currently loaded providers
+ *
+ * Returns: (transfer container): A #GList of #CallsProvider.
+ * Use g_list_free() when done using the list.
+ */
+GList *
+calls_manager_get_providers (CallsManager *self)
+{
+  g_return_val_if_fail (CALLS_IS_MANAGER (self), NULL);
+
+  return g_hash_table_get_values (self->providers);
+}
diff --git a/src/calls-manager.h b/src/calls-manager.h
index d7f62613..b80f8530 100644
--- a/src/calls-manager.h
+++ b/src/calls-manager.h
@@ -72,5 +72,6 @@ void                   calls_manager_hang_up_all_calls        (CallsManager *sel
 gboolean               calls_manager_has_any_provider         (CallsManager *self);
 const char           **calls_manager_get_provider_names       (CallsManager *self,
                                                                guint        *length);
+GList                 *calls_manager_get_providers            (CallsManager *self);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]