diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 10:41:02 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 17:09:39 +0100 |
| commit | 4351f4627ba9e71775438dd26c9acddd002c7e11 (patch) | |
| tree | 3c72c980c5c81507109087bda67052b7ec8216b6 /transferengine-plugins/mastodontransferplugin/mastodonuploader.h | |
Initial commit
Diffstat (limited to 'transferengine-plugins/mastodontransferplugin/mastodonuploader.h')
| -rw-r--r-- | transferengine-plugins/mastodontransferplugin/mastodonuploader.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/transferengine-plugins/mastodontransferplugin/mastodonuploader.h b/transferengine-plugins/mastodontransferplugin/mastodonuploader.h new file mode 100644 index 0000000..b0ea263 --- /dev/null +++ b/transferengine-plugins/mastodontransferplugin/mastodonuploader.h @@ -0,0 +1,51 @@ +#ifndef MASTODONUPLOADER_H +#define MASTODONUPLOADER_H + +#include <QtNetwork/QNetworkAccessManager> + +#include <mediatransferinterface.h> + +#include "mastodonshareservicestatus.h" + +class MastodonApi; + +class MastodonUploader : public MediaTransferInterface +{ + Q_OBJECT + +public: + MastodonUploader(QNetworkAccessManager *qnam, QObject *parent = 0); + ~MastodonUploader(); + + QString displayName() const; + QUrl serviceIcon() const; + bool cancelEnabled() const; + bool restartEnabled() const; + +public Q_SLOTS: + void start(); + void cancel(); + +private Q_SLOTS: + void startUploading(); + void transferFinished(); + void transferProgress(qreal progress); + void transferError(); + void transferCanceled(); + void credentialsExpired(); + +protected: + void setStatus(MediaTransferInterface::TransferStatus status); + +private: + void postImage(); + + MastodonApi *m_api; + MastodonShareServiceStatus *m_mastodonShareServiceStatus; + QNetworkAccessManager *m_qnam; + MastodonShareServiceStatus::AccountDetails m_accountDetails; + bool m_useTmpFile; + QString m_filePath; +}; + +#endif // MASTODONUPLOADER_H |
