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

Static Public Member Functions

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

Protected Attributes

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

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:

  • font family
  • size type (map units, points)
  • size (in points - device independent)
  • bold
  • italic
  • underline
  • color

Position:

  • (coordinates)
  • offset type (map units, points)
  • x offset, y offset (measured in text coordinate system, not in map coordinate system)
  • angle
  • alignment (from a point calculated by angle and offset)

Buffer:

  • buffer size type (map units, points)
  • buffer size
  • buffer color
  • buffer brush

Border:

  • border width
  • border color
  • border style

Each attribute is either set or unset.

Definition at line 76 of file qgslabelattributes.h.


Member Enumeration Documentation

Enumerator:
MapUnits 
PointUnits 

Definition at line 87 of file qgslabelattributes.h.


Constructor & Destructor Documentation

Constructor.

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

Definition at line 27 of file qgslabelattributes.cpp.

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


Member Function Documentation

int QgsLabelAttributes::alignment ( void  ) const

Definition at line 178 of file qgslabelattributes.cpp.

References mAlignment.

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

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

Definition at line 480 of file qgslabelattributes.cpp.

Referenced by QgsLabel::readXML().

bool QgsLabelAttributes::alignmentIsSet ( void  ) const

Definition at line 173 of file qgslabelattributes.cpp.

References mAlignmentIsSet.

Referenced by QgsLabel::writeXML().

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

Definition at line 464 of file qgslabelattributes.cpp.

References QgsDebugMsg.

Referenced by QgsLabel::writeXML().

double QgsLabelAttributes::angle ( void  ) const

Definition at line 151 of file qgslabelattributes.cpp.

References mAngle.

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

Definition at line 156 of file qgslabelattributes.cpp.

References mAngleIsAuto.

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

bool QgsLabelAttributes::angleIsSet ( void  ) const

Definition at line 146 of file qgslabelattributes.cpp.

References mAngleIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::bold ( void  ) const

Definition at line 212 of file qgslabelattributes.cpp.

References mFont.

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

bool QgsLabelAttributes::boldIsSet ( void  ) const

Definition at line 207 of file qgslabelattributes.cpp.

References mBoldIsSet.

Referenced by QgsLabel::writeXML().

QColor QgsLabelAttributes::borderColor ( void  ) const

Definition at line 384 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderColorIsSet ( void  ) const

Definition at line 379 of file qgslabelattributes.cpp.

References mBorderColorIsSet.

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

Definition at line 417 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderStyleIsSet ( void  ) const

Definition at line 412 of file qgslabelattributes.cpp.

References mBorderStyleIsSet.

int QgsLabelAttributes::borderWidth ( void  ) const

Definition at line 400 of file qgslabelattributes.cpp.

References mBorderPen.

bool QgsLabelAttributes::borderWidthIsSet ( void  ) const

Definition at line 395 of file qgslabelattributes.cpp.

References mBorderWidthIsSet.

QColor QgsLabelAttributes::bufferColor ( void  ) const

Definition at line 350 of file qgslabelattributes.cpp.

References mBufferBrush.

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

bool QgsLabelAttributes::bufferColorIsSet ( void  ) const

Definition at line 345 of file qgslabelattributes.cpp.

References mColorIsSet.

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

Definition at line 308 of file qgslabelattributes.cpp.

References mBufferEnabledFlag.

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

double QgsLabelAttributes::bufferSize ( void  ) const

Definition at line 333 of file qgslabelattributes.cpp.

References mBufferSize.

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

bool QgsLabelAttributes::bufferSizeIsSet ( void  ) const

Definition at line 323 of file qgslabelattributes.cpp.

References mBufferSizeIsSet.

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

int QgsLabelAttributes::bufferSizeType ( void  ) const

Definition at line 328 of file qgslabelattributes.cpp.

References mBufferSizeType.

Referenced by QgsLabel::writeXML().

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

Definition at line 367 of file qgslabelattributes.cpp.

References mBufferBrush.

bool QgsLabelAttributes::bufferStyleIsSet ( void  ) const

Definition at line 362 of file qgslabelattributes.cpp.

References mBufferStyleIsSet.

const QColor & QgsLabelAttributes::color ( void  ) const

Definition at line 302 of file qgslabelattributes.cpp.

References mColor.

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

bool QgsLabelAttributes::colorIsSet ( void  ) const

Definition at line 297 of file qgslabelattributes.cpp.

References mColorIsSet.

Referenced by QgsLabel::writeXML().

const QString QgsLabelAttributes::family ( void  ) const

Definition at line 195 of file qgslabelattributes.cpp.

References mFont.

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

bool QgsLabelAttributes::familyIsSet ( void  ) const

Definition at line 190 of file qgslabelattributes.cpp.

References mFamilyIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::italic ( void  ) const

Definition at line 229 of file qgslabelattributes.cpp.

References mFont.

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

bool QgsLabelAttributes::italicIsSet ( void  ) const

Definition at line 224 of file qgslabelattributes.cpp.

References mItalicIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::offsetIsSet ( void  ) const

Definition at line 119 of file qgslabelattributes.cpp.

References mOffsetIsSet.

Referenced by QgsLabel::writeXML().

int QgsLabelAttributes::offsetType ( void  ) const

Definition at line 124 of file qgslabelattributes.cpp.

References mOffsetType.

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

void QgsLabelAttributes::setAlignment ( int  alignment)

Definition at line 167 of file qgslabelattributes.cpp.

References alignment(), mAlignment, and mAlignmentIsSet.

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

void QgsLabelAttributes::setAngle ( double  angle)

Definition at line 140 of file qgslabelattributes.cpp.

References angle(), mAngle, and mAngleIsSet.

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

void QgsLabelAttributes::setAutoAngle ( bool  state)

Definition at line 161 of file qgslabelattributes.cpp.

References mAngleIsAuto.

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

void QgsLabelAttributes::setBold ( bool  enable)

Definition at line 201 of file qgslabelattributes.cpp.

References mBoldIsSet, and mFont.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setBorderColor ( const QColor &  color)

Definition at line 373 of file qgslabelattributes.cpp.

References mBorderColorIsSet, and mBorderPen.

Referenced by QgsLabelAttributes().

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

Definition at line 406 of file qgslabelattributes.cpp.

References mBorderPen, and mBorderStyleIsSet.

Referenced by QgsLabelAttributes().

Definition at line 389 of file qgslabelattributes.cpp.

References mBorderPen, and mBorderWidthIsSet.

Referenced by QgsLabelAttributes().

void QgsLabelAttributes::setBufferColor ( const QColor &  color)

Definition at line 339 of file qgslabelattributes.cpp.

References mBufferBrush, and mBufferColorIsSet.

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

void QgsLabelAttributes::setBufferEnabled ( bool  useBufferFlag)

Definition at line 312 of file qgslabelattributes.cpp.

References mBufferEnabledFlag.

Referenced by QgsLabel::readXML().

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

Definition at line 316 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 356 of file qgslabelattributes.cpp.

References mBufferBrush, and mBufferStyleIsSet.

Referenced by QgsLabelAttributes().

void QgsLabelAttributes::setColor ( const QColor &  color)

Definition at line 291 of file qgslabelattributes.cpp.

References color(), mColor, and mColorIsSet.

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

void QgsLabelAttributes::setFamily ( const QString &  family)

Definition at line 184 of file qgslabelattributes.cpp.

References mFamilyIsSet, and mFont.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setItalic ( bool  enable)

Definition at line 218 of file qgslabelattributes.cpp.

References mFont, and mItalicIsSet.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setMultilineEnabled ( bool  useMultiline)

Definition at line 427 of file qgslabelattributes.cpp.

References mMultilineEnabledFlag.

Referenced by QgsLabel::readXML().

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

Definition at line 111 of file qgslabelattributes.cpp.

References mOffsetIsSet, mOffsetType, mXOffset, and mYOffset.

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

void QgsLabelAttributes::setSelectedOnly ( bool  selectedonly)

Definition at line 437 of file qgslabelattributes.cpp.

References mSelectedOnly, and selectedOnly().

Referenced by QgsLabel::readXML().

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

Definition at line 268 of file qgslabelattributes.cpp.

References mSize, mSizeIsSet, mSizeType, and size().

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

void QgsLabelAttributes::setStrikeOut ( bool  enable)

Definition at line 251 of file qgslabelattributes.cpp.

References mFont, and mStrikeOutIsSet.

Referenced by QgsLabel::readXML().

void QgsLabelAttributes::setText ( const QString &  text)

Definition at line 93 of file qgslabelattributes.cpp.

References mText, mTextIsSet, and text().

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

void QgsLabelAttributes::setUnderline ( bool  enable)

Definition at line 235 of file qgslabelattributes.cpp.

References mFont, and mUnderlineIsSet.

Referenced by QgsLabel::readXML().

double QgsLabelAttributes::size ( void  ) const

Definition at line 285 of file qgslabelattributes.cpp.

References mSize.

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

bool QgsLabelAttributes::sizeIsSet ( void  ) const

Definition at line 275 of file qgslabelattributes.cpp.

References mSizeIsSet.

Referenced by QgsLabel::writeXML().

int QgsLabelAttributes::sizeType ( void  ) const

Definition at line 280 of file qgslabelattributes.cpp.

References mSizeType.

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

bool QgsLabelAttributes::strikeOut ( void  ) const

Definition at line 262 of file qgslabelattributes.cpp.

References mFont.

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

bool QgsLabelAttributes::strikeOutIsSet ( void  ) const

Definition at line 257 of file qgslabelattributes.cpp.

References mStrikeOutIsSet.

Referenced by QgsLabel::writeXML().

const QString QgsLabelAttributes::text ( void  ) const

Definition at line 104 of file qgslabelattributes.cpp.

References mText.

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

bool QgsLabelAttributes::textIsSet ( void  ) const

Definition at line 99 of file qgslabelattributes.cpp.

