Quantum GIS API Documentation  1.7.4
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
QgsLabelAttributes Class Reference

A class to store attributes needed for label rendering. More...

#include <qgslabelattributes.h>

List of all members.

Public Types

enum  Units { MapUnits = 0, PointUnits }

Public Member Functions

 QgsLabelAttributes (bool def=true)
 Constructor.
 ~QgsLabelAttributes ()
void setText (const QString &text)
bool textIsSet (void) const
const QString text (void) const
void setFamily (const QString &family)
bool familyIsSet (void) const
const QString family (void) const
void setBold (bool enable)
bool boldIsSet (void) const
bool bold (void) const
void setItalic (bool enable)
bool italicIsSet (void) const
bool italic (void) const
void setUnderline (bool enable)
bool underlineIsSet (void) const
bool underline (void) const
void setStrikeOut (bool enable)
bool strikeOutIsSet (void) const
bool strikeOut (void) const
void setSize (double size, int type)
bool sizeIsSet (void) const
int sizeType (void) const
double size (void) const
void setColor (const QColor &color)
bool colorIsSet (void) const
const QColor & color (void) const
void setOffset (double x, double y, int type)
bool offsetIsSet (void) const
int offsetType (void) const
double xOffset (void) const
double yOffset (void) const
void setAngle (double angle)
bool angleIsSet (void) const
double angle (void) const
bool angleIsAuto (void) const
void setAutoAngle (bool state)
void setAlignment (int alignment)
bool alignmentIsSet (void) const
int alignment (void) const
bool bufferEnabled () const
void setBufferEnabled (bool useBufferFlag)
void setBufferSize (double size, int type)
bool bufferSizeIsSet (void) const
int bufferSizeType (void) const
double bufferSize (void) const
void setBufferColor (const QColor &color)
bool bufferColorIsSet (void) const
QColor bufferColor (void) const
void setBufferStyle (Qt::BrushStyle style)
bool bufferStyleIsSet (void) const
Qt::BrushStyle bufferStyle (void) const
void setBorderColor (const QColor &color)
bool borderColorIsSet (void) const
QColor borderColor (void) const
void setBorderWidth (int width)
bool borderWidthIsSet (void) const
int borderWidth (void) const
void setBorderStyle (Qt::PenStyle style)
bool borderStyleIsSet (void) const
Qt::PenStyle borderStyle (void) const
bool multilineEnabled () const
void setMultilineEnabled (bool useMultiline)
bool selectedOnly () const
void setSelectedOnly (bool selectedonly)

Static Public Member Functions

static QString unitsName (int units)
static int unitsCode (const QString &name)
static QString alignmentName (int alignment)
static int alignmentCode (const QString &name)

Protected Attributes

QString mText
bool mTextIsSet
QFont mFont
 Font (family, weight, italic, underline, strikeout)
bool mFamilyIsSet
bool mBoldIsSet
bool mItalicIsSet
bool mUnderlineIsSet
bool mStrikeOutIsSet
int mSizeType
 Font size, size type.
double mSize
bool mSizeIsSet
QColor mColor
 Color.
bool mColorIsSet
int mOffsetType
 Offset.
double mXOffset
double mYOffset
bool mOffsetIsSet
double mAngle
 Angle (degrees)
bool mAngleIsSet
bool mAngleIsAuto
int mAlignment
 Alignment.
bool mAlignmentIsSet
bool mBufferEnabledFlag
 Buffer enablement.
int mBufferSizeType
 Buffer size, size type.
double mBufferSize
bool mBufferSizeIsSet
QBrush mBufferBrush
 Buffer brush (color, style)
bool mBufferColorIsSet
bool mBufferStyleIsSet
QPen mBorderPen
 Border pen (color, width, style)
bool mBorderColorIsSet
bool mBorderWidthIsSet
bool mBorderStyleIsSet
bool mMultilineEnabledFlag
 Multiline enablement.
bool mSelectedOnly
 Label only selected.

Detailed Description

A class to store attributes needed for label rendering.

Label attributes: border (color, width, style) / / text bounding box / / +-----------/--+ buffer (color, pattern) | / | / | +----+ |/ --+ | |Text| / |--- text size | +----+ /| --+ | | +--------------+ | | | | >|----|<--- buffer width | >|<--- border width

