Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
camitk::ActionExtension Class Referenceabstract

This class describes what is a generic Action extension. More...

#include <ActionExtension.h>

Public Member Functions

const ActionListgetActions ()
 get the list of actions registered y this extension
virtual QString getDescription () const =0
 returns the action extension small description (to be overriden in your ActionExtension)
QString getLocation () const
 get the file path (location of the .dll/.so/.dylib) of this plugin or the file path to the CamiTK extension file that generated this extension
virtual QString getName () const =0
 returns the action extension name (to be overriden in your ActionExtension)
virtual void init ()=0
 this method should just call registerNewAction(MyAction) for any MyAction class you need to register by this extension
void initResources ()
 Load, for the selected langage (asked to the Application), the associated .qm file.
void setLocation (const QString loc)
 set the file path (once loaded as a dynamic library)
 ~ActionExtension () override
 destructor

Protected Member Functions

 ActionExtension ()
 constructor
void registerAction (Action *)
 register an action instance

Protected Attributes

ActionList actions
 the list of actions

Detailed Description

This class describes what is a generic Action extension.

To add an ActionExtension to CamiTK core, write a new class that inherits from this class.

The following methods HAVE to be redefined in your subclass:

  • getName: return the name of your extension
  • getDescription: return a small description
  • init: a simple enough method, just call registerNewAction(MyAction) for any MyAction class inheriting from camitk::Action
See also
BasicMeshExtension For an example of an extension registering more than one action

Constructor & Destructor Documentation

◆ ActionExtension()

◆ ~ActionExtension()

camitk::ActionExtension::~ActionExtension ( )
override

destructor

References actions, and camitk::Action::getName().

Member Function Documentation

◆ getActions()

const camitk::ActionList & camitk::ActionExtension::getActions ( )

get the list of actions registered y this extension

References actions.

Referenced by init(), camitk::HotPlugExtensionManager::load(), camitk::Application::registerAllActions(), and camitk::Application::unregisterAllActions().

◆ getDescription()

◆ getLocation()

QString camitk::ActionExtension::getLocation ( ) const

get the file path (location of the .dll/.so/.dylib) of this plugin or the file path to the CamiTK extension file that generated this extension

Returns
null QString if this extension was not initialized properly

Referenced by camitk::HotPlugActionExtension::declaredActionCount(), init(), camitk::CppHotPlugActionExtension::initActions(), and initResources().

◆ getName()

◆ init()

◆ initResources()

void camitk::ActionExtension::initResources ( )

Load, for the selected langage (asked to the Application), the associated .qm file.

References CAMITK_INFO, getLocation(), and camitk::Application::getSelectedLanguage().

Referenced by init(), and camitk::ExtensionManager::loadExtension().

◆ registerAction()

void camitk::ActionExtension::registerAction ( Action * action)
protected

register an action instance

References actions.

Referenced by init(), and camitk::CppHotPlugActionExtension::initActions().

◆ setLocation()

void camitk::ActionExtension::setLocation ( const QString loc)

set the file path (once loaded as a dynamic library)

Referenced by camitk::HotPlugActionExtension::HotPlugActionExtension(), init(), and camitk::ExtensionManager::loadExtension().

Member Data Documentation

◆ actions

ActionList camitk::ActionExtension::actions
protected

The documentation for this class was generated from the following files: