1
/*
2
 * Copyright (C) 2011-2012 Jiri Techet <techet@gmail.com>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2.1 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
18
19
#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
20
#error "Only <champlain/champlain.h> can be included directly."
21
#endif
22
23
#ifndef __CHAMPLAIN_LOCATION_H__
24
#define __CHAMPLAIN_LOCATION_H__
25
26
#include <glib-object.h>
27
28
G_BEGIN_DECLS
29
30
#define CHAMPLAIN_TYPE_LOCATION (champlain_location_get_type ())
31
32
#define CHAMPLAIN_LOCATION(obj) \
33
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_LOCATION, ChamplainLocation))
34
35
#define CHAMPLAIN_IS_LOCATION(obj) \
36
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_LOCATION))
37
38
#define CHAMPLAIN_LOCATION_GET_IFACE(inst) \
39
  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), CHAMPLAIN_TYPE_LOCATION, ChamplainLocationIface))
40
41
typedef struct _ChamplainLocation ChamplainLocation; /* Dummy object */
42
typedef struct _ChamplainLocationIface ChamplainLocationIface;
43
44
/**
45
 * ChamplainLocation:
46
 *
47
 * An interface common to objects having latitude and longitude.
48
 */
49
50
/**
51
 * ChamplainLocationIface:
52
 * @get_latitude: virtual function for obtaining latitude.
53
 * @get_longitude: virtual function for obtaining longitude.
54
 * @set_location: virtual function for setting position.
55
 *
56
 * An interface common to objects having latitude and longitude.
57
 */
58
struct _ChamplainLocationIface
59
{
60
  /*< private >*/
61
  GTypeInterface g_iface;
62
63
  /*< public >*/
64
  gdouble (*get_latitude)(ChamplainLocation *location);
65
  gdouble (*get_longitude)(ChamplainLocation *location);
66
  void (*set_location)(ChamplainLocation *location,
67
      gdouble latitude,
68
      gdouble longitude);
69
};
70
71
GType champlain_location_get_type (void) G_GNUC_CONST;
72
73
void champlain_location_set_location (ChamplainLocation *location,
74
    gdouble latitude,
75
    gdouble longitude);
76
gdouble champlain_location_get_latitude (ChamplainLocation *location);
77
gdouble champlain_location_get_longitude (ChamplainLocation *location);
78
79
G_END_DECLS
80
81
#endif /* __CHAMPLAIN_LOCATION_H__ */