|
//
// TPTableViewController.h
// ThePaperDemo
//
// Created by scar1900 on 14/10/21.
// Copyright (c) 2014年 scar1900. All rights reserved.
//
#import "TPHttpController.h"
#import "SCGIFImageView.h"
#import "HeaderInsetTableView.h"
#pragma mark - 控件的刷新状态
typedef enum {
RefreshStatePulling = 1, // 松开就可以进行刷新的状态
RefreshStateNormal = 2, // 普通状态
RefreshStateRefreshing = 3, // 正在刷新中的状态
RefreshStateCancel = 4,
RefreshStateSucess = 5,
RefreshStateIsPulling = 6,
RefreshStateNoMore = 7,
RefreshStateFailed = 8
} RefreshState;
@protocol LoadFootDelegate<NSObject>
@optional
- (void)startLoad;//开始刷新代理
@end
@interface loadFootView : UIView
@property(nonatomic, strong)SCGIFImageView *gifView;
@property(nonatomic, assign)RefreshState state;
@property(nonatomic, weak)id<LoadFootDelegate> delegate;
@property(nonatomic, strong)UILabel *textLabel;
@property(nonatomic, assign)BOOL isMall;
@end
@protocol refreshHeadDelegate<NSObject>
@optional
- (void)startRefresh; //开始刷新代理
@end
@interface refreshHeadView : UIView {
}
- (id)initWithFrame:(CGRect)frame;
@property(nonatomic, strong)SCGIFImageView *gifView;
@property(nonatomic, assign)RefreshState state;
@property(nonatomic, strong)UILabel *timeLabel;
@property(nonatomic, assign)CGPoint contentOffset;
@property(nonatomic, strong)NSDate *lastUpdateDate;
@property(nonatomic, weak)id<refreshHeadDelegate> delegate;
@end
//处理上拉刷新下拉加载的tableviewcontroller
@interface TPTableViewController : TPHttpController
//设置是否开启上拉刷新下拉加载
@property(nonatomic, strong)HeaderInsetTableView *tableView;
@property(nonatomic, strong)refreshHeadView *refreshHeader;
@property(nonatomic, strong)loadFootView *loadFooter;
@property(nonatomic, strong)NSString *nextUrl;
@property(nonatomic, assign)CGFloat contentInsetTop;
/*上拉刷新*/
- (void)needNoFirstAutoRefresh;
- (void)firstAutoRefreshHandler; //进入后第一次刷新
- (void)manualRefresh; //手动调用刷新
- (void)endRefresh; //结束上拉刷新
- (void)cancelRefresh; //取消上拉刷新
- (void)pullRefreshHandler; //上拉刷新回调
/*下拉加载*/
- (void)noMoreLoad; //没有更多数据处理
- (void)loadFailed; //加载失败
- (void)loadSuccess; //加载成功
- (void)cancelLoadMore; //取消加载
- (void)pullLoadMoreHander; //下拉加载回调
- (void)configCanRefresh:(BOOL)canRefresh canLoad:(BOOL)canLoad;
@end
|