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

#import <UIKit/UIKit.h>
#import "Utility.h"
#import "ListViewController.h"
#import "ContainerView.h"

typedef enum {
    CommentActionAdd,
    CommentActionEdit
}CommentAction;

@protocol CommonCommentsDelegate <NSObject>

@optional
- (void)addPressed:(id)sender;
- (void)savePressed:(id)sender withComment:(NSString *)comment andSelectedIndex:(NSInteger )index forCommentAction:(CommentAction )action;
- (void)editPressed:(id)sender withComment:(NSString *)comment andSelectedIndex:(NSInteger )index;
- (void)cancelPressed:(id)sender;
- (void)deletePressed:(id)sender withComment:(NSString *)comment andSelectedIndex:(NSInteger )index;//09/18/2012:delete Button
//rowSelected is added to know which child comment is selected ...for now only enable/disable delete button is handled in rowSelected
- (void)rowSelectedwithComment:(NSString *)comment andSelectedIndex:(NSInteger )index;//12/26/2012:rowSelected
@end

@interface CommonCommentsViewController : UIViewController<UITextViewDelegate>
{
    
}

@property (nonatomic, strong)   IBOutlet      UIButton                      *addButton;
@property (nonatomic, strong)   IBOutlet      UIButton                      *saveButton;
@property (nonatomic, strong)   IBOutlet      UIButton                      *cancelButton;
@property (nonatomic, strong)   IBOutlet      UIButton                      *deleteButton;
@property (nonatomic, strong)   IBOutlet      UIButton                      *editButton;
@property (nonatomic, strong)   IBOutlet      UITextView                    *txtComment;
@property (nonatomic, strong)                 NSArray                       *commentsData;
@property (nonatomic, strong)   IBOutlet      UIButton                      *buttonClose;
@property (nonatomic, strong)   IBOutlet      UILabel                      *taskTitle;
@property (nonatomic        )                 CGFloat                       tableViewHieght;
@property (nonatomic        )                 CGFloat                       tableViewHieghtOffset;
@property (nonatomic        )                 CGFloat                       keyboardOffset;
@property (nonatomic, strong)                 NSString                      *noRecordsText;
@property (nonatomic, strong)                 NSString                      *emptyCommentMessage;
@property (nonatomic)                         BOOL                           departmentSecurityReadOnly;
@property (nonatomic)                         BOOL                           jTAuthReadOnly;
@property (nonatomic)                         BOOL                           isWorkRequest;
@property (nonatomic, weak  )           id                              delegate;

- (void)refresh;
- (void)disableButtons;
- (void)refreshTableViewHeigh:(CGFloat )height;
- (void)showCommentAddEditMode;
@end
