aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
commit49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3 (patch)
treee35d5472c2a3ed129f5a6a6826f9999b033cc548 /src/mainwindow.h
parentConfiguration creates missing items based on defaults (diff)
downloadsmolbote-49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3.tar.xz
Refactoring MainWindow
- Added NavigationBar object that manages the navigation buttons - Removed NavigationButton class that it obsoleted
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r--src/mainwindow.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h
deleted file mode 100644
index 79773d3..0000000
--- a/src/mainwindow.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: git://neueland.iserlohn-fortress.net/smolbote.git
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "browser.h"
-#include "lib/navigation/navigationbutton.h"
-#include "webengine/webengineprofile.h"
-#include "widgets/loadingbar.h"
-#include "widgets/mainwindowtabbar.h"
-#include <QMainWindow>
-#include <QUrl>
-#include <interfaces.h>
-#include <memory>
-
-namespace Ui
-{
-class MainWindow;
-}
-
-class SearchForm;
-
-class Configuration;
-class BookmarksWidget;
-class DownloadsWidget;
-
-class MainWindowMenuBar;
-class UrlLineEdit;
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
- friend class WebView;
- friend class SearchForm;
-
- friend class MainWindowMenuBar;
-
-public:
- explicit MainWindow(std::shared_ptr<Configuration> config, QWidget *parent = nullptr);
- Q_DISABLE_COPY(MainWindow)
- ~MainWindow() override;
-
- void addTabbedDock(Qt::DockWidgetArea area, QWidget *widget);
-
-public slots:
- void about();
- void showSettingsDialog();
-
- void newTab(const QUrl &url = QUrl(""));
- MainWindow *newWindow(const QUrl &url = QUrl(""));
-
- void setProfile(std::shared_ptr<WebEngineProfile> profile);
- WebEngineProfile *profile();
-
- void setBookmarksWidget(std::shared_ptr<BookmarksWidget> &widget);
- void setDownloadsWidget(std::shared_ptr<DownloadsWidget> &widget);
- void addPlugins(const QVector<Browser::Plugin> &plugins);
-
- void toggleFullscreen();
-
-protected:
- void closeEvent(QCloseEvent *event) override;
-
-private slots:
- void handleTabChanged(WebView *view);
- void handleTitleUpdated(const QString &title);
-
-private:
- Ui::MainWindow *ui;
- SearchForm *m_searchBox;
-
- MainWindowTabBar *tabBar;
- WebView *m_currentView;
-
- MainWindowMenuBar *menuBar;
-
- // navigation
- NavigationButton *m_backButton, *m_forwardButton, *m_reloadButton;
- UrlLineEdit *m_addressBar;
- LoadingBar *m_progressBar;
-
- bool m_tabBarAdded = false;
- std::shared_ptr<WebEngineProfile> m_profile;
- std::shared_ptr<Configuration> m_config;
- std::shared_ptr<BookmarksWidget> m_bookmarksWidget;
- std::shared_ptr<DownloadsWidget> m_downloadsWidget;
-};
-
-#endif // MAINWINDOW_H