//
//  MBMicroblinkSDK.h
//  MicroBlinkDev
//
//  Created by Jura Skrlec on 14/11/2017.
//

#import <Foundation/Foundation.h>
#import "PPMicroBlinkDefines.h"

NS_ASSUME_NONNULL_BEGIN
/**
 * Entry class for all Microblink SDKs - used for setting up license key and to add support for
 * optimisation of passing data.
 */
PP_CLASS_AVAILABLE_IOS(8.0)
@interface MBMicroblinkSDK : NSObject

+ (instancetype)sharedInstance;

/**
 * Set license buffer and unlock the SDK. Application package will be used to validate the license.
 * @param licenseBuffer Byte array containing the license.
 */
- (void)setLicenseBuffer:(NSData * _Nonnull)licenseBuffer;

/**
 * Set license buffer and unlock the SDK. Also define licensee that will be used to validate the license.
 * This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being
 * packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of
 * single license within multiple application packages.
 * @param licenseBuffer Byte array containing the license.
 * @param licensee Licensee to which license is given to.
 */
- (void)setLicenseBuffer:(NSData * _Nonnull)licenseBuffer andLicensee:(NSString * _Nonnull)licensee;

/**
 * Set license key and unlock the SDK. Application package will be used to validate the license.
 * @param base64LicenseKey License file encoded as base64 string.
 */
- (void)setLicenseKey:(NSString * _Nonnull)base64LicenseKey;

/**
 * Set license key and unlock the SDK. Also define licensee that will be used to validate the license.
 * This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being
 * packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of
 * single license within multiple application packages.
 * @param base64LicenseKey Byte array containing the license.
 * @param licensee Licensee to which license is given to.
 */
- (void)setLicenseKey:(NSString * _Nonnull)base64LicenseKey andLicensee:(NSString * _Nonnull)licensee;

/**
 * Set the license file and unlock the SDK. Application package will be used to validate the license.
 * @param fileName The name of resource file contained in the directory specified by subdirectory. If you specify nil, the method returns the first resource file it finds with the specified extension in that directory.
 * @param extension The filename extension of the file (etc. txt). If you specify an empty string or nil, the extension is assumed not to exist and the file URL is the first file encountered that exactly matches name.
 * @param subdirectory The valid path of top-level directory in which file is located inside bundle (etc. licenseFiles/). If you specify an empty string or nil, root direcotry of bundle will be searched.
 * @param bundle NSBundle bundle required to access file.
 */
- (void)setLicenseResource:(NSString * _Nonnull)fileName withExtension:(NSString * _Nullable)extension inSubdirectory:(NSString * _Nullable)subdirectory forBundle:(NSBundle * _Nonnull)bundle;

/**
 * Set the license file and unlock the SDK. Also define licensee that will be used to validate the license.
 * This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being
 * packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of
 * single license within multiple application packages.
 * @param fileName The name of resource file contained in the directory specified by subdirectory.
 * @param extension The filename extension of the file (etc. txt). If you specify an empty string or nil, the extension is assumed not to exist and the file URL is the first file encountered that exactly matches name.
 * @param subdirectory The valid path of top-level directory in which file is located inside bundle (etc. licenseFiles/). If you specify an empty string or nil, root direcotry of bundle will be searched.
 * @param bundle NSBundle bundle required to access file.
 * @param licensee Licensee to which license is given to.
 */
- (void)setLicenseResource:(NSString * _Nonnull)fileName withExtension:(NSString * _Nullable)extension inSubdirectory:(NSString * _Nullable)subdirectory forBundle:(NSBundle * _Nonnull)bundle andLicensee:(NSString *)licensee;

/**
 * Returns the string that contains the library build version
 *
 *  @return string that contains the library build version
 */
+ (NSString *)buildVersionString;

@end

NS_ASSUME_NONNULL_END
