//
//  MainListViewController.h
//  EAMiPad
//
//  Created by Satish Kumar Jakkula on 3/12/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum
{
    MainListViewTypeWorkOder,
    MainListViewTypeEquipment,
    MainListviewTypePrompt,
    MainListViewTypePOReceipt,
    MainListViewTypeNotebook,
    MainListViewTypeJSIWorkOrder,
    MainListViewTypeOperatorCheckList,
    MainListViewTypeBatchBookLabor,
    MainListViewTypePermitToWork,
    MainListViewTypeGISMapConfiguration
}MainListViewType;


@protocol MainListViewDelegate <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 MainListViewController : 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<MainListViewDelegate>      delegate;
@property (nonatomic        ) MainListViewType              listViewType;
@property (nonatomic        ) BOOL                          loadMore;
@property (nonatomic        ) BOOL                          isWOListByAssignedTo;
@property (nonatomic, strong) NSString                      *noRecordsText;
@property (nonatomic, strong) NSMutableDictionary           *screenDesignerJSON;

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

@end
