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

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2012 Utku Aydın <utkuaydin34@gmail.com>
0004 //
0005 
0006 #ifndef FOURSQUAREPLUGIN_H
0007 #define FOURSQUAREPLUGIN_H
0008 
0009 #include "AbstractDataPlugin.h"
0010 
0011 namespace Marble {
0012 
0013 class FoursquarePlugin : public AbstractDataPlugin
0014 {
0015     Q_OBJECT
0016     Q_PLUGIN_METADATA(IID "org.kde.marble.FoursquarePlugin" )
0017     Q_INTERFACES( Marble::RenderPluginInterface )
0018     MARBLE_PLUGIN( FoursquarePlugin )
0019 
0020 public:
0021     FoursquarePlugin();
0022 
0023     explicit FoursquarePlugin( const MarbleModel *marbleModel );
0024 
0025     void initialize() override;
0026 
0027     QString name() const override;
0028 
0029     QString guiString() const override;
0030 
0031     QString nameId() const override;
0032 
0033     QString version() const override;
0034 
0035     QString description() const override;
0036 
0037     QString copyrightYears() const override;
0038 
0039     QVector<PluginAuthor> pluginAuthors() const override;
0040 
0041     QIcon icon() const override;
0042 
0043     /**
0044      * @brief Checks if there is an access token stored.
0045      */
0046     Q_INVOKABLE bool isAuthenticated();
0047 
0048     /**
0049      * @brief Stores the access token.
0050      * @param tokenUrl A dummy URL that has a fragment named access_token
0051      * @see https://developer.foursquare.com/overview/auth
0052      */
0053     Q_INVOKABLE bool storeAccessToken(const QString &tokenUrl);
0054 };
0055 
0056 }
0057 
0058 #endif // FOURSQUAREPLUGIN_H