Text:

Position:

Buffer:

Border:

Each attribute is either set or unset.

Definition at line 77 of file qgslabelattributes.h.


Member Enumeration Documentation

Enumerator:
MapUnits 
PointUnits 

Definition at line 88 of file qgslabelattributes.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
defif true, defaults are set, if false all all attributes are unset

Definition at line 28 of file qgslabelattributes.cpp.

References mBoldIsSet, mFamilyIsSet, mFont, mItalicIsSet, mUnderlineIsSet, PointUnits, setAlignment(), setAngle(), setAutoAngle(), setBorderColor(), setBorderStyle(), setBorderWidth(), setBufferColor(), setBufferSize(), setBufferStyle(), setColor(), setOffset(), setSize(), and setText().

Definition at line 90 of file qgslabelattributes.cpp.


Member Function Documentation

int QgsLabelAttributes::alignment ( void  ) const

Definition at line 179 of file qgslabelattributes.cpp.

References mAlignment.

Referenced by QgsLabel::renderLabel(), setAlignment(), and QgsLabel::writeXML().

int QgsLabelAttributes::alignmentCode ( const QString &  name) [static]

Definition at line 481 of file qgslabelattributes.cpp.

Referenced by QgsLabel::readXML().

bool QgsLabelAttributes::alignmentIsSet ( void  ) const

Definition at line 174 of file qgslabelattributes.cpp.

References mAlignmentIsSet.

Referenced by QgsLabel::writeXML().

QString QgsLabelAttributes::alignmentName ( int  alignment) [static]

Definition at line 465 of file qgslabelattributes.cpp.

References QgsDebugMsg.

Referenced by QgsLabel::writeXML().

double QgsLabelAttributes::angle ( void  ) const

Definition at line 152 of file qgslabelattributes.cpp.

References mAngle.

Referenced by QgsLabel::renderLabel(), setAngle(), and QgsLabel::writeXML().

bool QgsLabelAttributes::angleIsAuto ( void  ) const

Definition at line 157 of file qgslabelattributes.cpp.

References mAngleIsAuto.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::angleIsSet ( void  ) const

Definition at line 147 of file qgslabelattributes.cpp.

References mAngleIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::bold ( void  ) const

Definition at line 213 of file qgslabelattributes.cpp.

References mFont.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::boldIsSet ( void  ) const

Definition at line 208 of file qgslabelattributes.cpp.

References mBoldIsSet.

Referenced by QgsLabel::writeXML().

QColor QgsLabelAttributes::borderColor ( void  ) const

Definition at line 385 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderColorIsSet ( void  ) const

Definition at line 380 of file qgslabelattributes.cpp.

References mBorderColorIsSet.

Qt::PenStyle QgsLabelAttributes::borderStyle ( void  ) const

Definition at line 418 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderStyleIsSet ( void  ) const

Definition at line 413 of file qgslabelattributes.cpp.

References mBorderStyleIsSet.

int QgsLabelAttributes::borderWidth ( void  ) const

Definition at line 401 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderWidthIsSet ( void  ) const

Definition at line 396 of file qgslabelattributes.cpp.

References mBorderWidthIsSet.

QColor QgsLabelAttributes::bufferColor ( void  ) const

Definition at line 351 of file qgslabelattributes.cpp.

References mBufferBrush.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::bufferColorIsSet ( void  ) const

Definition at line 346 of file qgslabelattributes.cpp.

References mColorIsSet.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

Definition at line 309 of file qgslabelattributes.cpp.

References mBufferEnabledFlag.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

double QgsLabelAttributes::bufferSize ( void  ) const

Definition at line 334 of file qgslabelattributes.cpp.

References mBufferSize.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::bufferSizeIsSet ( void  ) const

Definition at line 324 of file qgslabelattributes.cpp.

References mBufferSizeIsSet.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

int QgsLabelAttributes::bufferSizeType ( void  ) const

Definition at line 329 of file qgslabelattributes.cpp.

References mBufferSizeType.

Referenced by QgsLabel::writeXML().

