NDEVR
API Documentation
TransitIncidentReportHandler

Handles creating and rendering transit incident reports. More...

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

Public Member Functions

 TransitIncidentReportHandler ()
 Constructs the TransitIncidentReportHandler.
virtual bool canHandle (UUID id, QTModelManager *manager) const override
 Checks whether this handler can produce a report for the given ID.
virtual void createReportJSON (const UUID &id, JSONNode &node, ReportJSONMaker &maker) const override
 Serializes the report to JSON format.
virtual Buffer< UUIDdefaultReportIDs (const Buffer< UUID > &objects_to_report, QTModelManager *manager) const override
 Given a list of model objects, returns report IDs this handler requests to manage.
virtual QWidget * getReport (const UUID &id, QTModelManager *manager, const QRect &requested_geometry) const override
 Generates the report widget for the given ID.
virtual UUID id () const override
 Returns the unique identifier for this report handler type.
Public Member Functions inherited from ReportHandler
 ReportHandler (const TranslatedString &name, const TranslatedString &description, const StringView &icon)
 Constructs a report handler with the given display properties.
virtual bool defaultEnabled () const
 Checks whether this report handler is enabled by default.
const TranslatedStringdescription () const
 Retrieves the description of this report handler.
const Stringicon () const
 Retrieves the icon identifier for this report handler.
const TranslatedStringname () const
 Retrieves the display name of this report handler.
virtual QMenu * popupOptions () const
 Retrieves an optional popup menu with additional report options.

Public Attributes

TransitIncidentReport * m_report = nullptr
 Cached report instance.

Additional Inherited Members

Protected Attributes inherited from ReportHandler
bool m_default_enabled = true
 Whether this handler is enabled by default.
TranslatedString m_description
 The description of this report handler.
String m_icon
 The icon identifier for this report handler.
TranslatedString m_name
 The display name of this report handler.

Detailed Description

Handles creating and rendering transit incident reports.

Definition at line 19 of file IncidentReportHandler.h.

Member Function Documentation

◆ canHandle()

virtual bool TransitIncidentReportHandler::canHandle ( UUID id,
QTModelManager * manager ) const
overridevirtual

Checks whether this handler can produce a report for the given ID.

Parameters
[in]idThe report or model UUID to check.
[in]managerThe model manager for data access.
Returns
True if this handler can produce a report for the given ID.

Reimplemented from ReportHandler.

◆ createReportJSON()

virtual void TransitIncidentReportHandler::createReportJSON ( const UUID & id,
JSONNode & node,
ReportJSONMaker & maker ) const
overridevirtual

Serializes the report to JSON format.

Parameters
[in]idThe report UUID.
[in]nodeThe JSON node to populate.
[in]makerThe report JSON maker utility.

Reimplemented from ReportHandler.

◆ defaultReportIDs()

virtual Buffer< UUID > TransitIncidentReportHandler::defaultReportIDs ( const Buffer< UUID > & objects_to_report,
QTModelManager * manager ) const
overridevirtual

Given a list of model objects, returns report IDs this handler requests to manage.

Parameters
[in]objects_to_reportThe UUIDs of the objects to include in the report.
[in]managerThe model manager for data access.
Returns
A buffer of UUIDs identifying the reports this handler can produce.

Reimplemented from ReportHandler.

◆ getReport()

virtual QWidget * TransitIncidentReportHandler::getReport ( const UUID & id,
QTModelManager * manager,
const QRect & requested_geometry ) const
overridevirtual

Generates the report widget for the given ID.

Parameters
[in]idThe report UUID.
[in]managerThe model manager for data access.
[in]requested_geometryThe requested widget geometry.
Returns
A pointer to the report widget, or nullptr if the report cannot be generated.

Reimplemented from ReportHandler.

◆ id()

virtual UUID TransitIncidentReportHandler::id ( ) const
inlineoverridevirtual

Returns the unique identifier for this report handler type.

Returns
A UUID identifying this as an incident report handler.

Reimplemented from ReportHandler.

Definition at line 51 of file IncidentReportHandler.h.

References UUID::CreateUUID().


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