summaryrefslogtreecommitdiff
path: root/src/application.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.h')
-rw-r--r--src/application.h110
1 files changed, 53 insertions, 57 deletions
diff --git a/src/application.h b/src/application.h
index 307e2fd6..761bc89b 100644
--- a/src/application.h
+++ b/src/application.h
@@ -6,27 +6,28 @@
* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
* ============================================================
- * Description: Application Entry Point
+ * Description: Application Main Class
* ============================================================ */
#pragma once
#include "rekonq.hpp"
+#include <QUrl>
+#include <QWidget>
#include <SingleApplication>
// Forward Declarations
-class RekonqWindow;
+class rView;
+// class RekonqWindow;
-class WebTab;
-class WebPage;
+// class WebTab;
+// class WebPage;
-typedef QList< QWeakPointer<RekonqWindow> > RekonqWindowList;
-typedef QList<WebTab *> WebAppList;
+// typedef QList< QWeakPointer<RekonqWindow> > RekonqWindowList;
+// typedef QList<WebTab *> WebAppList;
// ---------------------------------------------------------------------------------------------------------------
-#define rApp Application::instance()
-
/**
* Rekonq Application class
*/
@@ -34,86 +35,81 @@ class Application : public SingleApplication {
Q_OBJECT
public:
- Application(int argc, char **argv);
+ Application(int &argc, char *argv[]);
~Application() override;
- int newInstance();
+ // int newInstance();
static Application *instance() { return (qobject_cast<Application *>(QCoreApplication::instance())); }
- RekonqWindow *rekonqWindow(const QString &activityID = QString());
- RekonqWindowList rekonqWindowList();
+ // RekonqWindow *rekonqWindow(const QString &activityID = QString());
+ // RekonqWindowList rekonqWindowList();
/**
* @returns the list of windows associated with activity whose id is @param activityID
* @param activityID the ID of the activity (if empty, it is interpreted as the current activity)
* @note If activities are disabled, returns the function returns the list of all tabs.
*/
- RekonqWindowList tabsForActivity(const QString &activityID = QString());
+ // RekonqWindowList tabsForActivity(const QString &activityID = QString());
/**
* @returns the true if there are windows associated with activity whose id is @param activityID
* @param activityID the ID of the activity (if empty, it is interpreted as the current activity)
* @note If activities are disabled, returns true if there are any tabs.
*/
- bool haveWindowsForActivity(const QString &activityID = QString());
-
- WebAppList webAppList();
+ // bool haveWindowsForActivity(const QString &activityID = QString());
- void bookmarksToolbarToggled(bool);
+ // WebAppList webAppList();
-public Q_SLOTS:
- /**
- * Save application's configuration
- *
- * @see ReKonfig::self()->writeConfig();
- */
- void saveConfiguration() const;
+ // void bookmarksToolbarToggled(bool);
- /**
- * @short load url
- *
- * @param url The url to load
- * @param type the type where loading the url. @see Rekonq::OpenType
- */
- void loadUrl(const KUrl& url,
- const Rekonq::OpenType& type = Rekonq::CurrentTab
- );
+public slots:
+ /**
+ * Save application's configuration
+ *
+ * @see ReKonfig::self()->writeConfig();
+ */
+ // void saveConfiguration() const;
- RekonqWindow *newWindow(bool withTab = true, bool PrivateBrowsingMode = false);
- RekonqWindow *newWindow(WebPage *pg);
+ /**
+ * @short load url
+ *
+ * @param url The url to load
+ * @param type the type where loading the url. @see Rekonq::OpenType
+ */
+ // void loadUrl(const KUrl& url, const Rekonq::OpenType& type = Rekonq::CurrentTab);
- WebTab *newWebApp();
+ // RekonqWindow *newWindow(bool withTab = true, bool PrivateBrowsingMode = false);
+ // RekonqWindow *newWindow(WebPage *pg);
+ rView *newWebApp(const QUrl &url = QUrl());
- void createWebAppShortcut(const QString & urlString = QString(), const QString & titleString = QString());
+ // void createWebAppShortcut(const QString & urlString = QString(), const QString & titleString = QString());
protected:
- // This is used to track which window was activated most recently
- bool eventFilter(QObject *watched, QEvent *event);
+ // This is used to track which window was activated most recently
+ // bool eventFilter(QObject *watched, QEvent *event);
-Q_SIGNALS:
- void toggleBookmarksToolbar(bool);
+signals:
+ void toggleBookmarksToolbar(bool);
private:
- void setWindowInfo(RekonqWindow *);
-
-private Q_SLOTS:
- void updateConfiguration();
+ // void setWindowInfo(RekonqWindow *);
- // clear private data
- void clearPrivateData();
+private slots:
+ // void updateConfiguration();
- void queryQuit();
+ // clear private data
+ // void clearPrivateData();
- void newPrivateBrowsingWindow();
+ // void queryQuit();
- void pageCreated(WebPage *);
+ // void newPrivateBrowsingWindow();
+
+ // void pageCreated(WebPage *);
private:
- RekonqWindowList m_rekonqWindows;
- WebAppList m_webApps;
-
-#ifdef HAVE_KACTIVITIES
- ActivityTabsMap m_activityRekonqWindowsMap;
- KActivities::Consumer *m_activityConsumer;
-#endif
+ // RekonqWindowList m_rekonqWindows;
+ QList<rView *> m_webApps;
};
+
+[[deprecated]] static inline auto *rApp_f() { return Application::instance(); }
+#define rApp rApp_f()