//
//  EAMiPadAppDelegate.h
//  EAMiPad
//
//  Created by Satish on 11/3/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WebQuery.h"
#import "Utility.h"
#import <InforAuthentication/InforAuthentication.h>

#define NUMBER_OF_ROWS_TO_FETCH 2000
#define LISTVIEW_MAXROW_LIMIT 500

#define SECTION_EDITABLE @"NO"
#define SECTION_READONLY @"YES"

#define SECTION_CONMODE_CON @"CON"
#define SECTION_CONMODE_DISCON @"DISCON"
#define SECTION_CONMODE_BOTH @""

#define APP_VERSION @"11.7"

#define BASE_BIOMETRIC_ENABLE_KEY @"BASE_BIOMETRIC_ENABLE"
#define MOBILE_BIOMETRIC_ENABLE_KEY @"MOBILE_BIOMETRIC_ENABLE"

#define APPLAUNCHEDFROMURLNOTIFICATION @"APPLAUNCHEDFROMURLNOTIFICATION"


@class HomeViewController;
@class Login;
@class EAMWorkOrders;
@class EAMObjects;
@class EAMPOReceipts;
@class EAMMobileNotebooks;
@class WorkOrderMainViewController;
@class WorkOrderRecordViewController;
@class EquipmentMainViewController;
@class EquipmentDetailViewController;
@class EAMComments;
@class EAMActivities;
@class MainListViewController;
@class Reachability;
@class WSPromptsMainViewController;
@class ECSlidingViewController;
@class LoginViewController; // <-- ION Class

UIColor *gDarkBasicColor, *gMediumBasicColor, *gLightBasicColor, *gLightHalfBasicColor, *gBlueBasicColor, *gListViewBackColor, *gViewBackgroundColor;;
NSString *gTimeOutNotificationID, *gCloseModelNotificationID;
NSMutableDictionary *gInstallParameters;
NSString    *gLogoutNotificationID;
NSString    *gReloadGISNotificationID;
NSString    *gClearMapViewNotificationID;

@interface EAMAppDelegate : UIResponder <UIApplicationDelegate> {

}

@property (nonatomic, strong) IBOutlet  UIWindow                        *window;
@property (nonatomic, strong) IBOutlet  UINavigationController          *navigationController;
@property (nonatomic, strong)           NSString                        *languageKey;
@property (nonatomic, strong)           HomeViewController              *homeViewController;
@property (nonatomic, strong)           Login                           *loginObject;
@property (nonatomic, strong)           EAMWorkOrders                   *workOrders;
@property (nonatomic, strong)           EAMObjects                      *equipments;
@property (nonatomic,strong)            EAMPOReceipts                   *poReceipts;
@property (nonatomic,strong)            EAMMobileNotebooks              *mobileNotebooks;
@property (nonatomic, strong)           WorkOrderRecordViewController   *workOrderRecordViewController;
@property (nonatomic, strong)           NSMutableDictionary             *lookUpItems;
@property (nonatomic, strong)           NSMutableArray                  *activitiesTemplate;
@property (nonatomic, strong)           NSMutableArray                  *commentsTemplate;
@property (nonatomic, strong)           NSMutableDictionary             *partsTemplate;
@property (nonatomic, strong)           EAMComments                     *comments;
@property (nonatomic, strong)           EAMActivities                   *activity;
@property (nonatomic, strong)           EquipmentDetailViewController         *equipmentViewController;
@property (nonatomic, strong)           UIView                          *cursorParentView;
@property (nonatomic, strong)           WorkOrderMainViewController     *listViewController;
@property (nonatomic, strong)           NSString                        *activityNumber;
@property (nonatomic        )           ActivityChildType               selectedActivityChildType;
@property (nonatomic        )           BOOL                            quickLoginVisible;

