//
//  ScannerButtonViewController.h
//  EAMiPad
//
//  Created by Ram Madichetty on 2/18/13.
//
//

#import <UIKit/UIKit.h>

@protocol ScannerAccessoryViewControllerDelegate

- (void)scannedValue:(NSString *)value;

@end

@interface ScannerAccessoryViewController : UIViewController

@property (nonatomic,strong) UIView *textField;
@property (nonatomic,strong) NSString *fieldName;
@property (nonatomic,strong) NSIndexPath *indexPath;
@property (nonatomic,weak) id delegate;
@property (nonatomic) BOOL autoHide;

- (IBAction)scanButtonPressed:(id)sender;
- (void)scannedValue:(NSString *)value;

+ (void)attachAccessoryViewToSearchBar:(UISearchBar *)searchBar
                          withdelegate:(id)delegate
                         withFieldName:(NSString *)fieldName
                         withIndexPath:(NSIndexPath *)indexPath;
+ (void)attachAccessoryViewToTextField:(UITextField *)textField
                          withdelegate:(id)delegate
                         withFieldName:(NSString *)fieldName
                         withIndexPath:(NSIndexPath *)indexPath;
+ (void)attachAccessoryViewToTextView:(UITextView *)textView
                         withdelegate:(id)delegate
                        withFieldName:(NSString *)fieldName
                        withIndexPath:(NSIndexPath *)indexPath;
+ (void)setAutoHide:(BOOL)value;

+ (UITextField *)getTextFieldInSearchBar:(UISearchBar *)searchBar;

@end
