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_abort
gweather_info_get_apparent
gweather_info_get_application_id
Get the application ID of the application fetching the weather.
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_conditions
gweather_info_get_contact_info
Get the contact information of the application fetching the weather.
gweather_info_get_dew
gweather_info_get_enabled_providers
Gets the bitmask of enabled GWeatherProvider
weather providers.
gweather_info_get_forecast_list
gweather_info_get_humidity
gweather_info_get_icon_name
gweather_info_get_location
gweather_info_get_location_name
gweather_info_get_pressure
gweather_info_get_sky
gweather_info_get_sunrise
gweather_info_get_sunset
gweather_info_get_symbolic_icon_name
gweather_info_get_temp
gweather_info_get_temp_max
gweather_info_get_temp_min
gweather_info_get_temp_summary
gweather_info_get_upcoming_moonphases
gweather_info_get_update
gweather_info_get_value_apparent
gweather_info_get_value_conditions
Fills out phenomenon
and qualifier
with current weather conditions.
gweather_info_get_value_dew
gweather_info_get_value_moonphase
gweather_info_get_value_pressure
gweather_info_get_value_sky
Fills out sky
with current sky conditions.
gweather_info_get_value_sunrise
gweather_info_get_value_sunset
gweather_info_get_value_temp
gweather_info_get_value_temp_max
gweather_info_get_value_temp_min
gweather_info_get_value_update
Note that value
may be 0 if info
has not yet been updated.
gweather_info_get_value_visibility
gweather_info_get_value_wind
gweather_info_get_visibility
gweather_info_get_weather_summary
gweather_info_get_wind
gweather_info_is_daytime
gweather_info_is_valid
gweather_info_network_error
gweather_info_next_sun_event
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_set_location
Changes the location of the weather report.
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.
GWeather.Info:contact-info
An email address or any other contact form URL.
GWeather.Info:enabled-providers
The enabled weather providers.
GWeather.Info:location
The location of 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.Object::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.