@property (nonatomic, strong)           Reachability                    *networkReachable;
@property (nonatomic        )           int                             timeoutInterval;
@property (readonly, nonatomic)         ConnectionMode                  connectionMode;
@property (nonatomic)                   BOOL                            syncRequired;
@property (nonatomic)                   BOOL                            loggerEnabled;
@property (nonatomic, strong)           WSPromptsMainViewController     *wslistViewController;
@property (nonatomic        )           BOOL                            recordChanged;
@property (nonatomic        )           BOOL                            appLaunchedByDocument;
@property (nonatomic, strong)           ECSlidingViewController         *slidingViewController;
@property (nonatomic        )           BOOL      IS_PREPARE_MOBILE_DOWNLOADING_WEBSERVICE_EXISTS;
@property (nonatomic, strong)           NSString *IS_PREPARE_MOBILE_DOWNLOADING_WEBSERVICE_SESSIONID;
@property (nonatomic, strong)           NSString *IS_PREPARE_MOBILE_DOWNLOADING_WEBSERVICE_SESSIONID_EQUIPMENT;
@property (nonatomic, strong)           NSString *IS_PREPARE_MOBILE_DOWNLOADING_WEBSERVICE_SESSIONID_PERMITTOWORK;
@property (nonatomic, strong)           NSMutableDictionary             *boilerTexts;
@property (nonatomic        )           BOOL                            workRequestAdded;
@property (nonatomic, strong)           NSString                        *mobileLogLevel;
@property (nonatomic        )           BOOL                            ionLogIn;
@property (nonatomic, strong)           LoginViewController             *loginViewController;
@property (nonatomic, strong)           NSTimer                         *delayTimerForOnDemandSync;
@property (nonatomic        )           BOOL                            sessionTimeOut;
@property (nonatomic        )           BOOL                            showBiometricsLogin;
@property (nonatomic        )           BOOL                            appLaunchedByURL;
@property (nonatomic, strong)           NSDictionary                    *appLaunchedByURLData;

- (void)initializations;
- (void)changeLanguage:(NSString *)lan;

- (void)showHomeViewController:(BOOL)syncRequired;
- (void)openHomeViewController:(NSString *)actionType;
- (void)showRendererViewController;
- (void)showGISMapConfigurationListViewController;
- (void)showReportViewController:(NSString *)urlString;
- (void)popViewController;
- (void)popToRootViewController;
- (void)showChangePasswordViewController;

- (void)saveLoginObject;
- (void)setLoginObject;

- (IBAction)showConfigAction:(CGRect )frame;
- (void)showFacetimeInRect:(CGRect )frame inView:(UIView *)inView;
- (void)dismissPopOver;
- (void)Logout;
- (void)showQuickLogin:(BOOL )appActive;
- (void)showTransactionErrors;
- (void)showSyncConfig;
- (void)showScreenDesigner;
-(void)showFlexScreen;

- (void)showRootViewController;
- (void)changeConnectionMode:(ConnectionMode)connectionMode;

- (void)showRecordChangedMessage:(id)delegate;
- (void)showUploadDocumentViewController;

- (void)enableSliding:(BOOL )enable;
- (void)enablePanning:(BOOL )enable;
- (void)showMenu;
- (void)showPingViewController;

+(EAMAppDelegate *) sharedInstance;


- (void)showSyncProgressView;
- (void)hideSyncProgressView:(NSString *)syncType;

#pragma mark - ION Methods
- (BOOL) isIONAPILogin;
/* - (void) loginWithOAuth;
- (void) logoutOAuthSession;
- (void) loginWithOAuthWithSwitchUserFlow;
- (void) checkUserSessionAndLoginWithOAuth;
- (void) logOutActions;
*/
- (void) enableEAMLogin:(BOOL )enable;
- (void) setHomeViewAsRootViewController;
- (void) showDUX;
- (void)startViewControllers;
- (void)authenticationCompleted;
- (void)authenticationFailed:(NSString *)error;
#pragma mark - 


@end
