//
//  AFRegistrationController.h
//  AFRegistration
//
//  Created by Scott on 4/21/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "AFRegistrationConfiguration.h"
#import "AFRegistrationWindowController.h"
#import "AFRegisterWindowController.h"
#import "AFFeedbackWindowController.h"
#import "AFMailingListWindowController.h"

#define		REGISTRATION_REGISTERED		@"AFRegistration Registered"
#define		REGISTRATION_RESTRICTED		@"AFRegistration Restricted"


@interface AFRegistrationManager : NSObject {

	id									 delegate;
	AFRegistrationWindowController		*windowController;
	AFRegisterWindowController			*registerWindowController;
	AFRegistrationConfiguration			*configuration;
  AFFeedbackWindowController			*feedbackWindowController;
  AFMailingListWindowController			*mailingListWindowController;
	NSString							*name;
	NSString							*serial;
	NSString							*serialType;
	int									 trialCounter;
	BOOL								 isApplicationLoaded;
	BOOL								 isInitialized;
	BOOL								 isUsageLoaded;
	BOOL								 wasWarnedAboutPiratedSerial;
	NSDate								*_serverDate;
}

@property (readonly) int trialCounter;
@property (readonly) AFRegistrationConfiguration *configuration;

+ (AFRegistrationManager *)sharedRegistrationManager;
+ (NSString*)scrubStringForComparison:(NSString*)_string;

- (void)setDelegate:(id)value;
- (id)delegate;
- (void)initializeSetup;
- (void)configure:(AFRegistrationConfiguration *)configurationValue;
- (BOOL)checkSerial:(NSString *)serialValue andName:(NSString *)nameValue;
- (void)incrementTrial;
- (BOOL)isRegistered;
- (BOOL)isRegisteredWithSerialType:(NSString*)serialTypeValue;
- (BOOL)isRestricted;
- (BOOL)registerSerial:(NSString *)serialValue andName:(NSString *)nameValue;
- (void)deactivate;
- (void)closeWindow;
- (void)showRegistrationWindow;
- (void)showTrialWindow;
- (void)showInformationWindow;
- (void)showBetaWindow;
- (void)showBetaExpiredWindow;
- (void)showRegisterWindow;
- (void)showFeedbackWindow;
- (void)showMailingListWindow;
- (NSString*)registeredName;
- (NSString*)registeredSerial;
- (NSString*)purchaseURL;

@end
