File indexing completed on 2025-01-05 03:58:57
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de> 0004 // 0005 0006 0007 #ifndef MARBLE_GEODATALINESTYLE_H 0008 #define MARBLE_GEODATALINESTYLE_H 0009 0010 #include <QVector> 0011 0012 #include "GeoDataColorStyle.h" 0013 0014 #include "digikam_export.h" 0015 0016 namespace Marble 0017 { 0018 0019 class GeoDataLineStylePrivate; 0020 0021 /** 0022 * @short specifies the style how lines are drawn 0023 * 0024 * A GeoDataLineStyle specifies how the <b>name</b> of a 0025 * GeoDataFeature is drawn in the viewer. A custom color, color mode 0026 * (both inherited from GeoDataColorStyle) and width for the width 0027 * of the line. 0028 */ 0029 class DIGIKAM_EXPORT GeoDataLineStyle : public GeoDataColorStyle 0030 { 0031 public: 0032 /// Construct a new GeoDataLineStyle 0033 GeoDataLineStyle(); 0034 GeoDataLineStyle( const GeoDataLineStyle& other ); 0035 /** 0036 * @brief Construct a new GeoDataLineStyle 0037 * @param color the color to use when showing the name @see GeoDataColorStyle 0038 */ 0039 explicit GeoDataLineStyle( const QColor &color ); 0040 0041 ~GeoDataLineStyle() override; 0042 0043 /** 0044 * @brief assignment operator 0045 */ 0046 GeoDataLineStyle& operator=( const GeoDataLineStyle& other ); 0047 0048 bool operator==( const GeoDataLineStyle &other ) const; 0049 bool operator!=( const GeoDataLineStyle &other ) const; 0050 0051 /// Provides type information for downcasting a GeoData 0052 const char* nodeType() const override; 0053 0054 /** 0055 * @brief Set the width of the line 0056 * @param width the new width 0057 */ 0058 void setWidth(float width); 0059 /** 0060 * @brief Return the current width of the line 0061 * @return the current width 0062 */ 0063 float width() const; 0064 0065 /** 0066 * @brief Set the physical width of the line (in meters) 0067 * @param realWidth the new width 0068 */ 0069 void setPhysicalWidth(float realWidth); 0070 /** 0071 * @brief Return the current physical width of the line 0072 * @return the current width 0073 */ 0074 float physicalWidth() const; 0075 0076 /** 0077 * @brief Set whether the line has a cosmetic 1 pixel outline 0078 */ 0079 void setCosmeticOutline( bool enabled ); 0080 /** 0081 * @brief Return whether the line has a cosmetic 1 pixel outline 0082 */ 0083 bool cosmeticOutline() const; 0084 0085 0086 /** 0087 * @brief Set pen cap style 0088 * @param style cap style 0089 */ 0090 void setCapStyle( Qt::PenCapStyle style ); 0091 0092 /** 0093 * @brief Return the current pen cap style 0094 * @return the current pen cap style 0095 */ 0096 Qt::PenCapStyle capStyle() const; 0097 0098 /** 0099 * @brief Set pen cap style 0100 * @param style cap style 0101 */ 0102 void setPenStyle( Qt::PenStyle style ); 0103 0104 /** 0105 * @brief Return the current pen cap style 0106 * @return the current pen cap style 0107 */ 0108 Qt::PenStyle penStyle() const; 0109 0110 /** 0111 * @brief Set whether to draw the solid background 0112 * @param background @c true if the background should be solid 0113 */ 0114 void setBackground( bool background ); 0115 0116 /** 0117 * @brief Return true if background get drawn 0118 * @return 0119 */ 0120 bool background() const; 0121 0122 /** 0123 * @brief Sets the dash pattern 0124 * @param pattern dash pattern 0125 */ 0126 void setDashPattern( const QVector<qreal>& pattern ); 0127 0128 /** 0129 * @brief Return the current dash pattern 0130 * @return the current dash pattern 0131 */ 0132 QVector<qreal> dashPattern() const; 0133 0134 /** 0135 * @brief Serialize the style to a stream. 0136 * @param stream the stream 0137 */ 0138 void pack( QDataStream& stream ) const override; 0139 /** 0140 * @brief Unserialize the style from a stream 0141 * @param stream the stream 0142 */ 0143 void unpack( QDataStream& stream ) override; 0144 0145 private: 0146 GeoDataLineStylePrivate * const d; 0147 }; 0148 0149 } 0150 0151 #endif