File indexing completed on 2024-05-19 07:39:15
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2011 Guillaume Martres <smarter@ubuntu.com> 0004 // 0005 0006 #ifndef MARBLE_TRACKERPLUGINITEM_H 0007 #define MARBLE_TRACKERPLUGINITEM_H 0008 0009 #include <qglobal.h> 0010 0011 class QString; 0012 0013 namespace Marble { 0014 0015 class GeoDataPlacemark; 0016 class TrackerPluginItemPrivate; 0017 0018 /** 0019 * Subclass this to represent items in your TrackerPluginModel. 0020 */ 0021 class TrackerPluginItem 0022 { 0023 public: 0024 /** 0025 * Constructs an item and set the wrapped placemark name to @p name 0026 */ 0027 explicit TrackerPluginItem( const QString &name ); 0028 0029 /** 0030 * Destroy the item. 0031 */ 0032 virtual ~TrackerPluginItem(); 0033 0034 /** 0035 * Satellite's name 0036 */ 0037 QString name() const; 0038 0039 /** 0040 * Returns the wrapped placemark which will be displayed if this item is in a TrackerPluginModel 0041 */ 0042 GeoDataPlacemark *placemark(); 0043 0044 /** 0045 * Returns whether the item is enabled or disabled. 0046 */ 0047 virtual bool isEnabled() const; 0048 0049 /** 0050 * Enable/Disable the item following the user checkbox action according to @p enabled. 0051 */ 0052 virtual void setEnabled( bool enabled ); 0053 0054 /** 0055 * Return whether the item is visible or invisible. 0056 */ 0057 virtual bool isVisible() const; 0058 0059 /** 0060 * Set item visible/invisible according to @p visible. 0061 */ 0062 virtual void setVisible( bool visible ); 0063 0064 /** 0065 * Return whether the track is visible or invisible. 0066 */ 0067 virtual bool isTrackVisible() const; 0068 0069 /** 0070 * Set item track visible/invisible according to @p visible. 0071 */ 0072 virtual void setTrackVisible( bool visible ); 0073 0074 /** 0075 * Reimplement this method to update the placemark, for example to change its coordinates. 0076 * If this item is in a TrackerPluginModel, this method will be called regularly. 0077 */ 0078 virtual void update() = 0; 0079 0080 private: 0081 Q_DISABLE_COPY(TrackerPluginItem) 0082 TrackerPluginItemPrivate *d; 0083 }; 0084 0085 } // namespace Marble 0086 0087 #endif // MARBLE_TRACKERPLUGINITEM_H