summaryrefslogtreecommitdiff
path: root/include/locations.h
blob: 746306f305bda3d418b872d7192ae98466514acf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
/*
 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __TIZEN_LOCATION_LOCATIONS_H__
#define __TIZEN_LOCATION_LOCATIONS_H__

#include <tizen_type.h>
#include <tizen_error.h>
#include <time.h>
#include <location_bounds.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @addtogroup CAPI_LOCATION_MANAGER_MODULE
 * @{
 */

/**
 * @brief Enumeration for error code for Location manager.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef enum {
	LOCATIONS_ERROR_NONE						= TIZEN_ERROR_NONE,						/**< Successful */
	LOCATIONS_ERROR_OUT_OF_MEMORY				= TIZEN_ERROR_OUT_OF_MEMORY,			/**< Out of memory */
	LOCATIONS_ERROR_INVALID_PARAMETER			= TIZEN_ERROR_INVALID_PARAMETER,		/**< Invalid parameter */
	LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED	= TIZEN_ERROR_PERMISSION_DENIED,		/**< Permission denied */
	LOCATIONS_ERROR_NOT_SUPPORTED				= TIZEN_ERROR_NOT_SUPPORTED,			/**< Not supported */
	LOCATIONS_ERROR_INCORRECT_METHOD			= TIZEN_ERROR_LOCATION_MANAGER | 0x01,	/**< Location manager contains incorrect method for a given call */
	LOCATIONS_ERROR_NETWORK_FAILED				= TIZEN_ERROR_LOCATION_MANAGER | 0x02,	/**< Network unavailable */
	LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE		= TIZEN_ERROR_LOCATION_MANAGER | 0x03,	/**< Location service is not available */
	LOCATIONS_ERROR_GPS_SETTING_OFF				= TIZEN_ERROR_LOCATION_MANAGER | 0x04,	/**< GPS/WPS setting is not enabled */
	LOCATIONS_ERROR_SECURITY_RESTRICTED			= TIZEN_ERROR_LOCATION_MANAGER | 0x05,	/**< Restricted by security system policy */
} location_error_e;


/**
 * @brief Enumeration for Location method type.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef enum {
	LOCATIONS_METHOD_NONE = -1,	/**< Undefined method */
	LOCATIONS_METHOD_HYBRID,	/**< This method selects the best method available at the moment */
	LOCATIONS_METHOD_GPS,		/**< This method uses Global Positioning System */
	LOCATIONS_METHOD_WPS,		/**< This method uses WiFi Positioning System */
} location_method_e;

/**
 * @brief Enumeration for Approximate accuracy level of given information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef enum {
	LOCATIONS_ACCURACY_NONE = 0,	/**< Invalid data */
	LOCATIONS_ACCURACY_COUNTRY,		/**< Country accuracy level */
	LOCATIONS_ACCURACY_REGION,		/**< Regional accuracy level */
	LOCATIONS_ACCURACY_LOCALITY,	/**< Local accuracy level */
	LOCATIONS_ACCURACY_POSTALCODE,	/**< Postal accuracy level */
	LOCATIONS_ACCURACY_STREET,		/**< Street accuracy level */
	LOCATIONS_ACCURACY_DETAILED,	/**< Detailed accuracy level */
} location_accuracy_level_e;

/**
 * @brief Enumeration for the state of the location service.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef enum {
	LOCATIONS_SERVICE_DISABLED,			/**< Service is disabled */
	LOCATIONS_SERVICE_ENABLED,			/**< Service is enabled */
} location_service_state_e;

/**
 * @brief Enumeration for the location service accessibility state.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef enum {
	LOCATIONS_ACCESS_STATE_NONE,		/**< Access state is not determined */
	LOCATIONS_ACCESS_STATE_DENIED,		/**< Access denied */
	LOCATIONS_ACCESS_STATE_ALLOWED,		/**< Access authorized */
} location_accessibility_state_e;

/**
 * @brief The location manager handle.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
typedef struct location_manager_s *location_manager_h;

/**
 * @}
 */
