/* Generated by Together */

#ifndef ILICENSINGERROR_H
#define ILICENSINGERROR_H

namespace KasperskyLicensing{

/** 
 * Licensing error interface.
 * All exceptional situations are reported by means of this interface.
 * @interface 
 */
class ILicensingError
{
public:

	/**
	 * Error codes enumeration.	
	 */
	enum ErrorCodeType
	{
		/**
		 * No error.	
		 */
		LICERR_OK = 0,

		/**
		 * Not found error.	
		 * Error is thrown when requested entity could not be found.
		 */
		LICERR_NOT_FOUND,

		/**
		 * Data parsing error.
		 * Error is thrown when supplied data could not be parsed.
		 */
		LICERR_PARSING_ERROR,

		/**
		 * Invalid signature error.
		 * Error is thrown when supplied data has invalid signature.
		 */
		LICERR_INVALID_SIGNATURE,

		/**
		 * Incompatible license key version error.
		 * Error is thrown when license key is not intended to use with
		 * this version of licensing library.
		 */
		LICERR_KEY_INCOMPATIBLE,

		/**
		 * License key mismatch error.
		 * Error is thrown when license key does not match given license context.
		 */
		LICERR_KEY_MISMATCH,

		/**
		 * Duplicate key error.
		 * Error is thrown when the library discovers duplicates in the 
		 * license keys storage.
		 */
		LICERR_DUPLICATE_KEY,

		/**
		 * Read from storage error.
		 * GetSpecificCode() provides read-specific error code.
		 */
		LICERR_STORAGE_READ,

		/**
		 * Write to storage error.	
		 * GetSpecificCode() provides write-specific error code.
		 */
		LICERR_STORAGE_WRITE,
		
		/**
		 * Signature checking library error.	
		 * GetSpecificCode() provides write-specific error code.
		 */
		LICERR_SIGNLIB_ERROR,

		/**
		 * Operating system specific error.
		 * GetSpecificCode() provides OS-specific error code.
		 */
		LICERR_OS_SPECIFIC,

		/**
		 * Overflow error.
		 * Error is thrown when evaluation of license condition
		 * causes an overflow.
		 */
		LICERR_OWERFLOW
	};

	/**
	 * Returns raised error code.
	 */
	virtual ErrorCodeType GetErrorCode() const = 0;

	/**
	 * Returns operation specific error code.	
	 */
	virtual int GetSpecificCode() const = 0;

	/**
	 * Destroys object.	
	 */
	virtual ~ILicensingError() {}

};

} // namespace KasperskyLicensing

#endif //ILICENSINGERROR_H
