kexi

KexiSimplePrintingEngine Class Reference

#include <kexisimpleprintingengine.h>

List of all members.


Detailed Description

An engine painting data on pages using QPainter. The engine allows for random access to any page.

Definition at line 57 of file kexisimpleprintingengine.h.


Public Slots

void paintPage (int pageNumber, QPainter &painter, bool paint=true)

Public Member Functions

 KexiSimplePrintingEngine (const KexiSimplePrintingSettings &settings, QObject *parent)
 ~KexiSimplePrintingEngine ()
bool init (KexiDB::Connection &conn, KexiDB::TableOrQuerySchema &tableOrQuery, const QString &titleText, QString &errorMessage)
void setTitleText (const QString &titleText)
void calculatePagesCount (QPainter &painter)
bool done ()
void clear ()
const KexiSimplePrintingSettingssettings () const
bool eof () const
uint pagesCount ()
uint paintedPages () const

Protected Member Functions

void paintRecord (QPainter &painter, KexiTableItem *item, uint count, int cellMargin, uint &y, uint paintedRows, bool paint)

Protected Attributes

const KexiSimplePrintingSettingsm_settings
QFont m_mainFont
QFont m_headerFont
QPaintDeviceMetrics m_pdm
int m_dpiX
int m_dpiY
uint m_pageWidth
uint m_pageHeight
KexiDB::Cursorm_cursor
KexiTableViewDatam_data
QPtrList< uint > m_dataOffsets
QString m_headerText
QString m_dateTimeText
uint m_dateTimeWidth
QRect m_headerTextRect
int m_maxFieldNameWidth
int m_mainLineSpacing
int m_footerHeight
KexiDB::QueryColumnInfo::Vector m_fieldsExpanded
uint m_pagesCount
bool m_eof
bool m_paintInitialized
double leftMargin
double rightMargin
double topMargin
double bottomMargin
double m_fx
double m_fy

Member Function Documentation

bool KexiSimplePrintingEngine::init ( KexiDB::Connection conn,
KexiDB::TableOrQuerySchema tableOrQuery,
const QString &  titleText,
QString &  errorMessage 
)

Definition at line 136 of file kexisimpleprintingengine.cpp.

void KexiSimplePrintingEngine::calculatePagesCount ( QPainter &  painter  ) 

Calculates pafe count that can be later obtained using pagesCount().

Page count can depend on painter (printer/screen) and on printing settings.

Definition at line 482 of file kexisimpleprintingengine.cpp.

bool KexiSimplePrintingEngine::eof (  )  const [inline]

Returns:
true when all records has been painted

Definition at line 79 of file kexisimpleprintingengine.h.

uint KexiSimplePrintingEngine::pagesCount (  )  [inline]

Returns:
number of pages. Can be used after calculatePagesCount().

Definition at line 82 of file kexisimpleprintingengine.h.

uint KexiSimplePrintingEngine::paintedPages (  )  const [inline]

Returns:
number of painted pages so far.

If eof() is true, this number is equal to total page count.

Definition at line 86 of file kexisimpleprintingengine.h.

void KexiSimplePrintingEngine::paintPage ( int  pageNumber,
QPainter &  painter,
bool  paint = true 
) [slot]

Paints a page number pageNumber (counted from 0) on painter. If paint is false, drawings are only computed but not painted, so this can be used for calculating page number before printing or previewing.

Todo:
add setting

Todo:
break large records anyway...

Definition at line 200 of file kexisimpleprintingengine.cpp.

void KexiSimplePrintingEngine::paintRecord ( QPainter &  painter,
KexiTableItem item,
uint  count,
int  cellMargin,
uint &  y,
uint  paintedRows,
bool  paint 
) [protected]

Definition at line 388 of file kexisimpleprintingengine.cpp.


Member Data Documentation

used by paintPage()

Definition at line 120 of file kexisimpleprintingengine.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys