//
// SearchViewController.h
// IvyMedia
//
// Created by haibara on 8/26/14.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface ComboBoxItem : NSObject
@property (nonatomic, strong)NSString *label;
@property (nonatomic, strong) id value;
@end

@interface ComboBoxViewController : UIViewController

@property (nonatomic, assign) BOOL allowsIndexedCollation;
@property (nonatomic, assign) BOOL allowsDeselection;
@property (nonatomic, assign) BOOL allowsMultipleSelection;
@property (nonatomic, strong) NSString *selectionTitle;
@property (nonatomic, strong) NSString *historyTitle;
@property (nonatomic, strong) NSString *suggestionTitle;
@property (nonatomic, assign) BOOL allowsLocation;
@property (nonatomic, strong) NSString *locationTitle;

- (void)setItemsWithDictionary:(NSDictionary *)dictionary;
- (void)setItemsWithArray:(NSArray *)array;
- (void)selectValue:(id)value;
- (void)selectValues:(NSArray *)values;
- (void)suggestValues:(NSArray *)values;
- (void)setHistoryValues:(NSArray *)values;
- (void)reloadIfNeeded;
- (void)updatePlacemark:(CLPlacemark *)placemark;

- (void)setDidDoneBlock:(void (^)(id obj))block;
- (void)setDidCancelBlock:(void (^)(void))block;
- (void)setDidSelectItemBlock:(void (^)(ComboBoxItem *item))block;
- (void)setSelectionChangedBlock:(void (^)(ComboBoxViewController *viewController, id obj))block;
- (void)setHistoryChangedBlock:(void (^)(NSArray<ComboBoxItem *> *items))block;

- (void)setGeocodeBlock:(void (^)(ComboBoxViewController *viewController))block;
- (void)setPlacemarkFormattingBlock:(NSString * (^)(CLPlacemark *placemark))block;
- (void)setPlacemarkTransformationBlock:(id (^)(CLPlacemark *placemark))block;


@end