Qt::BrushStyle QgsLabelAttributes::bufferStyle ( void  ) const

Definition at line 368 of file qgslabelattributes.cpp.

References mBufferBrush.

bool QgsLabelAttributes::bufferStyleIsSet ( void  ) const

Definition at line 363 of file qgslabelattributes.cpp.

References mBufferStyleIsSet.

const QColor & QgsLabelAttributes::color ( void  ) const

Definition at line 303 of file qgslabelattributes.cpp.

References mColor.

Referenced by QgsLabel::renderLabel(), setColor(), and QgsLabel::writeXML().

bool QgsLabelAttributes::colorIsSet ( void  ) const

Definition at line 298 of file qgslabelattributes.cpp.

References mColorIsSet.

Referenced by QgsLabel::writeXML().

const QString QgsLabelAttributes::family ( void  ) const

Definition at line 196 of file qgslabelattributes.cpp.

References mFont.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::familyIsSet ( void  ) const

Definition at line 191 of file qgslabelattributes.cpp.

References mFamilyIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::italic ( void  ) const

Definition at line 230 of file qgslabelattributes.cpp.

References mFont.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::italicIsSet ( void  ) const

Definition at line 225 of file qgslabelattributes.cpp.

References mItalicIsSet.

Referenced by QgsLabel::writeXML().

Definition at line 424 of file qgslabelattributes.cpp.

References mMultilineEnabledFlag.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::offsetIsSet ( void  ) const

Definition at line 120 of file qgslabelattributes.cpp.

References mOffsetIsSet.

Referenced by QgsLabel::writeXML().

int QgsLabelAttributes::offsetType ( void  ) const

Definition at line 125 of file qgslabelattributes.cpp.

References mOffsetType.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

Definition at line 434 of file qgslabelattributes.cpp.

References mSelectedOnly.

Referenced by QgsLabel::renderLabel(), setSelectedOnly(), and QgsLabel::writeXML().

void QgsLabelAttributes::setAlignment ( int  alignment)

Definition at line 168 of file qgslabelattributes.cpp.

References alignment(), mAlignment, and mAlignmentIsSet.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setAngle ( double  angle)

Definition at line 141 of file qgslabelattributes.cpp.

References angle(), mAngle, and mAngleIsSet.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setAutoAngle ( bool  state)

Definition at line 162 of file qgslabelattributes.cpp.

References mAngleIsAuto.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setBold ( bool  enable)

Definition at line 202 of file qgslabelattributes.cpp.

References mBoldIsSet, and mFont.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setBorderColor ( const QColor &  color)

Definition at line 374 of file qgslabelattributes.cpp.

References mBorderColorIsSet, and mBorderPen.

Referenced by QgsLabelAttributes().

void QgsLabelAttributes::setBorderStyle ( Qt::PenStyle  style)

Definition at line 407 of file qgslabelattributes.cpp.

References mBorderPen, and mBorderStyleIsSet.

Referenced by QgsLabelAttributes().

Definition at line 390 of file qgslabelattributes.cpp.

References mBorderPen, and mBorderWidthIsSet.

Referenced by QgsLabelAttributes().

void QgsLabelAttributes::setBufferColor ( const QColor &  color)

Definition at line 340 of file qgslabelattributes.cpp.

References mBufferBrush, and mBufferColorIsSet.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setBufferEnabled ( bool  useBufferFlag)

Definition at line 313 of file qgslabelattributes.cpp.

References mBufferEnabledFlag.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setBufferSize ( double  size,
int  type 
)

Definition at line 317 of file qgslabelattributes.cpp.

References mBufferSize, mBufferSizeIsSet, mBufferSizeType, and size().

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setBufferStyle ( Qt::BrushStyle  style)

Definition at line 357 of file qgslabelattributes.cpp.

References mBufferBrush, and mBufferStyleIsSet.

Referenced by QgsLabelAttributes().

void QgsLabelAttributes::setColor ( const QColor &  color)

Definition at line 292 of file qgslabelattributes.cpp.

References color(), mColor, and mColorIsSet.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setFamily ( const QString &  family)

Definition at line 185 of file qgslabelattributes.cpp.

