Example

Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
CLicenseManager.h File Reference
`#include "Capsule/CClient.h"`
`#include "Capsule/CDefinesPrivate.h"`
`#include "Capsule/CDevice.h"`
Include dependency graph for CLicenseManager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Typedefs
typedef enum clCLicenseError | clCLicenseError
| License error.
typedef void(* | clCLicenseManagerHandlerLicenseVerified) (clCLicenseManager, bool, clCLicenseError)

## Enumerations
enum | clCLicenseError { clC_LicenseError_OK , clC_LicenseError_InvalidOrExpiredKey , clC_LicenseError_InvalidKeyFormatOrDeviceSerial , clC_LicenseError_LicenseServiceNotFound , clC_LicenseError_LicenseServiceInaccessible , clC_LicenseError_GracePeriodExpired }
| License error. More...

## Functions
| CLC_CLASS_WN (LicenseManagerPrivate, clCLicenseManager)
CL_DLL clCLicenseManager | clCClient_GetLicenseManager (clCClient client) NOEXCEPT
| Get license manager instance.
void | clCLicenseManager_VerifyLicense (clCLicenseManager licenseManager, const char *licenseKey, clCDevice device) NOEXCEPT
| Request license verification.
bool | clCLicenseManager_IsLicenseValid (clCLicenseManager licenseManager) NOEXCEPT
| Check whether the license is valid.
| CLC_STRUCT (clCLicenseManagerDelegateLicenseVerified)
CL_DLL void | clCLicenseManagerDelegateLicenseVerified_Set (clCLicenseManagerDelegateLicenseVerified delegate, clCLicenseManagerHandlerLicenseVerified callback) NOEXCEPT
| Set callback for license verified event.
CL_DLL clCLicenseManagerDelegateLicenseVerified | clCLicenseManager_GetOnLicenseVerifiedEvent (clCLicenseManager licenseManager) NOEXCEPT
| Get delegate for license verified event.

## Typedef Documentation

## ◆ clCLicenseError

typedef enum clCLicenseError clCLicenseError

License error.

## ◆ clCLicenseManagerHandlerLicenseVerified

typedef void(* clCLicenseManagerHandlerLicenseVerified) (clCLicenseManager, bool, clCLicenseError)

## Enumeration Type Documentation

## ◆ clCLicenseError

enum clCLicenseError

License error.

Enumerator
clC_LicenseError_OK | No error.
clC_LicenseError_InvalidOrExpiredKey | License key is invalid or expired. Check your internet connection, and try again. Contact reseller manager.
clC_LicenseError_InvalidKeyFormatOrDeviceSerial | Invalid license key format or device serial number.
clC_LicenseError_LicenseServiceNotFound | Cannot access license service, license service not found.
clC_LicenseError_LicenseServiceInaccessible | Cannot access license service, license service is inaccessible.
clC_LicenseError_GracePeriodExpired | Unexpected license verification result.

## Function Documentation

## ◆ CLC_CLASS_WN()

CLC_CLASS_WN | ( | LicenseManagerPrivate | ,
|  | clCLicenseManager |
| ) |  |

## ◆ CLC_STRUCT()

CLC_STRUCT | ( | clCLicenseManagerDelegateLicenseVerified |  | ) |

## ◆ clCClient_GetLicenseManager()

CL_DLL clCLicenseManager clCClient_GetLicenseManager | ( | clCClient | client | ) |

Get license manager instance.

Only one instance of the `clCLicenseManager` class per client is allowed. The second attempt to get license manager will result in `nullptr`.

Parameters

  client | pointer to a clCClient instance

Returns
  license manager instance

## ◆ clCLicenseManager_GetOnLicenseVerifiedEvent()

CL_DLL clCLicenseManagerDelegateLicenseVerified clCLicenseManager_GetOnLicenseVerifiedEvent | ( | clCLicenseManager | licenseManager | ) |

Get delegate for license verified event.

Parameters

  licenseManager | pointer to a clCLicenseManager instance

Returns
  license verified event delegate

## ◆ clCLicenseManager_IsLicenseValid()

bool clCLicenseManager_IsLicenseValid | ( | clCLicenseManager | licenseManager | ) |

Check whether the license is valid.

Returns
  true if the license is valid, otherwise false

## ◆ clCLicenseManager_VerifyLicense()

void clCLicenseManager_VerifyLicense | ( | clCLicenseManager | licenseManager,
|  | const char * | licenseKey,
|  | clCDevice | device
| ) |  |

Request license verification.

This method requests license verification, and when it's finished, the delegate, returned by `clCLicenseManager_GetOnLicenseVerifiedEvent` is called.

Parameters

  licenseManager | pointer to a clCLicenseManager instance
  licenseKey | license key string
  device | pointer to a clCDevice instance (necessary for retrieving serial number)

## ◆ clCLicenseManagerDelegateLicenseVerified_Set()

CL_DLL void clCLicenseManagerDelegateLicenseVerified_Set | ( | clCLicenseManagerDelegateLicenseVerified | delegate,
|  | clCLicenseManagerHandlerLicenseVerified | callback
| ) |  |

Set callback for license verified event.

The callback has the following parameters: `clCLicenseManager` is the delegate's owner, `bool` is a success flag

Parameters

  delegate | license verified delegate. Can be obtained using clCLicenseManager_GetOnLicenseVerifiedEvent method
  callback | a function which is called on event