//
//  EZDeviceSearchFilterView.h
//  EZOpenSDKDemo
//
//  搜索筛选视图：包含搜索框、状态筛选、通道筛选、重置按钮
//

#import <UIKit/UIKit.h>

/// 在线状态筛选
typedef NS_ENUM(NSInteger, EZStatusFilter) {
    EZStatusFilterAll = 0,
    EZStatusFilterOnline = 1,
    EZStatusFilterOffline = 2,
};

/// 通道类型筛选
typedef NS_ENUM(NSInteger, EZChannelFilter) {
    EZChannelFilterAll = 0,
    EZChannelFilterSingle = 1,
    EZChannelFilterMulti = 2,
};

@class EZDeviceSearchFilterView;

@protocol EZDeviceSearchFilterDelegate <NSObject>

/// 筛选条件发生变化时回调
- (void)searchFilterView:(EZDeviceSearchFilterView *)view
      didChangeWithKeyword:(NSString *)keyword
            statusFilter:(EZStatusFilter)statusFilter
           channelFilter:(EZChannelFilter)channelFilter;

@end

@interface EZDeviceSearchFilterView : UIView

@property (nonatomic, weak) id<EZDeviceSearchFilterDelegate> delegate;

/// 当前筛选条件（只读）
@property (nonatomic, copy, readonly) NSString *searchKeyword;
@property (nonatomic, assign, readonly) EZStatusFilter statusFilter;
@property (nonatomic, assign, readonly) EZChannelFilter channelFilter;

/// 收起键盘
- (void)resignSearchFocus;

/// 重置所有筛选条件
- (void)resetAll;

@end
