Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 10:13:08

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright 2011 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  */
0020 
0021 #ifndef __G_NETWORK_MONITOR_H__
0022 #define __G_NETWORK_MONITOR_H__
0023 
0024 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0025 #error "Only <gio/gio.h> can be included directly."
0026 #endif
0027 
0028 #include <gio/giotypes.h>
0029 
0030 G_BEGIN_DECLS
0031 
0032 /**
0033  * G_NETWORK_MONITOR_EXTENSION_POINT_NAME:
0034  *
0035  * Extension point for network status monitoring functionality.
0036  * See [Extending GIO][extending-gio].
0037  *
0038  * Since: 2.30
0039  */
0040 #define G_NETWORK_MONITOR_EXTENSION_POINT_NAME "gio-network-monitor"
0041 
0042 #define G_TYPE_NETWORK_MONITOR             (g_network_monitor_get_type ())
0043 #define G_NETWORK_MONITOR(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitor))
0044 #define G_IS_NETWORK_MONITOR(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_MONITOR))
0045 #define G_NETWORK_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitorInterface))
0046 
0047 typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface;
0048 
0049 struct _GNetworkMonitorInterface {
0050   GTypeInterface g_iface;
0051 
0052   void     (*network_changed)  (GNetworkMonitor      *monitor,
0053                 gboolean              network_available);
0054 
0055   gboolean (*can_reach)        (GNetworkMonitor      *monitor,
0056                 GSocketConnectable   *connectable,
0057                 GCancellable         *cancellable,
0058                 GError              **error);
0059   void     (*can_reach_async)  (GNetworkMonitor      *monitor,
0060                 GSocketConnectable   *connectable,
0061                 GCancellable         *cancellable,
0062                 GAsyncReadyCallback   callback,
0063                 gpointer              user_data);
0064   gboolean (*can_reach_finish) (GNetworkMonitor      *monitor,
0065                 GAsyncResult         *result,
0066                 GError              **error);
0067 };
0068 
0069 GIO_AVAILABLE_IN_2_32
0070 GType                 g_network_monitor_get_type              (void) G_GNUC_CONST;
0071 GIO_AVAILABLE_IN_2_32
0072 GNetworkMonitor      *g_network_monitor_get_default           (void);
0073 
0074 GIO_AVAILABLE_IN_2_32
0075 gboolean              g_network_monitor_get_network_available (GNetworkMonitor     *monitor);
0076 
0077 GIO_AVAILABLE_IN_2_46
0078 gboolean              g_network_monitor_get_network_metered   (GNetworkMonitor     *monitor);
0079 
0080 GIO_AVAILABLE_IN_2_44
0081 GNetworkConnectivity  g_network_monitor_get_connectivity      (GNetworkMonitor     *monitor);
0082 
0083 GIO_AVAILABLE_IN_2_32
0084 gboolean              g_network_monitor_can_reach             (GNetworkMonitor     *monitor,
0085                                                                GSocketConnectable  *connectable,
0086                                                                GCancellable        *cancellable,
0087                                                                GError             **error);
0088 GIO_AVAILABLE_IN_2_32
0089 void                  g_network_monitor_can_reach_async       (GNetworkMonitor     *monitor,
0090                                                                GSocketConnectable  *connectable,
0091                                                                GCancellable        *cancellable,
0092                                                                GAsyncReadyCallback  callback,
0093                                                                gpointer             user_data);
0094 GIO_AVAILABLE_IN_2_32
0095 gboolean              g_network_monitor_can_reach_finish      (GNetworkMonitor     *monitor,
0096                                                                GAsyncResult        *result,
0097                                                                GError             **error);
0098 
0099 G_END_DECLS
0100 
0101 #endif /* __G_NETWORK_MONITOR_H__ */