diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-10 16:23:37 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-14 07:05:23 +0200 |
commit | c7e81d74708ca87d37d374cd8d2f67e9199a3c43 (patch) | |
tree | 79c9046e8dffa4e61759199eebc1e0ab9f8f6c1a | |
parent | 67081f02c88bc907561f6d9a9bd0e74cf9797189 (diff) |
libmm-glib: new `mm_modem_messaging_get_supported_storages()' method
-rw-r--r-- | libmm-glib/mm-modem-messaging.c | 24 | ||||
-rw-r--r-- | libmm-glib/mm-modem-messaging.h | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem-messaging.c b/libmm-glib/mm-modem-messaging.c index 7cd473b2..bc0b5ffb 100644 --- a/libmm-glib/mm-modem-messaging.c +++ b/libmm-glib/mm-modem-messaging.c @@ -63,6 +63,30 @@ mm_modem_messaging_dup_path (MMModemMessaging *self) RETURN_NON_EMPTY_STRING (value); } +/** + * mm_modem_messaging_get_supported_storages: + * @self: A #MMModem. + * @storages: (out): Return location for the array of #MMSmsStorage values. + * @n_storages: (out): Return location for the number of values in @storages. + * + * Gets the list of SMS storages supported by the #MMModem. + */ +void +mm_modem_messaging_get_supported_storages (MMModemMessaging *self, + MMSmsStorage **storages, + guint *n_storages) +{ + GArray *array; + + g_return_if_fail (MM_GDBUS_IS_MODEM_MESSAGING (self)); + g_return_if_fail (storages != NULL); + g_return_if_fail (n_storages != NULL); + + array = mm_common_sms_storages_variant_to_garray (mm_gdbus_modem_messaging_get_supported_storages (self)); + *n_storages = array->len; + *storages = (MMSmsStorage *)g_array_free (array, FALSE); +} + typedef struct { MMModemMessaging *self; GSimpleAsyncResult *result; diff --git a/libmm-glib/mm-modem-messaging.h b/libmm-glib/mm-modem-messaging.h index 7c3c4e53..6e8ad72e 100644 --- a/libmm-glib/mm-modem-messaging.h +++ b/libmm-glib/mm-modem-messaging.h @@ -39,6 +39,10 @@ typedef MmGdbusModemMessaging MMModemMessaging; const gchar *mm_modem_messaging_get_path (MMModemMessaging *self); gchar *mm_modem_messaging_dup_path (MMModemMessaging *self); +void mm_modem_messaging_get_supported_storages (MMModemMessaging *self, + MMSmsStorage **storages, + guint *n_storages); + void mm_modem_messaging_create (MMModemMessaging *self, MMSmsProperties *properties, GCancellable *cancellable, |