~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/app/qgslabeldialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                         qgslabeldialog.h  -  render vector labels
 
3
                             -------------------
 
4
    begin                : August 2004
 
5
    copyright            : (C) 2004 by Radim Blazek
 
6
    email                : blazek@itc.it
 
7
 ***************************************************************************/
 
8
/***************************************************************************
 
9
 *                                                                         *
 
10
 *   This program is free software; you can redistribute it and/or modify  *
 
11
 *   it under the terms of the GNU General Public License as published by  *
 
12
 *   the Free Software Foundation; either version 2 of the License, or     *
 
13
 *   (at your option) any later version.                                   *
 
14
 *                                                                         *
 
15
 ***************************************************************************/
 
16
/* $Id$ */
 
17
 
 
18
#ifndef QGSLABELDIALOG_H
 
19
#define QGSLABELDIALOG_H
 
20
 
 
21
#include "ui_qgslabeldialogbase.h"
 
22
 
 
23
class QgsLabel;
 
24
 
 
25
 
 
26
/** QgsLabelDialog is the dialog for label. */
 
27
class QgsLabelDialog: public QWidget, private Ui::QgsLabelDialogBase
 
28
{
 
29
    Q_OBJECT
 
30
 
 
31
  public:
 
32
    QgsLabelDialog( QgsLabel *label,  QWidget * parent = 0 );
 
33
    ~QgsLabelDialog();
 
34
    int itemNoForField( QString theFieldName, QStringList theFieldList );
 
35
 
 
36
    /* Attributes in order used in the table */
 
37
    enum Attribute
 
38
    {
 
39
      Text = 0,
 
40
      Family,
 
41
      Size,
 
42
      Bold,
 
43
      Italic,
 
44
      Underline,
 
45
      Color,
 
46
      XCoordinate,
 
47
      YCoordinate,
 
48
      XOffset,
 
49
      YOffset,
 
50
      Angle,
 
51
      Alignment,
 
52
      BufferSize,
 
53
      BufferColor,
 
54
      BufferBrush,
 
55
      BorderWidth,
 
56
      BorderColor,
 
57
      BorderStyle,
 
58
      AttributeCount
 
59
    };
 
60
 
 
61
  public slots:
 
62
    /** applies the changes to the label class */
 
63
    void apply( void );
 
64
 
 
65
    /** Change font - reimplements method from base class*/
 
66
    void changeFont( );
 
67
 
 
68
    /** Change color - reimplements method from base class */
 
69
    void changeBufferColor( );
 
70
    void changeFontColor( );
 
71
 
 
72
    /** Initialise dialog to vector layer values */
 
73
    void init( void );
 
74
 
 
75
    void on_cboLabelField_activated( int ) {emit labelSourceSet(); }
 
76
 
 
77
    void on_spinFontSize_valueChanged( double d ) { mFont.setPointSizeF( d ); lblSample->setFont( mFont ); }
 
78
 
 
79
  signals:
 
80
    /* emitted when an item in label source list is chosen */
 
81
    void labelSourceSet();
 
82
 
 
83
  protected:
 
84
 
 
85
    /** return field index based on field's name, -1 if not found */
 
86
    int fieldIndexFromName( QString name );
 
87
 
 
88
  private:
 
89
    QgsLabel *mLabel;
 
90
    QColor    mFontColor;
 
91
    QColor    mBufferColor;
 
92
    QFont     mFont;
 
93
};
 
94
 
 
95
#endif