/*
 * Location Manager
*/
/**
 * @addtogroup CAPI_LOCATION_MANAGER_MODULE
 * @{
 */
/**
 * @brief Called at defined interval with updated position information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] latitude		The updated latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] longitude		The updated longitude [-180.0 ~ 180.0] (degrees)
 * @param[in] altitude		The updated altitude (meters)
 * @param[in] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] user_data		The user data passed from the call registration function
 * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb().
 * @see location_manager_start()
 * @see location_manager_set_position_updated_cb()
 */
typedef void(*location_position_updated_cb)(double latitude, double longitude, double altitude, time_t timestamp, void *user_data);

/**
 * @brief Called at defined interval with updated velocity information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] speed			The updated speed (km/h)
 * @param[in] direction		The updated direction (in degrees from the north)
 * @param[in] climb			The updated climb (km/h)
 * @param[in] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_velocity_updated_cb().
 * @see location_manager_start()
 * @see location_manager_set_velocity_updated_cb()
 */
typedef void(*location_velocity_updated_cb)(double speed, double direction, double climb, time_t timestamp, void *user_data);

/**
 * @brief Called at defined interval with updated location information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] error			#LOCATIONS_ERROR_NONE Successful
 * @param[in] latitude		The updated latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] longitude		The updated longitude [-180.0 ~ 180.0] (degrees)
 * @param[in] altitude		The updated altitude (meters)
 * @param[in] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] speed			The updated speed (km/h)
 * @param[in] direction		The updated direction (in degrees from the north)
 * @param[in] climb			The updated climb (km/h)
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_manager_request_single_location() will invoke this callback.
 * @see location_manager_request_single_location()
 */
typedef void(*location_updated_cb)(location_error_e error, double latitude, double longitude, double altitude, time_t timestamp, double speed, double direction, double climb, void *user_data);

/**
 * @brief Called when the state of location service is changed from enabled to disabled or vice versa.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] state			The service state
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre Either location_manager_start() or location_manager_stop() will invoke this callback if you register this callback using location_manager_set_service_state_changed_cb()
 * @see location_manager_start()
 * @see location_manager_stop()
 * @see location_manager_set_service_state_changed_cb()
 * @see #location_service_state_e
 */
typedef void(*location_service_state_changed_cb)(location_service_state_e state, void *user_data);

/**
 * @brief Called when the user defined zones are entered or exited.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] state			The boundary state
 * @param[in] latitude		The updated latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] longitude		The updated longitude [-180.0 ~ 180.0] (degrees)
 * @param[in] altitude		The updated altitude (meters)
 * @param[in] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_zone_changed_cb().
 * @see #location_boundary_state_e
 * @see location_manager_start()
 * @see location_manager_set_zone_changed_cb()
 */
typedef void(*location_zone_changed_cb)(location_boundary_state_e state, double latitude, double longitude, double altitude, time_t timestamp, void *user_data);

/**
 * @brief Called when the state of location method is changed.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] method		The method changed on setting
 * @param[in] enable		The setting value changed
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_setting_changed_cb() will invoke this callback if you register this callback using location_manager_set_setting_changed_cb()
 * @see location_manager_set_setting_changed_cb()
 * @see location_manager_unset_setting_changed_cb()
 */
typedef void(*location_setting_changed_cb)(location_method_e method, bool enable, void *user_data);

/**
 * @brief Called once for each location bound.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] bounds		The location bounds handle
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_manager_foreach_boundary() will invoke this callback.
 * @see location_manager_foreach_boundary()
 */
typedef bool(*location_bounds_cb)(location_bounds_h bounds, void *user_data);

/**
 * @brief Called at defined interval with updated location information.
 * @since_tizen 2.4
 * @param[in] latitude		The updated latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] longitude		The updated longitude [-180.0 ~ 180.0] (degrees)
 * @param[in] altitude		The updated altitude (meters)
 * @param[in] speed			The updated speed (km/h)
 * @param[in] direction		The updated direction (in degrees from the north)
 * @param[in] horizontal_accuracy		The horizontal accuracy (meters)
 * @param[in] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] user_data		The user data passed from the callback registration function
 * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb()
 * @see location_manager_start()
 * @see location_manager_set_distance_based_location_changed_cb()
 * @see location_manager_set_location_changed_cb()
 */
