NDEVR
API Documentation
ReportIterator

Iterates through a series of reports for drawing, sending to a PDF or printing. More...

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

Public Member Functions

 ReportIterator (const Buffer< const ReportHandler * > &reports, const Buffer< UUID > &objects_to_report, QTModelManager *manager)
 Constructs a report iterator with specific handlers and objects.
 ReportIterator (const Buffer< const ReportHandler * > &reports, QTModelManager *manager)
 Constructs a report iterator with specific report handlers.
 ReportIterator (QTModelManager *manager)
 Constructs a report iterator using all registered report handlers.
virtual bool canHandle (UUID model_id, QTModelManager *)
 Checks whether any handler can process a report for the given model.
JSONNode createJSONNode () const
 Creates a JSON representation of the report data.
QWidget * getReport (uint04 report_index) const override
 Generates a report widget for the given report index.
const Buffer< const ReportHandler * > & reportHandlers ()
 Retrieves the current report handlers.
void saveReportMetaData (const File &file) const
 Saves report metadata to a file.
void setObjectsToReport (const Buffer< UUID > &objects_to_report)
 Sets the objects to include in the report.
void setReportHandlers (const Buffer< const ReportHandler * > &handlers)
 Sets the report handlers used for generating reports.
void updateAvailableReports ()
 Updates the list of available reports based on current objects and handlers.
Public Member Functions inherited from WidgetIterator
 WidgetIterator ()
 Constructs an empty WidgetIterator.
 WidgetIterator (const Buffer< QWidget * > &objects_to_report)
 Constructs a WidgetIterator with a buffer of widgets.
QSize preferredSize () const
 Returns the preferred size for rendering each report page.
uint04 reportCount () const
 Returns the total number of report widgets.
virtual void setCustomReport (uint04 index, QWidget *widget)
 Replaces the widget at the given index with a custom widget.

Protected Member Functions

void sortIDs ()
 Sorts the report object IDs for consistent ordering.

Protected Attributes

QTModelManagerm_manager
 The model manager providing data.
Buffer< UUIDm_objects_to_report
 UUIDs of objects to include in reports.
Buffer< const ReportHandler * > m_report_handlers
 The report handlers used for generation.
Buffer< std::pair< const ReportHandler *, UUID > > m_report_objects
 Paired handler-object entries for report generation.
Protected Attributes inherited from WidgetIterator
QSize m_preferred_size
 The preferred size for report rendering.
Buffer< QWidget * > m_widgets
 The collection of widgets to iterate over.

Detailed Description

Iterates through a series of reports for drawing, sending to a PDF or printing.


Definition at line 151 of file ReportIterator.h.

Constructor & Destructor Documentation

◆ ReportIterator() [1/3]

ReportIterator::ReportIterator ( QTModelManager * manager)

Constructs a report iterator using all registered report handlers.

Parameters
[in]managerThe model manager providing data.

◆ ReportIterator() [2/3]

ReportIterator::ReportIterator ( const Buffer< const ReportHandler * > & reports,
QTModelManager * manager )

Constructs a report iterator with specific report handlers.

Parameters
[in]reportsThe report handlers to use.
[in]managerThe model manager providing data.

◆ ReportIterator() [3/3]

ReportIterator::ReportIterator ( const Buffer< const ReportHandler * > & reports,
const Buffer< UUID > & objects_to_report,
QTModelManager * manager )

Constructs a report iterator with specific handlers and objects.

Parameters
[in]reportsThe report handlers to use.
[in]objects_to_reportThe UUIDs of objects to include in the report.
[in]managerThe model manager providing data.

Member Function Documentation

◆ canHandle()

virtual bool ReportIterator::canHandle ( UUID model_id,
QTModelManager *  )
virtual

Checks whether any handler can process a report for the given model.

Parameters
[in]model_idThe UUID of the model to check.
Returns
True if the report can be handled.

◆ createJSONNode()

JSONNode ReportIterator::createJSONNode ( ) const

Creates a JSON representation of the report data.

Returns
A JSONNode containing the report data.

◆ getReport()

QWidget * ReportIterator::getReport ( uint04 report_index) const
overridevirtual

Generates a report widget for the given report index.

Parameters
[in]report_indexThe index of the report page to generate.
Returns
A pointer to the generated report widget.

Reimplemented from WidgetIterator.

◆ reportHandlers()

const Buffer< const ReportHandler * > & ReportIterator::reportHandlers ( )
inline

Retrieves the current report handlers.

Returns
A reference to the buffer of report handler pointers.

Definition at line 210 of file ReportIterator.h.

References m_report_handlers.

◆ saveReportMetaData()

void ReportIterator::saveReportMetaData ( const File & file) const

Saves report metadata to a file.

Parameters
[in]fileThe file to save metadata to.

◆ setObjectsToReport()

void ReportIterator::setObjectsToReport ( const Buffer< UUID > & objects_to_report)

Sets the objects to include in the report.

Parameters
[in]objects_to_reportThe UUIDs of objects to report on.

◆ setReportHandlers()

void ReportIterator::setReportHandlers ( const Buffer< const ReportHandler * > & handlers)

Sets the report handlers used for generating reports.

Parameters
[in]handlersThe report handlers to use.

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