//
//  TnMapUtilities.h
//  TnMapKit
//
//  Created by Holzhauer, James on 2/4/14.
//  Copyright (c) 2014 TeleNav. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreGraphics/CGGeometry.h> //for CGRect
#import <UIKit/UIKit.h> // for UIImage and UIControlContentVerticalAlignment

#import "TMKTouchDelegate.h"
#import "TnAnnotationDetails.h"

#include <RenderEngine/ITnMapEngine.h>

//translation function for resource proxy
std::string const TMKFindResource_iOS(std::string const & name);

@interface TnMapUtilities : NSObject

struct optimizationInfo
{
    NSString* optimizedConfig;
    float     dpi;
};

+ (NSString*)deviceMachineString;
+ (optimizationInfo)getOptimizationInfoForDeviceWithScale:(CGFloat)scaleFactor;
+ (NSString*)GetConfigurationForRect:(CGRect)frame;

@end // TnMapUtilities

@class TnMapEngine;
@class TMKMapView;
@interface TnMapGLTouchBase : NSObject

- (id)initWithTarget:(id)target
             forView:(TMKMapView*)view
           forViewID:(ITnMapEngine::ViewId)viewId
             withDPI:(float)dpi
           withFrame:(CGRect)frame
 withAnnotationIdMap:(tn::shared_ptr<AnnotationIdMap>)annoIdMap
   withAnnotationMap:(tn::shared_ptr<AnnotationMap>)annoMap
          withEngine:(TnMapEngine*)engine;

// The current view rect, autotranslated for openGL
@property (nonatomic) CGRect frame;
// Touch delegate
@property (nonatomic, weak) id<TMKTouchDelegate> touchDelegate;

- (CGPoint)transformTouch:(CGPoint)point;   //transform touch point from iOS to openGL coordinate using translated GL frame
- (CGPoint)untransformTouch:(CGPoint)point; //transform touch point from openGL to iOS coordinate using translated GL frame

- (void)updatePopup;

- (void)registerPopup:(TMKAnnotationPopup*)popup;
- (void)removePopup;

@end // TnMapTouchBase

