summaryrefslogtreecommitdiff
path: root/src/application.h
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-03-13 17:50:00 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-03-13 17:50:00 +0100
commita34f7ad76fe02227cc59143d91dabb891c2e3605 (patch)
tree5ff9ed1816a7df7f0e52604882d1367f23ef5d21 /src/application.h
parentRestore a small portion of (un)ported code (diff)
downloadrekonq-a34f7ad76fe02227cc59143d91dabb891c2e3605.tar.xz
Support Activities
Open links in new tab only if there is a window in the current activity/on the current desktop This code has been written by Jonathan Verner and reviewed (a bit) by me. Hope everyone will be happy now... BUG: 316322 REVIEWED-BY: adjam
Diffstat (limited to 'src/application.h')
-rw-r--r--src/application.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/application.h b/src/application.h
index 5db6b424..e1801345 100644
--- a/src/application.h
+++ b/src/application.h
@@ -45,9 +45,22 @@ class WebWindow;
class WebTab;
class WebPage;
+#include <config-kactivities.h>
+
+#ifdef HAVE_KACTIVITIES
+namespace KActivities {
+ class Consumer;
+}
+#endif
+
typedef QList< QWeakPointer<RekonqWindow> > RekonqWindowList;
typedef QList<WebTab *> WebAppList;
+#ifdef HAVE_KACTIVITIES
+typedef QHash< QString, RekonqWindowList > ActivityTabsMap;
+#endif
+
+
// ---------------------------------------------------------------------------------------------------------------
@@ -67,9 +80,23 @@ public:
int newInstance();
static Application *instance();
- RekonqWindow *rekonqWindow();
+ 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());
+
+ /**
+ * @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();
void bookmarksToolbarToggled(bool);
@@ -120,6 +147,12 @@ private Q_SLOTS:
private:
RekonqWindowList m_rekonqWindows;
WebAppList m_webApps;
+
+#ifdef HAVE_KACTIVITIES
+ ActivityTabsMap m_activityRekonqWindowsMap;
+ KActivities::Consumer *m_activityConsumer;
+#endif
+
};
#endif // APPLICATION_H