Updated Spanish translation
[evolution.git] / e-util / e-map.h
bloba5ce3dc96288e213152374b79ade586a60a8eff1
1 /*
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU Lesser General Public License as published by
5 * the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10 * for more details.
12 * You should have received a copy of the GNU Lesser General Public License
13 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Authors:
17 * Hans Petter Jansson <hpj@ximian.com>
19 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
23 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
24 #error "Only <e-util/e-util.h> should be included directly."
25 #endif
27 #ifndef E_MAP_H
28 #define E_MAP_H
30 #include <gtk/gtk.h>
32 /* Standard GObject macros */
33 #define E_TYPE_MAP \
34 (e_map_get_type ())
35 #define E_MAP(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST \
37 ((obj), E_TYPE_MAP, EMap))
38 #define E_MAP_CLASS(cls) \
39 (G_TYPE_CHECK_CLASS_CAST \
40 ((cls), E_TYPE_MAP, EMapClass))
41 #define E_IS_MAP(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE \
43 ((obj), E_TYPE_MAP))
44 #define E_IS_MAP_CLASS(cls) \
45 (G_TYPE_CHECK_CLASS_TYPE \
46 ((cls), E_TYPE_MAP))
47 #define E_MAP_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS \
49 ((obj), E_TYPE_MAP, EMapClass))
51 G_BEGIN_DECLS
53 typedef struct _EMap EMap;
54 typedef struct _EMapClass EMapClass;
55 typedef struct _EMapPrivate EMapPrivate;
56 typedef struct _EMapPoint EMapPoint;
58 struct _EMap {
59 GtkWidget widget;
60 EMapPrivate *priv;
63 struct _EMapClass {
64 GtkWidgetClass parent_class;
66 /* Notification signals */
67 void (*zoom_fit) (EMap * view);
69 /* GTK+ scrolling interface */
70 void (*set_scroll_adjustments) (GtkWidget * widget,
71 GtkAdjustment * hadj,
72 GtkAdjustment * vadj);
75 /* The definition of Dot */
77 struct _EMapPoint {
78 gchar *name; /* Can be NULL */
79 gdouble longitude, latitude;
80 guint32 rgba;
81 gpointer user_data;
84 /* --- Widget --- */
86 GType e_map_get_type (void) G_GNUC_CONST;
88 EMap *e_map_new (void);
90 /* Stop doing redraws when map data changes (e.g. by modifying points) */
91 void e_map_freeze (EMap *map);
93 /* Do an immediate repaint, and start doing realtime repaints again */
94 void e_map_thaw (EMap *map);
96 /* --- Coordinate translation --- */
98 /* Translates window-relative coords to lat/long */
99 void e_map_window_to_world (EMap *map,
100 gdouble win_x, gdouble win_y,
101 gdouble *world_longitude, gdouble *world_latitude);
103 /* Translates lat/long to window-relative coordinates. Note that the
104 * returned coordinates can be negative or greater than the current size
105 * of the allocation area */
106 void e_map_world_to_window (EMap *map,
107 gdouble world_longitude, gdouble world_latitude,
108 gdouble *win_x, gdouble *win_y);
110 /* --- Zoom --- */
112 gdouble e_map_get_magnification (EMap *map);
114 /* Pass TRUE if we want the smooth zoom hack */
115 void e_map_set_smooth_zoom (EMap *map, gboolean state);
117 /* TRUE if smooth zoom hack will be employed */
118 gboolean e_map_get_smooth_zoom (EMap *map);
120 /* NB: Function definition will change shortly */
121 void e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude);
123 /* Zoom to mag factor 1.0 */
124 void e_map_zoom_out (EMap *map);
126 /* --- Points --- */
128 EMapPoint *e_map_add_point (EMap *map, gchar *name,
129 gdouble longitude, gdouble latitude,
130 guint32 color_rgba);
132 void e_map_remove_point (EMap *map, EMapPoint *point);
134 void e_map_point_get_location (EMapPoint *point,
135 gdouble *longitude, gdouble *latitude);
137 gchar *e_map_point_get_name (EMapPoint *point);
139 guint32 e_map_point_get_color_rgba (EMapPoint *point);
141 void e_map_point_set_color_rgba (EMap *map, EMapPoint *point, guint32 color_rgba);
143 void e_map_point_set_data (EMapPoint *point, gpointer data);
145 gpointer e_map_point_get_data (EMapPoint *point);
147 gboolean e_map_point_is_in_view (EMap *map, EMapPoint *point);
149 EMapPoint *e_map_get_closest_point (EMap *map, gdouble longitude, gdouble latitude,
150 gboolean in_view);
152 G_END_DECLS
154 #endif