ImagingTools Core SDK
Public Types | Public Member Functions | List of all members
imtlic::ILicenseDefinitionabstract

Interface for license definition information. More...

#include <ILicenseDefinition.h>

Inheritance diagram for imtlic::ILicenseDefinition:
imtlic::CLicenseDefinition imtlic::ILicenseInstance imtlic::CLicenseInstance imtlic::CLicenseInstance

Public Types

enum  MetaInfoTypes { MIT_LICENSE_NAME = idoc::IDocumentMetaInfo::MIT_USER + 1 , MIT_LICENSE_ID , MIT_LICENSE_DESCRIPTION , MIT_PRODUCT_ID }
 

Public Member Functions

virtual QString GetLicenseName () const =0
 
virtual void SetLicenseName (const QString &licenseName)=0
 
virtual QByteArray GetLicenseId () const =0
 
virtual void SetLicenseId (const QByteArray &licenseId)=0
 
virtual QString GetLicenseDescription () const =0
 
virtual void SetLicenseDescription (const QString &licenseDescription)=0
 
virtual QByteArray GetProductId () const =0
 
virtual void SetProductId (const QByteArray &productId)=0
 
virtual QByteArrayList GetDependencies () const =0
 
virtual void SetDependencies (QByteArrayList dependencies)=0
 
virtual FeatureInfos GetFeatureInfos () const =0
 
virtual void SetFeatureInfos (const FeatureInfos &featureInfos)=0
 

Detailed Description

Interface for license definition information.

A License Definition represents a specific license type that can be purchased and activated for a product. It serves as a "container of Features" - defining which features will be unlocked when this license is activated.

Conceptual Model

License Definition as Feature Container:**

Product "Office Suite"
├─ License "Basic"
│ └─ Unlocks: [Document Editing, Basic Formatting]
├─ License "Professional"
│ └─ Unlocks: [Document Editing, Advanced Formatting, Spreadsheet]
└─ License "Enterprise"
└─ Unlocks: [All Features]

Relationship Model:**

Product (definition)
├─ Contains: Features (all capabilities)
└─ Contains: License Definitions (feature subsets)
└─ Each License Definition → unlocks specific Features
Therefore: Product = Container of License Definitions = Container of Features

License Lifecycle

  1. Definition Phase:**

Create License Definition with unique ID

License Type Patterns

Tiered Licensing:**

Basic License:
└─ Core features only
Professional License:
└─ Core + Advanced features
Enterprise License:
└─ All features + Premium support

Feature-Based Licensing:**

Analytics Module License:
└─ Unlocks: Analytics features only
Export Module License:
└─ Unlocks: Export features only
Combined License:
└─ Unlocks: Analytics + Export

Hardware-Bound Licensing:**

Single-Machine License:
└─ Tied to specific hardware ID
Floating License:
└─ Can be moved between machines
Site License:
└─ Unlimited machines at location

License Dependencies

Licenses can depend on other licenses:

Enterprise License
└─ Depends on: Professional License
└─ Depends on: Basic License

Dependency Validation:**

  1. Check if license is in active licenses list
  2. Check if all dependent licenses are also active
  3. Recursively validate transitive dependencies
  4. License valid only if all dependencies satisfied

    Use Cases:**

Feature Management

Adding Features to License:**

ILicenseDefinitionSharedPtr license = ...;
license->AddFeature("feature-analytics-id", "Advanced Analytics");
license->AddFeature("feature-export-id", "PDF Export");

Querying License Features:**

QVector<FeatureInfo> features = license->GetFeatures();
for (const FeatureInfo& feature : features) {
qDebug() << "Feature:" << feature.name << "ID:" << feature.id;
}

Checking Feature Inclusion:**

bool hasAnalytics = license->HasFeature("feature-analytics-id");
if (hasAnalytics) {
// Enable analytics functionality
}

Meta-Information

License Definitions support meta-information:

License Validation

Validation Steps:**

  1. Parse license file or activation key
  2. Verify cryptographic signature
  3. Check license ID against catalog
  4. Validate product ID matches
  5. Check expiration date (for instances)
  6. Verify hardware binding (if applicable)
  7. Validate dependencies are satisfied
  8. Unlock features if valid

    License Status:**

Usage Examples

Creating a License Definition:**

ILicenseDefinitionSharedPtr license = ...; // From factory
license->SetLicenseId("license-professional");
license->SetLicenseName("Professional License");
license->SetLicenseDescription("Full-featured professional edition");
license->SetProductId("product-office-suite");
// Add features
license->AddFeature("feature-core-editing", "Core Editing");
license->AddFeature("feature-advanced-format", "Advanced Formatting");
license->AddFeature("feature-spreadsheet", "Spreadsheet Module");
// Set dependencies
QByteArrayList deps;
deps << "license-basic"; // Requires basic license
license->SetDependsOnLicenseIds(deps);

