NDEVR
API Documentation
Module

Base class for extensions, typically added as external DLL's that can modify or enhance the behavior of the software. More...

Inheritance diagram for Module:
[legend]
Collaboration diagram for Module:
[legend]

Public Types

enum  ModuleType : uint04 { e_application , e_utility , e_library_dependency , e_undefined }
 Categorizes the role a module plays within the application. More...

Public Member Functions

 Module ()
 Constructs a default Module with no name or library.
 Module (const StringView &name)
 Constructs a Module with the given name.
 Module (const StringView &name, const File &library)
 Constructs a Module with the given name and library file.
void callModuleFunction (const StringView &function) const
 Invokes a named hook function within this module.
void callModuleFunction (const StringView &function, QTModelManager *model_manager, QTWindowManager *window_manager) const
 Invokes a named UI hook function within this module, passing the model and window managers.
void defineModuleResources (ModuleResourceManager *resources) const
 Asks the module to declare its required resources via the given resource manager.
void initialize ()
 Loads the dynamic library and resolves the module hook functions.
bool isValid () const
 Checks whether this module has a valid loaded library.

Public Attributes

String activation_id
 Identifier used for license activation checks.
bool allow_deferred_loading = false
 Whether this module can be loaded asynchronously as a WASM side module.
bool allow_user_toggle_active = false
 Whether the user is allowed to enable or disable this module.
TranslatedString description
 User-facing description of the module.
TranslatedString display_name
 User-facing display name of the module.
String icon
 Name or path of the icon associated with this module.
bool is_active = true
 Whether the module is currently active.
File library
 Path to the dynamic library file for this module.
String license_agreement
 License agreement text for the module.
Dictionary< String, void * > loaded_functions
 Cached map of hook function names to their resolved addresses.
String name
 Internal identifier for the module.
ModuleType type = ModuleType::e_undefined
 The role category of this module.
String version
 Version string of the module.
String website
 URL to the module's website or documentation.

Protected Attributes

void * module_ptr = nullptr
 Opaque pointer to the loaded dynamic library handle.

Detailed Description

Base class for extensions, typically added as external DLL's that can modify or enhance the behavior of the software.


Definition at line 72 of file ModuleManager.h.

Member Enumeration Documentation

◆ ModuleType

Categorizes the role a module plays within the application.

Enumerator
e_application 

Module serves as an application entry-point.

e_utility 

Module provides utility or tool functionality.

e_library_dependency 

Module wraps a third-party library dependency.

e_undefined 

Module type has not been specified.

Definition at line 77 of file ModuleManager.h.

Constructor & Destructor Documentation

◆ Module() [1/2]

Module::Module ( const StringView & name)

Constructs a Module with the given name.

Parameters
[in]nameThe internal identifier for the module.

References name.

◆ Module() [2/2]

Module::Module ( const StringView & name,
const File & library )

Constructs a Module with the given name and library file.

Parameters
[in]nameThe internal identifier for the module.
[in]libraryThe dynamic library file to load for this module.

References library, and name.

Member Function Documentation

◆ callModuleFunction() [1/2]

void Module::callModuleFunction ( const StringView & function) const

Invokes a named hook function within this module.

Parameters
[in]functionThe name of the hook function to call.

◆ callModuleFunction() [2/2]

void Module::callModuleFunction ( const StringView & function,
QTModelManager * model_manager,
QTWindowManager * window_manager ) const

Invokes a named UI hook function within this module, passing the model and window managers.

Parameters
[in]functionThe name of the hook function to call.
[in]model_managerThe application model manager.
[in]window_managerThe application window manager.

◆ defineModuleResources()

void Module::defineModuleResources ( ModuleResourceManager * resources) const

Asks the module to declare its required resources via the given resource manager.

Parameters
[in]resourcesThe resource manager to populate with module dependencies.

◆ isValid()

bool Module::isValid ( ) const

Checks whether this module has a valid loaded library.

Returns
True if the module is valid and usable, false otherwise.

The documentation for this struct was generated from the following file: