MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
ShowcaseLicense.hpp
1 #pragma once
2 
3 #include "Export.hpp"
4 
5 #include <Radiant/Singleton.hpp>
6 #include <Sealed/RuntimeLicenseCache.hpp>
7 
8 namespace Showcase
9 {
10  class SHOWCASE_API ShowcaseLicense
11  {
12  DECLARE_SINGLETON(ShowcaseLicense);
13 
14  public:
15  ShowcaseLicense();
16 
20  bool check(bool allowWizard);
21 
24  bool hasExpired() const;
25 
27  bool isWarnOnly() const;
28 
31  QDate lastWorkingDate() const;
32 
34  QDate expiryDate() const {return m_expiryDate;}
35 
37  int maxScreenWidth() const {return m_maxWidth;}
38 
40  int maxScreenHeight() const {return m_maxHeight;}
41 
43  int maxScreenDiagonal() const {return m_maxDiagonal;}
44 
46  bool isCodiceEnabled() const {return m_enableCodice;}
47 
50  static bool isValidValue(float value, float limit);
51  static bool isValidValue(int value, int limit);
52 
53  private:
54  void getLicensedValues(Sealed::License::CheckedFeatures & checkedFeatures);
55 
58  static void showInvalidLicenceDialog(const Sealed::RuntimeLicenseCache::LicenseErrorTexts & licenseErrorTexts);
59 
61  bool hasExpiredWithWarning(Sealed::License::CheckedFeatures & featureResults);
62 
63  bool m_isLicensed;
64  bool m_warnOnly;
65  bool m_hasExpired;
66  Sealed::IntFeatures m_features;
67  QDate m_releaseDate;
68  QDate m_expiryDate;
69  int m_maxWidth;
70  int m_maxHeight;
71  int m_maxDiagonal;
72  bool m_enableCodice;
73  };
74  typedef std::shared_ptr<ShowcaseLicense> ShowcaseLicensePtr;
75 }