NDEVR
API Documentation
BuildActionProgramLogic

Custom model logic that manages build action definitions, providing UI integration for build actions including ribbon buttons, tree widgets, context menus, and property dialogs. More...

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

Public Member Functions

 BuildActionProgramLogic (QTWindowManager *window_manager, QTModelManager *manager)
 Constructs the build action program logic.
bool canBeHandledBySelectionWidget () const override
 Returns whether this model type can be handled by the generic selection widget.
ButtoncreateButton (const BuildActionDefinition &definition)
 Creates a button that opens the property dialog for the given build action.
void setupUI (const BuildActionDefinition &definition)
 Sets up ribbon and tree buttons for the given build action definition.
Public Member Functions inherited from CustomModelLogic
virtual const UUIDid () const
 Returns the unique identifier for this custom model logic instance.
virtual void registerAll ()
 Registers all callbacks (context menu, tree widgets, dialog, NDV) with the manager.
const Buffer< String > & typeNames () const
 Returns the type names handled by this custom model logic.

Protected Member Functions

virtual void addMenuItems (Model &model, QTModelManager *, QMenu &menu, const Buffer< UUID > &, const SelectionInfo &) override
 Override to add custom context menu items when a model of this type is selected.
void createAndShowChildDefinition (Model &model, PopupInfo info)
 Creates a child build action definition under the given model and shows its editor.
void executeMenuItems (Model &model, QTModelManager *manager, QAction *action, const Buffer< UUID > &, const SelectionInfo &, PopupInfo info) override
 Override to handle execution of custom context menu actions.
virtual void setTreeWidgetsForSelection (const Model &model, Buffer< QWidget * > &widgets, SceneTree *tree) override
 Override to provide custom tree widgets shown when the model is selected.
virtual void setupModel (Model &model) override
 Override to perform setup when a model of this type is read from an NDV file.
virtual void setupPropertiesDialog (DesignObjectDialog *dialog, const DynamicPointer< QTDesignObject > &object) override
 Override to customize property dialogs when objects of this type are created.
Protected Member Functions inherited from CustomModelLogic
 CustomModelLogic (QTModelManager *manager, const Buffer< String > &type_names)
 Constructs a CustomModelLogic for multiple model type names.
 CustomModelLogic (QTModelManager *manager, const StringView &type_name)
 Constructs a CustomModelLogic for a single model type name.
virtual ~CustomModelLogic ()
 Destructor.
ContextMenuCallbackcontextMenuCallback ()
 Returns the context menu callback for this model logic.
CustomDesignObjectDialogSetupCallback * dialogSetupCallback ()
 Returns the dialog setup callback for this model logic.
NDVSetupCallbackndvFileReadLogic ()
 Returns the NDV file read setup callback for this model logic.
void setSorter (const std::function< bool(const Model &a, const Model &b)> &sort_function)
 Sets a custom sorting function for models of this type.
virtual void setupUI (WindowManager *)
 Override to set up custom UI elements for this model type.
CustomTreeWidgetstreeWidgetCallback ()
 Returns the tree widget callback for this model logic.

Protected Attributes

Dictionary< UUID, Buffer< QPointer< Button > > > m_buttons
 Maps action UUIDs to their UI buttons.
QAction * m_create_child_action = nullptr
 Context menu action to create a child action.
Buttonm_create_child_button = nullptr
 Create-child button for the tree widget.
QAction * m_create_new_action_after = nullptr
 Context menu action to insert an action after.
QAction * m_create_new_action_before = nullptr
 Context menu action to insert an action before.
Model m_last_model
 The most recently selected model.
Buttonm_play_button = nullptr
 Play button for the tree widget.
QAction * m_run_menu_action = nullptr
 Context menu action to run the build action.
QTWindowManagerm_window_manager
 The window manager for UI operations.
Protected Attributes inherited from CustomModelLogic
ContextMenuCallbackm_custom_context_menu = nullptr
 Callback for custom context menu actions.