typedef void(*location_changed_cb)(double latitude, double longitude, double altitude, double speed, double direction, double horizontal_accuracy, time_t timestamp, void *user_data);

/**
 * @brief Checks whether the given location method is available.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
 * @param[in] method The location method to be checked
 * @return @c true if the specified location method is supported, otherwise @c false if it is not available
 * @retval #LOCATIONS_ERROR_NONE Successful
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
 * @see	location_manager_create()
 * @see location_manager_get_method()
 */
bool location_manager_is_supported_method(location_method_e method);

/**
 * @brief Checks whether the given location method is enabled or not on setting.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] method		The location method to be checked
 * @param[out] enable		The result value of checking the given location method
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE Successful
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED	Not supported
 * @see location_manager_create()
 * @see location_manager_set_setting_changed_cb()
 * @see location_manager_unset_setting_changed_cb()
 */
int location_manager_is_enabled_method(location_method_e method, bool *enable);

/**
 * @platform
 * @brief Enable the given location method.
 * @since_tizen 2.3.1
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/location.enable
 * @param[in] method		The location method to be checked
 * @param[in] enable		The value to set
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE Successful
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED Permission denied
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED	Not supported
 * @see location_manager_is_enabled_method()
 * @see location_manager_create()
 */
int location_manager_enable_method(const location_method_e method, const bool enable);

/**
 * @brief Creates a new location manager.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @remarks You must release @a manager using location_manager_destroy().
 * @param[in] method		The location method
 * @param[out] manager		The location manager handle that is newly created
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY		Out of memory
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED	Not supported
 * @see location_manager_destroy()
 */
int location_manager_create(location_method_e method, location_manager_h *manager);

/**
 * @brief Releases the location manager.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED	Not supported
 * @see location_manager_create()
*/
int location_manager_destroy(location_manager_h manager);

/**
 * @brief Request to update current location once.
 * @remarks Do not request to start the location service using the same manager handler
 * Calling this function invokes a location service event. When the location service is updated, location_updated_cb
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[in] timeout		Timeout to stop requesting single location after
 * @param[in] callback		The location callback function to register
 * @param[in] user_data		The user data to be passed to the callback function
 * @retval #LOCATIONS_ERROR_NONE						Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER			Invalid parameter
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE		Service not available
 * @retval #LOCATIONS_ERROR_NETWORK_FAILED				Network failed
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF				GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED	The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED				Not supported
 * @post It invokes location_updated_cb().
 */
int location_manager_request_single_location(location_manager_h manager, int timeout, location_updated_cb callback, void *user_data);

/**
 * @brief Starts the location service.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 *
 * @remarks There is no limit on number of location managers for which this function was called.
 *
 * @remarks Calling this function invokes a location service event. When the location service is enabled, the service state change callback
 *		(set using location_manager_set_service_state_changed_cb()) notifies the user with #LOCATIONS_SERVICE_ENABLED as
 *		the first argument, and the service starts.
 *
 * @remarks The started service is a requirement for calling these functions:
 *		location_manager_get_position(), location_manager_get_velocity(), location_manager_get_accuracy(),
 *		gps_status_get_nmea(), gps_status_get_satellite(), gps_status_foreach_satellites_in_view().
 *
 * @remarks Once you stop the service using location_manager_stop(), you can no longer call the functions listed above.
 *
 * @remarks Starting and stopping the service is in the scope of the given location manager only (if there is more than one manager,
 *		starting and stopping should be executed for each of them separately).
 *
 * @param[in] manager		The location manager handle
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid parameter
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_NETWORK_FAILED			Network failed
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF			GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @post It invokes location_position_updated_cb(), location_velocity_updated_cb(), location_zone_changed_cb(), and location_service_state_changed_cb().
 * @see location_manager_stop()
 * @see location_manager_get_position()
 * @see location_manager_get_velocity()
 * @see location_manager_get_accuracy()
 * @see location_manager_set_service_state_changed_cb()
 * @see location_manager_set_position_updated_cb()
 * @see location_position_updated_cb()
 * @see location_manager_set_velocity_updated_cb()
 * @see location_velocity_updated_cb()
 * @see location_manager_set_zone_changed_cb()
 * @see location_zone_changed_cb()
 */
