giotypes.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Alexander Larsson <[email protected]>
  19. */
  20. #ifndef __GIO_TYPES_H__
  21. #define __GIO_TYPES_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/gioenums.h>
  26. G_BEGIN_DECLS
  27. typedef struct _GAppLaunchContext GAppLaunchContext;
  28. typedef struct _GAppInfo GAppInfo; /* Dummy typedef */
  29. typedef struct _GAsyncResult GAsyncResult; /* Dummy typedef */
  30. typedef struct _GAsyncInitable GAsyncInitable;
  31. typedef struct _GBufferedInputStream GBufferedInputStream;
  32. typedef struct _GBufferedOutputStream GBufferedOutputStream;
  33. typedef struct _GCancellable GCancellable;
  34. typedef struct _GCharsetConverter GCharsetConverter;
  35. typedef struct _GConverter GConverter;
  36. typedef struct _GConverterInputStream GConverterInputStream;
  37. typedef struct _GConverterOutputStream GConverterOutputStream;
  38. typedef struct _GDataInputStream GDataInputStream;
  39. typedef struct _GSimplePermission GSimplePermission;
  40. typedef struct _GZlibCompressor GZlibCompressor;
  41. typedef struct _GZlibDecompressor GZlibDecompressor;
  42. typedef struct _GSimpleActionGroup GSimpleActionGroup;
  43. typedef struct _GRemoteActionGroup GRemoteActionGroup;
  44. typedef struct _GDBusActionGroup GDBusActionGroup;
  45. typedef struct _GActionMap GActionMap;
  46. typedef struct _GActionGroup GActionGroup;
  47. typedef struct _GPropertyAction GPropertyAction;
  48. typedef struct _GSimpleAction GSimpleAction;
  49. typedef struct _GAction GAction;
  50. typedef struct _GApplication GApplication;
  51. typedef struct _GApplicationCommandLine GApplicationCommandLine;
  52. typedef struct _GSettingsBackend GSettingsBackend;
  53. typedef struct _GSettings GSettings;
  54. typedef struct _GPermission GPermission;
  55. typedef struct _GMenuModel GMenuModel;
  56. typedef struct _GNotification GNotification;
  57. /**
  58. * GDrive:
  59. *
  60. * Opaque drive object.
  61. **/
  62. typedef struct _GDrive GDrive; /* Dummy typedef */
  63. typedef struct _GFileEnumerator GFileEnumerator;
  64. typedef struct _GFileMonitor GFileMonitor;
  65. typedef struct _GFilterInputStream GFilterInputStream;
  66. typedef struct _GFilterOutputStream GFilterOutputStream;
  67. /**
  68. * GFile:
  69. *
  70. * A handle to an object implementing the #GFileIface interface.
  71. * Generally stores a location within the file system. Handles do not
  72. * necessarily represent files or directories that currently exist.
  73. **/
  74. typedef struct _GFile GFile; /* Dummy typedef */
  75. typedef struct _GFileInfo GFileInfo;
  76. /**
  77. * GFileAttributeMatcher:
  78. *
  79. * Determines if a string matches a file attribute.
  80. **/
  81. typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
  82. typedef struct _GFileAttributeInfo GFileAttributeInfo;
  83. typedef struct _GFileAttributeInfoList GFileAttributeInfoList;
  84. typedef struct _GFileDescriptorBased GFileDescriptorBased;
  85. typedef struct _GFileInputStream GFileInputStream;
  86. typedef struct _GFileOutputStream GFileOutputStream;
  87. typedef struct _GFileIOStream GFileIOStream;
  88. typedef struct _GFileIcon GFileIcon;
  89. typedef struct _GFilenameCompleter GFilenameCompleter;
  90. typedef struct _GIcon GIcon; /* Dummy typedef */
  91. typedef struct _GInetAddress GInetAddress;
  92. typedef struct _GInetAddressMask GInetAddressMask;
  93. typedef struct _GInetSocketAddress GInetSocketAddress;
  94. typedef struct _GInputStream GInputStream;
  95. typedef struct _GInitable GInitable;
  96. typedef struct _GIOModule GIOModule;
  97. typedef struct _GIOExtensionPoint GIOExtensionPoint;
  98. typedef struct _GIOExtension GIOExtension;
  99. /**
  100. * GIOSchedulerJob:
  101. *
  102. * Opaque class for defining and scheduling IO jobs.
  103. **/
  104. typedef struct _GIOSchedulerJob GIOSchedulerJob;
  105. typedef struct _GIOStreamAdapter GIOStreamAdapter;
  106. typedef struct _GLoadableIcon GLoadableIcon; /* Dummy typedef */
  107. typedef struct _GBytesIcon GBytesIcon;
  108. typedef struct _GMemoryInputStream GMemoryInputStream;
  109. typedef struct _GMemoryOutputStream GMemoryOutputStream;
  110. /**
  111. * GMount:
  112. *
  113. * A handle to an object implementing the #GMountIface interface.
  114. **/
  115. typedef struct _GMount GMount; /* Dummy typedef */
  116. typedef struct _GMountOperation GMountOperation;
  117. typedef struct _GNetworkAddress GNetworkAddress;
  118. typedef struct _GNetworkMonitor GNetworkMonitor;
  119. typedef struct _GNetworkService GNetworkService;
  120. typedef struct _GOutputStream GOutputStream;
  121. typedef struct _GIOStream GIOStream;
  122. typedef struct _GPollableInputStream GPollableInputStream; /* Dummy typedef */
  123. typedef struct _GPollableOutputStream GPollableOutputStream; /* Dummy typedef */
  124. typedef struct _GResolver GResolver;
  125. /**
  126. * GResource:
  127. *
  128. * A resource bundle.
  129. *
  130. * Since: 2.32
  131. */
  132. typedef struct _GResource GResource;
  133. typedef struct _GSeekable GSeekable;
  134. typedef struct _GSimpleAsyncResult GSimpleAsyncResult;
  135. /**
  136. * GSocket:
  137. *
  138. * A lowlevel network socket object.
  139. *
  140. * Since: 2.22
  141. **/
  142. typedef struct _GSocket GSocket;
  143. /**
  144. * GSocketControlMessage:
  145. *
  146. * Base class for socket-type specific control messages that can be sent and
  147. * received over #GSocket.
  148. **/
  149. typedef struct _GSocketControlMessage GSocketControlMessage;
  150. /**
  151. * GSocketClient:
  152. *
  153. * A helper class for network clients to make connections.
  154. *
  155. * Since: 2.22
  156. **/
  157. typedef struct _GSocketClient GSocketClient;
  158. /**
  159. * GSocketConnection:
  160. *
  161. * A socket connection GIOStream object for connection-oriented sockets.
  162. *
  163. * Since: 2.22
  164. **/
  165. typedef struct _GSocketConnection GSocketConnection;
  166. /**
  167. * GSocketListener:
  168. *
  169. * A helper class for network servers to listen for and accept connections.
  170. *
  171. * Since: 2.22
  172. **/
  173. typedef struct _GSocketListener GSocketListener;
  174. /**
  175. * GSocketService:
  176. *
  177. * A helper class for handling accepting incomming connections in the
  178. * glib mainloop.
  179. *
  180. * Since: 2.22
  181. **/
  182. typedef struct _GSocketService GSocketService;
  183. typedef struct _GSocketAddress GSocketAddress;
  184. typedef struct _GSocketAddressEnumerator GSocketAddressEnumerator;
  185. typedef struct _GSocketConnectable GSocketConnectable;
  186. typedef struct _GSrvTarget GSrvTarget;
  187. typedef struct _GTask GTask;
  188. /**
  189. * GTcpConnection:
  190. *
  191. * A #GSocketConnection for TCP/IP connections.
  192. *
  193. * Since: 2.22
  194. **/
  195. typedef struct _GTcpConnection GTcpConnection;
  196. typedef struct _GTcpWrapperConnection GTcpWrapperConnection;
  197. /**
  198. * GThreadedSocketService:
  199. *
  200. * A helper class for handling accepting incoming connections in the
  201. * glib mainloop and handling them in a thread.
  202. *
  203. * Since: 2.22
  204. **/
  205. typedef struct _GThreadedSocketService GThreadedSocketService;
  206. typedef struct _GThemedIcon GThemedIcon;
  207. typedef struct _GTlsCertificate GTlsCertificate;
  208. typedef struct _GTlsClientConnection GTlsClientConnection; /* Dummy typedef */
  209. typedef struct _GTlsConnection GTlsConnection;
  210. typedef struct _GTlsDatabase GTlsDatabase;
  211. typedef struct _GTlsFileDatabase GTlsFileDatabase;
  212. typedef struct _GTlsInteraction GTlsInteraction;
  213. typedef struct _GTlsPassword GTlsPassword;
  214. typedef struct _GTlsServerConnection GTlsServerConnection; /* Dummy typedef */
  215. typedef struct _GVfs GVfs; /* Dummy typedef */
  216. /**
  217. * GProxyResolver:
  218. *
  219. * A helper class to enumerate proxies base on URI.
  220. *
  221. * Since: 2.26
  222. **/
  223. typedef struct _GProxyResolver GProxyResolver;
  224. typedef struct _GProxy GProxy;
  225. typedef struct _GProxyAddress GProxyAddress;
  226. typedef struct _GProxyAddressEnumerator GProxyAddressEnumerator;
  227. /**
  228. * GVolume:
  229. *
  230. * Opaque mountable volume object.
  231. **/
  232. typedef struct _GVolume GVolume; /* Dummy typedef */
  233. typedef struct _GVolumeMonitor GVolumeMonitor;
  234. /**
  235. * GAsyncReadyCallback:
  236. * @source_object: the object the asynchronous operation was started with.
  237. * @res: a #GAsyncResult.
  238. * @user_data: user data passed to the callback.
  239. *
  240. * Type definition for a function that will be called back when an asynchronous
  241. * operation within GIO has been completed.
  242. **/
  243. typedef void (*GAsyncReadyCallback) (GObject *source_object,
  244. GAsyncResult *res,
  245. gpointer user_data);
  246. /**
  247. * GFileProgressCallback:
  248. * @current_num_bytes: the current number of bytes in the operation.
  249. * @total_num_bytes: the total number of bytes in the operation.
  250. * @user_data: user data passed to the callback.
  251. *
  252. * When doing file operations that may take a while, such as moving
  253. * a file or copying a file, a progress callback is used to pass how
  254. * far along that operation is to the application.
  255. **/
  256. typedef void (*GFileProgressCallback) (goffset current_num_bytes,
  257. goffset total_num_bytes,
  258. gpointer user_data);
  259. /**
  260. * GFileReadMoreCallback:
  261. * @file_contents: the data as currently read.
  262. * @file_size: the size of the data currently read.
  263. * @callback_data: data passed to the callback.
  264. *
  265. * When loading the partial contents of a file with g_file_load_partial_contents_async(),
  266. * it may become necessary to determine if any more data from the file should be loaded.
  267. * A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
  268. * should be read, or %FALSE otherwise.
  269. *
  270. * Returns: %TRUE if more data should be read back. %FALSE otherwise.
  271. **/
  272. typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
  273. goffset file_size,
  274. gpointer callback_data);
  275. /**
  276. * GFileMeasureProgressCallback:
  277. * @reporting: %TRUE if more reports will come
  278. * @current_size: the current cumulative size measurement
  279. * @num_dirs: the number of directories visited so far
  280. * @num_files: the number of non-directory files encountered
  281. * @user_data: the data passed to the original request for this callback
  282. *
  283. * This callback type is used by g_file_measure_disk_usage() to make
  284. * periodic progress reports when measuring the amount of disk spaced
  285. * used by a directory.
  286. *
  287. * These calls are made on a best-effort basis and not all types of
  288. * #GFile will support them. At the minimum, however, one call will
  289. * always be made immediately.
  290. *
  291. * In the case that there is no support, @reporting will be set to
  292. * %FALSE (and the other values undefined) and no further calls will be
  293. * made. Otherwise, the @reporting will be %TRUE and the other values
  294. * all-zeros during the first (immediate) call. In this way, you can
  295. * know which type of progress UI to show without a delay.
  296. *
  297. * For g_file_measure_disk_usage() the callback is made directly. For
  298. * g_file_measure_disk_usage_async() the callback is made via the
  299. * default main context of the calling thread (ie: the same way that the
  300. * final async result would be reported).
  301. *
  302. * @current_size is in the same units as requested by the operation (see
  303. * %G_FILE_DISK_USAGE_APPARENT_SIZE).
  304. *
  305. * The frequency of the updates is implementation defined, but is
  306. * ideally about once every 200ms.
  307. *
  308. * The last progress callback may or may not be equal to the final
  309. * result. Always check the async result to get the final value.
  310. *
  311. * Since: 2.38
  312. **/
  313. typedef void (* GFileMeasureProgressCallback) (gboolean reporting,
  314. guint64 current_size,
  315. guint64 num_dirs,
  316. guint64 num_files,
  317. gpointer user_data);
  318. /**
  319. * GIOSchedulerJobFunc:
  320. * @job: a #GIOSchedulerJob.
  321. * @cancellable: optional #GCancellable object, %NULL to ignore.
  322. * @user_data: the data to pass to callback function
  323. *
  324. * I/O Job function.
  325. *
  326. * Long-running jobs should periodically check the @cancellable
  327. * to see if they have been cancelled.
  328. *
  329. * Returns: %TRUE if this function should be called again to
  330. * complete the job, %FALSE if the job is complete (or cancelled)
  331. **/
  332. typedef gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job,
  333. GCancellable *cancellable,
  334. gpointer user_data);
  335. /**
  336. * GSimpleAsyncThreadFunc:
  337. * @res: a #GSimpleAsyncResult.
  338. * @object: a #GObject.
  339. * @cancellable: optional #GCancellable object, %NULL to ignore.
  340. *
  341. * Simple thread function that runs an asynchronous operation and
  342. * checks for cancellation.
  343. **/
  344. typedef void (*GSimpleAsyncThreadFunc) (GSimpleAsyncResult *res,
  345. GObject *object,
  346. GCancellable *cancellable);
  347. /**
  348. * GSocketSourceFunc:
  349. * @socket: the #GSocket
  350. * @condition: the current condition at the source fired.
  351. * @user_data: data passed in by the user.
  352. *
  353. * This is the function type of the callback used for the #GSource
  354. * returned by g_socket_create_source().
  355. *
  356. * Returns: it should return %FALSE if the source should be removed.
  357. *
  358. * Since: 2.22
  359. */
  360. typedef gboolean (*GSocketSourceFunc) (GSocket *socket,
  361. GIOCondition condition,
  362. gpointer user_data);
  363. /**
  364. * GInputVector:
  365. * @buffer: Pointer to a buffer where data will be written.
  366. * @size: the available size in @buffer.
  367. *
  368. * Structure used for scatter/gather data input.
  369. * You generally pass in an array of #GInputVector<!-- -->s
  370. * and the operation will store the read data starting in the
  371. * first buffer, switching to the next as needed.
  372. *
  373. * Since: 2.22
  374. */
  375. typedef struct _GInputVector GInputVector;
  376. struct _GInputVector {
  377. gpointer buffer;
  378. gsize size;
  379. };
  380. /**
  381. * GOutputVector:
  382. * @buffer: Pointer to a buffer of data to read.
  383. * @size: the size of @buffer.
  384. *
  385. * Structure used for scatter/gather data output.
  386. * You generally pass in an array of #GOutputVector<!-- -->s
  387. * and the operation will use all the buffers as if they were
  388. * one buffer.
  389. *
  390. * Since: 2.22
  391. */
  392. typedef struct _GOutputVector GOutputVector;
  393. struct _GOutputVector {
  394. gconstpointer buffer;
  395. gsize size;
  396. };
  397. typedef struct _GCredentials GCredentials;
  398. typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage;
  399. typedef struct _GUnixFDList GUnixFDList;
  400. typedef struct _GDBusMessage GDBusMessage;
  401. typedef struct _GDBusConnection GDBusConnection;
  402. typedef struct _GDBusProxy GDBusProxy;
  403. typedef struct _GDBusMethodInvocation GDBusMethodInvocation;
  404. typedef struct _GDBusServer GDBusServer;
  405. typedef struct _GDBusAuthObserver GDBusAuthObserver;
  406. typedef struct _GDBusErrorEntry GDBusErrorEntry;
  407. typedef struct _GDBusInterfaceVTable GDBusInterfaceVTable;
  408. typedef struct _GDBusSubtreeVTable GDBusSubtreeVTable;
  409. typedef struct _GDBusAnnotationInfo GDBusAnnotationInfo;
  410. typedef struct _GDBusArgInfo GDBusArgInfo;
  411. typedef struct _GDBusMethodInfo GDBusMethodInfo;
  412. typedef struct _GDBusSignalInfo GDBusSignalInfo;
  413. typedef struct _GDBusPropertyInfo GDBusPropertyInfo;
  414. typedef struct _GDBusInterfaceInfo GDBusInterfaceInfo;
  415. typedef struct _GDBusNodeInfo GDBusNodeInfo;
  416. /**
  417. * GCancellableSourceFunc:
  418. * @cancellable: the #GCancellable
  419. * @user_data: data passed in by the user.
  420. *
  421. * This is the function type of the callback used for the #GSource
  422. * returned by g_cancellable_source_new().
  423. *
  424. * Returns: it should return %FALSE if the source should be removed.
  425. *
  426. * Since: 2.28
  427. */
  428. typedef gboolean (*GCancellableSourceFunc) (GCancellable *cancellable,
  429. gpointer user_data);
  430. /**
  431. * GPollableSourceFunc:
  432. * @pollable_stream: the #GPollableInputStream or #GPollableOutputStream
  433. * @user_data: data passed in by the user.
  434. *
  435. * This is the function type of the callback used for the #GSource
  436. * returned by g_pollable_input_stream_create_source() and
  437. * g_pollable_output_stream_create_source().
  438. *
  439. * Returns: it should return %FALSE if the source should be removed.
  440. *
  441. * Since: 2.28
  442. */
  443. typedef gboolean (*GPollableSourceFunc) (GObject *pollable_stream,
  444. gpointer user_data);
  445. typedef struct _GDBusInterface GDBusInterface; /* Dummy typedef */
  446. typedef struct _GDBusInterfaceSkeleton GDBusInterfaceSkeleton;
  447. typedef struct _GDBusObject GDBusObject; /* Dummy typedef */
  448. typedef struct _GDBusObjectSkeleton GDBusObjectSkeleton;
  449. typedef struct _GDBusObjectProxy GDBusObjectProxy;
  450. typedef struct _GDBusObjectManager GDBusObjectManager; /* Dummy typedef */
  451. typedef struct _GDBusObjectManagerClient GDBusObjectManagerClient;
  452. typedef struct _GDBusObjectManagerServer GDBusObjectManagerServer;
  453. /**
  454. * GDBusProxyTypeFunc:
  455. * @manager: A #GDBusObjectManagerClient.
  456. * @object_path: The object path of the remote object.
  457. * @interface_name: (allow-none): The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
  458. * @user_data: User data.
  459. *
  460. * Function signature for a function used to determine the #GType to
  461. * use for an interface proxy (if @interface_name is not %NULL) or
  462. * object proxy (if @interface_name is %NULL).
  463. *
  464. * This function is called in the
  465. * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
  466. * that @manager was constructed in.
  467. *
  468. * Returns: A #GType to use for the remote object. The returned type
  469. * must be a #GDBusProxy<!-- -->- or #GDBusObjectProxy<!-- -->-derived
  470. * type.
  471. *
  472. * Since: 2.30
  473. */
  474. typedef GType (*GDBusProxyTypeFunc) (GDBusObjectManagerClient *manager,
  475. const gchar *object_path,
  476. const gchar *interface_name,
  477. gpointer user_data);
  478. typedef struct _GTestDBus GTestDBus;
  479. /**
  480. * GSubprocess:
  481. *
  482. * A child process.
  483. *
  484. * Since: 2.40
  485. */
  486. typedef struct _GSubprocess GSubprocess;
  487. /**
  488. * GSubprocessLauncher:
  489. *
  490. * Options for launching a child process.
  491. *
  492. * Since: 2.36
  493. */
  494. typedef struct _GSubprocessLauncher GSubprocessLauncher;
  495. G_END_DECLS
  496. #endif /* __GIO_TYPES_H__ */