CustomDesignObjectDialogSetupCallback * m_dialog_callback = nullptr
 Callback for customizing property dialogs.
UUID m_id
 The unique identifier for this logic instance.
QTModelManagerm_manager
 The model manager providing data context.
NDVSetupCallbackm_ndv_setup_callback = nullptr
 Callback for NDV file read setup.
CustomModelSorter * m_sorter = nullptr
 Custom sorting logic for the model type.
CustomTreeWidgetsm_tree_button_menu = nullptr
 Callback for custom tree selection widgets.
Buffer< Stringm_type_names
 The model type names handled by this logic.

Detailed Description

Custom model logic that manages build action definitions, providing UI integration for build actions including ribbon buttons, tree widgets, context menus, and property dialogs.

Definition at line 23 of file BuildActionProgramLogic.h.

Constructor & Destructor Documentation

◆ BuildActionProgramLogic()

BuildActionProgramLogic::BuildActionProgramLogic ( QTWindowManager * window_manager,
QTModelManager * manager )
inline

Constructs the build action program logic.

Parameters
[in]window_managerThe window manager for UI integration.
[in]managerThe model manager for data access.

Definition at line 29 of file BuildActionProgramLogic.h.

References CustomModelLogic::CustomModelLogic(), and BuildActionDefinition::TypeName().

Member Function Documentation

◆ addMenuItems()

virtual void BuildActionProgramLogic::addMenuItems ( Model & ,
QTModelManager * ,
QMenu & ,
const Buffer< UUID > & ,
const SelectionInfo &  )
inlineoverrideprotectedvirtual

Override to add custom context menu items when a model of this type is selected.

Parameters
[in]modelThe model that was right-clicked (unused parameter name).
[in]managerThe model manager (unused parameter name).
[in]menuThe context menu to populate (unused parameter name).
[in]idsThe UUIDs of selected objects (unused parameter name).
[in]infoThe selection context information (unused parameter name).

Reimplemented from CustomModelLogic.

Definition at line 104 of file BuildActionProgramLogic.h.

References BuildActionDefinition::action(), e_file_loop, e_index_loop, e_process_files, e_variable_loop, e_workflow, QTIconManager::GetIconResourceBlocking(), Model::getParent(), DesignObject::isValid(), m_create_child_action, m_create_new_action_after, m_create_new_action_before, and m_run_menu_action.

◆ canBeHandledBySelectionWidget()

bool BuildActionProgramLogic::canBeHandledBySelectionWidget ( ) const
inlineoverridevirtual

Returns whether this model type can be handled by the generic selection widget.

Returns
Always false; build actions use custom dialogs.

Reimplemented from CustomModelLogic.

Definition at line 61 of file BuildActionProgramLogic.h.

◆ createAndShowChildDefinition()

void BuildActionProgramLogic::createAndShowChildDefinition ( Model & model,
PopupInfo info )
inlineprotected

Creates a child build action definition under the given model and shows its editor.

Parameters
[in]modelThe parent model to add the child to.
[in]infoPopup info for dialog display.

Definition at line 220 of file BuildActionProgramLogic.h.

References BuildActionDefinition::createChildBuildDefinition(), e_object_creation, guid, and CustomModelLogic::m_manager.

Referenced by executeMenuItems(), and setTreeWidgetsForSelection().

◆ createButton()

Button * BuildActionProgramLogic::createButton ( const BuildActionDefinition & definition)
inline

Creates a button that opens the property dialog for the given build action.

Parameters
[in]definitionThe build action definition.
Returns
Pointer to the newly created button.

Definition at line 47 of file BuildActionProgramLogic.h.

References Model::displayName(), DesignObject::get(), DesignObject::getIcon(), guid, and m_buttons.

Referenced by setupUI().

◆ executeMenuItems()

void BuildActionProgramLogic::executeMenuItems ( Model & ,
QTModelManager * ,
QAction * ,
const Buffer< UUID > & ,
const SelectionInfo & ,
PopupInfo  )
inlineoverrideprotectedvirtual

