KReportDataSource

Search for usage in LXR

KReportDataSource Class Referenceabstract

#include <KReportDataSource.h>

Classes

class  SortedField
 

Public Member Functions

virtual void addCondition (const QString &field, const QVariant &value, const QString &relation=QLatin1String("="))
 
virtual qint64 at () const =0
 
virtual bool close ()=0
 
virtual KReportDataSourcecreate (const QString &source) const
 
virtual QString dataSourceCaption (const QString &dataSourceName) const
 
virtual QStringList dataSourceNames () const =0
 
virtual QStringList fieldKeys () const
 
virtual QStringList fieldNames () const =0
 
virtual int fieldNumber (const QString &field) const =0
 
virtual bool moveFirst ()=0
 
virtual bool moveLast ()=0
 
virtual bool moveNext ()=0
 
virtual bool movePrevious ()=0
 
virtual bool open ()=0
 
virtual qint64 recordCount () const =0
 
virtual void setSorting (const QList< SortedField > &sorting)
 
virtual QString sourceClass () const
 
virtual QString sourceName () const
 
virtual QVariant value (const QString &field) const =0
 
virtual QVariant value (int pos) const =0
 

Detailed Description

Abstraction of report data source.

A data source provides data to the report engine, usually from a database, but could also be implemented for text and other file formats

Definition at line 32 of file KReportDataSource.h.

Constructor & Destructor Documentation

◆ KReportDataSource()

KReportDataSource::KReportDataSource ( )

Definition at line 100 of file KReportDataSource.cpp.

◆ ~KReportDataSource()

KReportDataSource::~KReportDataSource ( )
virtual

Definition at line 104 of file KReportDataSource.cpp.

Member Function Documentation

◆ addCondition()

void KReportDataSource::addCondition ( const QString & field,
const QVariant & value,
const QString & relation = QLatin1String("=") )
virtual

Adds a condition to the data source.

Definition at line 129 of file KReportDataSource.cpp.

◆ at()

virtual qint64 KReportDataSource::at ( ) const
pure virtual

Return the current position in the dataset.

◆ close()

virtual bool KReportDataSource::close ( )
pure virtual

Close the dataset.

◆ create()

KReportDataSource * KReportDataSource::create ( const QString & source) const
virtual

Creates a new instance with data source.

Default implementation returns nullptr. source is implementation-specific identifier. Owner of the returned pointer is the caller.

Definition at line 146 of file KReportDataSource.cpp.

◆ dataSourceCaption()

QString KReportDataSource::dataSourceCaption ( const QString & dataSourceName) const
virtual

Return data source caption for specified dataSourceName It is possibly translated.

As such it is suitable for use in GUIs. Default implementation just returns dataSourceName.

Definition at line 141 of file KReportDataSource.cpp.

◆ dataSourceNames()

QStringList KReportDataSource::dataSourceNames ( ) const
pure virtual

Return a list of data source names available for this data source Works after the source is opened.

Definition at line 136 of file KReportDataSource.cpp.

◆ fieldKeys()

QStringList KReportDataSource::fieldKeys ( ) const
virtual

Return the list of field keys. Returns fieldNames() by default.

Definition at line 109 of file KReportDataSource.cpp.

◆ fieldNames()

virtual QStringList KReportDataSource::fieldNames ( ) const
pure virtual

Return the list of field names.

◆ fieldNumber()

virtual int KReportDataSource::fieldNumber ( const QString & field) const
pure virtual

Return the index number of the field given by nane field.

◆ moveFirst()

virtual bool KReportDataSource::moveFirst ( )
pure virtual

Move to the first record.

◆ moveLast()

virtual bool KReportDataSource::moveLast ( )
pure virtual

Move to the last record.

◆ moveNext()

virtual bool KReportDataSource::moveNext ( )
pure virtual

Move to the next record.

◆ movePrevious()

virtual bool KReportDataSource::movePrevious ( )
pure virtual

Move to the previous record.

◆ open()

virtual bool KReportDataSource::open ( )
pure virtual

Open the dataset.

◆ recordCount()

virtual qint64 KReportDataSource::recordCount ( ) const
pure virtual

Return the total number of records.

◆ setSorting()

void KReportDataSource::setSorting ( const QList< SortedField > & sorting)
virtual

Sets the sorting for the data Should be called before open() so that the data source can be edited accordingly Default impl does nothing.

Definition at line 124 of file KReportDataSource.cpp.

◆ sourceClass()

QString KReportDataSource::sourceClass ( ) const
virtual
Returns
the class name of this source

Definition at line 119 of file KReportDataSource.cpp.

◆ sourceName()

QString KReportDataSource::sourceName ( ) const
virtual

Return the name of this source.

Definition at line 114 of file KReportDataSource.cpp.

◆ value() [1/2]

virtual QVariant KReportDataSource::value ( const QString & field) const
pure virtual

Return the value of the field fir the given name for the current record.

◆ value() [2/2]

virtual QVariant KReportDataSource::value ( int pos) const
pure virtual

Return the value of the field at the given position for the current record.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.