//
//  AppDefinitions.h
//  InforMobile
//
//  Created by Nookaraju Maddila on 7/14/17.
//  Copyright © 2017 Infor Global Solutions. All rights reserved.
//

#ifndef InforMobile_AppDefinitions_h
#define InforMobil_AppDefinitions_h


#endif



typedef enum{
    ToastTypeNetworkError = 1,
    ToastTypeError = 2,
    ToastTypeWarning = 3,
    ToastTypeInfo = 4,
    ToastTypeSuccess = 5,
} ToastType;

typedef enum{
    ToastLocationFullScreenCenter = 1,
    ToastLocationFullScreenTop = 2,
    ToastLocationFullScreenBottom = 3,
} ToastLocation;

typedef NS_ENUM (NSUInteger, PRIVACY_TYPE) {
    PRIVACY_TYPE_LOCATION = 1,
    PRIVACY_TYPE_PHOTOS = 2,
    PRIVACY_TYPE_CAMERA = 3,
    PRIVACY_TYPE_MICROPHONE = 4
};

typedef enum{
    // String Category
    DataTypeString = 1,
    DataTypeEmail = 200,
    DataTypeURL = 21,
    
    // Number Category
    DataTypeInteger = 2,
    DataTypeDecimal = 6,
    DataTypeDouble = 10,
    DataTypeLong = 4,
    DataTypeShort = 3,
    DataTypeBoolean = 20,
    DataTypePhone = 30,
    
    // Time Category
    DataTypeDatetime = 5,
    DataTypeTime = 8,
    DataTypeDate = 9,
    
    DataTypeDuration = 18,
  
    DataTypeCombo = 100,
    DataTypeUser = 101,
    DataTypeGroup = 11,
    
} DataType;


typedef enum{
    METHOD_TYPE_POST = 100,
    METHOD_TYPE_GET = 200,
    METHOD_TYPE_PUT = 300,
    METHOD_TYPE_DELETE = 400,
}METHOD_TYPE;

typedef enum{
    SERVICE_ENDPOINT_DATAMODEL = 1,
    SERVICE_ENDPOINT_ITEMS = 2,
    SERVICE_ENDPOINT_RESOURCES = 3,
    SERVICE_ENDPOINT_CONN = 4,
    SERVICE_ENDPOINT_MINGLE = 5,
    SERVICE_ENDPOINT_ADMIN = 6
}SERVICE_ENDPOINT;

typedef enum{
    RESPONSE_TYPE_JSON = 1,
    RESPONSE_TYPE_IMAGE = 2,
    RESPONSE_TYPE_FILE = 3,
}RESPONSE_TYPE;

typedef enum{
    CONTENT_TYPE_JSON = 1,
    CONTENT_TYPE_IMAGE = 2,
    CONTENT_TYPE_FILE = 3,
}CONTENT_TYPE;


typedef enum{
    MEDIA_TYPE_IMGE = 1,
    MEDIA_TYPE_VIDEO = 2,
    MEDIA_TYPE_FILE = 3,
}MEDIA_TYPE;


typedef enum{
    ActionQueueTypeNone = 0,
    ActionQueueTypePage = 1,
    ActionQueueTypeDetail = 2,
    ActionQueueTypeFileDownload = 3,
    ActionQueueTypeAutoRefresh = 4
} ActionQueueType;

typedef enum{
    ActionStateNone = 1,
    ActionStateSuccess = 2,
    ActionStateError = 10,
    ActionStateTimeout = 11,
    ActionStateAborted = 20
} ActionState;

typedef enum{
    ActionStageNone = 0,
    ActionStageStarted = 1,
    ActionStageRequestStarted = 2,
    ActionStageRestCallStarted = 3,
    ActionStageResponseStarted = 4,
    ActionStageResponseSyncStarted = 5,
    ActionStageCompleted = 6
} ActionStage;




typedef enum{
    FOLDER_TYPE_OFFLINE_DOCS = 1,
    FOLDER_TYPE_OUTBOX_DOCS = 2,
    FOLDER_TYPE_USERPICKED_DOCS = 3,
    FOLDER_TYPE_INBOX_DOCS = 4,
    
}FOLDER_TYPE;


