Quantum GIS API Documentation  master-ce49b66
src/gui/symbology-ng/qgssymbollayerv2widget.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgssymbollayerv2widget.h - symbol layer widgets
00003 
00004     ---------------------
00005     begin                : November 2009
00006     copyright            : (C) 2009 by Martin Dobias
00007     email                : wonder dot sk at gmail dot com
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 
00017 #ifndef QGSSYMBOLLAYERV2WIDGET_H
00018 #define QGSSYMBOLLAYERV2WIDGET_H
00019 
00020 #include <QWidget>
00021 
00022 class QgsSymbolLayerV2;
00023 class QgsVectorLayer;
00024 
00025 
00026 class GUI_EXPORT QgsSymbolLayerV2Widget : public QWidget
00027 {
00028     Q_OBJECT
00029 
00030   public:
00031     QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 ) : QWidget( parent ), mVectorLayer( vl ) {}
00032     virtual ~QgsSymbolLayerV2Widget() {}
00033 
00034     virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0;
00035     virtual QgsSymbolLayerV2* symbolLayer() = 0;
00036 
00037   protected:
00038     const QgsVectorLayer* mVectorLayer;
00039 
00040   signals:
00041     void changed();
00042 };
00043 
00045 
00046 #include "ui_widget_simpleline.h"
00047 
00048 class QgsSimpleLineSymbolLayerV2;
00049 
00050 class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleLine
00051 {
00052     Q_OBJECT
00053 
00054   public:
00055     QgsSimpleLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00056 
00057     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSimpleLineSymbolLayerV2Widget( vl ); }
00058 
00059     // from base class
00060     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00061     virtual QgsSymbolLayerV2* symbolLayer();
00062 
00063   public slots:
00064     void penWidthChanged();
00065     void colorChanged( const QColor& color );
00066     void penStyleChanged();
00067     void offsetChanged();
00068     void on_mCustomCheckBox_stateChanged( int state );
00069     void on_mChangePatternButton_clicked();
00070     void on_mPenWidthUnitComboBox_currentIndexChanged( int index );
00071     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00072     void on_mDashPatternUnitComboBox_currentIndexChanged( int index );
00073     void on_mDataDefinedPropertiesButton_clicked();
00074 
00075   protected:
00076     QgsSimpleLineSymbolLayerV2* mLayer;
00077 
00078     //creates a new icon for the 'change pattern' button
00079     void updatePatternIcon();
00080 };
00081 
00083 
00084 #include "ui_widget_simplemarker.h"
00085 
00086 class QgsSimpleMarkerSymbolLayerV2;
00087 
00088 class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleMarker
00089 {
00090     Q_OBJECT
00091 
00092   public:
00093     QgsSimpleMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00094 
00095     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSimpleMarkerSymbolLayerV2Widget( vl ); }
00096 
00097     // from base class
00098     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00099     virtual QgsSymbolLayerV2* symbolLayer();
00100 
00101   public slots:
00102     void setName();
00103     void setColorBorder( const QColor& color );
00104     void setColorFill( const QColor& color );
00105     void setSize();
00106     void setAngle();
00107     void setOffset();
00108     void on_mSizeUnitComboBox_currentIndexChanged( int index );
00109     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00110     void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index );
00111     void on_mDataDefinedPropertiesButton_clicked();
00112     void on_mOutlineWidthSpinBox_valueChanged( double d );
00113 
00114   protected:
00115     QgsSimpleMarkerSymbolLayerV2* mLayer;
00116 };
00117 
00119 
00120 #include "ui_widget_simplefill.h"
00121 
00122 class QgsSimpleFillSymbolLayerV2;
00123 
00124 class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleFill
00125 {
00126     Q_OBJECT
00127 
00128   public:
00129     QgsSimpleFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00130 
00131     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSimpleFillSymbolLayerV2Widget( vl ); }
00132 
00133     // from base class
00134     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00135     virtual QgsSymbolLayerV2* symbolLayer();
00136 
00137   public slots:
00138     void setColor( const QColor& color );
00139     void setBorderColor( const QColor& color );
00140     void setBrushStyle();
00141     void borderWidthChanged();
00142     void borderStyleChanged();
00143     void offsetChanged();
00144     void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
00145     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00146     void on_mDataDefinedPropertiesButton_clicked();
00147 
00148   protected:
00149     QgsSimpleFillSymbolLayerV2* mLayer;
00150 };
00151 
00152 
00154 
00155 #include "ui_widget_markerline.h"
00156 
00157 class QgsMarkerLineSymbolLayerV2;
00158 
00159 class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetMarkerLine
00160 {
00161     Q_OBJECT
00162 
00163   public:
00164     QgsMarkerLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00165 
00166     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsMarkerLineSymbolLayerV2Widget( vl ); }
00167 
00168     // from base class
00169     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00170     virtual QgsSymbolLayerV2* symbolLayer();
00171 
00172   public slots:
00173 
00174     void setInterval( double val );
00175     void setRotate();
00176     void setOffset();
00177     void setPlacement();
00178     void on_mIntervalUnitComboBox_currentIndexChanged( int index );
00179     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00180     void on_mDataDefinedPropertiesButton_clicked();
00181 
00182   protected:
00183 
00184     QgsMarkerLineSymbolLayerV2* mLayer;
00185 };
00186 
00187 
00189 
00190 #include "ui_widget_svgmarker.h"
00191 
00192 class QgsSvgMarkerSymbolLayerV2;
00193 
00194 class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSvgMarker
00195 {
00196     Q_OBJECT
00197 
00198   public:
00199     QgsSvgMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00200 
00201     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSvgMarkerSymbolLayerV2Widget( vl ); }
00202 
00203     // from base class
00204     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00205     virtual QgsSymbolLayerV2* symbolLayer();
00206 
00207   public slots:
00208     void setName( const QModelIndex& idx );
00209     void populateIcons( const QModelIndex& idx );
00210     void setSize();
00211     void setAngle();
00212     void setOffset();
00213     void on_mFileToolButton_clicked();
00214     void on_mFileLineEdit_textEdited( const QString& text );
00215     void on_mFileLineEdit_editingFinished();
00216     void on_mChangeColorButton_colorChanged( const QColor& color );
00217     void on_mChangeBorderColorButton_colorChanged( const QColor& color );
00218     void on_mBorderWidthSpinBox_valueChanged( double d );
00219     void on_mSizeUnitComboBox_currentIndexChanged( int index );
00220     void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
00221     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00222     void on_mDataDefinedPropertiesButton_clicked();
00223 
00224   protected:
00225 
00226     void populateList();
00227     //update gui for svg file (insert new path, update activation of gui elements for svg params)
00228     void setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer );
00229 
00230     QgsSvgMarkerSymbolLayerV2* mLayer;
00231 };
00232 
00233 
00235 
00236 #include "ui_widget_linedecoration.h"
00237 
00238 class QgsLineDecorationSymbolLayerV2;
00239 
00240 class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetLineDecoration
00241 {
00242     Q_OBJECT
00243 
00244   public:
00245     QgsLineDecorationSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00246 
00247     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsLineDecorationSymbolLayerV2Widget( vl ); }
00248 
00249     // from base class
00250     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00251     virtual QgsSymbolLayerV2* symbolLayer();
00252 
00253   public slots:
00254     void colorChanged( const QColor& color );
00255     void penWidthChanged();
00256     void on_mWidthUnitComboBox_currentIndexChanged( int index );
00257 
00258   protected:
00259     QgsLineDecorationSymbolLayerV2* mLayer;
00260 };
00261 
00263 
00264 #include "ui_widget_svgfill.h"
00265 
00266 class QgsSVGFillSymbolLayer;
00267 
00268 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetSVGFill
00269 {
00270     Q_OBJECT
00271 
00272   public:
00273     QgsSVGFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00274 
00275     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSVGFillSymbolLayerWidget( vl ); }
00276 
00277     // from base class
00278     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00279     virtual QgsSymbolLayerV2* symbolLayer();
00280 
00281   protected:
00282     QgsSVGFillSymbolLayer* mLayer;
00283     void insertIcons();
00284     void updateParamGui();
00285 
00286   private slots:
00287     void on_mBrowseToolButton_clicked();
00288     void on_mTextureWidthSpinBox_valueChanged( double d );
00289     void on_mSVGLineEdit_textEdited( const QString & text );
00290     void on_mSVGLineEdit_editingFinished();
00291     void setFile( const QModelIndex& item );
00292     void populateIcons( const QModelIndex& item );
00293     void on_mRotationSpinBox_valueChanged( double d );
00294     void on_mChangeColorButton_colorChanged( const QColor& color );
00295     void on_mChangeBorderColorButton_colorChanged( const QColor& color );
00296     void on_mBorderWidthSpinBox_valueChanged( double d );
00297     void on_mTextureWidthUnitComboBox_currentIndexChanged( int index );
00298     void on_mSvgOutlineWidthUnitComboBox_currentIndexChanged( int index );
00299     void on_mDataDefinedPropertiesButton_clicked();
00300 };
00301 
00303 
00304 #include "ui_widget_linepatternfill.h"
00305 
00306 class QgsLinePatternFillSymbolLayer;
00307 
00308 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetLinePatternFill
00309 {
00310     Q_OBJECT
00311 
00312   public:
00313 
00314     QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00315     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsLinePatternFillSymbolLayerWidget( vl ); }
00316 
00317     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00318     virtual QgsSymbolLayerV2* symbolLayer();
00319 
00320   protected:
00321     QgsLinePatternFillSymbolLayer* mLayer;
00322 
00323   private slots:
00324     void on_mAngleSpinBox_valueChanged( double d );
00325     void on_mDistanceSpinBox_valueChanged( double d );
00326     void on_mLineWidthSpinBox_valueChanged( double d );
00327     void on_mOffsetSpinBox_valueChanged( double d );
00328     void on_mColorPushButton_colorChanged( const QColor& color );
00329     void on_mDistanceUnitComboBox_currentIndexChanged( int index );
00330     void on_mLineWidthUnitComboBox_currentIndexChanged( int index );
00331     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00332     void on_mDataDefinedPropertiesButton_clicked();
00333 };
00334 
00336 
00337 #include "ui_widget_pointpatternfill.h"
00338 
00339 class QgsPointPatternFillSymbolLayer;
00340 
00341 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Widget, private Ui::WidgetPointPatternFill
00342 {
00343     Q_OBJECT
00344 
00345   public:
00346     QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00347     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsPointPatternFillSymbolLayerWidget( vl ); }
00348 
00349     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00350     virtual QgsSymbolLayerV2* symbolLayer();
00351 
00352   protected:
00353     QgsPointPatternFillSymbolLayer* mLayer;
00354 
00355   private slots:
00356     void on_mHorizontalDistanceSpinBox_valueChanged( double d );
00357     void on_mVerticalDistanceSpinBox_valueChanged( double d );
00358     void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
00359     void on_mVerticalDisplacementSpinBox_valueChanged( double d );
00360     void on_mHorizontalDistanceUnitComboBox_currentIndexChanged( int index );
00361     void on_mVerticalDistanceUnitComboBox_currentIndexChanged( int index );
00362     void on_mHorizontalDisplacementUnitComboBox_currentIndexChanged( int index );
00363     void on_mVerticalDisplacementUnitComboBox_currentIndexChanged( int index );
00364     void on_mDataDefinedPropertiesButton_clicked();
00365 };
00366 
00368 
00369 #include "ui_widget_fontmarker.h"
00370 
00371 class QgsFontMarkerSymbolLayerV2;
00372 class CharacterWidget;
00373 
00374 class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetFontMarker
00375 {
00376     Q_OBJECT
00377 
00378   public:
00379     QgsFontMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00380 
00381     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsFontMarkerSymbolLayerV2Widget( vl ); }
00382 
00383     // from base class
00384     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00385     virtual QgsSymbolLayerV2* symbolLayer();
00386 
00387   public slots:
00388     void setFontFamily( const QFont& font );
00389     void setColor( const QColor& color );
00390     void setSize( double size );
00391     void setAngle( double angle );
00392     void setCharacter( const QChar& chr );
00393     void setOffset();
00394     void on_mSizeUnitComboBox_currentIndexChanged( int index );
00395     void on_mOffsetUnitComboBox_currentIndexChanged( int index );
00396 
00397   protected:
00398     QgsFontMarkerSymbolLayerV2* mLayer;
00399     CharacterWidget* widgetChar;
00400 };
00401 
00403 
00404 
00405 #include "ui_widget_centroidfill.h"
00406 
00407 class QgsCentroidFillSymbolLayerV2;
00408 
00409 class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetCentroidFill
00410 {
00411     Q_OBJECT
00412 
00413   public:
00414     QgsCentroidFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
00415 
00416     static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsCentroidFillSymbolLayerV2Widget( vl ); }
00417 
00418     // from base class
00419     virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
00420     virtual QgsSymbolLayerV2* symbolLayer();
00421 
00422   protected:
00423     QgsCentroidFillSymbolLayerV2* mLayer;
00424 };
00425 
00426 
00427 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines