NDEVR
API Documentation
ReportHandler

Handles creating a report page from some given data. More...

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

Public Member Functions

 ReportHandler (const TranslatedString &name, const TranslatedString &description, const StringView &icon)
 Constructs a report handler with the given display properties.
virtual bool canHandle (UUID, QTModelManager *) const
 Checks whether this handler can generate a report for the given ID.
virtual void createReportJSON (const UUID &, JSONNode &, ReportJSONMaker &) const
 Creates JSON nodes containing report data for the given ID.
virtual bool defaultEnabled () const
 Checks whether this report handler is enabled by default.
virtual Buffer< UUIDdefaultReportIDs (const Buffer< UUID > &, QTModelManager *) const
 Given a list of model objects, returns report IDs this handler requests to process.
const TranslatedStringdescription () const
 Retrieves the description of this report handler.
virtual QWidget * getReport (const UUID &, QTModelManager *, const QRect &) const
 Creates a report widget for the given ID within the specified bounds.
const Stringicon () const
 Retrieves the icon identifier for this report handler.
virtual UUID id () const
 Retrieves the unique 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.

Protected Attributes

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 a report page from some given data.


A report page is a QWidget object that is formatted for printing to a printer or PDF page.

Definition at line 71 of file ReportIterator.h.

Constructor & Destructor Documentation

◆ ReportHandler()

ReportHandler::ReportHandler ( const TranslatedString & name,
const TranslatedString & description,
const StringView & icon )
inline

Constructs a report handler with the given display properties.

Parameters
[in]nameThe display name of the report handler.
[in]descriptionA description of what the report handler generates.
[in]iconThe icon identifier for the report handler.

Definition at line 80 of file ReportIterator.h.

References description(), icon(), m_description, m_icon, m_name, and name().

Member Function Documentation

◆ canHandle()

virtual bool ReportHandler::canHandle ( UUID ,
QTModelManager *  ) const
inlinevirtual

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

Returns
True if the handler can process this report ID.

Reimplemented in TransitIncidentReportHandler.

Definition at line 118 of file ReportIterator.h.

◆ createReportJSON()

virtual void ReportHandler::createReportJSON ( const UUID & ,
JSONNode & ,
ReportJSONMaker &  ) const
inlinevirtual

Creates JSON nodes containing report data for the given ID.

This is allowed to be a no-op if JSON export is not supported.

Reimplemented in TransitIncidentReportHandler.

Definition at line 130 of file ReportIterator.h.

◆ defaultEnabled()

virtual bool ReportHandler::defaultEnabled ( ) const
inlinevirtual

Checks whether this report handler is enabled by default.

Returns
True if enabled by default.

Definition at line 141 of file ReportIterator.h.

References m_default_enabled.

◆ defaultReportIDs()

virtual Buffer< UUID > ReportHandler::defaultReportIDs ( const Buffer< UUID > & ,
QTModelManager *  ) const
inlinevirtual

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

Returned IDs will be stored and then used with canHandle, getReport, and createReportJSON. Report IDs can be Model IDs or unique identifiers specific to this handler.

Returns
A buffer of report UUIDs.

Reimplemented in TransitIncidentReportHandler.

Definition at line 107 of file ReportIterator.h.

◆ description()

const TranslatedString & ReportHandler::description ( ) const
inline

Retrieves the description of this report handler.

Returns
A reference to the translated description.

Definition at line 95 of file ReportIterator.h.

References m_description.

Referenced by ReportHandler().

◆ getReport()

virtual QWidget * ReportHandler::getReport ( const UUID & ,
QTModelManager * ,
const QRect &  ) const
inlinevirtual

Creates a report widget for the given ID within the specified bounds.

Returns
A pointer to the report widget, or nullptr if the report cannot be generated.

Reimplemented in TransitIncidentReportHandler.

Definition at line 124 of file ReportIterator.h.

◆ icon()

const String & ReportHandler::icon ( ) const
inline

Retrieves the icon identifier for this report handler.

Returns
A reference to the icon string.

Definition at line 100 of file ReportIterator.h.

References m_icon.

Referenced by ReportHandler().

◆ id()

virtual UUID ReportHandler::id ( ) const
inlinevirtual

Retrieves the unique identifier for this report handler.

Returns
The UUID derived from the handler's translation ID.

Reimplemented in TransitIncidentReportHandler.

Definition at line 136 of file ReportIterator.h.

References m_name.

◆ name()

const TranslatedString & ReportHandler::name ( ) const
inline

Retrieves the display name of this report handler.

Returns
A reference to the translated name.

Definition at line 90 of file ReportIterator.h.

References m_name.

Referenced by ReportHandler().

◆ popupOptions()

virtual QMenu * ReportHandler::popupOptions ( ) const
inlinevirtual

Retrieves an optional popup menu with additional report options.

Returns
A pointer to the popup menu, or nullptr.

Definition at line 113 of file ReportIterator.h.


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