//
//  BaseScrollTableViewController.h
//  DingDCommunity
//
//  Created by JianjiYuan on 14-3-7.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import "BaseViewController.h"
#import "BaseTableViewCell.h"
#import "SwipeView.h"

typedef enum : NSUInteger {
    TitleItemPositionTop = 0,
    TitleItemPositionBottom
} TitleItemPosition;

#define kButtonItemFirst   200
#define kDataForTableKey(index) [NSString stringWithFormat:@"indexOfItem_%d", (int)index]


@interface BaseScrollTableViewController : BaseViewController < UITableViewDataSource,
UITableViewDelegate, SwipeViewDelegate, SwipeViewDataSource >

@property (nonatomic, strong) SwipeView *swipeView;
@property (nonatomic, strong) UIView *containerItems;
@property (nonatomic, strong) NSMutableDictionary *dictTableDatas;

@property (nonatomic) NSInteger lastIndexOfItem;
@property (nonatomic) BOOL useItemTitles;//是否启用标题按钮
@property (nonatomic) TitleItemPosition itemPosition;

@property (nonatomic) NSInteger numberOfItems;//分页的数目
@property (nonatomic, strong) NSArray *arrItemTitles;//选项的标题
@property (nonatomic) UIEdgeInsets titleInsets;
@property (nonatomic) UIEdgeInsets imageInsets;

@property (nonatomic, strong) NSArray *arrItemBgNorImages;
@property (nonatomic, strong) NSArray *arrItemBgPreImages;

@property (nonatomic, strong) NSArray *arrItemTitleNorColors;
@property (nonatomic, strong) NSArray *arrItemTitlePreColors;

@property (nonatomic, strong) UIImage *itemBgImageNormal;//上面的一排按钮背景色
@property (nonatomic, strong) UIImage *itemBgImageSelected;

@property (nonatomic, strong) UIFont *titleFontNor;//上面的一排按钮 title
@property (nonatomic, strong) UIFont *TitleFontPre;

@property (nonatomic, strong) UIColor *itemTitleColorNormal;//上面的一排按钮标题颜色
@property (nonatomic, strong) UIColor *itemTitleColorSelected;

@property (nonatomic) CGFloat leftMarginOfButton;//按钮的位置
@property (nonatomic) CGFloat columnMarginOfButton;
@property (nonatomic) CGFloat rightMarginOfButton;
@property (nonatomic) CGFloat heightOfButtons; //Item高度

@property (nonatomic, strong) NSIndexPath *selectedIndexPath;//当前选中的行

- (void)btnItemClick:(UIButton *)sender;

- (void)reloadItemTitles;
- (void)reRequestTableViewDatas;
- (void)reRequestTableViewDatasForst;
- (void)reloadTableView;

@end
