manager: Differentiate the NO_ORIGIN state

This avoids confusion when only the SIP plugin is loaded, but no account
is being used.

For this we introduce two new functions in the abstract CallsProvider class:
`is_modem()` to indicate whether the the provider deals with PTSN telephony and
`is_operational()` which by default simply checks if there any avalaible origins
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-05-04 21:49:07 +02:00
parent 98d66743a1
commit 44f2002f86
7 changed files with 90 additions and 5 deletions

View File

@@ -48,6 +48,8 @@ struct _CallsProviderClass
const char *(*get_status) (CallsProvider *self);
GListModel *(*get_origins) (CallsProvider *self);
const char * const *(*get_protocols) (CallsProvider *self);
gboolean (*is_modem) (CallsProvider *self);
gboolean (*is_operational) (CallsProvider *self);
};
const char *calls_provider_get_name (CallsProvider *self);
@@ -55,7 +57,9 @@ const char *calls_provider_get_status (CallsProvider *self);
GListModel *calls_provider_get_origins (CallsProvider *self);
CallsProvider *calls_provider_load_plugin (const char *name);
void calls_provider_unload_plugin (const char *name);
const char * const *calls_provider_get_protocols (CallsProvider *self);
const char * const *calls_provider_get_protocols (CallsProvider *self);
gboolean calls_provider_is_modem (CallsProvider *self);
gboolean calls_provider_is_operational (CallsProvider *self);
G_END_DECLS