1
/*
2
 * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
3
 * Copyright (C) 2010-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_VIEW_H
25
#define CHAMPLAIN_VIEW_H
26
27
#include <champlain/champlain-defines.h>
28
#include <champlain/champlain-layer.h>
29
#include <champlain/champlain-map-source.h>
30
#include <champlain/champlain-license.h>
31
#include <champlain/champlain-bounding-box.h>
32
33
#include <glib.h>
34
#include <glib-object.h>
35
#include <clutter/clutter.h>
36
37
G_BEGIN_DECLS
38
39
#define CHAMPLAIN_TYPE_VIEW champlain_view_get_type ()
40
41
#define CHAMPLAIN_VIEW(obj) \
42
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_VIEW, ChamplainView))
43
44
#define CHAMPLAIN_VIEW_CLASS(klass) \
45
  (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_VIEW, ChamplainViewClass))
46
47
#define CHAMPLAIN_IS_VIEW(obj) \
48
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_VIEW))
49
50
#define CHAMPLAIN_IS_VIEW_CLASS(klass) \
51
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_VIEW))
52
53
#define CHAMPLAIN_VIEW_GET_CLASS(obj) \
54
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_VIEW, ChamplainViewClass))
55
56
typedef struct _ChamplainViewPrivate ChamplainViewPrivate;
57
58
59
/**
60
 * ChamplainView:
61
 *
62
 * The #ChamplainView structure contains only private data
63
 * and should be accessed using the provided API
64
 *
65
 * Since: 0.1
66
 */
67
struct _ChamplainView
68
{
69
  ClutterActor parent;
70
71
  ChamplainViewPrivate *priv;
72
};
73
74
struct _ChamplainViewClass
75
{
76
  ClutterActorClass parent_class;
77
};
78
79
GType champlain_view_get_type (void);
80
81
ClutterActor *champlain_view_new (void);
82
83
void champlain_view_center_on (ChamplainView *view,
84
    gdouble latitude,
85
    gdouble longitude);
86
void champlain_view_go_to (ChamplainView *view,
87
    gdouble latitude,
88
    gdouble longitude);
89
void champlain_view_stop_go_to (ChamplainView *view);
90
gdouble champlain_view_get_center_latitude (ChamplainView *view);
91
gdouble champlain_view_get_center_longitude (ChamplainView *view);
92
93
void champlain_view_zoom_in (ChamplainView *view);
94
void champlain_view_zoom_out (ChamplainView *view);
95
void champlain_view_set_zoom_level (ChamplainView *view,
96
    guint zoom_level);
97
void champlain_view_set_min_zoom_level (ChamplainView *view,
98
    guint zoom_level);
99
void champlain_view_set_max_zoom_level (ChamplainView *view,
100
    guint zoom_level);
101
102
void champlain_view_ensure_visible (ChamplainView *view,
103
    ChamplainBoundingBox *bbox,
104
    gboolean animate);
105
void champlain_view_ensure_layers_visible (ChamplainView *view,
106
    gboolean animate);
107
108
void champlain_view_set_map_source (ChamplainView *view,
109
    ChamplainMapSource *map_source);
110
void champlain_view_set_deceleration (ChamplainView *view,
111
    gdouble rate);
112
void champlain_view_set_kinetic_mode (ChamplainView *view,
113
    gboolean kinetic);
114
void champlain_view_set_keep_center_on_resize (ChamplainView *view,
115
    gboolean value);
116
void champlain_view_set_zoom_on_double_click (ChamplainView *view,
117
    gboolean value);
118
void champlain_view_set_animate_zoom (ChamplainView *view,
119
    gboolean value);
120
121
void champlain_view_add_layer (ChamplainView *view,
122
    ChamplainLayer *layer);
123
void champlain_view_remove_layer (ChamplainView *view,
124
    ChamplainLayer *layer);
125
126
guint champlain_view_get_zoom_level (ChamplainView *view);
127
guint champlain_view_get_min_zoom_level (ChamplainView *view);
128
guint champlain_view_get_max_zoom_level (ChamplainView *view);
129
ChamplainMapSource *champlain_view_get_map_source (ChamplainView *view);
130
gdouble champlain_view_get_deceleration (ChamplainView *view);
131
gboolean champlain_view_get_kinetic_mode (ChamplainView *view);
132
gboolean champlain_view_get_keep_center_on_resize (ChamplainView *view);
133
gboolean champlain_view_get_zoom_on_double_click (ChamplainView *view);
134
gboolean champlain_view_get_animate_zoom (ChamplainView *view);
135
ChamplainState champlain_view_get_state (ChamplainView *view);
136
137
void champlain_view_reload_tiles (ChamplainView *view);
138
139
gdouble champlain_view_x_to_longitude (ChamplainView *view,
140
    gdouble x);
141
gdouble champlain_view_y_to_latitude (ChamplainView *view,
142
    gdouble y);
143
gdouble champlain_view_longitude_to_x (ChamplainView *view,
144
    gdouble longitude);
145
gdouble champlain_view_latitude_to_y (ChamplainView *view,
146
    gdouble latitude);
147
148
void champlain_view_get_viewport_origin (ChamplainView *view,
149
    gint *x,
150
    gint *y);
151
152
void champlain_view_bin_layout_add (ChamplainView *view,
153
    ClutterActor *child,
154
    ClutterBinAlignment x_align,
155
    ClutterBinAlignment y_align);
156
157
ChamplainLicense *champlain_view_get_license_actor (ChamplainView *view);
158
159
G_END_DECLS
160
161
#endif