File indexing completed on 2025-01-05 03:58:55
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com> 0004 // 0005 0006 #ifndef GEODATAITEMICON_H 0007 #define GEODATAITEMICON_H 0008 0009 #include <QFlags> 0010 0011 #include "GeoDataObject.h" 0012 0013 class QImage; 0014 0015 namespace Marble 0016 { 0017 0018 class GeoDataItemIconPrivate; 0019 0020 /** 0021 */ 0022 class DIGIKAM_EXPORT GeoDataItemIcon : public GeoDataObject 0023 { 0024 Q_FLAGS( ItemIconState ItemIconStates ) 0025 public: 0026 GeoDataItemIcon(); 0027 0028 GeoDataItemIcon( const GeoDataItemIcon &other ); 0029 0030 GeoDataItemIcon& operator=( const GeoDataItemIcon &other ); 0031 bool operator==( const GeoDataItemIcon &other ) const; 0032 bool operator!=( const GeoDataItemIcon &other ) const; 0033 0034 ~GeoDataItemIcon() override; 0035 0036 /** Provides type information for downcasting a GeoNode */ 0037 const char* nodeType() const override; 0038 0039 enum ItemIconState { 0040 Open = 1 << 0, 0041 Closed = 1 << 1, 0042 Error = 1 << 2, 0043 Fetching0 = 1 << 3, 0044 Fetching1 = 1 << 4, 0045 Fetching2 = 1 << 5 0046 }; 0047 Q_DECLARE_FLAGS( ItemIconStates, ItemIconState ) 0048 0049 ItemIconStates state() const; 0050 void setState(ItemIconStates state); 0051 0052 QString iconPath() const; 0053 void setIconPath( const QString &path ); 0054 0055 QImage icon() const; 0056 void setIcon( const QImage &icon ); 0057 0058 private: 0059 GeoDataItemIconPrivate* const d; 0060 }; 0061 0062 } 0063 0064 #endif