//
//  JSIWOBaseListViewController.h
//  EAMNext
//
//  Created by Satish Kumar Jakkula on 10/19/17.
//
//

#import <UIKit/UIKit.h>


typedef enum
{
    JSIWOListOptionsScheduleOverdue,
    JSIWOListOptionsScheduleDue,
    JSIWOListOptionsScheduleThisWeek,
    JSIWOListOptionsScheduleNextWeek,
    JSIWOListOptionsScheduleFuture,
    JSIWOListOptionsScheduleCompleted
}JSIWOListOptionsSchedule;

@protocol JSIWOBaseListViewDelegate <NSObject>
@optional

- (void)workOrderAddButtonClicked:(id)sender;
- (void)mapButtonPressed:(id)sender;
- (void)listItemSelected:(NSUInteger )index value:(NSString *)value;
- (void)refreshMainListView;
- (void)handleSearch:(NSString *)searchText;
- (void)loadMoreRecords:(NSInteger )currentRecordCount andSearchText:(NSString *)search;

@end

@interface JSIWOBaseListViewController : UIViewController<UITableViewDataSource, UITableViewDelegate>
{
    
}


@property (nonatomic, strong) UISearchBar                       *searchBar;
@property (nonatomic, strong) NSMutableArray                    *listViewData;
@property (nonatomic, strong) NSArray                           *listViewHeaderData;
@property (nonatomic        ) NSUInteger                        keyFieldIndex;
@property (unsafe_unretained) id<JSIWOBaseListViewDelegate>      delegate;
@property (nonatomic        ) BOOL                              loadMore;
@property (nonatomic        ) BOOL                              isWOListByAssignedTo;
@property (nonatomic, strong) NSString                          *noRecordsText;
@property (nonatomic, strong) UIButton                          *btnWOOptions;

- (id)initWithFrame:(CGRect )rect;
- (id)initWithFrame:(CGRect)rect andShowSearchBar:(BOOL )show;
- (void)refreshTableView;
- (void)selectRowAtIndex:(NSInteger )index;
- (void)deSelectRowAtIndex:(NSUInteger )index;
- (void)deSelectSelectedRow;
- (void)scrollToIndex:(NSUInteger )index;
- (void)setMapVisible:(BOOL )visible;
- (void)addMoreRecord:(NSArray *)records;

@end
