1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 2 /* location-entry.h - Location-selecting text entry 3 * 4 * Copyright 2008, Red Hat, Inc. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public License 8 * as published by the Free Software Foundation; either version 2.1 of 9 * the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, see 18 * <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef MATEWEATHER_LOCATION_ENTRY_H 22 #define MATEWEATHER_LOCATION_ENTRY_H 1 23 24 #include <gtk/gtk.h> 25 #include <libmateweather/mateweather-location.h> 26 27 #define MATEWEATHER_TYPE_LOCATION_ENTRY (mateweather_location_entry_get_type ()) 28 #define MATEWEATHER_LOCATION_ENTRY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MATEWEATHER_TYPE_LOCATION_ENTRY, MateWeatherLocationEntry)) 29 #define MATEWEATHER_LOCATION_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MATEWEATHER_TYPE_LOCATION_ENTRY, MateWeatherLocationEntryClass)) 30 #define MATEWEATHER_IS_LOCATION_ENTRY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MATEWEATHER_TYPE_LOCATION_ENTRY)) 31 #define MATEWEATHER_IS_LOCATION_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MATEWEATHER_TYPE_LOCATION_ENTRY)) 32 #define MATEWEATHER_LOCATION_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MATEWEATHER_TYPE_LOCATION_ENTRY, MateWeatherLocationEntryClass)) 33 34 typedef struct { 35 GtkEntry parent; 36 37 /*< private >*/ 38 MateWeatherLocation *location, *top; 39 guint custom_text : 1; 40 } MateWeatherLocationEntry; 41 42 typedef struct { 43 GtkEntryClass parent_class; 44 45 } MateWeatherLocationEntryClass; 46 47 GType mateweather_location_entry_get_type (void); 48 49 GtkWidget *mateweather_location_entry_new (MateWeatherLocation *top); 50 51 void mateweather_location_entry_set_location (MateWeatherLocationEntry *entry, 52 MateWeatherLocation *loc); 53 MateWeatherLocation *mateweather_location_entry_get_location (MateWeatherLocationEntry *entry); 54 55 gboolean mateweather_location_entry_has_custom_text (MateWeatherLocationEntry *entry); 56 57 gboolean mateweather_location_entry_set_city (MateWeatherLocationEntry *entry, 58 const char *city_name, 59 const char *code); 60 61 #endif 62