#import <Foundation/Foundation.h>
@class AdswizzAdRequest;
@class AdswizzRequestObject;
@class AdswizzAdResponseObject;
@class AdswizzLocation;
@protocol AdRequestHandler;

/**
 This is the main class of the library and provides support for making an ad request and receiving an answer.
 The reference to it's instance should be retained for the entire life of your application.
 In it's interface is defined also the protocol AdRequestHandler and AdMultiRequestHandler.
 The delegate should follow one these protocols in its implementation.
 The object can be initialized with the geolocalization support on or off
 */
@interface Camaro : NSObject {
    @private AdswizzAdRequest * adRequest;
    @private NSTimeInterval timeout;
    @private id delegate;
    @private NSTimer *timer;
    @private AdswizzLocation* location;
}

/**
 *  Returns the current version of the library
 */
@property(nonatomic,readonly) NSString* version;

/**
 *  The delegate object handling the ad response (single or multi)
 */
@property(nonatomic,assign) id delegate;

/**
  Returns an initialized Camaro object with geo localization turned off
*/
-(id) initWithoutGeolocation;

/**
 *  Starts an adrequest but before it sets the delegate
 *
 *  @param requestObject The objected which holds all the necesary data to build the ad request.
 *  @param handler       delegate object
 */
-(void) requestAd:(AdswizzRequestObject*)requestObject delegate:(id)handler;


/**
 * Starts an ad request but requires a delegate to have been set.
 *
 *  @param requestObject The objected which holds all the necesary data to build the ad request
 */
-(void) requestAd:(AdswizzRequestObject*)requestObject;
@end

/**
 *  The protocol the request handler delegate should follow when requesting for a single ad. Methods in the protocol has to be implemented by the delegate object.
 *
 */
@protocol AdRequestHandler <NSObject>

/**
 *  Method handling error during the ad request
 *
 *  @param info description object of the error
 */
-(void) onResponseError:(NSString*)info;

/**
 *  Method handling successfull completed ad request
 *
 *  @param adResponse the ad-response object as the result of the ad request this delegate handles
 */
-(void) onResponseReady:(AdswizzAdResponseObject*)adResponse;
@end

/**
 *  The protocol the request handler delegate should follow when requesting for multiple ads. Methods in the protocol has to be implemented by the delegate object.
 */
@protocol AdMultiRequestHandler <NSObject>

/**
 *  Method handling error during the ad request
 *
 *  @param info description object of the error
 */
-(void) onResponseError:(NSString*)info;

/**
 *  Method handling successfull completed ad reques
 *
 *  @param responseArray the list of ad-response objects as the result of the ad request this delegate handles
 */
-(void) onMultiResponseReady:(NSMutableArray*)responseArray;
@end