int location_manager_start(location_manager_h manager);

/**
 * @brief Stops the location service.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using
 * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as first argument.
 * When that happens, the service is stopped and the user is notified.
 *
 * @remarks You can stop and start the location manager as needed.
 *
 * @param[in] manager		The location manager handle
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE						Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER			Invalid parameter
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE		Service not available
 * @retval #LOCATIONS_ERROR_NETWORK_FAILED				Network failed
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED				Not supported
 * @see location_manager_start()
 * @see	location_manager_set_service_state_changed_cb()
 * @see	location_service_state_changed_cb()
 */
int location_manager_stop(location_manager_h manager);

/**
 * @brief Adds a bounds for a given location manager.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] bounds		The location bounds handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER			Invalid parameter
 * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY				Out of memory
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED				Not supported
 * @post It invokes location_manager_set_zone_changed_cb() when a boundary is entered or exited, if you set a callback with location_manager_set_zone_changed_cb().
 * @see location_manager_remove_boundary()
 * @see location_manager_set_zone_changed_cb()
 */
int location_manager_add_boundary(location_manager_h manager, const location_bounds_h bounds);

/**
 * @brief Deletes a bounds for a given location manager.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] bounds		The location bounds handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE						Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER			Invalid parameter
 * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY				Out of memory
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED				Not supported
 * @see location_manager_add_boundary()
 */
int location_manager_remove_boundary(location_manager_h manager, const location_bounds_h bounds);

/**
 * @brief Retrieves all location bounds by invoking a specific callback for each location bounds
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] callback		The iteration callback
 * @param[in] user_data		The user data to be passed to the callback function
 * @return	@c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE						Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER			Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED				Not supported
 * @post location_bounds_cb() will be invoked
 * @see location_manager_add_boundary()
 * @see location_manager_remove_boundary()
 * @see location_bounds_cb()
 */
int location_manager_foreach_boundary(location_manager_h manager, location_bounds_cb callback, void *user_data);

/**
 * @brief Gets the given location manager's method.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[out] method		The location method
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_create()
 */
int location_manager_get_method(location_manager_h manager, location_method_e *method);

/**
 * @brief Gets the current position information.
 * @details The result contains the current altitude, latitude, and longitude, with a measurement timestamp.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] altitude		The current altitude (meters)
 * @param[out] latitude		The current latitude [-90.0 ~ 90.0] (degrees)
 * @param[out] longitude	The current longitude [-180.0 ~ 180.0] (degrees)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF			GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 */
int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);

/**
 * @brief Gets the current position information.
 * @details The result contains the current altitude, latitude, longitude, climb, direction, speed, level, horizontal and vertical with a measurement timestamp.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] altitude		The current altitude (meters)
 * @param[out] latitude		The current latitude [-90.0 ~ 90.0] (degrees)
 * @param[out] longitude	The current longitude [-180.0 ~ 180.0] (degrees)
 * @param[out] climb		The climb (km/h)
 * @param[out] direction	The direction, degrees from the north
 * @param[out] speed		The speed (km/h)
 * @param[out] level		The accuracy level
 * @param[out] horizontal	The horizontal accuracy (meters)
 * @param[out] vertical		The vertical accuracy (meters)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF			GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 */
int location_manager_get_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);

/**
 * @brief Gets the current velocity information.
 * @details The result contains the current climb, direction, and speed, with a measurement timestamp.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] climb		The climb (km/h)
 * @param[out] direction	The direction, degrees from the north
 * @param[out] speed		The speed (km/h)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF			GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 */
int location_manager_get_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t *timestamp);