References mTextIsSet.

Referenced by QgsLabel::writeXML().

bool QgsLabelAttributes::underline ( void  ) const

Definition at line 246 of file qgslabelattributes.cpp.

References mFont.

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

bool QgsLabelAttributes::underlineIsSet ( void  ) const

Definition at line 241 of file qgslabelattributes.cpp.

References mUnderlineIsSet.

Referenced by QgsLabel::writeXML().

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

Definition at line 453 of file qgslabelattributes.cpp.

References MapUnits, and PointUnits.

Referenced by QgsLabel::readXML().

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

Definition at line 443 of file qgslabelattributes.cpp.

References MapUnits.

Referenced by QgsLabel::writeXML().

double QgsLabelAttributes::xOffset ( void  ) const

Definition at line 129 of file qgslabelattributes.cpp.

References mXOffset.

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

double QgsLabelAttributes::yOffset ( void  ) const

Definition at line 134 of file qgslabelattributes.cpp.

References mYOffset.

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


Member Data Documentation

Alignment.

Definition at line 227 of file qgslabelattributes.h.

Referenced by alignment(), and setAlignment().

Definition at line 228 of file qgslabelattributes.h.

Referenced by alignmentIsSet(), and setAlignment().

double QgsLabelAttributes::mAngle [protected]

Angle (degrees)

Definition at line 222 of file qgslabelattributes.h.

Referenced by angle(), and setAngle().

Definition at line 224 of file qgslabelattributes.h.

Referenced by angleIsAuto(), and setAutoAngle().

Definition at line 223 of file qgslabelattributes.h.

Referenced by angleIsSet(), and setAngle().

Definition at line 201 of file qgslabelattributes.h.

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

Definition at line 244 of file qgslabelattributes.h.

Referenced by borderColorIsSet(), and setBorderColor().

Border pen (color, width, style)

Definition at line 243 of file qgslabelattributes.h.

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

Definition at line 246 of file qgslabelattributes.h.

Referenced by borderStyleIsSet(), and setBorderStyle().

Definition at line 245 of file qgslabelattributes.h.

Referenced by borderWidthIsSet(), and setBorderWidth().

Buffer brush (color, style)

Definition at line 238 of file qgslabelattributes.h.

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

Definition at line 239 of file qgslabelattributes.h.

Referenced by setBufferColor().

Buffer enablement.

Definition at line 231 of file qgslabelattributes.h.

Referenced by bufferEnabled(), and setBufferEnabled().

double QgsLabelAttributes::mBufferSize [protected]

Definition at line 234 of file qgslabelattributes.h.

Referenced by bufferSize(), and setBufferSize().

Definition at line 235 of file qgslabelattributes.h.

Referenced by bufferSizeIsSet(), and setBufferSize().

Buffer size, size type.

Definition at line 233 of file qgslabelattributes.h.

Referenced by bufferSizeType(), and setBufferSize().

Definition at line 240 of file qgslabelattributes.h.

Referenced by bufferStyleIsSet(), and setBufferStyle().

QColor QgsLabelAttributes::mColor [protected]

Color.

Definition at line 212 of file qgslabelattributes.h.

Referenced by color(), and setColor().

Definition at line 213 of file qgslabelattributes.h.

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

Definition at line 200 of file qgslabelattributes.h.

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

QFont QgsLabelAttributes::mFont [protected]

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

Definition at line 199 of file qgslabelattributes.h.

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

Definition at line 202 of file qgslabelattributes.h.

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

Multiline enablement.

Definition at line 249 of file qgslabelattributes.h.

Referenced by multilineEnabled(), and setMultilineEnabled().

Definition at line 219 of file qgslabelattributes.h.

Referenced by offsetIsSet(), and setOffset().

Offset.

Definition at line 216 of file qgslabelattributes.h.

Referenced by offsetType(), and setOffset().

Label only selected.

Definition at line 252 of file qgslabelattributes.h.

Referenced by selectedOnly(), and setSelectedOnly().

double QgsLabelAttributes::mSize [protected]

Definition at line 208 of file qgslabelattributes.h.

Referenced by setSize(), and size().

Definition at line 209 of file qgslabelattributes.h.

Referenced by setSize(), and sizeIsSet().

Font size, size type.

Definition at line 207 of file qgslabelattributes.h.

Referenced by setSize(), and sizeType().

Definition at line 204 of file qgslabelattributes.h.

Referenced by setStrikeOut(), and strikeOutIsSet().

QString QgsLabelAttributes::mText [protected]

Definition at line 195 of file qgslabelattributes.h.

Referenced by setText(), and text().

Definition at line 196 of file qgslabelattributes.h.

Referenced by setText(), and textIsSet().

Definition at line 203 of file qgslabelattributes.h.

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

double QgsLabelAttributes::mXOffset [protected]

Definition at line 217 of file qgslabelattributes.h.

Referenced by setOffset(), and xOffset().

double QgsLabelAttributes::mYOffset [protected]

Definition at line 218 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 Properties Friends Defines