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 GType g_file_get_type (void) G_GNUC_CONST;
58 #define G_TYPE_FILE (g_file_get_type ())
62 * A handle to an object implementing the #GFileIface interface.
63 * Generally stores a location within the file system. Handles do not
64 * necessarily represent files or directories that currently exist.
66 typedef struct _GFile GFile; /* Dummy typedef */
68 struct _GFileEnumerator
70 GObject parent_instance;
73 GFileEnumeratorPrivate *priv;
76 struct _GFileEnumeratorClass
78 GObjectClass parent_class;
82 GFileInfo *(*next_file) (GFileEnumerator *enumerator,
83 GCancellable *cancellable,
85 gboolean (*close_fn) (GFileEnumerator *enumerator,
86 GCancellable *cancellable,
89 void (*next_files_async) (GFileEnumerator *enumerator,
92 GCancellable *cancellable,
93 GAsyncReadyCallback callback,
95 GList * (*next_files_finish) (GFileEnumerator *enumerator,
98 void (*close_async) (GFileEnumerator *enumerator,
100 GCancellable *cancellable,
101 GAsyncReadyCallback callback,
103 gboolean (*close_finish) (GFileEnumerator *enumerator,
108 /* Padding for future expansion */
109 void (*_g_reserved1) (void);
110 void (*_g_reserved2) (void);
111 void (*_g_reserved3) (void);
112 void (*_g_reserved4) (void);
113 void (*_g_reserved5) (void);
114 void (*_g_reserved6) (void);
115 void (*_g_reserved7) (void);
118 GType g_file_enumerator_get_type (void) G_GNUC_CONST;
120 GFileInfo *g_file_enumerator_next_file (GFileEnumerator *enumerator,
121 GCancellable *cancellable,
123 gboolean g_file_enumerator_close (GFileEnumerator *enumerator,
124 GCancellable *cancellable,
126 void g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
129 GCancellable *cancellable,
130 GAsyncReadyCallback callback,
132 GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
133 GAsyncResult *result,
135 void g_file_enumerator_close_async (GFileEnumerator *enumerator,
137 GCancellable *cancellable,
138 GAsyncReadyCallback callback,
140 gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator,
141 GAsyncResult *result,
143 gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator);
144 gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator);
145 void g_file_enumerator_set_pending (GFileEnumerator *enumerator,
147 GFile * g_file_enumerator_get_container (GFileEnumerator *enumerator);
151 #endif /* __G_FILE_ENUMERATOR_H__ */