Debian Codegraph @

src/libqmi-glib/qmi-file.h

raw
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * libqmi-glib -- GLib/GIO based library to control QMI devices
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA.
19 *
20 * Copyright (C) 2019 Eric Caruso <[email protected]>
21 */
22
23 #ifndef _LIBQMI_GLIB_QMI_FILE_H_
24 #define _LIBQMI_GLIB_QMI_FILE_H_
25
26 #include <glib-object.h>
27 #include <gio/gio.h>
28
29 #define QMI_TYPE_FILE (qmi_file_get_type ())
30 #define QMI_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), QMI_TYPE_FILE, QmiFile))
31 #define QMI_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QMI_TYPE_FILE, QmiFileClass))
32 #define QMI_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), QMI_TYPE_FILE))
33 #define QMI_IS_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QMI_TYPE_FILE))
34 #define QMI_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QMI_TYPE_FILE, QmiFileClass))
35
36 typedef struct _QmiFile QmiFile;
37 typedef struct _QmiFileClass QmiFileClass;
38 typedef struct _QmiFilePrivate QmiFilePrivate;
39
40 struct _QmiFile {
41 /*< private >*/
42 GObject parent;
43 QmiFilePrivate *priv;
44 };
45
46 struct _QmiFileClass {
47 /*< private >*/
48 GObjectClass parent;
49 };
50
51 GType qmi_file_get_type (void);
52 G_DEFINE_AUTOPTR_CLEANUP_FUNC (QmiFile, g_object_unref)
53
54 QmiFile *qmi_file_new (GFile *file);
55 GFile *qmi_file_get_file (QmiFile *self);
56 GFile *qmi_file_peek_file (QmiFile *self);
57 const gchar *qmi_file_get_path (QmiFile *self);
58 const gchar *qmi_file_get_path_display (QmiFile *self);
59 void qmi_file_check_type_async (QmiFile *self,
60 GCancellable *cancellable,
61 GAsyncReadyCallback callback,
62 gpointer user_data);
63 gboolean qmi_file_check_type_finish (QmiFile *self,
64 GAsyncResult *res,
65 GError **error);
66
67 #endif /* _LIBQMI_GLIB_QMI_FILE_H_ */