/**
 * @brief Gets the current accuracy information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] level		The accuracy level
 * @param[out] horizontal	The horizontal accuracy (meters)
 * @param[out] vertical		The vertical accuracy (meters)
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF			GPS is not enabled
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 */
int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical);

/**
 * @brief Gets the last position information which is recorded.
 * @details The @a altitude, @a latitude, @a longitude, and @c timestamp values should be 0, if there is no record of any previous position information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] altitude		The last altitude (meters)
 * @param[out] latitude		The last latitude [-90.0 ~ 90.0] (degrees)
 * @param[out] longitude	The last longitude [-180.0 ~ 180.0] (degrees)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid argument
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @pre The location manager handle must be created by location_manager_create()
 */
int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);

/**
 * @brief Gets the last location information.
 * @details The @a altitude, @a latitude, @a longitude, @a climb, @a direction, @a speed and @c timestamp values should be 0, if there is no record of any previous position information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] altitude		The current altitude (meters)
 * @param[out] latitude		The current latitude [-90.0 ~ 90.0] (degrees)
 * @param[out] longitude	The current longitude [-180.0 ~ 180.0] (degrees)
 * @param[out] climb		The climb (km/h)
 * @param[out] direction	The direction, degrees from the north
 * @param[out] speed		The speed (km/h)
 * @param[out] level		The accuracy level
 * @param[out] horizontal	The horizontal accuracy (meters)
 * @param[out] vertical		The vertical accuracy (meters)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid argument
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @pre The location manager handle must be created by location_manager_create()
 */
int location_manager_get_last_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);


/**
 * @brief Gets the last velocity information which is recorded.
 * @details The @a climb, @a direction and @a speed values should be @c 0, if there is no record of any previous velocity information.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] climb		The last climb (km/h)
 * @param[out] direction	The last direction, degrees from the north
 * @param[out] speed		The last speed (km/h)
 * @param[out] timestamp	The timestamp (time when measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid argument
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @pre The location manager handle must be created by location_manager_create()
 */
int location_manager_get_last_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t *timestamp);

/**
 * @brief Gets the last accuracy information which is recorded.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[out] level		The last accuracy level
 * @param[out] horizontal	The last horizontal accuracy (meters)
 * @param[out] vertical		The last vertical accuracy (meters)
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid argument
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED	Not supported
 * @pre The location manager handle must be created by location_manager_create()
 */
int location_manager_get_last_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical);

/**
 * @brief Gets the current application's location accessibility status.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[out] state		The current location service accessibility status.
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 */
int location_manager_get_accessibility_state(location_accessibility_state_e *state);

/**
 * @brief Registers a callback function to be invoked at defined interval with updated position information.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] interval		The interval [1 ~ 120] (seconds)
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_position_updated_cb() will be invoked
 * @see location_manager_unset_position_updated_cb()
 * @see location_position_updated_cb()
 */
