FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
Loading...
Searching...
No Matches
business_logic::input::ConnectPortsInteraction Class Referencefinal

Connect ports via dragging interaction DTO. More...

#include <ConnectPortsInteraction.h>

+ Inheritance diagram for business_logic::input::ConnectPortsInteraction:
+ Collaboration diagram for business_logic::input::ConnectPortsInteraction:

Public Member Functions

bool isStarted () const
 Returns whether the interaction has started (i.e., is pending and a dragging line should be rendered)
 
void sanitize ()
 Sanitizes the interaction by removing both sides if any of them has become invalid.
 
void handleUserInteractedWith (business_logic::elements::blocks::BaseBlock *block, const business_logic::elements::structures::Port *port, business_logic::delegate::IWindowDelegate *windowDelegate, business_logic::delegate::IBlockLifecycleManagerDelegate *blockLifecycleManagerDelegate)
 
const std::optional< business_logic::elements::structures::BlocksConnectionSide > & getStartSide () const
 Gets an immutable reference to the start side.
 
const std::optional< business_logic::elements::structures::BlocksConnectionSide > & getEndSide () const
 Gets an immutable reference to the end side.
 
void resetInteraction ()
 Resets the interaction, setting both sides to std::nullopt
 
- Public Member Functions inherited from business_logic::Loggable< ConnectPortsInteraction >
 Loggable ()
 

Protected Member Functions

bool isInvalid ()
 Returns whether the interaction is invalid (i.e., one of the sides is no longer valid)
 

Protected Attributes

std::optional< business_logic::elements::structures::BlocksConnectionSidestartSide
 the first interaction side
 
std::optional< business_logic::elements::structures::BlocksConnectionSideendSide
 the second interaction side
 
- Protected Attributes inherited from business_logic::Loggable< ConnectPortsInteraction >
std::shared_ptr< spdlog::logger > logger
 

Detailed Description

Connect ports via dragging interaction DTO.

Definition at line 19 of file ConnectPortsInteraction.h.

Member Function Documentation

◆ getEndSide()

const std::optional< business_logic::elements::structures::BlocksConnectionSide > & business_logic::input::ConnectPortsInteraction::getEndSide ( ) const
inline

Gets an immutable reference to the end side.

Definition at line 144 of file ConnectPortsInteraction.h.

References endSide.

◆ getStartSide()

const std::optional< business_logic::elements::structures::BlocksConnectionSide > & business_logic::input::ConnectPortsInteraction::getStartSide ( ) const
inline

Gets an immutable reference to the start side.

Definition at line 135 of file ConnectPortsInteraction.h.

References startSide.

Referenced by gui::elements::SkiaBlocksManagerRenderer::maybeRenderDraggedLine().

+ Here is the caller graph for this function:

◆ handleUserInteractedWith()

◆ isInvalid()

bool business_logic::input::ConnectPortsInteraction::isInvalid ( )
inlineprotected

Returns whether the interaction is invalid (i.e., one of the sides is no longer valid)

Definition at line 171 of file ConnectPortsInteraction.h.

References endSide, and startSide.

Referenced by sanitize().

+ Here is the caller graph for this function:

◆ isStarted()

bool business_logic::input::ConnectPortsInteraction::isStarted ( ) const
inline

Returns whether the interaction has started (i.e., is pending and a dragging line should be rendered)

Definition at line 25 of file ConnectPortsInteraction.h.

References startSide.

Referenced by business_logic::BlocksManager::handleEscapeKeyPress(), business_logic::BlocksManager::handleRightClickOnBlock(), handleUserInteractedWith(), and gui::elements::SkiaBlocksManagerRenderer::maybeRenderDraggedLine().

+ Here is the caller graph for this function:

◆ resetInteraction()

void business_logic::input::ConnectPortsInteraction::resetInteraction ( )
inline

Resets the interaction, setting both sides to std::nullopt

Definition at line 151 of file ConnectPortsInteraction.h.

References endSide, and startSide.

Referenced by business_logic::BlocksManager::handleEscapeKeyPress(), business_logic::BlocksManager::handleRightClickOnBlock(), handleUserInteractedWith(), and sanitize().

+ Here is the caller graph for this function:

◆ sanitize()

void business_logic::input::ConnectPortsInteraction::sanitize ( )
inline

Sanitizes the interaction by removing both sides if any of them has become invalid.

Definition at line 31 of file ConnectPortsInteraction.h.

References isInvalid(), business_logic::Loggable< ConnectPortsInteraction >::logger, and resetInteraction().

Referenced by gui::elements::SkiaBlocksManagerRenderer::maybeRenderDraggedLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ endSide

std::optional<business_logic::elements::structures::BlocksConnectionSide> business_logic::input::ConnectPortsInteraction::endSide
protected

the second interaction side

Definition at line 165 of file ConnectPortsInteraction.h.

Referenced by getEndSide(), handleUserInteractedWith(), isInvalid(), and resetInteraction().

◆ startSide

std::optional<business_logic::elements::structures::BlocksConnectionSide> business_logic::input::ConnectPortsInteraction::startSide
protected

the first interaction side

Definition at line 160 of file ConnectPortsInteraction.h.

Referenced by getStartSide(), handleUserInteractedWith(), isInvalid(), isStarted(), and resetInteraction().


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