Files
Work/guitar/backup/20030501/Registration.hpp
2024-08-07 09:16:27 -04:00

56 lines
1.9 KiB
C++

#ifndef _GUITAR_REGISTRATION_HPP_
#define _GUITAR_REGISTRATION_HPP_
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
#ifndef _COMMON_REGKEY_HPP_
#include <common/regkey.hpp>
#endif
#ifndef _GUITAR_LICENSE_HPP_
#include <guitar/license.hpp>
#endif
// Registration procedure
// When application first comes up it will check registry for a license
// If no license exists and there is no "install.gid" file it will create a 30 day license
// along with an "install.gid" hidden file in the product directory.
// If no license key exists and there IS an "install.gid" file in the product directory,
// the user will be prompted to enter a valid license key.
//
//
// If a license exists it will check the validity of the license by....
// If the license is type "non expiring", the application will proceeed normally.
// If the license is type "expiring", it will check to see if the license has expired.
// If the license has expired, a dialog box will appear, prompting the user to
// enter a valid license.
// If no valid license is entered, then the application will exit.
// In addition, a dialog box will be available from the help screen to enable the user
// to enter in additional licenses
class Registration
{
public:
virtual ~Registration();
static Registration &getInstance();
bool hasLicense(void)const;
bool hasGID(void)const;
bool getLicense(License &license)const;
bool create30DayLicense(void)const;
bool create15DayLicense(void)const;
bool createPermanentLicense(void)const;
bool createLicense(int days)const;
bool removeLicense(void);
bool applyLicense(const String &uuencodedLicense);
bool applyLicense(Block<String> &strLicenseLines);
License generatePermanentLicense(void)const; // return a permanent license
private:
Registration();
static SmartPointer<Registration> smRegistration;
String mRegistrationKeyName;
String mSettingsLicenseKey;
RegKey mRegKeyRegistration;
};
#endif