MBXLocationService_Internal.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <MapboxCommon/MBXAccuracyAuthorization.h>
  4. #import <MapboxCommon/MBXGetLocationCallback_Internal.h>
  5. #import <MapboxCommon/MBXPermissionStatus.h>
  6. @class MBXExpected<__covariant Value, __covariant Error>;
  7. @class MBXLocation;
  8. @class MBXLocationError;
  9. @protocol MBXLiveTrackingClient;
  10. @protocol MBXLocationServiceObserver;
  11. NS_SWIFT_NAME(LocationService)
  12. @protocol MBXLocationService
  13. /**
  14. * Check if the platform location service is available
  15. *
  16. * Returns true if the platform service is available and
  17. * false if it's not (for example when the device does not
  18. * have GNSS unit or has location service turned off).
  19. */
  20. - (BOOL)isAvailable;
  21. - (nonnull MBXExpected<MBXLocation *, MBXLocationError *> *)getLastLocation;
  22. - (int32_t)getCurrentLocationForSettings:(nullable id)settings
  23. callback:(nonnull MBXGetLocationCallback)callback;
  24. /**
  25. * Cancels the request of getting current location.
  26. *
  27. * Please use this method to avoid unnecessary power consumption if it
  28. * happens that while waiting for current location you've realized that
  29. * you don't need it anymore.
  30. *
  31. * @param requestId An id of the request returned by
  32. * the getCurrentLocation() method.
  33. */
  34. - (void)cancelGetCurrentLocationForRequestId:(int32_t)requestId;
  35. /** Gets a current status of location permission of the app. */
  36. - (MBXPermissionStatus)getPermissionStatus;
  37. /** Gets a current accuracy authorization of the app */
  38. - (MBXAccuracyAuthorization)getAccuracyAuthorization;
  39. /**
  40. * Registers an observer. LocationService can have more than one observer.
  41. *
  42. * @param observer An observer to add.
  43. */
  44. - (void)registerObserverForObserver:(nonnull id<MBXLocationServiceObserver>)observer;
  45. /**
  46. * Removes observer. If the observer is not registered, this is no-op.
  47. *
  48. * @param observer An observer to remove.
  49. */
  50. - (void)unregisterObserverForObserver:(nonnull id<MBXLocationServiceObserver>)observer;
  51. /**
  52. * Gets list of available live tracking client implementation names.
  53. *
  54. * @return Returns a list of available LiveTracking client implementation names.
  55. */
  56. - (nonnull NSArray<NSString *> *)getLiveTrackingClients;
  57. /**
  58. * Gets capabilities of live tracking client implementation.
  59. *
  60. * @param name A LiveTrackingClient's name or nonspecified
  61. * for the default implementation.
  62. * @return capabilities Capabilities of the chosen live tracking client
  63. * (see LiveTrackingClientCapabilities or
  64. * live_tracking_client_capabilities for c++).
  65. */
  66. - (nullable id)getLiveTrackingClientCapabilitiesForName:(nullable NSString *)name;
  67. /**
  68. * Gets settings supported by the live tracking client implementation.
  69. *
  70. * @return Returns settings supported by the implementation of the live tracking client.
  71. * See LiveTrackingClientSettings.
  72. */
  73. - (nullable id)getLiveTrackingClientSettingsForName:(nullable NSString *)name;
  74. - (nonnull MBXExpected<id<MBXLiveTrackingClient>, MBXLocationError *> *)getLiveTrackingClientForName:(nullable NSString *)name
  75. capabilities:(nullable id)capabilities;
  76. @end