/**
 * Created by OCAnnotation.
 * Copyright (c) 2017, Ant Financial Wealth Mobile Team. All rights reserved.
 *
 * This source code is licensed under the Apache.
 * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
 */

#import <Foundation/Foundation.h>
#import "OCABaseAnnotation.h"

@interface OCAAnnotationManager : NSObject


/**
 Manager singleton
 
 */
+ (instancetype)sharedManager;

/**
 Query for annotation info

 @param position    annotation position
 @param className   related class
 @param typeString  annotation type
 @return            array of annotation infos(subclass of OCABaseAnnotation)
 */
- (NSArray<OCABaseAnnotation * > *)annotationInfosWithPosition:(OCAAnnotationPosition)position
                              className:(NSString*)className
                             typeString:(NSString*)typeString;


/**
 Register custom annotation type. If you have custom annotation type, you should define a proper annotation class for that type. This registration method should be called at initialization phase of your project.

 @param typeString  annotation type
 @param position    annotation position
 @param annoClass   related class
 @return            whether the registration is successful
 */
- (BOOL)registerAnnotationType:(NSString*)typeString
                      position:(OCAAnnotationPosition)position
                         class:(Class)annoClass;

/**
 Add config dict from generated macro. You should call this API at initialization phase of your project.

 @param configDic   config dictionary generated by scanning the project using script.
 */
- (void)addConfigsWithConfigDic:(NSDictionary*)configDic;


/**
 Query annotation class for relative annotation type and position

 @param typeString  annotation type
 @param position    annotation position
 @return            annotation class (subclass of OCABaseAnnotation)
 */
- (Class)annotationClassForTypeString:(NSString*)typeString
                             position:(OCAAnnotationPosition)position;
@end