typedef void (^ MCActivitityCompleteBlock)(NSString *, id, int);
typedef void (^ MCToastCompleteBlock)(NSString *, id, int);


typedef void (^ MCActionResponseBlock)(NSString *, id, NSDictionary *, id);
typedef void (^ MCActionResponseErrorBlock)(NSString *, id, NSDictionary*, id);

#define ERROR_RESP_TIMEOUT              201
#define ERROR_NO_NETWORK                202
#define RESULT_OK                       101
#define RESULT_GENERAL_ERROR            102
#define RESULT_BAD_HTTP_RESPONSE_ERROR  103
#define RESULT_RESP_JSON_INAVALID       104
#define RESULT_RESP_SERVER_ERROR        105
#define RESULT_RESP_TIMEOUT             106
#define RESULT_NO_NETWORK               107
#define RESULT_UNKNOWN_ERROR            108

#define SERVICE_NOT_AVAILABLE            109
#define ERROR_ON_TRUST            110

#define RESULT_ITEM_NOT_FOUND            111
#define RESULT_ERROR_ON_TRANCATION       199
#define RESULT_ERROR_NO_IDM_ROLE       400


#define TITLE_LABEL_TAG         99


#define APP_NAME  [[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:@"CFBundleName"]
#define KEYCHAIN_ACCESS_GROUP @"7U3DC43RL8.com.infor.mobileapps" //dev app team

//CoreData

#define ANALYTICS_OPTED      @"opted_for_analytics"
#define ANALYTICS_RESPONDED_USERS      @"analytics_repsponded_users"
#define GET_STARTED_SCREENS_SHOWN      @"ShownGetStartedScreens"
#define SERVER_DETAILS_CELL_IDENTIFIER @"serverEditCellIdentifier"
#define FLASH_SETTING_FOR_CAMERA @"flashSettingForCamera"



#define PARAM_AUTO_REFRESH_ACTION_NAME              @"actionName"
#define ACTION_GET_DOCUMENT_TYPES @"getDocumentTypes"

#pragma mark - Event Action

#define EVENT_ACTION_REQUEST            @"Request"
#define EVENT_ACTION_RESTCALL           @"Restcall"
#define EVENT_ACTION_RESPONSE           @"Response"
#define EVENT_ACTION_ERROR              @"Error"
#define EVENT_ACTION_TIMEOUT            @"Timeout"
#define EVENT_ACTION_FINISH             @"Finish"
#define EVENT_ACTION_ABORT              @"abort"
#define EVENT_ACTION_START_AUTO_REFRESH @"autoRefresh"


#define USER_LOGIN_PREFERENCE_KEY @"IDM_USER_LOGIN_PREFERENCE_KEY"
#define ACTION_APP_DID_BECOME_ACTIVE        @"applicationDidBecomeActive"
#define CERTIFICATE_PATH_EP  @"Certificates.dat"
#define SUPPORTED_FILE_FORMATS     @"SupportedFileFormats"
#define PARAM_AUTO_REFRESH_ID                       @"AutoResfreshID"


#define SETTING_AS_SERVER_URL      @"as_server_url"
#define SETTING_ION_SERVER_URL      @"ion_server_url"
#define SETTING_SERVER_PROFILE_NAME      @"server_profile_name"

#define SETTING_TENANT_ID       @"server_tenant_id"
#define SETTING_ORG_ID       @"server_organization"
#define SETTING_SERVER_URL      @"server_url"
#define SETTING_SERVER_PORT     @"server_port"
#define SETTING_IDM_URL      @"idm_server_url"
#define SETTING_ION_URL         @"ion_server_url"

#define kSocialServiceUrlKey        @"SocialServiceUrl"


#define kRestUserProfile                @"getMingleUserProfile"
#define kRestProfilePhoto               @"getMingleUserIcon"
#define kRestUserProfileDetail                @"getMingleUserProfileDetail"

#define KDocumetTypes @"getDocumentTypes"



#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

