Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 qgslabelattributes.h - render vector labels 00003 ------------------- 00004 begin : August 2004 00005 copyright : (C) 2004 by Radim Blazek 00006 email : blazek@itc.it 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 /* $Id$ */ 00017 #ifndef QGSLABELATTRIBUTES_H 00018 #define QGSLABELATTRIBUTES_H 00019 00020 #include <QBrush> 00021 #include <QFont> 00022 #include <QPen> 00023 00024 class QString; 00025 class QColor; 00026 00077 class CORE_EXPORT QgsLabelAttributes 00078 { 00079 public: 00083 QgsLabelAttributes( bool def = true ); 00084 00085 ~QgsLabelAttributes(); 00086 00087 /* Units type */ 00088 enum Units 00089 { 00090 MapUnits = 0, 00091 PointUnits 00092 }; 00093 00094 static QString unitsName( int units ); 00095 static int unitsCode( const QString &name ); 00096 00097 static QString alignmentName( int alignment ); 00098 static int alignmentCode( const QString &name ); 00099 00100 /* Text */ 00101 void setText( const QString & text ); 00102 bool textIsSet( void ) const; 00103 const QString text( void ) const; 00104 00105 /* Font */ 00106 void setFamily( const QString & family ); 00107 bool familyIsSet( void ) const; 00108 const QString family( void ) const; 00109 00110 void setBold( bool enable ); 00111 bool boldIsSet( void ) const; 00112 bool bold( void ) const; 00113 00114 void setItalic( bool enable ); 00115 bool italicIsSet( void ) const; 00116 bool italic( void ) const; 00117 00118 void setUnderline( bool enable ); 00119 bool underlineIsSet( void ) const; 00120 bool underline( void ) const; 00121 00122 /* strikeout added in 1.5 */ 00123 void setStrikeOut( bool enable ); 00124 bool strikeOutIsSet( void ) const; 00125 bool strikeOut( void ) const; 00126 00127 void setSize( double size, int type ); 00128 bool sizeIsSet( void ) const; 00129 int sizeType( void ) const; 00130 double size( void ) const; 00131 00132 void setColor( const QColor &color ); 00133 bool colorIsSet( void ) const; 00134 const QColor & color( void ) const; 00135 00136 /* Offset */ 00137 void setOffset( double x, double y, int type ); 00138 bool offsetIsSet( void ) const; 00139 int offsetType( void ) const; 00140 double xOffset( void ) const; 00141 double yOffset( void ) const; 00142 00143 /* Angle */ 00144 void setAngle( double angle ); 00145 bool angleIsSet( void ) const; 00146 double angle( void ) const; 00147 00148 bool angleIsAuto( void ) const; 00149 void setAutoAngle( bool state ); 00150 00151 /* Alignment */ 00152 void setAlignment( int alignment ); 00153 bool alignmentIsSet( void ) const; 00154 int alignment( void ) const; 00155 00156 /* Buffer */ 00157 bool bufferEnabled() const; 00158 void setBufferEnabled( bool useBufferFlag ); 00159 void setBufferSize( double size, int type ); 00160 bool bufferSizeIsSet( void ) const; 00161 int bufferSizeType( void ) const; 00162 double bufferSize( void ) const; 00163 00164 void setBufferColor( const QColor &color ); 00165 bool bufferColorIsSet( void ) const; 00166 QColor bufferColor( void ) const; 00167 00168 void setBufferStyle( Qt::BrushStyle style ); 00169 bool bufferStyleIsSet( void ) const; 00170 Qt::BrushStyle bufferStyle( void ) const; 00171 00172 /* Border */ 00173 void setBorderColor( const QColor &color ); 00174 bool borderColorIsSet( void ) const; 00175 QColor borderColor( void ) const; 00176 00177 void setBorderWidth( int width ); 00178 bool borderWidthIsSet( void ) const; 00179 int borderWidth( void ) const; 00180 00181 void setBorderStyle( Qt::PenStyle style ); 00182 bool borderStyleIsSet( void ) const; 00183 Qt::PenStyle borderStyle( void ) const; 00184 00185 bool multilineEnabled() const; 00186 void setMultilineEnabled( bool useMultiline ); 00187 00188 /* label only selected features 00189 * added in 1.5 00190 */ 00191 bool selectedOnly() const; 00192 void setSelectedOnly( bool selectedonly ); 00193 00194 protected: 00195 /* Text */ 00196 QString mText; 00197 bool mTextIsSet; 00198 00200 QFont mFont; 00201 bool mFamilyIsSet; 00202 bool mBoldIsSet; 00203 bool mItalicIsSet; 00204 bool mUnderlineIsSet; 00205 bool mStrikeOutIsSet; 00206 00208 int mSizeType; 00209 double mSize; 00210 bool mSizeIsSet; 00211 00213 QColor mColor; 00214 bool mColorIsSet; 00215 00217 int mOffsetType; 00218 double mXOffset; 00219 double mYOffset; 00220 bool mOffsetIsSet; 00221 00223 double mAngle; 00224 bool mAngleIsSet; 00225 bool mAngleIsAuto; 00226 00228 int mAlignment; 00229 bool mAlignmentIsSet; 00230 00232 bool mBufferEnabledFlag; 00234 int mBufferSizeType; 00235 double mBufferSize; 00236 bool mBufferSizeIsSet; 00237 00239 QBrush mBufferBrush; 00240 bool mBufferColorIsSet; 00241 bool mBufferStyleIsSet; 00242 00244 QPen mBorderPen; 00245 bool mBorderColorIsSet; 00246 bool mBorderWidthIsSet; 00247 bool mBorderStyleIsSet; 00248 00250 bool mMultilineEnabledFlag; 00251 00253 bool mSelectedOnly; 00254 }; 00255 00256 #endif