/
qgslabelinggui.h
133 lines (108 loc) · 4.74 KB
/
qgslabelinggui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/***************************************************************************
qgslabelinggui.h
Smart labeling for vector layers
-------------------
begin : June 2009
copyright : (C) Martin Dobias
email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QgsLabelingGUI_H
#define QgsLabelingGUI_H
#include <QDialog>
#include <QFontDatabase>
#include <ui_qgslabelingguibase.h>
class QgsVectorLayer;
class QgsMapCanvas;
class QgsCharacterSelectorDialog;
#include "qgspallabeling.h"
class APP_EXPORT QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
{
Q_OBJECT
public:
QgsLabelingGui( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QWidget* parent );
~QgsLabelingGui();
QgsPalLayerSettings layerSettings();
void writeSettingsToLayer();
public slots:
void init();
void collapseSample( bool collapse );
void apply();
void changeTextColor( const QColor &color );
void showEngineConfigDialog();
void changeBufferColor( const QColor &color );
void updateUi();
void updatePreview();
void scrollPreview();
void updatePlacementWidgets();
void updateSvgWidgets( const QString& svgPath );
void on_mLabelModeComboBox_currentIndexChanged( int index );
void on_mPreviewSizeSlider_valueChanged( int i );
void on_mFontSizeSpinBox_valueChanged( double d );
void on_mFontCapitalsComboBox_currentIndexChanged( int index );
void on_mFontFamilyCmbBx_currentFontChanged( const QFont& f );
void on_mFontStyleComboBox_currentIndexChanged( const QString & text );
void on_mFontUnderlineBtn_toggled( bool ckd );
void on_mFontStrikethroughBtn_toggled( bool ckd );
void on_mFontWordSpacingSpinBox_valueChanged( double spacing );
void on_mFontLetterSpacingSpinBox_valueChanged( double spacing );
void on_mFontSizeUnitWidget_changed();
void on_mFontMinPixelSpinBox_valueChanged( int px );
void on_mFontMaxPixelSpinBox_valueChanged( int px );
void on_mBufferUnitWidget_changed();
void on_mCoordXDDBtn_dataDefinedActivated( bool active );
void on_mCoordYDDBtn_dataDefinedActivated( bool active );
void on_mShapeTypeCmbBx_currentIndexChanged( int index );
void on_mShapeRotationCmbBx_currentIndexChanged( int index );
void on_mShapeSVGParamsBtn_clicked();
void on_mShapeSVGSelectorBtn_clicked();
void on_mPreviewTextEdit_textChanged( const QString & text );
void on_mPreviewTextBtn_clicked();
void on_mPreviewBackgroundBtn_colorChanged( const QColor &color );
void on_mDirectSymbLeftToolBtn_clicked();
void on_mDirectSymbRightToolBtn_clicked();
void on_mChkNoObstacle_toggled( bool active );
protected:
void blockInitSignals( bool block );
void blockFontChangeSignals( bool blk );
void setPreviewBackground( QColor color );
void syncDefinedCheckboxFrame( QgsDataDefinedButton* ddBtn, QCheckBox* chkBx, QFrame* f );
void populateFontCapitalsComboBox();
void populateFontStyleComboBox();
void populatePlacementMethods();
void populateFieldNames();
void populateDataDefinedButtons( QgsPalLayerSettings& s );
/** Sets data defined property attribute to map */
void setDataDefinedProperty( const QgsDataDefinedButton* ddBtn, QgsPalLayerSettings::DataDefinedProperties p, QgsPalLayerSettings& lyr );
void updateFont( QFont font );
private:
QgsVectorLayer* mLayer;
QgsMapCanvas* mMapCanvas;
QFontDatabase mFontDB;
QgsCharacterSelectorDialog* mCharDlg;
QButtonGroup* mQuadrantBtnGrp;
QButtonGroup* mDirectSymbBtnGrp;
QButtonGroup* mUpsidedownBtnGrp;
QButtonGroup* mPlacePointBtnGrp;
QButtonGroup* mPlaceLineBtnGrp;
QButtonGroup* mPlacePolygonBtnGrp;
// background reference font
QFont mRefFont;
int mPreviewSize;
int mMinPixelLimit;
bool mLoadSvgParams;
void enableDataDefinedAlignment( bool enable );
private slots:
void optionsStackedWidget_CurrentChanged( int indx );
void showBackgroundRadius( bool show );
void showBackgroundPenStyle( bool show );
void on_mShapeSVGPathLineEdit_textChanged( const QString& text );
void updateLinePlacementOptions();
};
#endif