//
//  MobiControlConnectionManager.h
//  iOSAgent
//
//  Created by SOTI Inc. on 2015-06-11.
//  Copyright (c) 2015 SOTI Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

/*!
    To start using iOS SOTI SDK, it's necessary to import AgentSDK.h file
 */
#import "AgentSDK.h"




/*!
 It's a core class that wrapps all iOS SDK calls - communicating (connect/disconnect and enroll/unenroll) to MobiControl server
 */
@interface MobiControlConnectionManager : NSObject

/*!
 Shows if connected to a MobiControl server
 */
@property (nonatomic, readonly) BOOL isConnected;

/*!
 Shows if enrolled to a MobiControl server
 */
@property (nonatomic, readonly) BOOL isEnrolled;

/*!
 Shows if Application Config is available: by default it has to be available. It's downloaded from a server as a very last step of MDM enrollment.
 In order to enable Application Config for a 3rd party application the following line of the Deployment Server configuration file needs to be modified:
 
 File: "C:\Program Files (x86)\SOTI\MobiControl\MCDeplSvr.exe.config" should have the following line included:
  <soti.mdm authorizationMode="0" agentApplicationIds="net.soti.SOTI-sample, net.soti.mobicontrol"/>

 NOTE: Server requires a reboot once the configuration file is updated

 If App Config is unavailable after initiating the enrollment precedure it could indicate that something wrong happened during enrollment.
 App Config is represented as simple XML.
 */
@property (nonatomic, readonly) BOOL isAppConfigAvailable;

/*!
 Just for UI purposes - to update a UI to reflect connection/enrollment state.
 */
@property (nonatomic, copy) void (^ callbackUpdateUI)(NSString *);
@property (nonatomic, copy) void (^ callbackUpdateStatus)(NSString *);

/*!
 MobiControlConnectionManager is a singleton.
 The method returns an instance of MobiControlConnectionManager.
 */
+ (id)defaultMobiControlConnectionManager;

/*!
 Triggers a connect operation to MobiControl server
 */
- (void)connectToMobiControl;

/*!
 Disconnects from MobiControl server
 */
- (void)disconnectFromMobiControl;


@end
