GAction is now an interface
[platform/upstream/glib.git] / gio / giotypes.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2006-2007 Red Hat, Inc.
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
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.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
26
27 #ifndef __GIO_TYPES_H__
28 #define __GIO_TYPES_H__
29
30 #include <gio/gioenums.h>
31
32 G_BEGIN_DECLS
33
34 typedef struct _GAppLaunchContext             GAppLaunchContext;
35 typedef struct _GAppInfo                      GAppInfo; /* Dummy typedef */
36 typedef struct _GAsyncResult                  GAsyncResult; /* Dummy typedef */
37 typedef struct _GAsyncInitable                GAsyncInitable;
38 typedef struct _GBufferedInputStream          GBufferedInputStream;
39 typedef struct _GBufferedOutputStream         GBufferedOutputStream;
40 typedef struct _GCancellable                  GCancellable;
41 typedef struct _GCharsetConverter             GCharsetConverter;
42 typedef struct _GConverter                    GConverter;
43 typedef struct _GConverterInputStream         GConverterInputStream;
44 typedef struct _GConverterOutputStream        GConverterOutputStream;
45 typedef struct _GDataInputStream              GDataInputStream;
46 typedef struct _GSimplePermission             GSimplePermission;
47 typedef struct _GZlibCompressor               GZlibCompressor;
48 typedef struct _GZlibDecompressor             GZlibDecompressor;
49
50 typedef struct _GSimpleActionGroup            GSimpleActionGroup;
51 typedef struct _GActionGroup                  GActionGroup;
52 typedef struct _GSimpleAction                 GSimpleAction;
53 typedef struct _GAction                       GAction;
54 typedef struct _GSettingsBackend              GSettingsBackend;
55 typedef struct _GSettings                     GSettings;
56 typedef struct _GPermission                   GPermission;
57
58 /**
59  * GDrive:
60  *
61  * Opaque drive object.
62  **/
63 typedef struct _GDrive                        GDrive; /* Dummy typedef */
64 typedef struct _GFileEnumerator               GFileEnumerator;
65 typedef struct _GFileMonitor                  GFileMonitor;
66 typedef struct _GFilterInputStream            GFilterInputStream;
67 typedef struct _GFilterOutputStream           GFilterOutputStream;
68
69 /**
70  * GFile:
71  *
72  * A handle to an object implementing the #GFileIface interface.
73  * Generally stores a location within the file system. Handles do not
74  * necessarily represent files or directories that currently exist.
75  **/
76 typedef struct _GFile                         GFile; /* Dummy typedef */
77 typedef struct _GFileInfo                     GFileInfo;
78
79 /**
80  * GFileAttributeMatcher:
81  *
82  * Determines if a string matches a file attribute.
83  **/
84 typedef struct _GFileAttributeMatcher         GFileAttributeMatcher;
85 typedef struct _GFileAttributeInfo            GFileAttributeInfo;
86 typedef struct _GFileAttributeInfoList        GFileAttributeInfoList;
87 typedef struct _GFileDescriptorBased          GFileDescriptorBased;
88 typedef struct _GFileInputStream              GFileInputStream;
89 typedef struct _GFileOutputStream             GFileOutputStream;
90 typedef struct _GFileIOStream                 GFileIOStream;
91 typedef struct _GFileIcon                     GFileIcon;
92 typedef struct _GFilenameCompleter            GFilenameCompleter;
93
94
95 typedef struct _GIcon                         GIcon; /* Dummy typedef */
96 typedef struct _GInetAddress                  GInetAddress;
97 typedef struct _GInetSocketAddress            GInetSocketAddress;
98 typedef struct _GInputStream                  GInputStream;
99 typedef struct _GInitable                     GInitable;
100 typedef struct _GIOModule                     GIOModule;
101 typedef struct _GIOExtensionPoint             GIOExtensionPoint;
102 typedef struct _GIOExtension                  GIOExtension;
103
104 /**
105  * GIOSchedulerJob:
106  *
107  * Opaque class for definining and scheduling IO jobs.
108  **/
109 typedef struct _GIOSchedulerJob               GIOSchedulerJob;
110 typedef struct _GLoadableIcon                 GLoadableIcon; /* Dummy typedef */
111 typedef struct _GMemoryInputStream            GMemoryInputStream;
112 typedef struct _GMemoryOutputStream           GMemoryOutputStream;
113
114 /**
115  * GMount:
116  *
117  * A handle to an object implementing the #GMountIface interface.
118  **/
119 typedef struct _GMount                        GMount; /* Dummy typedef */
120 typedef struct _GMountOperation               GMountOperation;
121 typedef struct _GNetworkAddress               GNetworkAddress;
122 typedef struct _GNetworkService               GNetworkService;
123 typedef struct _GOutputStream                 GOutputStream;
124 typedef struct _GIOStream                     GIOStream;
125 typedef struct _GResolver                     GResolver;
126 typedef struct _GSeekable                     GSeekable;
127 typedef struct _GSimpleAsyncResult            GSimpleAsyncResult;
128
129 /**
130  * GSocket:
131  *
132  * A lowlevel network socket object.
133  *
134  * Since: 2.22
135  **/
136 typedef struct _GSocket                       GSocket;
137
138 /**
139  * GSocketControlMessage:
140  *
141  * Base class for socket-type specific control messages that can be sent and
142  * received over #GSocket.
143  **/
144 typedef struct _GSocketControlMessage         GSocketControlMessage;
145 /**
146  * GSocketClient:
147  *
148  * A helper class for network clients to make connections.
149  *
150  * Since: 2.22
151  **/
152 typedef struct _GSocketClient                               GSocketClient;
153 /**
154  * GSocketConnection:
155  *
156  * A socket connection GIOStream object for connection-oriented sockets.
157  *
158  * Since: 2.22
159  **/
160 typedef struct _GSocketConnection                           GSocketConnection;
161 /**
162  * GSocketClient:
163  *
164  * A helper class for network servers to listen for and accept connections.
165  *
166  * Since: 2.22
167  **/
168 typedef struct _GSocketListener                             GSocketListener;
169 /**
170  * GSocketService:
171  *
172  * A helper class for handling accepting incomming connections in the
173  * glib mainloop.
174  *
175  * Since: 2.22
176  **/
177 typedef struct _GSocketService                              GSocketService;
178 typedef struct _GSocketAddress                GSocketAddress;
179 typedef struct _GSocketAddressEnumerator      GSocketAddressEnumerator;
180 typedef struct _GSocketConnectable            GSocketConnectable;
181 typedef struct _GSrvTarget                    GSrvTarget;
182 /**
183  * GTcpConnection:
184  *
185  * A #GSocketConnection for TCP/IP connections.
186  *
187  * Since: 2.22
188  **/
189 typedef struct _GTcpConnection                              GTcpConnection;
190 /**
191  * GThreadedSocketService:
192  *
193  * A helper class for handling accepting incomming connections in the
194  * glib mainloop and handling them in a thread.
195  *
196  * Since: 2.22
197  **/
198 typedef struct _GThreadedSocketService                      GThreadedSocketService;
199 typedef struct _GThemedIcon                   GThemedIcon;
200 typedef struct _GVfs                          GVfs; /* Dummy typedef */
201
202 /**
203  * GProxyResolver:
204  *
205  * A helper class to enumerate proxies base on URI.
206  *
207  * Since: 2.26
208  **/
209 typedef struct _GProxyResolver                GProxyResolver;
210 typedef struct _GProxy                        GProxy;
211 typedef struct _GProxyAddress                 GProxyAddress;
212 typedef struct _GProxyAddressEnumerator       GProxyAddressEnumerator;
213
214 /**
215  * GVolume:
216  *
217  * Opaque mountable volume object.
218  **/
219 typedef struct _GVolume                       GVolume; /* Dummy typedef */
220 typedef struct _GVolumeMonitor                GVolumeMonitor;
221
222 /**
223  * GAsyncReadyCallback:
224  * @source_object: the object the asynchronous operation was started with.
225  * @res: a #GAsyncResult.
226  * @user_data: user data passed to the callback.
227  *
228  * Type definition for a function that will be called back when an asynchronous
229  * operation within GIO has been completed.
230  **/
231 typedef void (*GAsyncReadyCallback) (GObject *source_object,
232                                      GAsyncResult *res,
233                                      gpointer user_data);
234
235 /**
236  * GFileProgressCallback:
237  * @current_num_bytes: the current number of bytes in the operation.
238  * @total_num_bytes: the total number of bytes in the operation.
239  * @user_data: user data passed to the callback.
240  *
241  * When doing file operations that may take a while, such as moving
242  * a file or copying a file, a progress callback is used to pass how
243  * far along that operation is to the application.
244  **/
245 typedef void (*GFileProgressCallback) (goffset current_num_bytes,
246                                        goffset total_num_bytes,
247                                        gpointer user_data);
248
249 /**
250  * GFileReadMoreCallback:
251  * @file_contents: the data as currently read.
252  * @file_size: the size of the data currently read.
253  * @callback_data: data passed to the callback.
254  *
255  * When loading the partial contents of a file with g_file_load_partial_contents_async(),
256  * it may become necessary to determine if any more data from the file should be loaded.
257  * A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
258  * should be read, or %FALSE otherwise.
259  *
260  * Returns: %TRUE if more data should be read back. %FALSE otherwise.
261  **/
262 typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
263                                             goffset file_size,
264                                             gpointer callback_data);
265
266
267 /**
268  * GIOSchedulerJobFunc:
269  * @job: a #GIOSchedulerJob.
270  * @cancellable: optional #GCancellable object, %NULL to ignore.
271  * @user_data: the data to pass to callback function
272  *
273  * I/O Job function.
274  *
275  * Note that depending on whether threads are available, the
276  * #GIOScheduler may run jobs in separate threads or in an idle
277  * in the mainloop.
278  *
279  * Long-running jobs should periodically check the @cancellable
280  * to see if they have been cancelled.
281  *
282  * Returns: %TRUE if this function should be called again to
283  *    complete the job, %FALSE if the job is complete (or cancelled)
284  **/
285 typedef gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job,
286                                          GCancellable    *cancellable,
287                                          gpointer         user_data);
288
289 /**
290  * GSimpleAsyncThreadFunc:
291  * @res: a #GSimpleAsyncResult.
292  * @object: a #GObject.
293  * @cancellable: optional #GCancellable object, %NULL to ignore.
294  *
295  * Simple thread function that runs an asynchronous operation and
296  * checks for cancellation.
297  **/
298 typedef void (*GSimpleAsyncThreadFunc) (GSimpleAsyncResult *res,
299                                         GObject *object,
300                                         GCancellable *cancellable);
301
302 /**
303  * GSocketSourceFunc:
304  * @socket: the #GSocket
305  * @condition: the current condition at the source fired.
306  * @user_data: data passed in by the user.
307  *
308  * This is the function type of the callback used for the #GSource
309  * returned by g_socket_create_source().
310  *
311  * Returns: it should return %FALSE if the source should be removed.
312  *
313  * Since: 2.22
314  */
315 typedef gboolean (*GSocketSourceFunc) (GSocket *socket,
316                                        GIOCondition condition,
317                                        gpointer user_data);
318
319 /**
320  * GInputVector:
321  * @buffer: Pointer to a buffer where data will be written.
322  * @size: the available size in @buffer.
323  *
324  * Structure used for scatter/gather data input.
325  * You generally pass in an array of #GInputVector<!-- -->s
326  * and the operation will store the read data starting in the
327  * first buffer, switching to the next as needed.
328  *
329  * Since: 2.22
330  */
331 typedef struct _GInputVector GInputVector;
332
333 struct _GInputVector {
334   gpointer buffer;
335   gsize size;
336 };
337
338 /**
339  * GOutputVector:
340  * @buffer: Pointer to a buffer of data to read.
341  * @size: the size of @buffer.
342  *
343  * Structure used for scatter/gather data output.
344  * You generally pass in an array of #GOutputVector<!-- -->s
345  * and the operation will use all the buffers as if they were
346  * one buffer.
347  *
348  * Since: 2.22
349  */
350 typedef struct _GOutputVector GOutputVector;
351
352 struct _GOutputVector {
353   gconstpointer buffer;
354   gsize size;
355 };
356
357 typedef struct _GCredentials                  GCredentials;
358 typedef struct _GUnixCredentialsMessage       GUnixCredentialsMessage;
359 typedef struct _GUnixFDList                   GUnixFDList;
360 typedef struct _GDBusMessage                  GDBusMessage;
361 typedef struct _GDBusConnection               GDBusConnection;
362 typedef struct _GDBusProxy                    GDBusProxy;
363 typedef struct _GDBusMethodInvocation         GDBusMethodInvocation;
364 typedef struct _GDBusServer                   GDBusServer;
365 typedef struct _GDBusAuthObserver             GDBusAuthObserver;
366 typedef struct _GDBusErrorEntry               GDBusErrorEntry;
367 typedef struct _GDBusInterfaceVTable          GDBusInterfaceVTable;
368 typedef struct _GDBusSubtreeVTable            GDBusSubtreeVTable;
369 typedef struct _GDBusAnnotationInfo           GDBusAnnotationInfo;
370 typedef struct _GDBusArgInfo                  GDBusArgInfo;
371 typedef struct _GDBusMethodInfo               GDBusMethodInfo;
372 typedef struct _GDBusSignalInfo               GDBusSignalInfo;
373 typedef struct _GDBusPropertyInfo             GDBusPropertyInfo;
374 typedef struct _GDBusInterfaceInfo            GDBusInterfaceInfo;
375 typedef struct _GDBusNodeInfo                 GDBusNodeInfo;
376
377 G_END_DECLS
378
379 #endif /* __GIO_TYPES_H__ */