MBNNNavigator.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <MapboxNavigationNative/MBNNChangeLegCallback.h>
  4. #import <MapboxNavigationNative/MBNNGetBannerInstructionCallback.h>
  5. #import <MapboxNavigationNative/MBNNResetCallback.h>
  6. #import <MapboxNavigationNative/MBNNUpdateLocationCallback.h>
  7. @class MBNNCacheHandle;
  8. @class MBNNConfigHandle;
  9. @class MBNNElectronicHorizonOptions;
  10. @class MBNNFixLocation;
  11. @class MBNNHistoryRecorderHandle;
  12. @class MBNNPredictiveCacheController;
  13. @class MBNNPredictiveCacheControllerOptions;
  14. @class MBNNPredictiveLocationTrackerOptions;
  15. @class MBNNRoadObjectsStore;
  16. @class MBNNSetRoutesDataParams;
  17. @class MBNNSetRoutesParams;
  18. @class MBXTileStore;
  19. @class MBXTilesetDescriptor;
  20. @protocol MBNNElectronicHorizonObserver;
  21. @protocol MBNNExperimental;
  22. @protocol MBNNFallbackVersionsObserver;
  23. @protocol MBNNNavigatorObserver;
  24. @protocol MBNNRerouteControllerInterface;
  25. @protocol MBNNRerouteDetectorInterface;
  26. @protocol MBNNRerouteObserver;
  27. @protocol MBNNRouteAlternativesControllerInterface;
  28. @protocol MBNNRouteInterface;
  29. @protocol MBNNRouteRefreshControllerInterface;
  30. @protocol MBNNRouterInterface;
  31. NS_SWIFT_NAME(Navigator)
  32. __attribute__((visibility ("default")))
  33. @interface MBNNNavigator : NSObject
  34. // This class provides custom init which should be called
  35. - (nonnull instancetype)init NS_UNAVAILABLE;
  36. // This class provides custom init which should be called
  37. + (nonnull instancetype)new NS_UNAVAILABLE;
  38. /** Obtain config object that was used for Navigator construction */
  39. - (nonnull MBNNConfigHandle *)config __attribute((ns_returns_retained));
  40. /**
  41. * Shuts down Navigator instance, so it frees resources.
  42. * This Navigator instance should not be used after shutdown call.
  43. */
  44. - (void)shutdown;
  45. /**
  46. * Sets the `FallbackVersionsObserver` instance for notifications about fallback (available offline) versions found.
  47. * In order to remove observer just call `setFallbackVersionsObserver(null)`.
  48. */
  49. - (void)setFallbackVersionsObserverForObserver:(nullable id<MBNNFallbackVersionsObserver>)observer;
  50. /**
  51. * After setting observer `getStatus` shouldn't be called,
  52. * but `Navigator` object will start calling `NavigatorObserver.onStatus` as soon as at least one raw location is received.
  53. */
  54. - (void)addObserverForObserver:(nonnull id<MBNNNavigatorObserver>)observer;
  55. - (void)removeObserverForObserver:(nonnull id<MBNNNavigatorObserver>)observer;
  56. - (void)addRerouteObserverForObserver:(nonnull id<MBNNRerouteObserver>)observer;
  57. - (void)removeRerouteObserverForObserver:(nonnull id<MBNNRerouteObserver>)observer;
  58. /**
  59. * Asynchronously passes in the current fix location of the user.
  60. * The callback is scheduled using the `common::Scheduler` of the thread calling the `Navigator` constructor.
  61. *
  62. * @param fix The current fix location of user.
  63. * @param callback Callback which is called when the async operation is completed
  64. */
  65. - (void)updateLocationForFixLocation:(nonnull MBNNFixLocation *)fixLocation
  66. callback:(nonnull MBNNUpdateLocationCallback)callback;
  67. /**
  68. * Asynchronously gets the current banner instruction
  69. * The callback is scheduled using the `common::Scheduler` of the thread calling the `Navigator` constructor.
  70. * @param callback Callback which is called when the async operation is completed
  71. */
  72. - (void)getBannerInstructionForCallback:(nonnull MBNNGetBannerInstructionCallback)callback __attribute__((deprecated("This method should not be used anymore. Banner and Voice instructions are returned in NavigationStatus for all route states except RouteState::Invalid and RouteState::OffRoute.")));
  73. /**
  74. * Asynchronously sets leg of the already loaded directions
  75. * The callback is scheduled using the `common::Scheduler` of the thread calling the `Navigator` constructor.
  76. *
  77. * @param leg new leg index
  78. * @param callback Callback which is called when the async operation is completed
  79. */
  80. - (void)changeLegForLeg:(uint32_t)leg
  81. callback:(nonnull MBNNChangeLegCallback)callback;
  82. /** Set an observer and the configuration for the EH. */
  83. - (void)setElectronicHorizonObserverForObserver:(nullable id<MBNNElectronicHorizonObserver>)observer;
  84. /** Sets electronic horizon options. Pass null to reset to defaults. */
  85. - (void)setElectronicHorizonOptionsForOptions:(nullable MBNNElectronicHorizonOptions *)options;
  86. /** Returns road object store */
  87. - (nonnull MBNNRoadObjectsStore *)roadObjectStore __attribute((ns_returns_retained));
  88. /**
  89. * Resets ride session. This method exposes recreation of ride session, which is
  90. * needed for restarting of simulation.
  91. * Please call it before significant change of location, e.g. when restarting
  92. * navigation simulation, or before resetting location to not real (simulated)
  93. * position without recreation of navigator.
  94. */
  95. - (void)resetRideSession __attribute__((deprecated("Use Navigator#reset instead")));
  96. /**
  97. * Resets internal state of Navigator, useful in case if we use Navigator for replays or simulation,
  98. * when timestamps can decrease and locations can have unexpected significant changes.
  99. * Please call it before significant change of location, e.g. when restarting
  100. * navigation simulation, or before resetting location to not real (simulated)
  101. * position without recreation of navigator.
  102. */
  103. - (void)resetForCallback:(nonnull MBNNResetCallback)callback;
  104. /**
  105. * Creates predictive cache controller to populate the specified tile store instance
  106. * with the tiles described by the specified tileset descriptors.
  107. *
  108. * @param tileStore a tile store that should be populated with tiles
  109. * @param descriptors a list of tileset descriptors
  110. * @param locationTrackerOptions options to configure what tiles should be loaded for current location and route
  111. *
  112. * @return a PredictiveCacheController object
  113. */
  114. - (nonnull MBNNPredictiveCacheController *)createPredictiveCacheControllerForTileStore:(nonnull MBXTileStore *)tileStore
  115. descriptors:(nonnull NSArray<MBXTilesetDescriptor *> *)descriptors
  116. locationTrackerOptions:(nonnull MBNNPredictiveLocationTrackerOptions *)locationTrackerOptions __attribute((ns_returns_retained));
  117. /**
  118. * @param tileStore a tile store that should be populated with tiles
  119. * @param cacheOptions cache options such as dataset and version of tiles
  120. * @param locationTrackerOptions options to configure what tiles should be loaded for current location and route
  121. *
  122. * @return a PredictiveCacheController object
  123. */
  124. - (nonnull MBNNPredictiveCacheController *)createPredictiveCacheControllerForTileStore:(nonnull MBXTileStore *)tileStore
  125. cacheOptions:(nonnull MBNNPredictiveCacheControllerOptions *)cacheOptions
  126. locationTrackerOptions:(nonnull MBNNPredictiveLocationTrackerOptions *)locationTrackerOptions __attribute((ns_returns_retained));
  127. /**
  128. * Creates predictive cache controller to populate inner tile store instance of this navigator.
  129. *
  130. * @param cacheOptions cache options such as dataset and version of tiles
  131. * @param locationTrackerOptions options to configure what tiles should be loaded for current location and route
  132. *
  133. * @return a PredictiveCacheController object
  134. */
  135. - (nonnull MBNNPredictiveCacheController *)createPredictiveCacheControllerForCacheOptions:(nonnull MBNNPredictiveCacheControllerOptions *)cacheOptions
  136. locationTrackerOptions:(nonnull MBNNPredictiveLocationTrackerOptions *)locationTrackerOptions __attribute((ns_returns_retained));
  137. /**
  138. * Creates predictive cache controller to populate inner tile store instance of this navigator
  139. * and take dataset and version of tiles from Navigator's config.
  140. *
  141. * @param locationTrackerOptions options to configure what tiles should be loaded for current location and route
  142. *
  143. * @return a PredictiveCacheController object
  144. */
  145. - (nonnull MBNNPredictiveCacheController *)createPredictiveCacheControllerForLocationTrackerOptions:(nonnull MBNNPredictiveLocationTrackerOptions *)locationTrackerOptions __attribute((ns_returns_retained));
  146. - (nonnull id<MBNNRouteRefreshControllerInterface>)getRouteRefreshController __attribute((ns_returns_retained));
  147. /**
  148. * Returns interface implementing experimental APIs
  149. * Caller must guarantee `Navigator` instance is alive when calling any methods of returned instance
  150. */
  151. - (nonnull id<MBNNExperimental>)getExperimental __attribute((ns_returns_retained));
  152. /** Pause navigator. We will no longer receive NavigationStatus while there is a pause. */
  153. - (void)pause;
  154. /** Resume navigator. Remove pause, and start receiving NavigationStatus'es */
  155. - (void)resume;
  156. @end