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

« back to all changes in this revision

Viewing changes to src/core/symbology/qgsmarkercatalogue.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
                             qgsmarkercatalogue.h
 
3
                             -------------------
 
4
    begin                : March 2005
 
5
    copyright            : (C) 2005 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
#ifndef QGSMARKERCATALOGUE_H
 
17
#define QGSMARKERCATALOGUE_H
 
18
 
 
19
#include <QStringList>
 
20
 
 
21
class QImage;
 
22
class QString;
 
23
class QPicture;
 
24
class QPen;
 
25
class QBrush;
 
26
class QPainter;
 
27
 
 
28
 
 
29
/** Catalogue of point symbols */
 
30
class CORE_EXPORT QgsMarkerCatalogue : public QObject
 
31
{
 
32
    Q_OBJECT
 
33
  public:
 
34
    //! Destructor
 
35
    ~QgsMarkerCatalogue();
 
36
 
 
37
    //! Access to canonical QgsMarkerCatalogue instance
 
38
    static QgsMarkerCatalogue *instance();
 
39
 
 
40
    /**List of available markers*/
 
41
    QStringList list();
 
42
 
 
43
    /** Returns pixmap of the marker
 
44
     * \param fullName full name, e.g. hard:circle, svg:/home/usr1/marker1.svg
 
45
     */
 
46
    QImage imageMarker( QString fullName, double size, QPen pen, QBrush brush, double opacity = 1.0 );
 
47
 
 
48
    /** Returns qpicture of the marker
 
49
     * \param fullName full name, e.g. hard:circle, svg:/home/usr1/marker1.svg
 
50
     */
 
51
    QPicture pictureMarker( QString fullName, double size, QPen pen, QBrush brush, double opacity = 1.0 );
 
52
 
 
53
    /** Returns a pixmap given a file name of a svg marker
 
54
     *  NOTE: this method needs to be public static for QgsMarkerDialog::visualizeMarkers */
 
55
    static bool svgMarker( QPainter * thepPainter, QString name, double size );
 
56
 
 
57
  public slots:
 
58
    void refreshList();
 
59
 
 
60
  signals:
 
61
    void markersRefreshed();
 
62
 
 
63
  private:
 
64
 
 
65
    /**Constructor*/
 
66
    QgsMarkerCatalogue();
 
67
 
 
68
    static QgsMarkerCatalogue *mMarkerCatalogue;
 
69
 
 
70
    /** List of availabel markers*/
 
71
    QStringList mList;
 
72
 
 
73
    /** Hard coded */
 
74
    void hardMarker( QPainter * thepPainter, int imageSize, QString name, double size, QPen pen, QBrush brush );
 
75
 
 
76
    bool fontMarker( QPainter * thepPainter, QString name, double size );
 
77
 
 
78
};
 
79
 
 
80
#endif // QGSMARKERCATALOGUE_H
 
81
 
 
82