//
//  MapEngineTypes.h
//  TelenavNavigator
//
//  Created by Holzhauer, James 1/31/2014
//  Copyright (c) 2014 TeleNav. All rights reserved.
//

#import <CoreGraphics/CGGeometry.h> //for CGRect

// Value returned from TMKMapView addAnnotation: API.  This number
// is then used for all subsequent operations on the annotation.

typedef NSNumber TMKAnnotationID;

// Denotes the concept of a layer for annotation management.  Can be
// used to group annotations for efficient manipulation operations.

typedef NSNumber TMKMapLayer;

// Value returned from TMKMapView for addAnnotation: API.  This
// number is then used for all subsequent operations on the shape
// model.

typedef NSNumber TMKOverlayID;

// A popup structure for displaying additional info when an annotation or interactable featuer of the map is touched
@class UIView;

__attribute__((visibility("default")))
@interface TMKAnnotationPopup : NSObject

// Denotes whether or not to lock the popup to the screen boundaries.  Default value is FALSE.
@property BOOL screenLocked;
// The view to display at the annotation position.
@property UIView* view;
// The annotation we are displaying this for.
@property TMKAnnotationID* anno;
// The origin, needs to be kept independently from the view value since the view value's center position will be updating
// Is grabbed automatically when the user sets the view, but can be set independently, or even updated dynamically
@property CGPoint offset;

- (id)init;
- (BOOL)valid;

@end // TMKAnnotationPopup;

// Rendering modes for a map view

typedef enum
{
    TMKRenderMode_NorthUp_2D,
    TMKRenderMode_NorthUp_3D,
    TMKRenderMode_HeadingUp_2D,
    TMKRenderMode_HeadingUp_3D,
    TMKRenderMode_FreeLook_2D,
    TMKRenderMode_FreeLook_3D
} TMKRenderMode;

// Touch event stages

typedef enum
{
    TMKTouchEvent_Begin,
    TMKTouchEvent_Move,
    TMKTouchEvent_End
} TMKTouchEvent;

// Touch modes for a map view.  Used as a bitmask, any bitwise
// combination (expect for TN_INVALID) of the below values is valid.
// Some combinations have been predefined for convenience.

typedef enum
{
    TMKTouchMode_Auto = 0,
    
    TMKTouchMode_Zoom = 1 << 0,
    TMKTouchMode_Pan = 1 << 1,
    TMKTouchMode_Rotate = 1 << 2,
    TMKTouchMode_Tilt = 1 << 3,
    
    TMKTouchMode_All = (TMKTouchMode_Zoom | TMKTouchMode_Pan | TMKTouchMode_Rotate | TMKTouchMode_Tilt),
    
    TMKTouchMode_PanAndZoom = (TMKTouchMode_Pan | TMKTouchMode_Zoom),
    
    TMKTouchMode_PanAndZoomAndRotate = (TMKTouchMode_Pan | TMKTouchMode_Zoom | TMKTouchMode_Rotate)
} TMKTouchMode;

// Supported shape types.  Used in the creation of TMKOverlay
// structures

typedef enum
{
    TMKShapeType_Polygon,
    TMKShapeType_Polyline
} TMKShapeType;

// Supported annotation types for a map view

typedef enum
{
    TMKAnnotationType_Flat,
    TMKAnnotationType_ViewerFacing,
    TMKAnnotationType_Screen2D,
    TMKAnnotationType_LatLonToScreen2D
} TMKAnnotationType;

