![]() |
![]() |
![]() |
Tracker Miner Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
TrackerNetworkProviderTrackerNetworkProvider — Network status interface for cross platform backends |
#include <libtracker-miner/tracker-miner.h> #define TRACKER_NETWORK_PROVIDER_GET_INTERFACE(o) typedef TrackerNetworkProvider; TrackerNetworkProviderIface; enum TrackerNetworkProviderStatus; TrackerNetworkProvider * tracker_network_provider_get (void
); gchar * tracker_network_provider_get_name (TrackerNetworkProvider *provider
); TrackerNetworkProviderStatus tracker_network_provider_get_status (TrackerNetworkProvider *provider
);
The TrackerNetworkProvider allows different backends to be written for retrieving network connectivity status information. This can be used to avoid heavy transfers when on a slow connection, or on a connection where costs may apply. Currently, there are two implementations. The NetworkManager one uses NetworkManager, and the Dummy one will always expose the network as connected, no matter what the connectivity status actually is.
#define TRACKER_NETWORK_PROVIDER_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TRACKER_TYPE_NETWORK_PROVIDER, TrackerNetworkProviderIface))
typedef struct { GTypeInterface parent_iface; TrackerNetworkProviderStatus (* get_status) (TrackerNetworkProvider *provider); } TrackerNetworkProviderIface;
GTypeInterface |
parent object interface |
get the network status |
Since 0.10
typedef enum { TRACKER_NETWORK_PROVIDER_DISCONNECTED, TRACKER_NETWORK_PROVIDER_UNKNOWN, TRACKER_NETWORK_PROVIDER_GPRS, TRACKER_NETWORK_PROVIDER_EDGE, TRACKER_NETWORK_PROVIDER_3G, TRACKER_NETWORK_PROVIDER_LAN } TrackerNetworkProviderStatus;
Enumerates the different types of connections that the device might use when connected to internet. Note that not all providers might provide this information.
Network is disconnected | |
Network status is unknown | |
Network is connected over a GPRS connection | |
Network is connected over an EDGE connection | |
Network is connected over a 3G or faster (HSDPA, UMTS, ...) connection | |
Network is connected over a local network connection. This can be ethernet, wifi, etc. |
Since 0.10
TrackerNetworkProvider * tracker_network_provider_get (void
);
This function MUST be defined by the implementation of TrackerNetworkProvider.
For example, tracker-network-provider-network-manager.c should include this function for a NetworkManager implementation.
Only one implementation can exist at once.
Returns : |
a TrackerNetworkProvider . |
Since 0.10
gchar * tracker_network_provider_get_name (TrackerNetworkProvider *provider
);
At the moment there are only two providers, "Dummy" and "NetworkManager". Either of these is what will be returned unless new providers are written.
|
a TrackerNetworkProvider |
Returns : |
a newly allocated string representing the name
which must be freed with g_free() . [transfer full]
|
Since 0.10
TrackerNetworkProviderStatus tracker_network_provider_get_status
(TrackerNetworkProvider *provider
);
This function calls the network provider's "get_status" implementation.
|
a TrackerNetworkProvider |
Returns : |
a TrackerNetworkProviderStatus decribing the current network status. |
Since 0.10