digiKam
inatbrowserdlg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2021-03-20
7  * Description : a simple web browser dialog based on Qt WebEngine.
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2021 by Joerg Lohse <joergmlpts at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_INAT_BROWSER_DLG_H
26 #define DIGIKAM_INAT_BROWSER_DLG_H
27 
28 // Qt include
29 
30 #include <QDialog>
31 #include <QWidget>
32 #include <QUrl>
33 #include <QString>
34 #include <QCloseEvent>
35 #include <QNetworkCookie>
36 #include <QDateTime>
37 
39 {
40 
41 class SearchTextSettings;
42 
43 class INatBrowserDlg : public QDialog
44 {
45  Q_OBJECT
46 
47 public:
48 
49  INatBrowserDlg(const QString& username, const QList<QNetworkCookie>&,
50  QWidget* const parent);
51  ~INatBrowserDlg() override;
52 
53  static bool filterCookie(const QNetworkCookie& cookie,
54  bool keepSessionCookies, const QDateTime&);
55 
60  bool keepSessionCookies = true);
61 
62 Q_SIGNALS:
63 
64  void signalApiToken(const QString&, const QList<QNetworkCookie>&);
65  void signalWebText(const QString&);
66 
67 private Q_SLOTS:
68 
69  void slotLoadingFinished(bool);
70  void slotTitleChanged(const QString&);
71  void slotWebText(const QString&);
72  void slotGoHome();
73  void slotCookieAdded(const QNetworkCookie&);
74  void slotCookieRemoved(const QNetworkCookie&);
75 
76 protected:
77 
78  void closeEvent(QCloseEvent*) override;
79 
80 private:
81 
82  class Private;
83  Private* const d;
84 };
85 
86 } // namespace DigikamGenericINatPlugin
87 
88 #endif // DIGIKAM_INAT_BROWSER_DLG_H
Definition: inatbrowserdlg.h:44
~INatBrowserDlg() override
Definition: inatbrowserdlg.cpp:234
static bool filterCookie(const QNetworkCookie &cookie, bool keepSessionCookies, const QDateTime &)
Definition: inatbrowserdlg.cpp:348
INatBrowserDlg(const QString &username, const QList< QNetworkCookie > &, QWidget *const parent)
Definition: inatbrowserdlg.cpp:125
static QList< QNetworkCookie > filterCookies(const QList< QNetworkCookie > &, bool keepSessionCookies=true)
Definition: inatbrowserdlg.cpp:356
void signalApiToken(const QString &, const QList< QNetworkCookie > &)
void closeEvent(QCloseEvent *) override
Definition: inatbrowserdlg.cpp:239
Definition: inatbrowserdlg.cpp:64