int location_manager_set_position_updated_cb(location_manager_h manager, location_position_updated_cb callback, int interval, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_position_updated_cb()
 */
int location_manager_unset_position_updated_cb(location_manager_h manager);

/**
 * @brief Registers a callback function to be invoked at defined interval with updated velocity information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] interval		The interval [1 ~ 120] (seconds)
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_velocity_updated_cb() will be invoked
 * @see location_manager_unset_velocity_updated_cb()
 * @see location_velocity_updated_cb()
 */
int location_manager_set_velocity_updated_cb(location_manager_h manager, location_velocity_updated_cb callback, int interval, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_velocity_updated_cb()
 */
int location_manager_unset_velocity_updated_cb(location_manager_h manager);

/**
 * @brief Registers a callback function to be invoked when the location service state is changed.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_service_state_changed_cb() will be invoked
 * @see location_manager_unset_service_state_changed_cb()
 * @see location_service_state_changed_cb()
 * @see location_manager_start()
 * @see location_manager_stop()
 * @see #location_service_state_e
*/
int location_manager_set_service_state_changed_cb(location_manager_h manager, location_service_state_changed_cb callback, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_service_state_changed_cb()
 */
int location_manager_unset_service_state_changed_cb(location_manager_h manager);

/**
 * @brief Registers a callback function to be invoked when the previously set boundary area is entered or left.
 *
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @pre		location_manager_add_boundary() is called before.
 * @post location_zone_changed_cb() will be invoked
 * @see location_manager_unset_zone_changed_cb()
 * @see location_zone_changed_cb()
 */
int location_manager_set_zone_changed_cb(location_manager_h manager, location_zone_changed_cb callback, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] manager		The location manager handle
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_zone_changed_cb()
 */
int location_manager_unset_zone_changed_cb(location_manager_h manager);

/**
 * @brief Registers a callback function to be invoked when the location setting is changed.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] method		The method to observe
 * @param[in] callback		The callback function to register
 * @param[in] user_data		The user data to be passed to the callback function
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_setting_changed_cb() will be invoked
 * @see location_manager_unset_setting_changed_cb()
 * @see location_setting_changed_cb()
 */
int location_manager_set_setting_changed_cb(location_method_e method, location_setting_changed_cb callback, void *user_data);

/**
 * @brief Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] method		The method to observe
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval	#LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_setting_changed_cb()
 */
int location_manager_unset_setting_changed_cb(location_method_e method);

/**
 * @brief Gets the distance in meters between two locations.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] start_latitude		The starting latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] start_longitude		The starting longitude [-180.0 ~ 180.0] (degrees)
 * @param[in] end_latitude			The ending latitude [-90.0 ~ 90.0] (degrees)
 * @param[in] end_longitude			The ending longitude [-180.0 ~ 180.0] (degrees)
 * @param[out] distance				The distance between two locations (meters)
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid argument
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 */
int location_manager_get_distance(double start_latitude, double start_longitude, double end_latitude, double end_longitude, double *distance);

/**
 * @brief Registers a callback function to be invoked at minimum interval or minimum distance with updated position information.
 * @since_tizen 2.4
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] interval		The minimum interval between position updates [1 ~ 120] (seconds)
 * @param[in] distance		The minimum distance between position updates [1 ~ 120] (meters)
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_changed_cb() will be invoked
 * @see location_manager_unset_distance_based_location_changed_cb()
 * @see location_changed_cb()
 */
int location_manager_set_distance_based_location_changed_cb(location_manager_h manager, location_changed_cb callback, int interval, double distance, void *user_data);

/**
 * @brief Unregisters the callback function.
 * @since_tizen 2.4
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_distance_based_location_changed_cb()
 */
int location_manager_unset_distance_based_location_changed_cb(location_manager_h manager);

/**
 * @brief Registers a callback function to be invoked at defined interval with updated location information.
 * @since_tizen 2.4
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] interval		The interval [1 ~ 120] (seconds)
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post location_changed_cb() will be invoked
 * @see location_manager_unset_location_changed_cb()
 * @see location_changed_cb()
 */
int location_manager_set_location_changed_cb(location_manager_h manager, location_changed_cb callback, int interval, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen 2.4
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see location_manager_set_location_changed_cb()
 */
int location_manager_unset_location_changed_cb(location_manager_h manager);

/**
 * @}
 */

/*
 * GPS Status & Satellites
 */

/**
 * @addtogroup CAPI_LOCATION_GPS_STATUS_MODULE
 * @{
 */

/**
 * @brief Called once for each satellite in range.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[in] azimuth		The azimuth of the satellite (degrees)
 * @param[in] elevation		The elevation of the satellite (meters)
 * @param[in] prn			The PRN of the satellite
 * @param[in] snr			The SNR of the satellite [dB]
 * @param[in] is_active		The flag signaling if satellite is in use
 * @param[in] user_data		The user data passed from the foreach function
 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
 * @pre gps_status_foreach_satellites_in_view() will invoke this callback.
 * @pre gps_status_foreach_last_satellites_in_view() will invoke this callback.
 * @see gps_status_foreach_satellites_in_view()
 */
typedef bool(*gps_status_get_satellites_cb)(unsigned int azimuth, unsigned int elevation, unsigned int prn, int snr, bool is_active, void *user_data);

/**
 * @brief Called at defined interval with updated satellite information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @param[out] num_of_active	The last number of active satellites
 * @param[out] num_of_inview	The last number of satellites in view
 * @param[out] timestamp		The last timestamp (time when measurement took place or @c 0 if valid)
 * @param[in] user_data			The user data passed from the call registration function
 * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb()
 * @see location_manager_start()
 * @see location_manager_set_position_updated_cb()
 */
typedef void(*gps_status_satellite_updated_cb)(int num_of_active, int num_of_inview, time_t timestamp, void *user_data);

/**
 * @brief Gets the GPS NMEA data.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
 *		 You must release @a nmea using @c free().
 * @param[in] manager	The location manager handle
 * @param[out] nmea		The NMEA data
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 * @see location_manager_start()
 */
int gps_status_get_nmea(location_manager_h manager, char **nmea);

/**
 * @brief Gets the information of satellites.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
 * @param[in] manager			The location manager handle
 * @param[out] num_of_active	The number of active satellites
 * @param[out] num_of_inview	The number of satellites in view
 * @param[out] timestamp		The timestamp (time when measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
 * @see	gps_status_foreach_satellites_in_view()
 */
int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp);

/**
 * @brief Registers a callback function to be invoked at defined interval with updated satellite information.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @param[in] callback		The callback function to register
 * @param[in] interval		The interval [1 ~ 120] (seconds)
 * @param[in] user_data		The user data to be passed to the callback function
 * @return 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @post gps_status_satellite_updated_cb() will be invoked
 * @see gps_status_unset_satellite_updated_cb()
 * @see gps_status_satellite_updated_cb()
 * @see gps_status_get_satellite()
 * @see gps_status_foreach_satellites_in_view()
 * @see gps_status_get_last_satellite()
 * @see gps_status_foreach_last_satellites_in_view()
 */
int gps_status_set_satellite_updated_cb(location_manager_h manager, gps_status_satellite_updated_cb callback, int interval, void *user_data);

/**
 * @brief	Unregisters the callback function.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @param[in] manager		The location manager handle
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE				Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER	Invalid parameter
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED		Not supported
 * @see gps_status_set_satellite_updated_cb()
 */
int gps_status_unset_satellite_updated_cb(location_manager_h manager);

/**
 * @brief Invokes the callback function for each satellite.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method.
 * @param[in] manager		The location manager handle
 * @param[in] callback		The iteration callback function
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD		Incorrect method
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
 * @post It invokes gps_status_get_satellites_cb().
 * @see	gps_status_get_satellite()
 * @see	gps_status_get_satellites_cb()
 */
int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data);

/**
 * @brief Gets the last information of satellites.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
 * @param[in] manager			The location manager handle
 * @param[out] num_of_active	The last number of active satellites
 * @param[out] num_of_inview	The last number of satellites in view
 * @param[out] timestamp		The last timestamp (time when last measurement took place or @c 0 if valid)
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD		Incorrect method
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
 * @see	gps_status_foreach_satellites_in_view()
 */
int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp);

/**
 * @brief Invokes the callback function for each last satellite which is recorded.
 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/location
 * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method.
 * @param[in] manager		The location manager handle
 * @param[in] callback		The iteration callback function
 * @param[in] user_data		The user data to be passed to the callback function
 * @return @c 0 on success, otherwise a negative error value
 * @retval #LOCATIONS_ERROR_NONE					Successful
 * @retval #LOCATIONS_ERROR_INVALID_PARAMETER		Invalid argument
 * @retval #LOCATIONS_ERROR_INCORRECT_METHOD		Incorrect method
 * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE	Service not available
 * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
 * @retval #LOCATIONS_ERROR_NOT_SUPPORTED			Not supported
 * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
 * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
 * @post It invokes gps_status_get_satellites_cb().
 * @see	gps_status_get_last_satellite()
 * @see	gps_status_get_satellites_cb()
 */
int gps_status_foreach_last_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data);

/**
 * @}
 */
#ifdef __cplusplus
}
#endif

#endif /* __TIZEN_LOCATION_LOCATIONS_H__ */