X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.h;h=41ba64c62f9e895707c096c2a185a992be2b2b15;hb=e715eca23297fb10dcf70e4c8bb2712413d16e3d;hp=246daa41cf4860c9c080426309a815e7de3c69f6;hpb=15219459baed09d03d17a12c72302595c135fd53;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.h b/src/widgets/TabWidget.h index 246daa4..41ba64c 100644 --- a/src/widgets/TabWidget.h +++ b/src/widgets/TabWidget.h @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Soren Stoutner . + * Copyright 2022-2023 Soren Stoutner . * * This file is part of Privacy Browser PC . * @@ -22,11 +22,13 @@ // Application headers. #include "PrivacyWebEngineView.h" +#include "helpers/UserAgentHelper.h" // KDE Framework headers. #include // Qt toolkit headers. +#include #include #include #include @@ -43,17 +45,21 @@ class TabWidget : public QWidget public: // The primary contructor. - explicit TabWidget(QWidget *parent); + explicit TabWidget(QWidget *windowPointer); // The destructor. ~TabWidget(); // The public functions. - void applyOnTheFlyZoomFactor(const double &zoomFactor); + void applyOnTheFlyZoomFactor(const double &zoomFactor) const; + void applySpellCheckLanguages() const; PrivacyWebEngineView* loadBlankInitialWebsite(); void loadInitialWebsite(); void findPrevious(const QString &text) const; std::list* getCookieList() const; + QIcon getCurrentTabFavoritIcon() const; + QString getCurrentTabTitle() const; + QString getCurrentTabUrl() const; QString& getDomainSettingsName() const; void setTabBarVisible(const bool visible) const; void toggleDomStorage() const; @@ -75,6 +81,7 @@ signals: void showProgressBar(const int &progress) const; void updateBackAction(const bool &isEnabled) const; void updateCookiesAction(const int numberOfCookies) const; + void updateDefaultZoomFactor(const double newDefaultZoomFactor) const; void updateDomStorageAction(const bool &isEnabled) const; void updateDomainSettingsIndicator(const bool status) const; void updateFindText(const QString &text, const bool findCaseSensitive) const; @@ -86,15 +93,14 @@ signals: void updateUrlLineEdit(const QUrl &newUrl) const; void updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus) const; void updateWindowTitle(const QString &title) const; - void updateZoomFactorAction(const double &zoomFactor) const; + void updateZoomActions(const double &zoomFactor) const; public Q_SLOTS: // The public slots. void addCookieToStore(QNetworkCookie cookie, QWebEngineCookieStore *webEngineCookieStorePointer = nullptr) const; - PrivacyWebEngineView* addTab(const bool removeUrlLineEditFocus=false, const bool backgroundTab=false); + PrivacyWebEngineView* addTab(const bool removeUrlLineEditFocus = false, const bool backgroundTab = false, const QString urlString = nullptr); void applyApplicationSettings(); void applyDomainSettingsAndReload(); - void applyDomainSettingsWithoutReloading(const QString &hostname); void applyOnTheFlySearchEngine(QAction *searchEngineActionPointer); void applyOnTheFlyUserAgent(QAction *userAgentActionPointer) const; void back() const; @@ -109,6 +115,7 @@ public Q_SLOTS: void print() const; void printPreview() const; void refresh() const; + void reloadAndBypassCache() const; private Q_SLOTS: // The private slots. @@ -118,25 +125,26 @@ private Q_SLOTS: void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest) const; void pageLinkHovered(const QString &linkUrl) const; void printWebpage(QPrinter *printerPointer) const; - void showSaveDialog(QWebEngineDownloadItem *downloadItemPointer) const; - void showSaveFilePickerDialog(QUrl &downloadUrl, QString &suggestedFileName); + void showSaveDialog(QWebEngineDownloadItem *downloadItemPointer); + void stopLoadingFavoriteIconMovie() const; + void updateUiFromWebEngineView(const PrivacyWebEngineView *privacyWebEngineViewPointer) const; void updateUiWithTabSettings(); + void useNativeKdeDownloader(QUrl &downloadUrl, QString &suggestedFileName); private: // The private variables. - double currentZoomFactor; // This can be removed once has been resolved. PrivacyWebEngineView *currentPrivacyWebEngineViewPointer; QWebEngineCookieStore *currentWebEngineCookieStorePointer; QWebEngineHistory *currentWebEngineHistoryPointer; QWebEnginePage *currentWebEnginePagePointer; QWebEngineProfile *currentWebEngineProfilePointer; QWebEngineSettings *currentWebEngineSettingsPointer; - QIcon defaultTabIcon = QIcon::fromTheme(QStringLiteral("globe")); + QIcon defaultFavoriteIcon = QIcon::fromTheme(QLatin1String("globe"), QIcon::fromTheme(QLatin1String("applications-internet"))); + bool isRunningKde = false; + QMovie *loadingFavoriteIconMoviePointer; QString searchEngineUrl; - QTabWidget *tabWidgetPointer; + QTabWidget *qTabWidgetPointer; + UserAgentHelper *userAgentHelperPointer; bool wipingCurrentFindTextSelection = false; - - // The private functions. - void applyDomainSettings(const QString &hostname, const bool reloadWebsite); }; #endif