]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikmapsource.h
Tidy up: simpler and better use of trackpoint free methods in TRW Layer.
[andy/viking.git] / src / vikmapsource.h
index a8e4f8109cb09fb9c8cfe7c088c0129cd3f8ba46..7088c56eed3e5a0d8973921425e0c3725159d305 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
  * viking
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
  * viking
- * Copyright (C) Guilhem Bonnefille 2009 <guilhem.bonnefille@gmail.com>
+ * Copyright (C) 2009-2010, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
  * 
  * viking is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * 
  * viking is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -25,6 +25,7 @@
 #include "vikviewport.h"
 #include "vikcoord.h"
 #include "mapcoord.h"
 #include "vikviewport.h"
 #include "vikcoord.h"
 #include "mapcoord.h"
+#include "bbox.h"
 
 G_BEGIN_DECLS
 
 
 G_BEGIN_DECLS
 
@@ -41,14 +42,25 @@ typedef struct _VikMapSource VikMapSource;
 struct _VikMapSourceClass
 {
        GObjectClass parent_class;
 struct _VikMapSourceClass
 {
        GObjectClass parent_class;
-       
+
+       /* Legal info */
+       void (* get_copyright) (VikMapSource * self, LatLonBBox bbox, gdouble zoom, void (*fct)(VikViewport*,const gchar*), void *data);
+       const gchar *(* get_license) (VikMapSource * self);
+       const gchar *(* get_license_url) (VikMapSource * self);
+       const GdkPixbuf *(* get_logo) (VikMapSource * self);
+
        guint8 (* get_uniq_id) (VikMapSource * self);
        guint8 (* get_uniq_id) (VikMapSource * self);
+       const gchar * (* get_label) (VikMapSource * self);
        guint16 (* get_tilesize_x) (VikMapSource * self);
        guint16 (* get_tilesize_y) (VikMapSource * self);
        VikViewportDrawMode (* get_drawmode) (VikMapSource * self);
        guint16 (* get_tilesize_x) (VikMapSource * self);
        guint16 (* get_tilesize_y) (VikMapSource * self);
        VikViewportDrawMode (* get_drawmode) (VikMapSource * self);
+       gboolean (* is_direct_file_access) (VikMapSource * self);
+       gboolean (* supports_download_only_new) (VikMapSource * self);
        gboolean (* coord_to_mapcoord) (VikMapSource * self, const VikCoord * src, gdouble xzoom, gdouble yzoom, MapCoord * dest);
        void (* mapcoord_to_center_coord) (VikMapSource * self, MapCoord * src, VikCoord * dest);
        gboolean (* coord_to_mapcoord) (VikMapSource * self, const VikCoord * src, gdouble xzoom, gdouble yzoom, MapCoord * dest);
        void (* mapcoord_to_center_coord) (VikMapSource * self, MapCoord * src, VikCoord * dest);
-       int (* download) (VikMapSource * self, MapCoord * src, const gchar * dest_fn);
+       int (* download) (VikMapSource * self, MapCoord * src, const gchar * dest_fn, void * handle);
+       void * (* download_handle_init) (VikMapSource * self);
+       void (* download_handle_cleanup) (VikMapSource * self, void * handle);
 };
 
 struct _VikMapSource
 };
 
 struct _VikMapSource
@@ -58,13 +70,23 @@ struct _VikMapSource
 
 GType vik_map_source_get_type (void) G_GNUC_CONST;
 
 
 GType vik_map_source_get_type (void) G_GNUC_CONST;
 
+void vik_map_source_get_copyright (VikMapSource * self, LatLonBBox bbox, gdouble zoom, void (*fct)(VikViewport*,const gchar*), void *data);
+const gchar *vik_map_source_get_license (VikMapSource * self);
+const gchar *vik_map_source_get_license_url (VikMapSource * self);
+const GdkPixbuf *vik_map_source_get_logo (VikMapSource * self);
+
 guint8 vik_map_source_get_uniq_id (VikMapSource * self);
 guint8 vik_map_source_get_uniq_id (VikMapSource * self);
+const gchar *vik_map_source_get_label (VikMapSource * self);
 guint16 vik_map_source_get_tilesize_x (VikMapSource * self);
 guint16 vik_map_source_get_tilesize_y (VikMapSource * self);
 VikViewportDrawMode vik_map_source_get_drawmode (VikMapSource * self);
 guint16 vik_map_source_get_tilesize_x (VikMapSource * self);
 guint16 vik_map_source_get_tilesize_y (VikMapSource * self);
 VikViewportDrawMode vik_map_source_get_drawmode (VikMapSource * self);
+gboolean vik_map_source_is_direct_file_access (VikMapSource * self);
+gboolean vik_map_source_supports_download_only_new (VikMapSource * self);
 gboolean vik_map_source_coord_to_mapcoord (VikMapSource * self, const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest );
 void vik_map_source_mapcoord_to_center_coord (VikMapSource * self, MapCoord *src, VikCoord *dest);
 gboolean vik_map_source_coord_to_mapcoord (VikMapSource * self, const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest );
 void vik_map_source_mapcoord_to_center_coord (VikMapSource * self, MapCoord *src, VikCoord *dest);
-int vik_map_source_download (VikMapSource * self, MapCoord * src, const gchar * dest_fn);
+int vik_map_source_download (VikMapSource * self, MapCoord * src, const gchar * dest_fn, void * handle);
+void * vik_map_source_download_handle_init (VikMapSource * self);
+void vik_map_source_download_handle_cleanup (VikMapSource * self, void * handle);
 
 G_END_DECLS
 
 
 G_END_DECLS