From fe8aea1c3b5348347633da18a02b0bffd3b266a1 Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 1 Dec 2011 21:42:39 -0300 Subject: moving from https://github.com/perberos/mate-desktop-environment --- libmateweather/mateweather-prefs.h | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 libmateweather/mateweather-prefs.h (limited to 'libmateweather/mateweather-prefs.h') diff --git a/libmateweather/mateweather-prefs.h b/libmateweather/mateweather-prefs.h new file mode 100644 index 0000000..17cc65f --- /dev/null +++ b/libmateweather/mateweather-prefs.h @@ -0,0 +1,76 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* mateweather-prefs.h - Preference handling functions + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see + * . + */ + +#ifndef __MATEWEATHER_PREFS_H_ +#define __MATEWEATHER_PREFS_H_ + + +#ifndef MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE +#error "libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform" +#endif + + +#include +#include + +/* mateconf keys */ +#define MATECONF_TEMP_UNIT "temperature_unit" +#define MATECONF_SPEED_UNIT "speed_unit" +#define MATECONF_PRESSURE_UNIT "pressure_unit" +#define MATECONF_DISTANCE_UNIT "distance_unit" + +typedef struct _MateWeatherPrefs MateWeatherPrefs; + +struct _MateWeatherPrefs { + WeatherLocation *location; + gint update_interval; /* in seconds */ + gboolean update_enabled; + gboolean detailed; + gboolean radar_enabled; + gboolean use_custom_radar_url; + gchar *radar; + + TempUnit temperature_unit; + gboolean use_temperature_default; + SpeedUnit speed_unit; + gboolean use_speed_default; + PressureUnit pressure_unit; + gboolean use_pressure_default; + DistanceUnit distance_unit; + gboolean use_distance_default; +}; + +void mateweather_prefs_load (MateWeatherPrefs *prefs, + MateWeatherMateConf *ctx); + +const char * mateweather_prefs_temp_enum_to_string (TempUnit temp); +const char * mateweather_prefs_speed_enum_to_string (SpeedUnit speed); +const char * mateweather_prefs_pressure_enum_to_string (PressureUnit pressure); +const char * mateweather_prefs_distance_enum_to_string (DistanceUnit distance); + +TempUnit mateweather_prefs_parse_temperature (const char *str, + gboolean *is_default); +SpeedUnit mateweather_prefs_parse_speed (const char *str, + gboolean *is_default); + +const char * mateweather_prefs_get_temp_display_name (TempUnit temp); +const char * mateweather_prefs_get_speed_display_name (SpeedUnit speed); +const char * mateweather_prefs_get_pressure_display_name (PressureUnit pressure); +const char * mateweather_prefs_get_distance_display_name (DistanceUnit distance); + +#endif /* __MATEWEATHER_PREFS_H_ */ -- cgit v1.2.1