References mFamilyIsSet, and mFont.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setItalic ( bool  enable)

Definition at line 219 of file qgslabelattributes.cpp.

References mFont, and mItalicIsSet.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setMultilineEnabled ( bool  useMultiline)

Definition at line 428 of file qgslabelattributes.cpp.

References mMultilineEnabledFlag.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setOffset ( double  x,
double  y,
int  type 
)

Definition at line 112 of file qgslabelattributes.cpp.

References mOffsetIsSet, mOffsetType, mXOffset, and mYOffset.

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setSelectedOnly ( bool  selectedonly)

Definition at line 438 of file qgslabelattributes.cpp.

References mSelectedOnly, and selectedOnly().

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setSize ( double  size,
int  type 
)
void QgsLabelAttributes::setStrikeOut ( bool  enable)

Definition at line 252 of file qgslabelattributes.cpp.

References mFont, and mStrikeOutIsSet.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setText ( const QString &  text)

Definition at line 94 of file qgslabelattributes.cpp.

References mText, mTextIsSet, and text().

Referenced by QgsLabelAttributes(), and QgsLabel::readXML().

void QgsLabelAttributes::setUnderline ( bool  enable)

Definition at line 236 of file qgslabelattributes.cpp.

References mFont, and mUnderlineIsSet.

Referenced by QgsLabel::readXML().

double QgsLabelAttributes::size ( void  ) const
bool QgsLabelAttributes::sizeIsSet ( void  ) const

Definition at line 276 of file qgslabelattributes.cpp.

References mSizeIsSet.

Referenced by QgsLabel::writeXML().

int QgsLabelAttributes::sizeType ( void  ) const
bool QgsLabelAttributes::strikeOut ( void  ) const

Definition at line 263 of file qgslabelattributes.cpp.

References mFont.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::strikeOutIsSet ( void  ) const

Definition at line 258 of file qgslabelattributes.cpp.

References mStrikeOutIsSet.

Referenced by QgsLabel::writeXML().

const QString QgsLabelAttributes::text ( void  ) const

Definition at line 105 of file qgslabelattributes.cpp.

References mText.

Referenced by QgsLabel::renderLabel(), setText(), and QgsLabel::writeXML().

bool QgsLabelAttributes::textIsSet ( void  ) const

Definition at line 100 of file qgslabelattributes.cpp.

References mTextIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::underline ( void  ) const

Definition at line 247 of file qgslabelattributes.cpp.

References mFont.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

bool QgsLabelAttributes::underlineIsSet ( void  ) const

Definition at line 242 of file qgslabelattributes.cpp.

References mUnderlineIsSet.

Referenced by QgsLabel::writeXML().

int QgsLabelAttributes::unitsCode ( const QString &  name) [static]

Definition at line 454 of file qgslabelattributes.cpp.

References MapUnits, and PointUnits.

Referenced by QgsLabel::readXML().

QString QgsLabelAttributes::unitsName ( int  units) [static]

Definition at line 444 of file qgslabelattributes.cpp.

References MapUnits.

Referenced by QgsLabel::writeXML().

double QgsLabelAttributes::xOffset ( void  ) const

Definition at line 130 of file qgslabelattributes.cpp.

References mXOffset.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().

double QgsLabelAttributes::yOffset ( void  ) const

Definition at line 135 of file qgslabelattributes.cpp.

References mYOffset.

Referenced by QgsLabel::renderLabel(), and QgsLabel::writeXML().


Member Data Documentation

Alignment.

Definition at line 228 of file qgslabelattributes.h.

Referenced by alignment(), and setAlignment().

Definition at line 229 of file qgslabelattributes.h.

Referenced by alignmentIsSet(), and setAlignment().

double QgsLabelAttributes::mAngle [protected]

Angle (degrees)

Definition at line 223 of file qgslabelattributes.h.

Referenced by angle(), and setAngle().

Definition at line 225 of file qgslabelattributes.h.

Referenced by angleIsAuto(), and setAutoAngle().

Definition at line 224 of file qgslabelattributes.h.

Referenced by angleIsSet(), and setAngle().

Definition at line 202 of file qgslabelattributes.h.

Referenced by boldIsSet(), QgsLabelAttributes(), and setBold().

