File indexing completed on 2024-05-19 05:01:19

0001 /* This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2023 Stefano Crocco <stefano.crocco@alice.it>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef WEBENGINEPART_PROFILE_H
0008 #define WEBENGINEPART_PROFILE_H
0009 
0010 #include <QWebEngineProfile>
0011 
0012 namespace KonqWebEnginePart
0013 {
0014 #if QT_VERSION_MAJOR == 6
0015 
0016 /**
0017  * @brief Profile for pages created by Konqueror
0018  * @note If the profile is not off-the-record, according to the documentation, it
0019  * "should be destroyed on or before application exit". To ensure this, it's
0020  * recommended to make it a child of the application object.
0021  */
0022 class Profile : public QWebEngineProfile
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027 
0028     /**
0029      * Constructor
0030      *
0031      * @param storageName the name of the location where to store data
0032      * @param parent the parent object
0033      */
0034     Profile(const QString& storageName, QObject* parent = nullptr);
0035     ~Profile(); ///< Destructor
0036 
0037     /**
0038      * @brief A default instance of this class
0039      *
0040      * This works as Qt5 `QtWebEngineProfile::defaultProfile()`
0041      * @return A default instance of this class
0042      */
0043     static Profile* defaultProfile();
0044 };
0045 #else
0046 typedef QWebEngineProfile Profile;
0047 #endif
0048 
0049 }
0050 
0051 #endif // WEBENGINEPART_PROFILE_H