Class
GWeatherInfo
Description [src]
final class GWeather.Info : GObject.Object
{
/* No available fields */
}
GWeatherInfo
provides a handy way to access weather conditions
and forecasts from a GWeatherLocation
, aggregating multiple
different web services.
It includes also astronomical data such as sunrise times and moon phases.
Constructors
gweather_info_new
Builds a new GWeatherInfo
that will provide weather information about
the given location.
Functions
gweather_info_store_cache
Ensures that any data cached from the network is stored to disk.
Calling this is not necessary, as the cache will be saved when
the last reference to a GWeatherInfo
will be dropped.
On the other hand, it must be called if there is any chance that
the application will be closed without unreffing all objects, such
as when using a language binding that employs a GC.
Instance methods
gweather_info_get_attribution
Some weather services require the application showing the data to include an attribution text, possibly including links to the service website. This must be shown prominently toghether with the data.
gweather_info_get_value_conditions
Fills out phenomenon
and qualifier
with current weather conditions.
gweather_info_set_application_id
Sets the application ID of the application fetching the weather. It is a requirement for using any of the online weather providers.
gweather_info_set_contact_info
Sets the contact information for the application fetching the weather. It is a requirement for using any of the online weather providers as it allows API providers to contact application developers in case of terms of use breaches.
gweather_info_set_enabled_providers
Sets the enabled providers for fetching the weather. Note that it is up to the application developer to make sure that the terms of use for each service are respected.
gweather_info_update
Requests a reload of weather conditions and forecast data from
enabled network services.
This call does no synchronous IO: rather, the result is delivered
by emitting the GWeatherInfo::updated
signal.
Note that if no network services are enabled, the signal will not
be emitted. See GWeatherInfo:enabled-providers
for details.
Properties
GWeather.Info:application-id
A unique identifier, typically in the form of reverse DNS notation, for the application that is querying the weather information.
Signals
GWeather.Info::updated
This signal is emitted after the initial fetch of the weather
data from upstream services, and after every successful call
to gweather_info_update()
.
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.