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 
65  LicenseID getTrialLicense(
66  Customer::ptr_t user = nullptr, const std::string &licensePolicy = std::string());
67 
85  LicenseID getTrialLicense(const std::string &userEmail);
86 
103  std::string getSSOUrl(const std::string &accountCode = std::string(), bool useAuthCode = true);
104 
109  std::string getAirGapActivationCode(
110  const std::string &initializationCode, const std::string &licenseKey);
111 
123  const License::ptr_t activateAirGapLicense(const std::string &confirmationCode,
124  const std::wstring &policyPath, const std::string &licenseKey, uint32_t policyId);
125 
150  const License::ptr_t activateLicense(const LicenseID &licenseID);
151 
176  const License::ptr_t activateLicense(
177  const LicenseID &licenseID, const std::vector<DeviceVariable> &deviceVariables);
178 
206  const License::ptr_t activateLicense(const std::string &authData,
207  const std::string &accountCode = std::string(), bool useAuthCode = true);
208 
221  const License::ptr_t activateLicenseOffline(
222  const std::wstring &activationResponseFile = std::wstring());
223 
238  const License::ptr_t relinkLicense(
239  DeviceIDAlgorithm deviceIdAlgorithm, const std::string &userPassword = "");
240 
255  bool changePassword(
256  const std::string &user, const std::string &password, const std::string &newPassword);
257 
272  std::vector<std::string> getVersionList(
273  const LicenseID &licenseID, const InstallFileFilter &filter = InstallFileFilter());
274 
292  InstallationFile::ptr_t getInstallationFile(const LicenseID &licenseID,
293  const std::string &version = std::string(),
294  const InstallFileFilter &filter = InstallFileFilter());
295 
302  std::wstring createOfflineActivationFile(
303  const LicenseID &licenseID, const std::wstring &activationRequestFile = std::wstring());
304 
313  std::wstring createOfflineActivationFile(const LicenseID &licenseID,
314  const std::vector<DeviceVariable> &deviceVariables,
315  const std::wstring &activationRequestFile = std::wstring());
316 
325  bool isOnline(bool throwExceptions = false) const;
326 
340  std::vector<LicenseUser::ptr_t> getLicenseUsers(const Customer &customer);
341 
346  std::vector<LicenseUser::ptr_t> getLicenseUsers(const std::string &customerEmail);
347 
354  std::vector<UserLicensesData::ptr_t> getUserLicenses(
355  const std::string &username, const std::string &password);
356 };
357 } // namespace LicenseSpring
358 
359 #ifdef _MSC_VER
360 #pragma warning(pop)
361 #endif
362 
363 #endif // LS_LICENSE_MANAGER_H
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:21
LicenseSpring::InstallFileFilter
Helper struct for filtering installation files by environment and channel.
Definition: InstallationFile.h:18
LicenseSpring::LicenseStorage::ptr_t
std::shared_ptr< LicenseStorage > ptr_t
Definition: LicenseStorage.h:20
LicenseSpring::Customer
Class that encapsulates information about a customer.
Definition: Customer.h:17
LicenseSpring::LicenseID
Class that represents License identifier.
Definition: LicenseID.h:20
BaseManager.h
LicenseSpring
Definition: BaseManager.h:16
DeviceIDAlgorithm
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:118
LicenseSpring::License::ptr_t
std::shared_ptr< License > ptr_t
Definition: License.h:37
LicenseSpring::LicenseManager
Class for performing basic requests to LicenseSpring backend and managing licenses.
Definition: LicenseManager.h:18
LS_API
#define LS_API
Definition: APIDef.h:23
LicenseSpring::LicenseManager::ptr_t
std::shared_ptr< LicenseManager > ptr_t
Definition: LicenseManager.h:21
LicenseSpring::BaseManager
Base class for license management.
Definition: BaseManager.h:24
LicenseSpring::Customer::ptr_t
std::shared_ptr< Customer > ptr_t
Definition: Customer.h:20
LicenseSpring::InstallationFile::ptr_t
std::shared_ptr< InstallationFile > ptr_t
Definition: InstallationFile.h:59