1
/*
2
 * Copyright (C) 2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
3
 * Copyright (C) 2011-2012 Jiri Techet <techet@gmail.com>
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9
 *
10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
19
20
#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
21
#error "Only <champlain/champlain.h> can be included directly."
22
#endif
23
24
#ifndef CHAMPLAIN_MAP_SOURCE_DESC_H
25
#define CHAMPLAIN_MAP_SOURCE_DESC_H
26
27
#include <glib-object.h>
28
#include "champlain-tile-source.h"
29
30
G_BEGIN_DECLS
31
32
#define CHAMPLAIN_TYPE_MAP_SOURCE_DESC champlain_map_source_desc_get_type ()
33
34
#define CHAMPLAIN_MAP_SOURCE_DESC(obj) \
35
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_MAP_SOURCE_DESC, ChamplainMapSourceDesc))
36
37
#define CHAMPLAIN_MAP_SOURCE_DESC_CLASS(klass) \
38
  (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_MAP_SOURCE_DESC, ChamplainMapSourceDescClass))
39
40
#define CHAMPLAIN_IS_MAP_SOURCE_DESC(obj) \
41
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_MAP_SOURCE_DESC))
42
43
#define CHAMPLAIN_IS_MAP_SOURCE_DESC_CLASS(klass) \
44
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_MAP_SOURCE_DESC))
45
46
#define CHAMPLAIN_MAP_SOURCE_DESC_GET_CLASS(obj) \
47
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_MAP_SOURCE_DESC, ChamplainMapSourceDescClass))
48
49
typedef struct _ChamplainMapSourceDescPrivate ChamplainMapSourceDescPrivate;
50
51
typedef struct _ChamplainMapSourceDesc ChamplainMapSourceDesc;
52
typedef struct _ChamplainMapSourceDescClass ChamplainMapSourceDescClass;
53
54
/**
55
 * ChamplainMapSourceDesc:
56
 *
57
 * The #ChamplainMapSourceDesc structure contains only private data
58
 * and should be accessed using the provided API
59
 *
60
 * Since: 0.10
61
 */
62
struct _ChamplainMapSourceDesc
63
{
64
  GObject parent_instance;
65
66
  ChamplainMapSourceDescPrivate *priv;
67
};
68
69
struct _ChamplainMapSourceDescClass
70
{
71
  GObjectClass parent_class;
72
};
73
74
/**
75
 * ChamplainMapSourceConstructor:
76
 * @desc: a #ChamplainMapSourceDesc
77
 *
78
 * A #ChamplainMapSource constructor.  It should return a ready to use
79
 * #ChamplainMapSource.
80
 *
81
 * Returns: A fully constructed #ChamplainMapSource ready to be used.
82
 *
83
 * Since: 0.10
84
 */
85
typedef ChamplainMapSource* (*ChamplainMapSourceConstructor) (ChamplainMapSourceDesc *desc);
86
87
/**
88
 * CHAMPLAIN_MAP_SOURCE_CONSTRUCTOR:
89
 *
90
 * Conversion macro to #ChamplainMapSourceConstructor.
91
 *
92
 * Since: 0.10
93
 */
94
#define CHAMPLAIN_MAP_SOURCE_CONSTRUCTOR (f) ((ChamplainMapSourceConstructor) (f))
95
96
GType champlain_map_source_desc_get_type (void);
97
98
ChamplainMapSourceDesc *champlain_map_source_desc_new_full (
99
    gchar *id,
100
    gchar *name,
101
    gchar *license,
102
    gchar *license_uri,
103
    guint min_zoom,
104
    guint max_zoom,
105
    guint tile_size,
106
    ChamplainMapProjection projection,
107
    gchar *uri_format,
108
    ChamplainMapSourceConstructor constructor,
109
    gpointer data);
110
111
const gchar *champlain_map_source_desc_get_id (ChamplainMapSourceDesc *desc);
112
const gchar *champlain_map_source_desc_get_name (ChamplainMapSourceDesc *desc);
113
const gchar *champlain_map_source_desc_get_license (ChamplainMapSourceDesc *desc);
114
const gchar *champlain_map_source_desc_get_license_uri (ChamplainMapSourceDesc *desc);
115
const gchar *champlain_map_source_desc_get_uri_format (ChamplainMapSourceDesc *desc);
116
guint champlain_map_source_desc_get_min_zoom_level (ChamplainMapSourceDesc *desc);
117
guint champlain_map_source_desc_get_max_zoom_level (ChamplainMapSourceDesc *desc);
118
guint champlain_map_source_desc_get_tile_size (ChamplainMapSourceDesc *desc);
119
ChamplainMapProjection champlain_map_source_desc_get_projection (ChamplainMapSourceDesc *desc);
120
gpointer champlain_map_source_desc_get_data (ChamplainMapSourceDesc *desc);
121
ChamplainMapSourceConstructor champlain_map_source_desc_get_constructor (ChamplainMapSourceDesc *desc);
122
123
G_END_DECLS
124
125
#endif