digiKam
welcomepageview.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 : 2006-12-20
7  * Description : a widget to display a welcome page
8  * on root album.
9  *
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
12  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_WELCOME_PAGE_VIEW_H
28 #define DIGIKAM_WELCOME_PAGE_VIEW_H
29 
30 #include "digikam_config.h"
31 
32 // Qt includes
33 
34 #include <QByteArray>
35 #include <QString>
36 #include <QUrl>
37 #include <QWidget>
38 #include <QLabel>
39 
40 #ifdef HAVE_QWEBENGINE
41 # include <QWebEngineView>
42 # include <QWebEnginePage>
43 # include <QWebEngineSettings>
44 #else
45 # include <qwebview.h>
46 #endif
47 
48 // Local includes
49 
50 #include "digikam_export.h"
51 
52 namespace Digikam
53 {
54 
55 #ifdef HAVE_QWEBENGINE
56 
57 class WelcomePageViewPage : public QWebEnginePage
58 {
59  Q_OBJECT
60 
61 public:
62 
63  explicit WelcomePageViewPage(QObject* const parent = nullptr);
64  ~WelcomePageViewPage() override;
65 
66  bool acceptNavigationRequest(const QUrl&, QWebEnginePage::NavigationType, bool) override;
67 
68 Q_SIGNALS:
69 
70  void linkClicked(const QUrl&);
71 
72 };
73 
74 // -------------------------------------------------------------------
75 
76 class WelcomePageView : public QWebEngineView
77 
78 #else
79 
80 class WelcomePageView : public QWebView
81 
82 #endif
83 
84 {
85  Q_OBJECT
86 
87 public:
88 
89  explicit WelcomePageView(QWidget* const parent);
90  ~WelcomePageView() override;
91 
92 private:
93 
94  QByteArray fileToString(const QString& aFileName) const;
95  QStringList featuresTabContent() const;
96  QStringList aboutTabContent() const;
97 
98 private Q_SLOTS:
99 
100  void slotUrlOpen(const QUrl&);
101  void slotThemeChanged();
102 };
103 
104 
105 } // namespace Digikam
106 
107 #endif // DIGIKAM_WELCOME_PAGE_VIEW_H
Definition: welcomepageview.h:84
~WelcomePageView() override
Definition: welcomepageview.cpp:136
WelcomePageView(QWidget *const parent)
Definition: welcomepageview.cpp:88
Definition: datefolderview.cpp:43