1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.
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.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #ifndef __G_FILE_ENUMERATOR_H__
28 #define __G_FILE_ENUMERATOR_H__
30 #include <glib-object.h>
31 #include <gio/gioerror.h>
32 #include <gio/gcancellable.h>
33 #include <gio/gfileinfo.h>
34 #include <gio/gasyncresult.h>
39 #define G_TYPE_FILE_ENUMERATOR (g_file_enumerator_get_type ())
40 #define G_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumerator))
41 #define G_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
42 #define G_IS_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_ENUMERATOR))
43 #define G_IS_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_ENUMERATOR))
44 #define G_FILE_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
48 * @parent_instance: The parent class.
50 * A per matched file iterator.
52 typedef struct _GFileEnumerator GFileEnumerator;
53 typedef struct _GFileEnumeratorClass GFileEnumeratorClass;
54 typedef struct _GFileEnumeratorPrivate GFileEnumeratorPrivate;
57 struct _GFileEnumerator
59 GObject parent_instance;
62 GFileEnumeratorPrivate *priv;
65 struct _GFileEnumeratorClass
67 GObjectClass parent_class;
71 GFileInfo *(*next_file) (GFileEnumerator *enumerator,
72 GCancellable *cancellable,
74 gboolean (*close_fn) (GFileEnumerator *enumerator,
75 GCancellable *cancellable,
78 void (*next_files_async) (GFileEnumerator *enumerator,
81 GCancellable *cancellable,
82 GAsyncReadyCallback callback,
84 GList * (*next_files_finish) (GFileEnumerator *enumerator,
87 void (*close_async) (GFileEnumerator *enumerator,
89 GCancellable *cancellable,
90 GAsyncReadyCallback callback,
92 gboolean (*close_finish) (GFileEnumerator *enumerator,
97 /* Padding for future expansion */
98 void (*_g_reserved1) (void);
99 void (*_g_reserved2) (void);
100 void (*_g_reserved3) (void);
101 void (*_g_reserved4) (void);
102 void (*_g_reserved5) (void);
103 void (*_g_reserved6) (void);
104 void (*_g_reserved7) (void);
107 GType g_file_enumerator_get_type (void) G_GNUC_CONST;
109 GFileInfo *g_file_enumerator_next_file (GFileEnumerator *enumerator,
110 GCancellable *cancellable,
112 gboolean g_file_enumerator_close (GFileEnumerator *enumerator,
113 GCancellable *cancellable,
115 void g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
118 GCancellable *cancellable,
119 GAsyncReadyCallback callback,
121 GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
122 GAsyncResult *result,
124 void g_file_enumerator_close_async (GFileEnumerator *enumerator,
126 GCancellable *cancellable,
127 GAsyncReadyCallback callback,
129 gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator,
130 GAsyncResult *result,
132 gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator);
133 gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator);
134 void g_file_enumerator_set_pending (GFileEnumerator *enumerator,
139 #endif /* __G_FILE_ENUMERATOR_H__ */