File indexing completed on 2024-05-05 03:50:47

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Utku Aydın <utkuaydin34@gmail.com>
0004 //
0005 
0006 #ifndef OPENDESKTOPITEM_H
0007 #define OPENDESKTOPITEM_H
0008  
0009 #include "AbstractDataPluginItem.h"
0010 #include "MarbleWidget.h"
0011 
0012 #include <QUrl>
0013 
0014 class QAction;
0015 
0016 namespace Marble
0017 {
0018  
0019 class OpenDesktopItem : public AbstractDataPluginItem
0020 {
0021     Q_OBJECT
0022 
0023     public:
0024         explicit OpenDesktopItem(QObject *parent);
0025 
0026         ~OpenDesktopItem() override;
0027 
0028         bool initialized() const override;
0029 
0030         void addDownloadedFile( const QString& url, const QString& type ) override;
0031         
0032         void paint( QPainter *painter ) override;
0033 
0034         bool operator<( const AbstractDataPluginItem *other ) const override;
0035 
0036         void updateToolTip();
0037         
0038         QAction *action() override;
0039         
0040         QUrl profileUrl() const;
0041 
0042         QUrl avatarUrl() const;
0043 
0044         void setAvatarUrl( const QUrl& url );
0045 
0046         QString fullName() const;
0047 
0048         void setFullName(const QString& fullName );
0049 
0050         QString location() const;
0051 
0052         void setLocation(const QString& location );
0053 
0054         QString role() const;
0055 
0056         void setRole(const QString& role );
0057 
0058         void setMarbleWidget(MarbleWidget *widget);
0059     
0060     public Q_SLOTS:
0061         void openBrowser();
0062 
0063     private:
0064         MarbleWidget *m_marbleWidget;
0065         QString m_fullName;
0066         QString m_location;
0067         QString m_role;
0068         QPixmap m_pixmap;
0069         QUrl m_avatarUrl;
0070         QAction* m_action;
0071 };
0072  
0073 }
0074 #endif // OPENDESKTOPITEM_H