aboutsummaryrefslogtreecommitdiff
path: root/src/mm-callback-info.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-callback-info.h')
-rw-r--r--src/mm-callback-info.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/mm-callback-info.h b/src/mm-callback-info.h
new file mode 100644
index 0000000..66c2048
--- /dev/null
+++ b/src/mm-callback-info.h
@@ -0,0 +1,74 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details:
+ *
+ * Copyright (C) 2008 Novell, Inc.
+ */
+
+#ifndef MM_CALLBACK_INFO_H
+#define MM_CALLBACK_INFO_H
+
+#include "mm-modem.h"
+
+typedef struct _MMCallbackInfo MMCallbackInfo;
+
+typedef void (*MMCallbackInfoInvokeFn) (MMCallbackInfo *info);
+
+struct _MMCallbackInfo {
+ guint32 refcount;
+
+ GData *qdata;
+ MMModem *modem;
+
+ MMCallbackInfoInvokeFn invoke_fn;
+ GCallback callback;
+ gboolean called;
+
+ gpointer user_data;
+ GError *error;
+ guint pending_id;
+};
+
+MMCallbackInfo *mm_callback_info_new_full (MMModem *modem,
+ MMCallbackInfoInvokeFn invoke_fn,
+ GCallback callback,
+ gpointer user_data);
+
+MMCallbackInfo *mm_callback_info_new (MMModem *modem,
+ MMModemFn callback,
+ gpointer user_data);
+
+MMCallbackInfo *mm_callback_info_uint_new (MMModem *modem,
+ MMModemUIntFn callback,
+ gpointer user_data);
+
+MMCallbackInfo *mm_callback_info_string_new (MMModem *modem,
+ MMModemStringFn callback,
+ gpointer user_data);
+
+void mm_callback_info_schedule (MMCallbackInfo *info);
+void mm_callback_info_set_result (MMCallbackInfo *info,
+ gpointer data,
+ GDestroyNotify destroy);
+
+void mm_callback_info_set_data (MMCallbackInfo *info,
+ const char *key,
+ gpointer data,
+ GDestroyNotify destroy);
+
+gpointer mm_callback_info_get_data (MMCallbackInfo *info,
+ const char *key);
+
+MMCallbackInfo *mm_callback_info_ref (MMCallbackInfo *info);
+void mm_callback_info_unref (MMCallbackInfo *info);
+
+#endif /* MM_CALLBACK_INFO_H */
+