MBXTileStore.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <MapboxCommon/MBXTileDataDomain.h>
  4. #import <MapboxCommon/MBXTileRegionLoadProgressCallback.h>
  5. @class MBXCancelable;
  6. @class MBXResourceDescription;
  7. @class MBXResourceLoadOptions;
  8. @class MBXTileRegionLoadOptions;
  9. @class MBXTilesetDescriptor;
  10. @protocol MBXTileStoreObserver;
  11. /**
  12. * TileStore manages downloads and storage for requests to tile-related API endpoints, enforcing a disk usage
  13. * quota: tiles available on disk may be deleted to make room for a new download. This interface can be used by an
  14. * app developer to set the disk quota. The rest of TileStore API is intended for native SDK consumption only.
  15. */
  16. NS_SWIFT_NAME(TileStore)
  17. __attribute__((visibility ("default")))
  18. @interface MBXTileStore : NSObject
  19. // This class provides custom init which should be called
  20. - (nonnull instancetype)init NS_UNAVAILABLE;
  21. // This class provides custom init which should be called
  22. + (nonnull instancetype)new NS_UNAVAILABLE;
  23. /**
  24. * Creates a TileStore instance for the given storage path.
  25. *
  26. * The returned instance exists as long as it is retained by the client.
  27. * If the tile store instance already exists for the given path this method will return it without creating
  28. * a new instance, thus making sure that there is only one tile store instance for a path at a time.
  29. *
  30. * If the given path is empty, the tile store at the default location is returned.
  31. * On iOS, this storage path is excluded from automatic cloud backup.
  32. * On Android, please exclude the storage path in your Manifest.
  33. * Please refer to the [Android Documentation](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information.
  34. *
  35. * @param path The path on disk where tiles and metadata will be stored
  36. * @return Returns a TileStore instance.
  37. */
  38. + (nonnull MBXTileStore *)createForPath:(nonnull NSString *)path __attribute((ns_returns_retained)) NS_REFINED_FOR_SWIFT;
  39. /**
  40. * Creates a TileStore instance at the default location.
  41. *
  42. * If the tile store instance already exists for the default location this method will return it without creating
  43. * a new instance, thus making sure that there is only one tile store instance for a path at a time.
  44. *
  45. * @return Returns a TileStore instance.
  46. */
  47. + (nonnull MBXTileStore *)create __attribute((ns_returns_retained)) NS_REFINED_FOR_SWIFT;
  48. /**
  49. * An overloaded version that does not report progess or finished status of the loading operation.
  50. *
  51. * @param id The tile region identifier.
  52. * @param loadOptions The tile region load options.
  53. * @return Returns a Cancelable object to cancel the load request
  54. */
  55. - (nonnull MBXCancelable *)loadTileRegionForId:(nonnull NSString *)id
  56. loadOptions:(nonnull MBXTileRegionLoadOptions *)loadOptions __attribute((ns_returns_retained)) NS_REFINED_FOR_SWIFT;
  57. /**
  58. * Removes a tile region.
  59. *
  60. * Removes a tile region from the existing packages list. The actual resources
  61. * eviction might be deferred. All pending loading operations for the tile region
  62. * with the given id will fail with Canceled error.
  63. *
  64. * @param id The tile region identifier.
  65. */
  66. - (void)removeTileRegionForId:(nonnull NSString *)id;
  67. /**
  68. * Sets additional options for this instance.
  69. *
  70. * @param key The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions.
  71. * @param value The value for the configuration option, or null if it should be reset.
  72. */
  73. - (void)setOptionForKey:(nonnull NSString *)key
  74. value:(nonnull id)value;
  75. /**
  76. * Sets additional options for this instance that are specific to a data type.
  77. *
  78. * @param key The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions.
  79. * @param domain The data type this setting should be applied for.
  80. * @param value The value for the configuration option, or null if it should be reset.
  81. */
  82. - (void)setOptionForKey:(nonnull NSString *)key
  83. domain:(MBXTileDataDomain)domain
  84. value:(nonnull id)value;
  85. @end