summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLTypes.h
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
commit3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5 (patch)
tree9f0faeb5af456dc559b48d114883b2f6771400ba /platform/darwin/src/MGLTypes.h
parent2d32336a41dac77b6182642b7067a23add12eb09 (diff)
downloadqtlocation-mapboxgl-3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5.tar.gz
[ios, osx] Eliminated platform/{ios,osx}/include
Also updated various project references to be group-relative, so Xcode chooses the right directory by default when adding a new file. Fixes #4770.
Diffstat (limited to 'platform/darwin/src/MGLTypes.h')
-rw-r--r--platform/darwin/src/MGLTypes.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLTypes.h b/platform/darwin/src/MGLTypes.h
new file mode 100644
index 0000000000..746cb686c0
--- /dev/null
+++ b/platform/darwin/src/MGLTypes.h
@@ -0,0 +1,64 @@
+#import <Foundation/Foundation.h>
+
+#pragma once
+
+#if !__has_feature(nullability)
+ #define NS_ASSUME_NONNULL_BEGIN
+ #define NS_ASSUME_NONNULL_END
+ #define nullable
+ #define nonnull
+ #define null_resettable
+ #define _Nullable
+ #define _Nonnull
+#endif
+
+NS_ASSUME_NONNULL_BEGIN
+
+/** Indicates an error occurred in the Mapbox SDK. */
+extern NSString * const MGLErrorDomain;
+
+/** Error constants for the Mapbox SDK. */
+typedef NS_ENUM(NSInteger, MGLErrorCode) {
+ /** An unknown error occurred. */
+ MGLErrorCodeUnknown = -1,
+ /** The resource could not be found. */
+ MGLErrorCodeNotFound = 1,
+ /** The connection received an invalid server response. */
+ MGLErrorCodeBadServerResponse = 2,
+ /** An attempt to establish a connection failed. */
+ MGLErrorCodeConnectionFailed = 3,
+};
+
+/** The mode used to track the user location on the map. */
+typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) {
+ /** The map does not follow the user location. */
+ MGLUserTrackingModeNone = 0,
+ /** The map follows the user location. */
+ MGLUserTrackingModeFollow,
+ /** The map follows the user location and rotates when the heading changes. */
+ MGLUserTrackingModeFollowWithHeading,
+ /** The map follows the user location and rotates when the course changes. */
+ MGLUserTrackingModeFollowWithCourse,
+};
+
+NS_ASSUME_NONNULL_END
+
+#ifndef NS_ARRAY_OF
+ // Foundation collection classes adopted lightweight generics in iOS 9.0 and OS X 10.11 SDKs.
+ #if __has_feature(objc_generics) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
+ /** Inserts a type specifier for a pointer to a lightweight generic with the given collection and object classes. Use a `*` for any non-`id` object classes but no `*` for the collection class. */
+ #define NS_ARRAY_OF(ObjectClass...) NSArray <ObjectClass>
+ #define NS_MUTABLE_ARRAY_OF(ObjectClass...) NSMutableArray <ObjectClass>
+ #define NS_SET_OF(ObjectClass...) NSSet <ObjectClass>
+ #define NS_MUTABLE_SET_OF(ObjectClass...) NSMutableSet <ObjectClass>
+ #define NS_DICTIONARY_OF(ObjectClass...) NSDictionary <ObjectClass>
+ #define NS_MUTABLE_DICTIONARY_OF(ObjectClass...) NSMutableDictionary <ObjectClass>
+ #else
+ #define NS_ARRAY_OF(ObjectClass...) NSArray
+ #define NS_MUTABLE_ARRAY_OF(ObjectClass...) NSMutableArray
+ #define NS_SET_OF(ObjectClass...) NSSet
+ #define NS_MUTABLE_SET_OF(ObjectClass...) NSMutableSet
+ #define NS_DICTIONARY_OF(ObjectClass...) NSDictionary
+ #define NS_MUTABLE_DICTIONARY_OF(ObjectClass...) NSMutableDictionary
+ #endif
+#endif