#ifndef __LICENSEVALIDATIONRESULT_H
#define __LICENSEVALIDATIONRESULT_H

#include <memory>
#include "license.h"

using namespace std;

class LicensingClientImpl;

class LicenseValidationResultImpl
{
	//friend class LicensingClientT<char>;
	//friend class LicensingClientT<wchar_t>;
	friend class LicensingClientImpl;
	friend class LicenseValidationResultT<char>;
	friend class LicenseValidationResultT<wchar_t>;

public:
	LicenseValidationResultImpl()
	{
		m_isLicenseExpired = false;
		m_isPaymentRequired = false;
		m_licenseValidityDays = 0;
		m_licenseExpirationYear = m_licenseExpirationMonth = m_licenseExpirationDay = 0;
	}

	~LicenseValidationResultImpl()
	{

	}

	void MoveFrom(LicenseValidationResultImpl& src)
	{
		m_isLicenseExpired = src.m_isLicenseExpired;
		m_isLicenseValid = src.m_isLicenseValid;
		m_isPaymentRequired = src.m_isPaymentRequired;
		m_license = std::move(src.m_license);
		m_licenseValidityDays = src.m_licenseValidityDays;
		m_licenseExpirationDay = src.m_licenseExpirationDay;
		m_licenseExpirationMonth = src.m_licenseExpirationMonth;
		m_licenseExpirationYear = src.m_licenseExpirationYear;
	}

	LicenseImpl * GetLicense()
	{
		return m_license.get();
	}

	void SetLicense(LicenseImpl * lic)
	{
		m_license.reset(lic);
	}

	bool IsLicenseValid()
	{
		return m_isLicenseValid;
	}

	void SetLicenseValid(bool isValid)
	{
		m_isLicenseValid = isValid;
	}

	bool IsLicenseExpired()
	{
		return m_isLicenseExpired;
	}

	void SetLicenseExpired(bool licenseExpired)
	{
		m_isLicenseExpired = licenseExpired;
	}

	bool IsPaymentRequired()
	{
		return m_isPaymentRequired;
	}

	void SetPaymentRequired(bool paymentRequired)
	{
		m_isPaymentRequired = paymentRequired;
	}

	int GetLicenseValidityDays()
	{
		return m_licenseValidityDays;
	}

	void SetLicenseValidityDays(int days)
	{
		m_licenseValidityDays = days;
	}

	void GetLicenseExpirationDate(int * year, int * month, int * day) 
	{
		*year = m_licenseExpirationYear;
		*month = m_licenseExpirationMonth;
		*day = m_licenseExpirationDay;
	}

	void SetLicenseExpirationDate(int year, int month, int day)
	{
		m_licenseExpirationYear = year;
		m_licenseExpirationMonth = month;
		m_licenseExpirationDay = day;
	}

private:
	bool m_isLicenseValid;
	bool m_isLicenseExpired;
	bool m_isPaymentRequired;
	int m_licenseValidityDays;
	int m_licenseExpirationYear, m_licenseExpirationMonth, m_licenseExpirationDay;
	unique_ptr<LicenseImpl> m_license;
};

#endif
