Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 qgsscalebarstyle.h 00003 ------------------ 00004 begin : June 2008 00005 copyright : (C) 2008 by Marco Hugentobler 00006 email : [email protected] 00007 ***************************************************************************/ 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 QGSSCALEBARSTYLE_H 00018 #define QGSSCALEBARSTYLE_H 00019 00020 #include <QIcon> 00021 #include <QRectF> 00022 00023 class QgsComposerScaleBar; 00024 class QPainter; 00025 00030 class CORE_EXPORT QgsScaleBarStyle 00031 { 00032 public: 00033 QgsScaleBarStyle( const QgsComposerScaleBar* bar ); 00034 virtual ~QgsScaleBarStyle(); 00035 00039 virtual void draw( QPainter* p, double xOffset = 0 ) const = 0; //to do by every subclass 00040 virtual void drawLabels( QPainter* p ) const; //default implementation provided 00041 virtual QRectF calculateBoxSize() const; //default implementation provided 00042 virtual QString name() const = 0; //return name of the style 00043 //virtual QIcon styleIcon() const = 0; 00044 00045 private: 00046 QgsScaleBarStyle(); //default constructor forbidden 00047 00048 protected: 00049 const QgsComposerScaleBar* mScaleBar; 00050 }; 00051 00052 #endif