aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-modem-messaging.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-10 16:23:37 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-14 07:05:23 +0200
commitc7e81d74708ca87d37d374cd8d2f67e9199a3c43 (patch)
tree79c9046e8dffa4e61759199eebc1e0ab9f8f6c1a /libmm-glib/mm-modem-messaging.c
parent67081f02c88bc907561f6d9a9bd0e74cf9797189 (diff)
libmm-glib: new `mm_modem_messaging_get_supported_storages()' method
Diffstat (limited to 'libmm-glib/mm-modem-messaging.c')
-rw-r--r--libmm-glib/mm-modem-messaging.c24
1 files changed, 24 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;