1 /* vim: set et ts=8 sw=8: */
2 /*
3  * Copyright 2014 Red Hat, Inc.
4  *
5  * Geoclue is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License as published by the Free
7  * Software Foundation; either version 2 of the License, or (at your option)
8  * any later version.
9  *
10  * Geoclue is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with Geoclue; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
20  */
21 
22 #ifndef GCLUE_LOCATION_SOURCE_H
23 #define GCLUE_LOCATION_SOURCE_H
24 
25 #include <glib.h>
26 #include <gio/gio.h>
27 #include "gclue-enum-types.h"
28 #include "gclue-location.h"
29 #include "gclue-min-uint.h"
30 
31 G_BEGIN_DECLS
32 
33 #define GCLUE_TYPE_LOCATION_SOURCE            (gclue_location_source_get_type())
34 #define GCLUE_LOCATION_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCLUE_TYPE_LOCATION_SOURCE, GClueLocationSource))
35 #define GCLUE_LOCATION_SOURCE_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCLUE_TYPE_LOCATION_SOURCE, GClueLocationSource const))
36 #define GCLUE_LOCATION_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GCLUE_TYPE_LOCATION_SOURCE, GClueLocationSourceClass))
37 #define GCLUE_IS_LOCATION_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCLUE_TYPE_LOCATION_SOURCE))
38 #define GCLUE_IS_LOCATION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GCLUE_TYPE_LOCATION_SOURCE))
39 #define GCLUE_LOCATION_SOURCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GCLUE_TYPE_LOCATION_SOURCE, GClueLocationSourceClass))
40 
41 typedef struct _GClueLocationSource        GClueLocationSource;
42 typedef struct _GClueLocationSourceClass   GClueLocationSourceClass;
43 typedef struct _GClueLocationSourcePrivate GClueLocationSourcePrivate;
44 
45 struct _GClueLocationSource
46 {
47         GObject parent;
48 
49         /*< private >*/
50         GClueLocationSourcePrivate *priv;
51 };
52 
53 struct _GClueLocationSourceClass
54 {
55         GObjectClass parent_class;
56 
57         gboolean (*start) (GClueLocationSource *source);
58         gboolean (*stop)  (GClueLocationSource *source);
59 };
60 
61 GType gclue_location_source_get_type (void) G_GNUC_CONST;
62 
63 void              gclue_location_source_start (GClueLocationSource *source);
64 void              gclue_location_source_stop  (GClueLocationSource *source);
65 GClueLocation    *gclue_location_source_get_location
66                                               (GClueLocationSource *source);
67 void              gclue_location_source_set_location
68                                               (GClueLocationSource *source,
69                                                GClueLocation       *location);
70 gboolean          gclue_location_source_get_active
71                                               (GClueLocationSource *source);
72 GClueAccuracyLevel
73                   gclue_location_source_get_available_accuracy_level
74                                               (GClueLocationSource *source);
75 GClueMinUINT     *gclue_location_source_get_time_threshold
76                                               (GClueLocationSource *source);
77 
78 gboolean
79 gclue_location_source_get_compute_movement (GClueLocationSource *source);
80 void
81 gclue_location_source_set_compute_movement (GClueLocationSource *source,
82                                             gboolean             compute);
83 
84 G_END_DECLS
85 
86 #endif /* GCLUE_LOCATION_SOURCE_H */
87