Override to handle execution of custom context menu actions.

Parameters
[in]modelThe model the action applies to (unused parameter name).
[in]managerThe model manager (unused parameter name).
[in]actionThe triggered action (unused parameter name).
[in]idsThe UUIDs of selected objects (unused parameter name).
[in]infoThe selection context information (unused parameter name).
[in]originThe popup origin for positioning dialogs (unused parameter name).

Reimplemented from CustomModelLogic.

Definition at line 134 of file BuildActionProgramLogic.h.

References QTModelManager::addModel(), createAndShowChildDefinition(), Model::createChild(), BuildActionDefinition::defaultLogName(), e_object_creation, BuildActionDefinition::executeThreaded(), DesignObject::get(), Model::getChildIndex(), LogManager::getLog(), Model::getParent(), guid, DesignObject::isValid(), DesignObjectLookup::lockPtr(), QTModelManager::logManager(), m_create_child_action, m_create_new_action_after, m_create_new_action_before, m_last_model, m_run_menu_action, QTModelManager::ShowProperties(), Model::updateModifiedTime(), and DesignObjectLookup::writeLock().

◆ setTreeWidgetsForSelection()

virtual void BuildActionProgramLogic::setTreeWidgetsForSelection ( const Model & ,
Buffer< QWidget * > & ,
SceneTree *  )
inlineoverrideprotectedvirtual

Override to provide custom tree widgets shown when the model is selected.

Parameters
[in]modelThe selected model (unused parameter name).
[in]widgetsBuffer to populate with custom widgets (unused parameter name).
[in]treeThe scene tree requesting the widgets (unused parameter name).

Reimplemented from CustomModelLogic.

Definition at line 180 of file BuildActionProgramLogic.h.

References BuildActionDefinition::action(), Buffer< t_type, t_memory_manager >::add(), createAndShowChildDefinition(), BuildActionDefinition::defaultLogName(), e_file_loop, e_index_loop, e_process_files, Button::e_small, e_variable_loop, e_workflow, BuildActionDefinition::executeThreaded(), LogManager::getLog(), DesignObjectLookup::lockPtr(), QTModelManager::logManager(), m_create_child_button, m_last_model, m_play_button, and SceneTree::manager().

◆ setupModel()

virtual void BuildActionProgramLogic::setupModel ( Model & )
inlineoverrideprotectedvirtual

Override to perform setup when a model of this type is read from an NDV file.

Parameters
[in]modelThe model being set up (unused parameter name).

Reimplemented from CustomModelLogic.

Definition at line 170 of file BuildActionProgramLogic.h.

References application_locked, DesignObject::is(), model_color, DesignObject::set(), setupUI(), type, and BuildActionDefinition::TypeName().

◆ setupPropertiesDialog()

virtual void BuildActionProgramLogic::setupPropertiesDialog ( DesignObjectDialog * ,
const DynamicPointer< QTDesignObject > &  )
inlineoverrideprotectedvirtual

Override to customize property dialogs when objects of this type are created.

Parameters
[in]dialogThe design object dialog to modify (unused parameter name).
[in]objectThe design object being edited (unused parameter name).

Reimplemented from CustomModelLogic.

Definition at line 163 of file BuildActionProgramLogic.h.

References DesignObjectDialog::addTabDialog().

◆ setupUI()

void BuildActionProgramLogic::setupUI ( const BuildActionDefinition & definition)
inline

Sets up ribbon and tree buttons for the given build action definition.

Parameters
[in]definitionThe build action definition to create UI for.

Definition at line 67 of file BuildActionProgramLogic.h.

References RibbonSubGroup::addButton(), createButton(), DesignObject::get(), guid, m_buttons, m_window_manager, BuildActionUIDefinition::ribbon_group, BuildActionUIDefinition::ribbon_sub_group, BuildActionUIDefinition::show_at_bottom_of_tree, BuildActionUIDefinition::show_on_ribbon, and BuildActionDefinition::uiDefinition().

Referenced by setupModel().


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