Checking License Features:**

// Check if specific feature is included
if (license->HasFeature("feature-advanced-format")) {
qDebug() << "Advanced formatting included";
}
// Get all features
QVector<FeatureInfo> features = license->GetFeatures();
qDebug() << "License includes" << features.size() << "features";
// Check dependencies
QByteArrayList deps = license->GetDependsOnLicenseIds();
for (const QByteArray& depId : deps) {
// Validate dependency license is available
}

Creating License Instance:**

// License Definition → License Instance
ILicenseDefinitionSharedPtr definition = ...; // Purchased license type
ILicenseInstanceSharedPtr instance = ...; // From factory
// Copy definition properties
instance->SetLicenseId(definition->GetLicenseId());
instance->SetLicenseName(definition->GetLicenseName());
// Add temporal properties
instance->SetExpirationDate(QDate::currentDate().addYears(1));
instance->SetGoodwillPeriodDays(30);

Best Practices

License Design:**

Related Interfaces

See also
IFeatureInfo, IProductInfo, ILicenseInstance, IProductLicensingInfo

Definition at line 280 of file ILicenseDefinition.h.

Member Enumeration Documentation

◆ MetaInfoTypes

Enumerator
MIT_LICENSE_NAME 

License Name given as QString.

MIT_LICENSE_ID 

License-ID given as QByteArray.

MIT_LICENSE_DESCRIPTION 

License Description given as QString.

MIT_PRODUCT_ID 

Product-ID given as QByteArray.

Definition at line 283 of file ILicenseDefinition.h.

Member Function Documentation

◆ GetDependencies()

virtual QByteArrayList imtlic::ILicenseDefinition::GetDependencies ( ) const
pure virtual

Get the list of licenses that this license depends on. Dependent licenses must be activated before this license can be used.

Returns
List of license IDs that this license depends on

◆ GetFeatureInfos()

virtual FeatureInfos imtlic::ILicenseDefinition::GetFeatureInfos ( ) const
pure virtual

Get the list of features that this license unlocks. This defines which product capabilities are enabled when this license is activated.

Returns
List of feature information (ID and name) enabled by this license

◆ GetLicenseDescription()

virtual QString imtlic::ILicenseDefinition::GetLicenseDescription ( ) const
pure virtual

Get the detailed description of the license.

Returns
Description explaining what this license provides

◆ GetLicenseId()

virtual QByteArray imtlic::ILicenseDefinition::GetLicenseId ( ) const
pure virtual

Get the license ID used for identification during license validation. This ID is used by the rights provider system to check license validity.

Returns
Unique identifier for this license type
See also
iauth::IRightsProvider

◆ GetLicenseName()

virtual QString imtlic::ILicenseDefinition::GetLicenseName ( ) const
pure virtual

Get the human-readable name of the license.

Returns
Display name of this license type

◆ GetProductId()

virtual QByteArray imtlic::ILicenseDefinition::GetProductId ( ) const
pure virtual

Get the product ID that this license belongs to.

Returns
ID of the product this license is associated with

◆ SetDependencies()

virtual void imtlic::ILicenseDefinition::SetDependencies ( QByteArrayList  dependencies)
pure virtual

Set the license dependencies.

Parameters
dependenciesList of license IDs that must be active for this license to work

◆ SetFeatureInfos()

virtual void imtlic::ILicenseDefinition::SetFeatureInfos ( const FeatureInfos &  featureInfos)
pure virtual

Set the list of features that this license unlocks.

Parameters
featureInfosList of features enabled by this license

◆ SetLicenseDescription()

virtual void imtlic::ILicenseDefinition::SetLicenseDescription ( const QString &  licenseDescription)
pure virtual

Set the description of the license.

Parameters
licenseDescriptionDetailed description of the license

◆ SetLicenseId()

virtual void imtlic::ILicenseDefinition::SetLicenseId ( const QByteArray &  licenseId)
pure virtual

Set the unique ID of the license.

Parameters
licenseIdUnique identifier for license validation

◆ SetLicenseName()

virtual void imtlic::ILicenseDefinition::SetLicenseName ( const QString &  licenseName)
pure virtual

Set the name of the license.

Parameters
licenseNameHuman-readable name for this license

◆ SetProductId()

virtual void imtlic::ILicenseDefinition::SetProductId ( const QByteArray &  productId)
pure virtual

Set the product ID that this license belongs to.

Parameters
productIdID of the associated product