QGIS API Documentation  2.99.0-Master (7fe5405)
qgsscalebarstyle.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsscalebarstyle.h
3  ------------------
4  begin : June 2008
5  copyright : (C) 2008 by Marco Hugentobler
6  email : [email protected]
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 
17 #ifndef QGSSCALEBARSTYLE_H
18 #define QGSSCALEBARSTYLE_H
19 
20 #include <QIcon>
21 #include <QRectF>
22 
23 #include "qgis_core.h"
24 
26 class QPainter;
27 
32 class CORE_EXPORT QgsScaleBarStyle
33 {
34  public:
36  virtual ~QgsScaleBarStyle() = default;
37 
41  virtual void draw( QPainter* p, double xOffset = 0 ) const = 0; //to do by every subclass
42  virtual void drawLabels( QPainter* p ) const; //default implementation provided
43  virtual QRectF calculateBoxSize() const; //default implementation provided
44 
49  virtual QString name() const = 0;
50 
51  private:
52  QgsScaleBarStyle(); //default constructor forbidden
53 
54  protected:
56 };
57 
58 #endif
A scale bar item that can be added to a map composition.
Abstraction of composer scale bar style.
const QgsComposerScaleBar * mScaleBar