File indexing completed on 2025-01-05 04:25:45
0001 /**************************************************************************************** 0002 * Copyright (c) 2010 Rick W. Chen <stuffcorpse@archlinux.us> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify it under * 0005 * the terms of the GNU General Public License as published by the Free Software * 0006 * Foundation; either version 2 of the License, or (at your option) any later * 0007 * version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0012 * * 0013 * You should have received a copy of the GNU General Public License along with * 0014 * this program. If not, see <http://www.gnu.org/licenses/>. * 0015 ****************************************************************************************/ 0016 0017 #ifndef AMAROK_UPCOMING_EVENTS_MAP_WIDGET_H 0018 #define AMAROK_UPCOMING_EVENTS_MAP_WIDGET_H 0019 0020 #include "LastFmEvent.h" 0021 0022 #include <KGraphicsWebView> 0023 0024 class QGraphicsItem; 0025 class UpcomingEventsListWidget; 0026 class UpcomingEventsMapWidgetPrivate; 0027 0028 class UpcomingEventsMapWidget : public KGraphicsWebView 0029 { 0030 Q_OBJECT 0031 Q_PROPERTY( int eventCount READ eventCount ) 0032 Q_PROPERTY( bool isLoaded READ isLoaded ) 0033 Q_PROPERTY( LastFmEvent::List events READ events ) 0034 0035 public: 0036 explicit UpcomingEventsMapWidget( QGraphicsItem *parent = nullptr ); 0037 ~UpcomingEventsMapWidget(); 0038 0039 bool isLoaded() const; 0040 int eventCount() const; 0041 LastFmEvent::List events() const; 0042 0043 void addEvents( const LastFmEvent::List &events ); 0044 0045 void clear(); 0046 0047 public Q_SLOTS: 0048 void addEvent( const LastFmEventPtr &event ); 0049 void removeEvent( const LastFmEventPtr &event ); 0050 void addEventsListWidget( UpcomingEventsListWidget *widget ); 0051 void removeEventsListWidget( UpcomingEventsListWidget *widget ); 0052 void centerAt( double latitude, double longitude ); 0053 void centerAt( const LastFmVenuePtr &venue ); 0054 0055 private: 0056 UpcomingEventsMapWidgetPrivate *const d_ptr; 0057 Q_DECLARE_PRIVATE( UpcomingEventsMapWidget ) 0058 Q_DISABLE_COPY( UpcomingEventsMapWidget ) 0059 0060 Q_PRIVATE_SLOT( d_ptr, void _centerAt(QObject*)) 0061 Q_PRIVATE_SLOT( d_ptr, void _linkClicked(QUrl) ) 0062 Q_PRIVATE_SLOT( d_ptr, void _loadFinished(bool) ) 0063 Q_PRIVATE_SLOT( d_ptr, void _init() ) 0064 }; 0065 0066 #endif // AMAROK_UPCOMING_EVENTS_MAP_WIDGET_H