//
//  ImageBrowserViewController.h
//  TaiZhouTobacco_7s
//
//  Created by JianjiYuan on 14-9-11.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import "BaseViewController.h"

typedef enum : NSUInteger {
    ImageBrowserPhotoSourceLibrary,
    ImageBrowserPhotoSourceCamera,
    ImageBrowserPhotoSourceAlbum,
    ImageBrowserPhotoSourceAsset
} ImageBrowserPhotoSource;


@class ImageBrowserViewController;

@protocol ImageBrowserDelegate <NSObject>

- (void)imageBrowser:(ImageBrowserViewController *)imageBrowser
     didSelectImages:(NSArray *)images;

@optional
- (void)imageBrowserDidClickAddPicsButton:(ImageBrowserViewController *)imageBrowser;

- (void)imageBrowser:(ImageBrowserViewController *)imageBrowser
     didDeleteImages:(NSArray *)images;

@end

@interface ImageBrowserViewController : BaseViewController

@property (nonatomic, assign) id<ImageBrowserDelegate> delegate;
@property (nonatomic, strong) NSArray *selectedImages;
@property (nonatomic) BOOL showAddPicsButton;
@property (nonatomic) ImageBrowserPhotoSource photoSource;
@property (nonatomic) BOOL editing;
@property (nonatomic) CGSize itemSize;
@property (nonatomic) UIEdgeInsets edgeInset;
@property (nonatomic, strong) UICollectionView *collectionView;

@property (nonatomic) BOOL canBeDelete;

@property (nonatomic, weak) UIViewController *vcImagePickerPrensentFrom;//设置弹出

- (void)reloadImageDatas;

- (void)addImageWithImageBrowserPhotoSource:(ImageBrowserPhotoSource)sourceType;

@end

typedef enum : NSUInteger {
    ImageSourceTypeBundle = 0,
    ImageSourceTypeFilePath,
    ImageSourceTypeWebURL
} ImageSourceType;

typedef enum : NSUInteger {
    ImageItemTypeImage = 0,
    ImageItemTypeAddButton,
    ImageItemTypeDefault
} ImageItemType;

@interface ImageBrowserObj : NSObject

@property (nonatomic) BOOL isAddPicsButton;//是否是添加按钮
@property (nonatomic) ImageSourceType sourceType;
@property (nonatomic) ImageItemType itemType;
@property (nonatomic, strong) NSString *imageId;//唯一
@property (nonatomic, strong) NSString *imageName;
@property (nonatomic, strong) NSString *imagePath;
@property (nonatomic, strong) NSString *imageURL;
@property (nonatomic, strong) NSData *imageSavedData;
@property (nonatomic) BOOL isShaking;//晃动
@property (nonatomic) BOOL isDeletable;//可删除
@property (nonatomic) BOOL isBGGray;
@end