//
//  PWLicense.h
//  PWFoundation
//
//  Created by Andreas KŠnner on 21.10.08.
//  Copyright 2006 ProjectWizards GmbH. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PWLicenseKit-Obfuscating.h"

@class PWLicenseCenter;

@interface PWLicense : NSObject
{
    NSString		*baseProduct;
    NSString		*owner;
    NSDate			*expirationDate;
    NSMutableSet	*serialNumbers;
	NSString		*serialNumber;
    NSString		*path;
    NSSet			*features;
    NSSet			*requiredFeatures;
    int				quantity;
	int				runningNumber;
	NSMutableSet	*subLicenses;
	NSString		*productName;
	BOOL			isBlocked;
	BOOL			isOverused;
	BOOL			isForeignLicense;
	int				quantityInNetwork;
}

+ (PWLicense*) licenseWithString:(NSString*)string licenseCenter:(PWLicenseCenter*)licenseCenter;
+ (PWLicense*) licenseForLicenseFileAtPath:(NSString*)path licenseCenter:(PWLicenseCenter*)licenseCenter;
+ (BOOL)features:(NSSet**)features product:(NSString**)product productName:(NSString**)productName serialNumber:(NSString**)serialNumber dictionary:(NSDictionary**)dictionary fromLicenseString:(NSString*)licenseString;

- (id)initWithString:(NSString*)string licenseCenter:(PWLicenseCenter*)licenseCenter;
- (id)initWithLicensePath:(NSString*)path licenseCenter:(PWLicenseCenter*)licenseCenter;
- (id)initWithBaseProduct:(NSString*)aBaseProduct features:(NSSet*)theFeatures quantity:(int)theQuantity  expirationDate:(NSDate*)expirationDate runningNumber:(int)aRunningNumber owner:(NSString*)owner path:(NSString*)aPath isForeign:(BOOL)isForeign;

- (id) copyWithZone:(NSZone *)zone;

- (void) setIsForeignLicense:(BOOL)flag;

- (NSString*) baseProduct;
- (NSString*) owner;
- (NSDate*) expirationDate;
- (NSSet*) serialNumbers;
- (NSString*) serialNumber;
- (NSString*) path;
- (NSSet*) features;
- (NSString *) mainFeature;
- (NSSet*) requiredFeatures;
- (NSSet*) subLicenses;
- (int) quantity;
- (int) quantityInNetwork;
- (int) runningNumber;
- (BOOL) isExpired;
- (double) highestVersionNumber;
- (NSSet*) featuresWithoutVersionNumbers;
- (NSSet*) featuresByFilteringOutSmallerVersionNumbers;
- (NSString*) logStringWithTabCount:(int)tabCount;
- (BOOL) isBlocked;
- (BOOL) isForeignLicense;

@end

@interface PWLicense (PWLicenseManagerAdditions)

- (void) setIsRegistered:(BOOL)flag;
- (BOOL) isRegistered;
- (NSString*) productName;

@end
