]> git.street.me.uk Git - andy/viking.git/blame - src/vikmapsource.h
Improve ordering of date/time output on time graphs.
[andy/viking.git] / src / vikmapsource.h
CommitLineData
820c59f4
GB
1/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2/*
3 * viking
82aa018d 4 * Copyright (C) 2009-2010, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
820c59f4
GB
5 *
6 * viking is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * viking 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.
14 * See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef _VIK_MAP_SOURCE_H_
21#define _VIK_MAP_SOURCE_H_
22
23#include <glib-object.h>
24
25#include "vikviewport.h"
26#include "vikcoord.h"
27#include "mapcoord.h"
68b1d6c0 28#include "bbox.h"
820c59f4
GB
29
30G_BEGIN_DECLS
31
32#define VIK_TYPE_MAP_SOURCE (vik_map_source_get_type ())
33#define VIK_MAP_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TYPE_MAP_SOURCE, VikMapSource))
34#define VIK_MAP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TYPE_MAP_SOURCE, VikMapSourceClass))
35#define VIK_IS_MAP_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TYPE_MAP_SOURCE))
36#define VIK_IS_MAP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TYPE_MAP_SOURCE))
37#define VIK_MAP_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIK_TYPE_MAP_SOURCE, VikMapSourceClass))
38
39typedef struct _VikMapSourceClass VikMapSourceClass;
40typedef struct _VikMapSource VikMapSource;
41
42struct _VikMapSourceClass
43{
44 GObjectClass parent_class;
82aa018d
GB
45
46 /* Legal info */
551ee033 47 void (* get_copyright) (VikMapSource * self, LatLonBBox bbox, gdouble zoom, void (*fct)(VikViewport*,const gchar*), void *data);
53ac8302
GB
48 const gchar *(* get_license) (VikMapSource * self);
49 const gchar *(* get_license_url) (VikMapSource * self);
26336cf0 50 const GdkPixbuf *(* get_logo) (VikMapSource * self);
82aa018d 51
d7e495b2 52 guint16 (* get_uniq_id) (VikMapSource * self);
db03733a 53 const gchar * (* get_label) (VikMapSource * self);
820c59f4
GB
54 guint16 (* get_tilesize_x) (VikMapSource * self);
55 guint16 (* get_tilesize_y) (VikMapSource * self);
56 VikViewportDrawMode (* get_drawmode) (VikMapSource * self);
2673b29d 57 gboolean (* is_direct_file_access) (VikMapSource * self);
0fb11294 58 gboolean (* is_mbtiles) (VikMapSource * self);
c81ded98 59 gboolean (* supports_download_only_new) (VikMapSource * self);
820c59f4
GB
60 gboolean (* coord_to_mapcoord) (VikMapSource * self, const VikCoord * src, gdouble xzoom, gdouble yzoom, MapCoord * dest);
61 void (* mapcoord_to_center_coord) (VikMapSource * self, MapCoord * src, VikCoord * dest);
825413ba
SW
62 int (* download) (VikMapSource * self, MapCoord * src, const gchar * dest_fn, void * handle);
63 void * (* download_handle_init) (VikMapSource * self);
64 void (* download_handle_cleanup) (VikMapSource * self, void * handle);
820c59f4
GB
65};
66
67struct _VikMapSource
68{
69 GObject parent_instance;
70};
71
72GType vik_map_source_get_type (void) G_GNUC_CONST;
73
551ee033 74void vik_map_source_get_copyright (VikMapSource * self, LatLonBBox bbox, gdouble zoom, void (*fct)(VikViewport*,const gchar*), void *data);
53ac8302
GB
75const gchar *vik_map_source_get_license (VikMapSource * self);
76const gchar *vik_map_source_get_license_url (VikMapSource * self);
26336cf0 77const GdkPixbuf *vik_map_source_get_logo (VikMapSource * self);
82aa018d 78
d7e495b2 79guint16 vik_map_source_get_uniq_id (VikMapSource * self);
db03733a 80const gchar *vik_map_source_get_label (VikMapSource * self);
820c59f4
GB
81guint16 vik_map_source_get_tilesize_x (VikMapSource * self);
82guint16 vik_map_source_get_tilesize_y (VikMapSource * self);
83VikViewportDrawMode vik_map_source_get_drawmode (VikMapSource * self);
2673b29d 84gboolean vik_map_source_is_direct_file_access (VikMapSource * self);
0fb11294 85gboolean vik_map_source_is_mbtiles (VikMapSource * self);
c81ded98 86gboolean vik_map_source_supports_download_only_new (VikMapSource * self);
820c59f4
GB
87gboolean vik_map_source_coord_to_mapcoord (VikMapSource * self, const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest );
88void vik_map_source_mapcoord_to_center_coord (VikMapSource * self, MapCoord *src, VikCoord *dest);
825413ba
SW
89int vik_map_source_download (VikMapSource * self, MapCoord * src, const gchar * dest_fn, void * handle);
90void * vik_map_source_download_handle_init (VikMapSource * self);
91void vik_map_source_download_handle_cleanup (VikMapSource * self, void * handle);
820c59f4
GB
92
93G_END_DECLS
94
95#endif /* _VIK_MAP_SOURCE_H_ */