ENetworkMonitor: Evolution-Data-Server Reference Manual

## ENetworkMonitor ENetworkMonitor |

## Functions

GNetworkMonitor * | e_network_monitor_get_default ()
GSList * | e_network_monitor_list_gio_names ()
gchar * | e_network_monitor_dup_gio_name ()
void | e_network_monitor_set_gio_name ()

## Types and Values

#define | E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME
struct | ENetworkMonitor

## Object Hierarchy

        GObject
        ╰── ENetworkMonitor

## Implemented Interfaces

ENetworkMonitor implements GInitable and GNetworkMonitor.

## Description

## Functions

### e_network_monitor_get_default ()

    GNetworkMonitor *
    e_network_monitor_get_default (void);

Gets the default ENetworkMonitor. The caller should not unref the returned instance. The ENetworkMonitor implements the GNetworkMonitor iterface.

#### Returns

The default ENetworkMonitor instance.

[transfer none]

Since: 3.22

### e_network_monitor_list_gio_names ()

    GSList *
    e_network_monitor_list_gio_names (ENetworkMonitor *network_monitor);

Get a list of available GIO names for the GNetworkMonitor implementations. The strings can be used in `e_network_monitor_set_gio_name()`.

#### Parameters

network_monitor | an ENetworkMonitor |

#### Returns

A newly allocated GSList, with newly allocated strings, the GIO names. The GSList should be freed with g_slist_free_full (gio_names, g_free); when no longer needed.

[transfer full][element-type utf8]

Since: 3.22

### e_network_monitor_dup_gio_name ()

    gchar *
    e_network_monitor_dup_gio_name (ENetworkMonitor *network_monitor);

Get currently set GIO name for the network availability checks. See `e_network_monitor_set_gio_name()` for more details.

#### Parameters

network_monitor | an ENetworkMonitor |

#### Returns

A newly allocated string, a GIO name of the underlying GNetworkMonitor which is set to be used. The returned string should be freed with `g_free()`, when no longer needed.

[transfer full]

Since: 3.22

### e_network_monitor_set_gio_name ()

    void
    e_network_monitor_set_gio_name (ENetworkMonitor *network_monitor,
                                    const gchar *gio_name);

Set a `gio_name` of the GNetworkMonitor implementation to use, can be `NULL`. Use `e_network_monitor_list_gio_names()` for a list of available implementations. A special value, `E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME`, can be used to report the network as always reachable. When an unknown GIO name is used the default GNetworkMonitor implementation, as returned by the `g_network_monitor_get_default()`, will be used.

#### Parameters

network_monitor | an ENetworkMonitor |
gio_name | a GIO name of a GNetworkMonitor implementation to use, or `NULL`. | [nullable]

Since: 3.22

## Types and Values

### E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME

    #define E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME "always-online"

A special name, which can be used as a GIO name in the call to `e_network_monitor_set_gio_name()`, which is used to report the the network as always reachable.

Since: 3.22

### struct ENetworkMonitor

    struct ENetworkMonitor;

Contains only private data that should be read and manipulated using the functions below. Implements GNetworkMonitorInterface.

Since: 3.22