File indexing completed on 2024-05-12 03:50:14

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com>
0004 //
0005 
0006 #ifndef GEODATALISTSTYLE_H
0007 #define GEODATALISTSTYLE_H
0008 
0009 #include "MarbleGlobal.h"
0010 #include "GeoDataObject.h"
0011 #include "geodata_export.h"
0012 
0013 #include <QColor>
0014 #include <QVector>
0015 
0016 
0017 namespace Marble
0018 {
0019 
0020 class GeoDataListStylePrivate;
0021 class GeoDataItemIcon;
0022 
0023 /**
0024  */
0025 class GEODATA_EXPORT GeoDataListStyle : public GeoDataObject
0026 {
0027 public:
0028     GeoDataListStyle();
0029 
0030     GeoDataListStyle( const GeoDataListStyle &other );
0031 
0032     GeoDataListStyle& operator=( const GeoDataListStyle &other );
0033 
0034     bool operator==( const GeoDataListStyle &other ) const;
0035     bool operator!=( const GeoDataListStyle &other ) const;
0036 
0037     ~GeoDataListStyle() override;
0038 
0039     /** Provides type information for downcasting a GeoNode */
0040     const char* nodeType() const override;
0041 
0042     enum ListItemType {
0043         Check,
0044         RadioFolder,
0045         CheckOffOnly,
0046         CheckHideChildren
0047     };
0048 
0049     ListItemType listItemType() const;
0050     void setListItemType(ListItemType type);
0051 
0052     QColor backgroundColor() const;
0053     void setBackgroundColor( const QColor &color );
0054 
0055     QVector<GeoDataItemIcon*> itemIconList() const;
0056 
0057     GeoDataItemIcon* child( int );
0058 
0059     const GeoDataItemIcon* child( int ) const;
0060 
0061     int childPosition( const GeoDataItemIcon *child ) const;
0062 
0063     void append( GeoDataItemIcon *other );
0064 
0065     void remove( int index );
0066 
0067     int size() const;
0068 
0069     GeoDataItemIcon& at( int pos );
0070     const GeoDataItemIcon& at( int pos ) const;
0071 
0072     GeoDataItemIcon& last();
0073     const GeoDataItemIcon& last() const;
0074 
0075     GeoDataItemIcon& first();
0076     const GeoDataItemIcon& first() const;
0077 
0078     QVector<GeoDataItemIcon*>::Iterator begin();
0079     QVector<GeoDataItemIcon*>::Iterator end();
0080     QVector<GeoDataItemIcon*>::ConstIterator constBegin() const;
0081     QVector<GeoDataItemIcon*>::ConstIterator constEnd() const;
0082     void clear();
0083 
0084     void pack( QDataStream& stream ) const override;
0085 
0086     void unpack( QDataStream& stream ) override;
0087 
0088 private:
0089     friend class GeoDataItemIcon;
0090     GeoDataListStylePrivate* const d;
0091 };
0092 
0093 }
0094 
0095 #endif