Definition at line 245 of file qgslabelattributes.h.

Referenced by borderColorIsSet(), and setBorderColor().

Border pen (color, width, style)

Definition at line 244 of file qgslabelattributes.h.

Referenced by borderColor(), borderStyle(), borderWidth(), setBorderColor(), setBorderStyle(), and setBorderWidth().

Definition at line 247 of file qgslabelattributes.h.

Referenced by borderStyleIsSet(), and setBorderStyle().

Definition at line 246 of file qgslabelattributes.h.

Referenced by borderWidthIsSet(), and setBorderWidth().

Buffer brush (color, style)

Definition at line 239 of file qgslabelattributes.h.

Referenced by bufferColor(), bufferStyle(), setBufferColor(), and setBufferStyle().

Definition at line 240 of file qgslabelattributes.h.

Referenced by setBufferColor().

Buffer enablement.

Definition at line 232 of file qgslabelattributes.h.

Referenced by bufferEnabled(), and setBufferEnabled().

double QgsLabelAttributes::mBufferSize [protected]

Definition at line 235 of file qgslabelattributes.h.

Referenced by bufferSize(), and setBufferSize().

Definition at line 236 of file qgslabelattributes.h.

Referenced by bufferSizeIsSet(), and setBufferSize().

Buffer size, size type.

Definition at line 234 of file qgslabelattributes.h.

Referenced by bufferSizeType(), and setBufferSize().

Definition at line 241 of file qgslabelattributes.h.

Referenced by bufferStyleIsSet(), and setBufferStyle().

QColor QgsLabelAttributes::mColor [protected]

Color.

Definition at line 213 of file qgslabelattributes.h.

Referenced by color(), and setColor().

Definition at line 214 of file qgslabelattributes.h.

Referenced by bufferColorIsSet(), colorIsSet(), and setColor().

Definition at line 201 of file qgslabelattributes.h.

Referenced by familyIsSet(), QgsLabelAttributes(), and setFamily().

QFont QgsLabelAttributes::mFont [protected]

Font (family, weight, italic, underline, strikeout)

Definition at line 200 of file qgslabelattributes.h.

Referenced by bold(), family(), italic(), QgsLabelAttributes(), setBold(), setFamily(), setItalic(), setStrikeOut(), setUnderline(), strikeOut(), and underline().

Definition at line 203 of file qgslabelattributes.h.

Referenced by italicIsSet(), QgsLabelAttributes(), and setItalic().

Multiline enablement.

Definition at line 250 of file qgslabelattributes.h.

Referenced by multilineEnabled(), and setMultilineEnabled().

Definition at line 220 of file qgslabelattributes.h.

Referenced by offsetIsSet(), and setOffset().

Offset.

Definition at line 217 of file qgslabelattributes.h.

Referenced by offsetType(), and setOffset().

Label only selected.

Definition at line 253 of file qgslabelattributes.h.

Referenced by selectedOnly(), and setSelectedOnly().

double QgsLabelAttributes::mSize [protected]

Definition at line 209 of file qgslabelattributes.h.

Referenced by setSize(), and size().

Definition at line 210 of file qgslabelattributes.h.

Referenced by setSize(), and sizeIsSet().

Font size, size type.

Definition at line 208 of file qgslabelattributes.h.

Referenced by setSize(), and sizeType().

Definition at line 205 of file qgslabelattributes.h.

Referenced by setStrikeOut(), and strikeOutIsSet().

QString QgsLabelAttributes::mText [protected]

Definition at line 196 of file qgslabelattributes.h.

Referenced by setText(), and text().

Definition at line 197 of file qgslabelattributes.h.

Referenced by setText(), and textIsSet().

Definition at line 204 of file qgslabelattributes.h.

Referenced by QgsLabelAttributes(), setUnderline(), and underlineIsSet().

double QgsLabelAttributes::mXOffset [protected]

Definition at line 218 of file qgslabelattributes.h.

Referenced by setOffset(), and xOffset().

double QgsLabelAttributes::mYOffset [protected]

Definition at line 219 of file qgslabelattributes.h.

Referenced by setOffset(), and yOffset().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines