QgsScaleBarStyle Class Reference
[MapComposer]

#include <qgsscalebarstyle.h>

Inheritance diagram for QgsScaleBarStyle:

Inheritance graph
[legend]
Collaboration diagram for QgsScaleBarStyle:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstraction of composer scale bar style.

Subclasses draw themselves, have the possibility to implement custom labeling and calculate corresponding box size.

Definition at line 30 of file qgsscalebarstyle.h.

Public Member Functions

 QgsScaleBarStyle (const QgsComposerScaleBar *bar)
virtual ~QgsScaleBarStyle ()
virtual void draw (QPainter *p, double xOffset=0) const =0
 Draws the style.
virtual void drawLabels (QPainter *p) const
virtual QRectF calculateBoxSize () const
virtual QString name () const=0

Protected Attributes

const QgsComposerScaleBarmScaleBar

Private Member Functions

 QgsScaleBarStyle ()


Constructor & Destructor Documentation

QgsScaleBarStyle::QgsScaleBarStyle ( const QgsComposerScaleBar bar  ) 

Definition at line 22 of file qgsscalebarstyle.cpp.

QgsScaleBarStyle::~QgsScaleBarStyle (  )  [virtual]

Definition at line 32 of file qgsscalebarstyle.cpp.

QgsScaleBarStyle::QgsScaleBarStyle (  )  [private]

Definition at line 27 of file qgsscalebarstyle.cpp.


Member Function Documentation

virtual void QgsScaleBarStyle::draw ( QPainter *  p,
double  xOffset = 0 
) const [pure virtual]

Draws the style.

Parameters:
xOffset offset to account for centered labeling

Implemented in QgsDoubleBoxScaleBarStyle, QgsNumericScaleBarStyle, QgsSingleBoxScaleBarStyle, and QgsTicksScaleBarStyle.

Referenced by QgsComposerScaleBar::paint().

void QgsScaleBarStyle::drawLabels ( QPainter *  p  )  const [virtual]

Definition at line 37 of file qgsscalebarstyle.cpp.

References QgsComposerScaleBar::boxContentSpace(), QgsComposerItem::drawText(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegmentsLeft(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::segmentMillimeters(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().

Referenced by QgsTicksScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), and QgsDoubleBoxScaleBarStyle::draw().

QRectF QgsScaleBarStyle::calculateBoxSize (  )  const [virtual]

Reimplemented in QgsNumericScaleBarStyle.

Definition at line 101 of file qgsscalebarstyle.cpp.

References QgsComposerScaleBar::boxContentSpace(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), QgsComposerScaleBar::height(), QgsComposerScaleBar::labelBarSpace(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegments(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::pen(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().

Referenced by QgsComposerScaleBar::adjustBoxSize().

virtual QString QgsScaleBarStyle::name (  )  const [pure virtual]

Implemented in QgsDoubleBoxScaleBarStyle, QgsNumericScaleBarStyle, QgsSingleBoxScaleBarStyle, and QgsTicksScaleBarStyle.

Referenced by QgsComposerScaleBar::style(), and QgsComposerScaleBar::writeXML().


Member Data Documentation

const QgsComposerScaleBar* QgsScaleBarStyle::mScaleBar [protected]

Definition at line 48 of file qgsscalebarstyle.h.

Referenced by calculateBoxSize(), QgsNumericScaleBarStyle::calculateBoxSize(), QgsTicksScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), QgsNumericScaleBarStyle::draw(), QgsDoubleBoxScaleBarStyle::draw(), drawLabels(), and QgsNumericScaleBarStyle::scaleText().


The documentation for this class was generated from the following files:
Generated on Fri Nov 21 01:51:25 2008 for Quantum GIS API Documentation by  doxygen 1.5.1