Debian Codegraph @

src/gui/operations/HandleUploadResultOperation.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2019 Damir Porobic <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef KSNIP_HANDLEUPLOADRESULTOPERATION_H
21 #define KSNIP_HANDLEUPLOADRESULTOPERATION_H
22
23 #include <QUrl>
24
25 #include "src/backend/config/IConfig.h"
26 #include "src/backend/uploader/UploadResult.h"
27 #include "src/gui/operations/NotifyOperation.h"
28 #include "src/gui/clipboard/IClipboard.h"
29 #include "src/gui/desktopService/IDesktopService.h"
30
31 class HandleUploadResultOperation : public QObject
32 {
33 Q_OBJECT
34 public:
35 explicit HandleUploadResultOperation(
36 const UploadResult &result,
37 const QSharedPointer<INotificationService> &notificationService,
38 const QSharedPointer<IClipboard> &clipboard,
39 const QSharedPointer<IDesktopService> &desktopService,
40 const QSharedPointer<IConfig> &config);
41 ~HandleUploadResultOperation() override = default;
42 bool execute();
43
44 private:
45 UploadResult mUploadResult;
46 QSharedPointer<INotificationService> mNotificationService;
47 QSharedPointer<IConfig> mConfig;
48 QSharedPointer<IClipboard> mClipboardService;
49 QSharedPointer<IDesktopService> mDesktopService;
50
51 void notifyImgurSuccessfulUpload(const QString &url) const;
52 void handleImgurResult();
53 void handleScriptResult();
54 void handleFtpResult();
55 void copyToClipboard(const QString &url) const;
56 void OpenUrl(const QString &url) const;
57 void handleUploadError();
58 void notifyFtpSuccessfulUpload() const;
59 void notifyScriptSuccessfulUpload() const;
60 void notifyFailedUpload(const QString &message) const;
61 };
62
63 #endif //KSNIP_HANDLEUPLOADRESULTOPERATION_H