LicenseSpring C++ SDK
Easily add Software Licensing to your application
LicenseManager.h
Go to the documentation of this file.
1 #ifndef LS_LICENSE_MANAGER_H
2 #define LS_LICENSE_MANAGER_H
3 
4 #ifdef _MSC_VER
5 #pragma once
6 #pragma warning(push)
7 #pragma warning(disable : 4251)
8 #endif
9 
10 #include "BaseManager.h"
11 
12 namespace LicenseSpring
13 {
19 {
20 public:
21  using ptr_t = std::shared_ptr<LicenseManager>;
22 
29  static LicenseManager::ptr_t create(
30  Configuration::ptr_t config, LicenseStorage::ptr_t storage = nullptr);
31 
35 
38  ~LicenseManager() override;
39 
64  LicenseID getTrialLicense(
65  Customer::ptr_t user = nullptr, const std::string &licensePolicy = std::string());
66 
83  LicenseID getTrialLicense(const std::string &userEmail);
84 
100  std::string getSSOUrl(const std::string &accountCode = std::string(), bool useAuthCode = true);
101 
106  std::string getAirGapActivationCode(
107  const std::string &initializationCode, const std::string &licenseKey);
108 
120  const License::ptr_t activateAirGapLicense(const std::string &confirmationCode,
121  const std::wstring &policyPath, const std::string &licenseKey, uint32_t policyId);
122 
146  const License::ptr_t activateLicense(const LicenseID &licenseID);
147 
171  const License::ptr_t activateLicense(
172  const LicenseID &licenseID, const std::vector<DeviceVariable> &deviceVariables);
173 
200  const License::ptr_t activateLicense(const std::string &authData,
201  const std::string &accountCode = std::string(), bool useAuthCode = true);
202 
215  const License::ptr_t activateLicenseOffline(
216  const std::wstring &activationResponseFile = std::wstring());
217 
231  const License::ptr_t relinkLicense(
232  DeviceIDAlgorithm deviceIdAlgorithm, const std::string &userPassword = "");
233 
247  bool changePassword(
248  const std::string &user, const std::string &password, const std::string &newPassword);
249 
263  std::vector<std::string> getVersionList(
264  const LicenseID &licenseID, const InstallFileFilter &filter = InstallFileFilter());
265 
282  InstallationFile::ptr_t getInstallationFile(const LicenseID &licenseID,
283  const std::string &version = std::string(),
284  const InstallFileFilter &filter = InstallFileFilter());
285 
292  std::wstring createOfflineActivationFile(
293  const LicenseID &licenseID, const std::wstring &activationRequestFile = std::wstring());
294 
303  std::wstring createOfflineActivationFile(const LicenseID &licenseID,
304  const std::vector<DeviceVariable> &deviceVariables,
305  const std::wstring &activationRequestFile = std::wstring());
306 
315  bool isOnline(bool throwExceptions = false) const;
316 
329  std::vector<LicenseUser::ptr_t> getLicenseUsers(const Customer &customer);
330 
335  std::vector<LicenseUser::ptr_t> getLicenseUsers(const std::string &customerEmail);
336 
343  std::vector<UserLicensesData::ptr_t> getUserLicenses(
344  const std::string &username, const std::string &password);
345 };
346 } // namespace LicenseSpring
347 
348 #ifdef _MSC_VER
349 #pragma warning(pop)
350 #endif
351 
352 #endif // LS_LICENSE_MANAGER_H
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:21
std::shared_ptr< LicenseStorage > ptr_t
Base class for license management.
Definition: BaseManager.h:24
Class that encapsulates information about a customer.
Definition: Customer.h:17
std::shared_ptr< License > ptr_t
Definition: License.h:37
std::shared_ptr< LicenseManager > ptr_t
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:114
std::shared_ptr< Customer > ptr_t
Definition: Customer.h:20
#define LS_API
Definition: APIDef.h:23
Class that represents License identifier.
Definition: LicenseID.h:20
Class for performing basic requests to LicenseSpring backend and managing licenses.
std::shared_ptr< InstallationFile > ptr_t
Helper struct for filtering installation files by environment and channel.