From 9461c52f07a2bf8b9bc25f037b17805cda51b2b0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 10 Mar 2013 19:02:12 +0100 Subject: Supporting panel (again) :) - Move to a pure QWidget base window (instead of TabWidget one) (this to properly store panels position) - Restoring && rewamping panels code - Restoring actions to activate/deactivate them BUG: 312354 --- src/tabwindow/rekonqwindow.h | 130 +++++++++++++------------------------------ 1 file changed, 38 insertions(+), 92 deletions(-) (limited to 'src/tabwindow/rekonqwindow.h') diff --git a/src/tabwindow/rekonqwindow.h b/src/tabwindow/rekonqwindow.h index ed018e4a..1d46faeb 100644 --- a/src/tabwindow/rekonqwindow.h +++ b/src/tabwindow/rekonqwindow.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2012 by Andrea Diamantini +* Copyright (C) 2013 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -32,109 +32,55 @@ // Rekonq Includes #include "rekonq_defines.h" -// KDE Includes -#include -#include -#include +// Local Includes +#include "rwindow.h" +#include "tabwidget.h" + +#include "bookmarkspanel.h" +#include "historypanel.h" // Qt Includes -#include - -/** - * This is rekonq (re)implementation of KMainWindow, - * given that we'd like to NOT use a "real" xMainWindow - * but a widget with the nice mainwindow properties - * (eg: session management, auto save dimension, etc) but - * NOT its peculiar containers (eg: toolbars, menubar, statusbar, - * central widget...) - * - */ -class RekonqWindow : public KTabWidget -{ - friend class KRWSessionManager; +#include +#include + +// Forward Declarations +class TabBar; + +class WebPage; +class WebWindow; + +class RekonqWindow : public RWindow +{ Q_OBJECT public: - explicit RekonqWindow(QWidget* parent = 0); + explicit RekonqWindow(bool withTab = true, bool PrivateBrowsingMode = false, QWidget *parent = 0); + explicit RekonqWindow(WebPage *pg, QWidget *parent = 0); virtual ~RekonqWindow(); - QSize sizeHint() const; - - /** - * List of members of RekonqWindow class. - */ - static QList windowList(); - - /** - * If the session did contain so high a @p number, @p true is returned, - * else @p false. - * @see restore() - **/ - static bool canBeRestored(int number); - - /** - * Try to restore the toplevel widget as defined by @p number (1..X). - * - * You should call canBeRestored() first. - * - **/ - bool restore(int number, bool show = true); - - // NOTE: For internal purpose only ------------------------------------------------------ - int addTab(QWidget *page, const QString &label); - int addTab(QWidget *page, const QIcon &icon, const QString &label); - - int insertTab(int index, QWidget *page, const QString &label); - int insertTab(int index, QWidget *page, const QIcon &icon, const QString &label); - // -------------------------------------------------------------------------------------- - -protected: - /** - * Save your instance-specific properties. The function is - * invoked when the session manager requests your application - * to save its state. - * - * Please reimplement these function in childclasses. - * - * Note: No user interaction is allowed - * in this function! - * - */ - virtual void saveProperties(KConfigGroup &) {} - - /** - * Read your instance-specific properties. - * - * Is called indirectly by restore(). - */ - virtual void readProperties(const KConfigGroup &) {} - - void savePropertiesInternal(KConfig*, int); - bool readPropertiesInternal(KConfig*, int); - - /** - * For inherited classes - */ - void saveWindowSize(const KConfigGroup &config) const; - /** - * For inherited classes - * Note that a -geometry on the command line has priority. - */ - void restoreWindowSize(const KConfigGroup & config); - - /// parse the geometry from the geometry command line argument - void parseGeometry(); - - virtual void resizeEvent(QResizeEvent *); + TabWidget *tabWidget(); + TabBar *tabBar(); + WebWindow *currentWebWindow() const; -private Q_SLOTS: - void saveAutoSaveSettings(); +private: + void init(); + +public Q_SLOTS: + void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0); +private Q_SLOTS: + void showBookmarksPanel(bool); + void showHistoryPanel(bool); + private: - /// This has been added to just fix window position && not let them be overlying - void checkPosition(); + TabWidget *_tabWidget; + + QSplitter *_splitter; + + QWeakPointer _historyPanel; + QWeakPointer _bookmarksPanel; }; #endif // REKONQ_WINDOW_H -- cgit v1.2.1