From 63b34dc6ccd32c9bc7c3d8c0137ff12530238bde Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 30 Oct 2008 01:50:51 +0100 Subject: reKonq initial commit. Yeah! --- src/bookmarks.h | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 src/bookmarks.h (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h new file mode 100644 index 00000000..768efd53 --- /dev/null +++ b/src/bookmarks.h @@ -0,0 +1,306 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information +** to ensure GNU General Public Licensing requirements will be met: +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. In addition, as a special +** exception, Nokia gives you certain additional rights. These rights +** are described in the Nokia Qt GPL Exception version 1.3, included in +** the file GPL_EXCEPTION.txt in this package. +** +** Qt for Windows(R) Licensees +** As a special exception, Nokia, as the sole copyright holder for Qt +** Designer, grants users of the Qt/Eclipse Integration plug-in the +** right for the Qt/Eclipse Integration to link to functionality +** provided by Qt Designer and its related libraries. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +#ifndef BOOKMARKS_H +#define BOOKMARKS_H + +#include +#include + +#include + +/*! + Bookmark manager, owner of the bookmarks, loads, saves and basic tasks + */ +class AutoSaver; +class BookmarkNode; +class BookmarksModel; +class BookmarksManager : public QObject +{ + Q_OBJECT + +signals: + void entryAdded(BookmarkNode *item); + void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item); + void entryChanged(BookmarkNode *item); + +public: + BookmarksManager(QObject *parent = 0); + ~BookmarksManager(); + + void addBookmark(BookmarkNode *parent, BookmarkNode *node, int row = -1); + void removeBookmark(BookmarkNode *node); + void setTitle(BookmarkNode *node, const QString &newTitle); + void setUrl(BookmarkNode *node, const QString &newUrl); + void changeExpanded(); + + BookmarkNode *bookmarks(); + BookmarkNode *menu(); + BookmarkNode *toolbar(); + + BookmarksModel *bookmarksModel(); + QUndoStack *undoRedoStack() { return &m_commands; }; + +public slots: + void importBookmarks(); + void exportBookmarks(); + +private slots: + void save() const; + +private: + void load(); + + bool m_loaded; + AutoSaver *m_saveTimer; + BookmarkNode *m_bookmarkRootNode; + BookmarksModel *m_bookmarkModel; + QUndoStack m_commands; + + friend class RemoveBookmarksCommand; + friend class ChangeBookmarkCommand; +}; + +class RemoveBookmarksCommand : public QUndoCommand +{ + +public: + RemoveBookmarksCommand(BookmarksManager *m_bookmarkManagaer, BookmarkNode *parent, int row); + ~RemoveBookmarksCommand(); + void undo(); + void redo(); + +protected: + int m_row; + BookmarksManager *m_bookmarkManagaer; + BookmarkNode *m_node; + BookmarkNode *m_parent; + bool m_done; +}; + +class InsertBookmarksCommand : public RemoveBookmarksCommand +{ + +public: + InsertBookmarksCommand(BookmarksManager *m_bookmarkManagaer, + BookmarkNode *parent, BookmarkNode *node, int row); + void undo() { RemoveBookmarksCommand::redo(); } + void redo() { RemoveBookmarksCommand::undo(); } + +}; + +class ChangeBookmarkCommand : public QUndoCommand +{ + +public: + ChangeBookmarkCommand(BookmarksManager *m_bookmarkManagaer, + BookmarkNode *node, const QString &newValue, bool title); + void undo(); + void redo(); + +private: + BookmarksManager *m_bookmarkManagaer; + bool m_title; + QString m_oldValue; + QString m_newValue; + BookmarkNode *m_node; +}; + +/*! + BookmarksModel is a QAbstractItemModel wrapper around the BookmarkManager + */ +#include +class BookmarksModel : public QAbstractItemModel +{ + Q_OBJECT + +public slots: + void entryAdded(BookmarkNode *item); + void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item); + void entryChanged(BookmarkNode *item); + +public: + enum Roles { + TypeRole = Qt::UserRole + 1, + UrlRole = Qt::UserRole + 2, + UrlStringRole = Qt::UserRole + 3, + SeparatorRole = Qt::UserRole + 4 + }; + + BookmarksModel(BookmarksManager *bookmarkManager, QObject *parent = 0); + inline BookmarksManager *bookmarksManager() const { return m_bookmarksManager; } + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + QModelIndex index(int, int, const QModelIndex& = QModelIndex()) const; + QModelIndex parent(const QModelIndex& index= QModelIndex()) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::DropActions supportedDropActions () const; + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + QMimeData *mimeData(const QModelIndexList &indexes) const; + QStringList mimeTypes() const; + bool dropMimeData(const QMimeData *data, + Qt::DropAction action, int row, int column, const QModelIndex &parent); + bool hasChildren(const QModelIndex &parent = QModelIndex()) const; + + BookmarkNode *node(const QModelIndex &index) const; + QModelIndex index(BookmarkNode *node) const; + +private: + + bool m_endMacro; + BookmarksManager *m_bookmarksManager; +}; + +// Menu that is dynamically populated from the bookmarks +#include "modelmenu.h" +class BookmarksMenu : public ModelMenu +{ + Q_OBJECT + +signals: + void openUrl(const QUrl &url); + +public: + BookmarksMenu(QWidget *parent = 0); + void setInitialActions(QList actions); + +protected: + bool prePopulated(); + +private slots: + void activated(const QModelIndex &index); + +private: + BookmarksManager *m_bookmarksManager; + QList m_initialActions; +}; + +/* + Proxy model that filters out the bookmarks so only the folders + are left behind. Used in the add bookmark dialog combobox. + */ +#include +class AddBookmarkProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + AddBookmarkProxyModel(QObject * parent = 0); + int columnCount(const QModelIndex & parent = QModelIndex()) const; + +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; +}; + +/*! + Add bookmark dialog + */ +#include "ui_addbookmarkdialog.h" +class AddBookmarkDialog : public QDialog, public Ui_AddBookmarkDialog +{ + Q_OBJECT + +public: + AddBookmarkDialog(const QString &url, const QString &title, QWidget *parent = 0, BookmarksManager *bookmarkManager = 0); + +private slots: + void accept(); + +private: + QString m_url; + BookmarksManager *m_bookmarksManager; + AddBookmarkProxyModel *m_proxyModel; +}; + +#include "ui_bookmarks.h" +class TreeProxyModel; +class BookmarksDialog : public QDialog, public Ui_BookmarksDialog +{ + Q_OBJECT + +signals: + void openUrl(const QUrl &url); + +public: + BookmarksDialog(QWidget *parent = 0, BookmarksManager *manager = 0); + ~BookmarksDialog(); + +private slots: + void customContextMenuRequested(const QPoint &pos); + void open(); + void newFolder(); + +private: + void expandNodes(BookmarkNode *node); + bool saveExpandedNodes(const QModelIndex &parent); + + BookmarksManager *m_bookmarksManager; + BookmarksModel *m_bookmarksModel; + TreeProxyModel *m_proxyModel; +}; + +#include +class BookmarksToolBar : public QToolBar +{ + Q_OBJECT + +signals: + void openUrl(const QUrl &url); + +public: + BookmarksToolBar(BookmarksModel *model, QWidget *parent = 0); + void setRootIndex(const QModelIndex &index); + QModelIndex rootIndex() const; + +protected: + void dragEnterEvent(QDragEnterEvent *event); + void dropEvent(QDropEvent *event); + +private slots: + void triggered(QAction *action); + void activated(const QModelIndex &index); + void build(); + +private: + BookmarksModel *m_bookmarksModel; + QPersistentModelIndex m_root; +}; + +#endif // BOOKMARKS_H -- cgit v1.2.1 From 4a0acb308cfecde67af334f48a521c221c4aee1a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 7 Nov 2008 00:17:56 +0100 Subject: Setting right license --- src/bookmarks.h | 55 +++++++++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 36 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 768efd53..4ce3e49f 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -1,39 +1,22 @@ -/**************************************************************************** -** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information -** to ensure GNU General Public Licensing requirements will be met: -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. In addition, as a special -** exception, Nokia gives you certain additional rights. These rights -** are described in the Nokia Qt GPL Exception version 1.3, included in -** the file GPL_EXCEPTION.txt in this package. -** -** Qt for Windows(R) Licensees -** As a special exception, Nokia, as the sole copyright holder for Qt -** Designer, grants users of the Qt/Eclipse Integration plug-in the -** right for the Qt/Eclipse Integration to link to functionality -** provided by Qt Designer and its related libraries. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ +/* ============================================================ + * + * This file is a part of the reKonq project + * + * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved + * Copyright (C) 2008 by Andrea Diamantini + * + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * ============================================================ */ #ifndef BOOKMARKS_H #define BOOKMARKS_H -- cgit v1.2.1 From 76319190fa422c0a12417410ad12241172bf3c0a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 13 Nov 2008 03:13:34 +0100 Subject: 1st new implementation of KDE bookmarks system. The idea is to share konqueror bookmarks until we don't have an akonadi storage of them.. --- src/bookmarks.h | 289 -------------------------------------------------------- 1 file changed, 289 deletions(-) delete mode 100644 src/bookmarks.h (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h deleted file mode 100644 index 4ce3e49f..00000000 --- a/src/bookmarks.h +++ /dev/null @@ -1,289 +0,0 @@ -/* ============================================================ - * - * This file is a part of the reKonq project - * - * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved - * Copyright (C) 2008 by Andrea Diamantini - * - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef BOOKMARKS_H -#define BOOKMARKS_H - -#include -#include - -#include - -/*! - Bookmark manager, owner of the bookmarks, loads, saves and basic tasks - */ -class AutoSaver; -class BookmarkNode; -class BookmarksModel; -class BookmarksManager : public QObject -{ - Q_OBJECT - -signals: - void entryAdded(BookmarkNode *item); - void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item); - void entryChanged(BookmarkNode *item); - -public: - BookmarksManager(QObject *parent = 0); - ~BookmarksManager(); - - void addBookmark(BookmarkNode *parent, BookmarkNode *node, int row = -1); - void removeBookmark(BookmarkNode *node); - void setTitle(BookmarkNode *node, const QString &newTitle); - void setUrl(BookmarkNode *node, const QString &newUrl); - void changeExpanded(); - - BookmarkNode *bookmarks(); - BookmarkNode *menu(); - BookmarkNode *toolbar(); - - BookmarksModel *bookmarksModel(); - QUndoStack *undoRedoStack() { return &m_commands; }; - -public slots: - void importBookmarks(); - void exportBookmarks(); - -private slots: - void save() const; - -private: - void load(); - - bool m_loaded; - AutoSaver *m_saveTimer; - BookmarkNode *m_bookmarkRootNode; - BookmarksModel *m_bookmarkModel; - QUndoStack m_commands; - - friend class RemoveBookmarksCommand; - friend class ChangeBookmarkCommand; -}; - -class RemoveBookmarksCommand : public QUndoCommand -{ - -public: - RemoveBookmarksCommand(BookmarksManager *m_bookmarkManagaer, BookmarkNode *parent, int row); - ~RemoveBookmarksCommand(); - void undo(); - void redo(); - -protected: - int m_row; - BookmarksManager *m_bookmarkManagaer; - BookmarkNode *m_node; - BookmarkNode *m_parent; - bool m_done; -}; - -class InsertBookmarksCommand : public RemoveBookmarksCommand -{ - -public: - InsertBookmarksCommand(BookmarksManager *m_bookmarkManagaer, - BookmarkNode *parent, BookmarkNode *node, int row); - void undo() { RemoveBookmarksCommand::redo(); } - void redo() { RemoveBookmarksCommand::undo(); } - -}; - -class ChangeBookmarkCommand : public QUndoCommand -{ - -public: - ChangeBookmarkCommand(BookmarksManager *m_bookmarkManagaer, - BookmarkNode *node, const QString &newValue, bool title); - void undo(); - void redo(); - -private: - BookmarksManager *m_bookmarkManagaer; - bool m_title; - QString m_oldValue; - QString m_newValue; - BookmarkNode *m_node; -}; - -/*! - BookmarksModel is a QAbstractItemModel wrapper around the BookmarkManager - */ -#include -class BookmarksModel : public QAbstractItemModel -{ - Q_OBJECT - -public slots: - void entryAdded(BookmarkNode *item); - void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item); - void entryChanged(BookmarkNode *item); - -public: - enum Roles { - TypeRole = Qt::UserRole + 1, - UrlRole = Qt::UserRole + 2, - UrlStringRole = Qt::UserRole + 3, - SeparatorRole = Qt::UserRole + 4 - }; - - BookmarksModel(BookmarksManager *bookmarkManager, QObject *parent = 0); - inline BookmarksManager *bookmarksManager() const { return m_bookmarksManager; } - - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - QModelIndex index(int, int, const QModelIndex& = QModelIndex()) const; - QModelIndex parent(const QModelIndex& index= QModelIndex()) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - Qt::DropActions supportedDropActions () const; - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - QMimeData *mimeData(const QModelIndexList &indexes) const; - QStringList mimeTypes() const; - bool dropMimeData(const QMimeData *data, - Qt::DropAction action, int row, int column, const QModelIndex &parent); - bool hasChildren(const QModelIndex &parent = QModelIndex()) const; - - BookmarkNode *node(const QModelIndex &index) const; - QModelIndex index(BookmarkNode *node) const; - -private: - - bool m_endMacro; - BookmarksManager *m_bookmarksManager; -}; - -// Menu that is dynamically populated from the bookmarks -#include "modelmenu.h" -class BookmarksMenu : public ModelMenu -{ - Q_OBJECT - -signals: - void openUrl(const QUrl &url); - -public: - BookmarksMenu(QWidget *parent = 0); - void setInitialActions(QList actions); - -protected: - bool prePopulated(); - -private slots: - void activated(const QModelIndex &index); - -private: - BookmarksManager *m_bookmarksManager; - QList m_initialActions; -}; - -/* - Proxy model that filters out the bookmarks so only the folders - are left behind. Used in the add bookmark dialog combobox. - */ -#include -class AddBookmarkProxyModel : public QSortFilterProxyModel -{ - Q_OBJECT -public: - AddBookmarkProxyModel(QObject * parent = 0); - int columnCount(const QModelIndex & parent = QModelIndex()) const; - -protected: - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; -}; - -/*! - Add bookmark dialog - */ -#include "ui_addbookmarkdialog.h" -class AddBookmarkDialog : public QDialog, public Ui_AddBookmarkDialog -{ - Q_OBJECT - -public: - AddBookmarkDialog(const QString &url, const QString &title, QWidget *parent = 0, BookmarksManager *bookmarkManager = 0); - -private slots: - void accept(); - -private: - QString m_url; - BookmarksManager *m_bookmarksManager; - AddBookmarkProxyModel *m_proxyModel; -}; - -#include "ui_bookmarks.h" -class TreeProxyModel; -class BookmarksDialog : public QDialog, public Ui_BookmarksDialog -{ - Q_OBJECT - -signals: - void openUrl(const QUrl &url); - -public: - BookmarksDialog(QWidget *parent = 0, BookmarksManager *manager = 0); - ~BookmarksDialog(); - -private slots: - void customContextMenuRequested(const QPoint &pos); - void open(); - void newFolder(); - -private: - void expandNodes(BookmarkNode *node); - bool saveExpandedNodes(const QModelIndex &parent); - - BookmarksManager *m_bookmarksManager; - BookmarksModel *m_bookmarksModel; - TreeProxyModel *m_proxyModel; -}; - -#include -class BookmarksToolBar : public QToolBar -{ - Q_OBJECT - -signals: - void openUrl(const QUrl &url); - -public: - BookmarksToolBar(BookmarksModel *model, QWidget *parent = 0); - void setRootIndex(const QModelIndex &index); - QModelIndex rootIndex() const; - -protected: - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); - -private slots: - void triggered(QAction *action); - void activated(const QModelIndex &index); - void build(); - -private: - BookmarksModel *m_bookmarksModel; - QPersistentModelIndex m_root; -}; - -#endif // BOOKMARKS_H -- cgit v1.2.1 From 6efdfa17dd017d735364626220b501cb2063e1c9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 1 Dec 2008 01:09:56 +0100 Subject: New BookmarkMenu implementation --- src/bookmarks.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/bookmarks.h (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h new file mode 100644 index 00000000..4f527436 --- /dev/null +++ b/src/bookmarks.h @@ -0,0 +1,55 @@ +/* ============================================================ + * + * This file is a part of the reKonq project + * + * Copyright (C) 2008 by Andrea Diamantini + * + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * ============================================================ */ + +#ifndef BOOKMARKS_H +#define BOOKMARKS_H + +#include +#include +#include + + +class OwnBookMarks : public KBookMarkOwner +{ +Q_OBJECT +public: + OwnBookMarks(KMainWindow *parent); + + virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); +}; + + +class BookmarkMenu : public KMenu +{ +Q_OBJECT +public: + BookmarkMenu(KMainWindow *parent); + +private: + void setActions(); + + KBookmarkManager *m_manager; + OwnBookMarks *m_owner; + KActionCollection *m_ac; + KBookmarkMenu *m_menu; + KMainWindow *m_parent; +}; + +#endif + -- cgit v1.2.1 From 15ecefe10101dd068c4e075fca23ba64519bedb1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Dec 2008 16:22:28 +0100 Subject: New Bookmarks menu, sharing bkmrs with Konqueror (And that's reKonq 1st feature!!) --- src/bookmarks.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 4f527436..80362e1c 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -20,36 +20,48 @@ #ifndef BOOKMARKS_H #define BOOKMARKS_H +// KDE Includes #include #include #include +#include +#include -class OwnBookMarks : public KBookMarkOwner +class BrowserMainWindow; + +class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT public: - OwnBookMarks(KMainWindow *parent); + OwnBookMarks(KMainWindow * ); virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); + + // KBookmarkOwner interface: + virtual QString currentUrl() const; + virtual QString currentTitle() const; + +signals: + void openUrl(const QUrl &); // FIXME pass all to KUrl!! + +private: + BrowserMainWindow *m_parent; }; -class BookmarkMenu : public KMenu +class BookmarksMenu : public KMenu { Q_OBJECT public: - BookmarkMenu(KMainWindow *parent); + BookmarksMenu(KMainWindow * parent); private: - void setActions(); - KBookmarkManager *m_manager; OwnBookMarks *m_owner; KActionCollection *m_ac; KBookmarkMenu *m_menu; - KMainWindow *m_parent; }; -#endif +#endif -- cgit v1.2.1 From b9f8ccd9099fa48406203ad5c5389266b3318d88 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 5 Dec 2008 00:27:23 +0100 Subject: QUrl --> KUrl! --- src/bookmarks.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 80362e1c..950fc8a6 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -43,7 +44,7 @@ public: virtual QString currentTitle() const; signals: - void openUrl(const QUrl &); // FIXME pass all to KUrl!! + void openUrl(const KUrl &); private: BrowserMainWindow *m_parent; -- cgit v1.2.1 From 19e901a0ca9630b2003dd24ccfa6da54eb70bb09 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 14 Dec 2008 18:27:17 +0100 Subject: adjusted rekonq name commented out (hopefully, for now) resizeEvents and focusInEvents in urlbar & searchbar --- src/bookmarks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 950fc8a6..91160321 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -1,6 +1,6 @@ /* ============================================================  * - * This file is a part of the reKonq project + * This file is a part of the rekonq project  * * Copyright (C) 2008 by Andrea Diamantini  * -- cgit v1.2.1 From c7048563b95f8d27b20aac0a0e1fbc5c4584c514 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 27 Dec 2008 12:54:30 +0100 Subject: BrowserMainWindow --> MainWindow --- src/bookmarks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 91160321..e0e49c78 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -29,7 +29,7 @@ #include #include -class BrowserMainWindow; +class MainWindow; class OwnBookMarks : public QObject , public KBookmarkOwner { @@ -47,7 +47,7 @@ signals: void openUrl(const KUrl &); private: - BrowserMainWindow *m_parent; + MainWindow *m_parent; }; -- cgit v1.2.1 From 96bd94c88f238fe06ddf5e772bcbe084405cc252 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Jan 2009 01:41:30 +0100 Subject: 1st introduction of new bookmarks line --- src/bookmarks.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index e0e49c78..490f8ee2 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -50,6 +50,7 @@ private: MainWindow *m_parent; }; +// ------------------------------------------------------------------------------ class BookmarksMenu : public KMenu { @@ -64,5 +65,14 @@ private: KBookmarkMenu *m_menu; }; +// ------------------------------------------------------------------------------ + +class BookmarksLine : public QObject +{ +Q_OBJECT +public: + BookmarksLine(QObject *parent, KToolBar *toolbar); + +}; #endif -- cgit v1.2.1 From de1b2a26f7eaebd3fa1fa2eeb30f4e26afb534fe Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Jan 2009 17:33:26 +0100 Subject: Fixed MenuBar. Fixed BookmarkLine in rekonqui.rc Now we need just the code to implement it.. --- src/bookmarks.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 490f8ee2..5aa384a1 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -56,10 +56,9 @@ class BookmarksMenu : public KMenu { Q_OBJECT public: - BookmarksMenu(KMainWindow * parent); + BookmarksMenu(KMainWindow*, KBookmarkManager *); private: - KBookmarkManager *m_manager; OwnBookMarks *m_owner; KActionCollection *m_ac; KBookmarkMenu *m_menu; @@ -71,8 +70,11 @@ class BookmarksLine : public QObject { Q_OBJECT public: - BookmarksLine(QObject *parent, KToolBar *toolbar); + BookmarksLine(KBookmarkManager *, KToolBar *toolbar); +private: + OwnBookMarks *m_owner; + KActionCollection *m_ac; }; #endif -- cgit v1.2.1 From d467ccf90fb3e8c851db97c44f551aeaa9fa289f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 28 Jan 2009 15:58:37 +0100 Subject: New BookmarkBar!! 1st version, Yeah!! --- src/bookmarks.h | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 5aa384a1..2bdfab0a 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -35,7 +36,7 @@ class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT public: - OwnBookMarks(KMainWindow * ); + OwnBookMarks(KMainWindow *); virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); @@ -52,29 +53,19 @@ private: // ------------------------------------------------------------------------------ -class BookmarksMenu : public KMenu +class BookmarksProvider : public QObject { Q_OBJECT public: - BookmarksMenu(KMainWindow*, KBookmarkManager *); + BookmarksProvider(KMainWindow*); -private: - OwnBookMarks *m_owner; - KActionCollection *m_ac; - KBookmarkMenu *m_menu; -}; - -// ------------------------------------------------------------------------------ - -class BookmarksLine : public QObject -{ -Q_OBJECT -public: - BookmarksLine(KBookmarkManager *, KToolBar *toolbar); + void provideBmToolbar(KToolBar*); + KMenu *bookmarksMenu(); private: + KMainWindow *m_parent; OwnBookMarks *m_owner; + KBookmarkManager *m_manager; KActionCollection *m_ac; }; - #endif -- cgit v1.2.1 From 43fa9af21ff14b895b1d0ef3b559b9236208eb79 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 15 Feb 2009 16:10:16 +0100 Subject: First bits of documentation.. --- src/bookmarks.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 2bdfab0a..aa18834c 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -24,7 +24,6 @@ #include #include #include - #include #include #include @@ -32,6 +31,9 @@ class MainWindow; +/* + * + */ class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT @@ -53,6 +55,9 @@ private: // ------------------------------------------------------------------------------ +/* + * + */ class BookmarksProvider : public QObject { Q_OBJECT -- cgit v1.2.1 From 1388bed0effca69e1fee0fb080eb035a3653f4c1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 24 Feb 2009 11:50:03 +0100 Subject: Documented API bookmarks && download classes. Fixed load on startup --- src/bookmarks.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 7 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index aa18834c..825c0d3a 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -31,40 +31,112 @@ class MainWindow; -/* +/** + * Inherited from KBookmarkOwner, this class allows to manage + * bookmarks as actions * + * @author Andrea Diamantini + * @since 4.x */ class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT + public: - OwnBookMarks(KMainWindow *); - virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); + /** + * The class ctor. + * + * @param parent the pointer to the browser mainwindow. We need it + * to link bookmarks actions with the right window + * where load url in + */ + OwnBookMarks(KMainWindow *parent); + + /** + * This function is called when a bookmark is selected and belongs to + * the ancestor class. + * This method actually emits signal to load bookmark's url without + * considering mousebuttons or keyboard modifiers. + * + * @param b the bookmark to open + * @param mb the mouse buttons clicked to select the bookmark + * @param km the keyboard modifiers pushed when the bookmark was selected + */ + virtual void openBookmark (const KBookmark &b , Qt::MouseButtons mb, Qt::KeyboardModifiers km); - // KBookmarkOwner interface: + + /** + * this method, from KBookmarkOwner interface, allows to add the current page + * to the bookmark list, returning the URL page as QString. + * + * @return the current page's URL + */ virtual QString currentUrl() const; + + /** + * this method, from KBookmarkOwner interface, allows to add the current page + * to the bookmark list, returning the title's page as QString. + * + * @return the current page's title + */ virtual QString currentTitle() const; signals: + /** + * This signal is emitted when an url has to be loaded + * + * @param url the URL to load + * + */ void openUrl(const KUrl &); private: + // the MainWindow pointer MainWindow *m_parent; }; + // ------------------------------------------------------------------------------ -/* + +/** + * This class represent the interface to rekonq bookmarks system. + * All rekonq needs (Bookmarks Menu, Bookmarks Toolbar) is provided + * from this class. + * So it implements code to have each one + * + * @author Andrea Diamantini + * @since 4.x * */ class BookmarksProvider : public QObject { Q_OBJECT + public: - BookmarksProvider(KMainWindow*); + /** + * Class constructor. Connect BookmarksProvider with bookmarks source + * (actually konqueror's bookmarks) + * + * @param parent The MainWindow to provide bookmarks objects + * + */ + BookmarksProvider(KMainWindow* parent); + + /** + * Customize bookmarks toolbar + * + * @param toolbar the toolbar to customize + */ + void provideBmToolbar(KToolBar* toolbar); - void provideBmToolbar(KToolBar*); + /** + * Generate the Bookmarks Menu + * + * @return the Bookmarks Menu + * + */ KMenu *bookmarksMenu(); private: -- cgit v1.2.1 From 5e6be36618dd2e9f9dd64ffd2ed899ec4dc55f2c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 25 Feb 2009 12:05:15 +0100 Subject: 1st fixes to bookmarks system, toolbar and menu. Needs care and docs.. --- src/bookmarks.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 825c0d3a..f9f3e91c 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -97,6 +97,26 @@ private: }; +// ------------------------------------------------------------------------------ + +/** + * This class represent the rekonq bookmarks menu. + * It's just a simple class inherited from KBookmarkMenu + * + * @author Andrea Diamantini + * @since 4.x + * + */ +class BookmarksMenu : public KBookmarkMenu +{ +Q_OBJECT + +public: + BookmarksMenu( KBookmarkManager* manager, KBookmarkOwner* owner, KMenu* menu, KActionCollection* ac); + + KMenu *viewContextMenu(QAction* action); +}; + // ------------------------------------------------------------------------------ @@ -139,10 +159,16 @@ public: */ KMenu *bookmarksMenu(); +public slots: + void contextMenu(const QPoint & point); + private: KMainWindow *m_parent; OwnBookMarks *m_owner; KBookmarkManager *m_manager; KActionCollection *m_ac; + BookmarksMenu *m_bmMenu; + KToolBar *m_bmToolbar; }; + #endif -- cgit v1.2.1 From 39409ac6a2880ad815d6096231d0fcdcfd2547f6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 22 Mar 2009 10:21:09 +0100 Subject: Fixed Copyright intro --- src/bookmarks.h | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index f9f3e91c..7b4bcdef 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -1,21 +1,23 @@ /* ============================================================ - * - * This file is a part of the rekonq project - * - * Copyright (C) 2008 by Andrea Diamantini - * - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - * - * ============================================================ */ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2008 by Andrea Diamantini +* +* +* This program is free software; you can redistribute it +* and/or modify it under the terms of the GNU General +* Public License as published by the Free Software Foundation; +* either version 2, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* ============================================================ */ + + #ifndef BOOKMARKS_H #define BOOKMARKS_H -- cgit v1.2.1 From ab6e758071ac9ac8ede21f34bd9d60607651a27f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 22 Mar 2009 11:45:05 +0100 Subject: typo --- src/bookmarks.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 7b4bcdef..d6e74baa 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -22,6 +22,7 @@ #ifndef BOOKMARKS_H #define BOOKMARKS_H + // KDE Includes #include #include @@ -31,8 +32,11 @@ #include #include + +// Forward Declarations class MainWindow; + /** * Inherited from KBookmarkOwner, this class allows to manage * bookmarks as actions @@ -101,6 +105,7 @@ private: // ------------------------------------------------------------------------------ + /** * This class represent the rekonq bookmarks menu. * It's just a simple class inherited from KBookmarkMenu @@ -119,6 +124,7 @@ public: KMenu *viewContextMenu(QAction* action); }; + // ------------------------------------------------------------------------------ -- cgit v1.2.1 From 98fc1dc5406c3d4f191f899154eda1b0fa144d1a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 22 Mar 2009 12:09:30 +0100 Subject: update toolbar when bookmarks change. Yeah.. --- src/bookmarks.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index d6e74baa..9ef82624 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -169,6 +169,7 @@ public: public slots: void contextMenu(const QPoint & point); + void slotBookmarksChanged(const QString &); private: KMainWindow *m_parent; -- cgit v1.2.1 From a934072cf9695e46e793898102590322f43c0733 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 28 Mar 2009 15:53:26 +0100 Subject: astyle. First round.. --- src/bookmarks.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 9ef82624..f31cea62 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -37,8 +37,8 @@ class MainWindow; -/** - * Inherited from KBookmarkOwner, this class allows to manage +/** + * Inherited from KBookmarkOwner, this class allows to manage * bookmarks as actions * * @author Andrea Diamantini @@ -46,21 +46,21 @@ class MainWindow; */ class OwnBookMarks : public QObject , public KBookmarkOwner { -Q_OBJECT + Q_OBJECT public: - /** + /** * The class ctor. * * @param parent the pointer to the browser mainwindow. We need it - * to link bookmarks actions with the right window + * to link bookmarks actions with the right window * where load url in */ OwnBookMarks(KMainWindow *parent); /** - * This function is called when a bookmark is selected and belongs to + * This function is called when a bookmark is selected and belongs to * the ancestor class. * This method actually emits signal to load bookmark's url without * considering mousebuttons or keyboard modifiers. @@ -69,10 +69,10 @@ public: * @param mb the mouse buttons clicked to select the bookmark * @param km the keyboard modifiers pushed when the bookmark was selected */ - virtual void openBookmark (const KBookmark &b , Qt::MouseButtons mb, Qt::KeyboardModifiers km); + virtual void openBookmark(const KBookmark &b , Qt::MouseButtons mb, Qt::KeyboardModifiers km); + - - /** + /** * this method, from KBookmarkOwner interface, allows to add the current page * to the bookmark list, returning the URL page as QString. * @@ -80,7 +80,7 @@ public: */ virtual QString currentUrl() const; - /** + /** * this method, from KBookmarkOwner interface, allows to add the current page * to the bookmark list, returning the title's page as QString. * @@ -90,7 +90,7 @@ public: signals: /** - * This signal is emitted when an url has to be loaded + * This signal is emitted when an url has to be loaded * * @param url the URL to load * @@ -106,7 +106,7 @@ private: // ------------------------------------------------------------------------------ -/** +/** * This class represent the rekonq bookmarks menu. * It's just a simple class inherited from KBookmarkMenu * @@ -116,10 +116,10 @@ private: */ class BookmarksMenu : public KBookmarkMenu { -Q_OBJECT + Q_OBJECT public: - BookmarksMenu( KBookmarkManager* manager, KBookmarkOwner* owner, KMenu* menu, KActionCollection* ac); + BookmarksMenu(KBookmarkManager* manager, KBookmarkOwner* owner, KMenu* menu, KActionCollection* ac); KMenu *viewContextMenu(QAction* action); }; @@ -128,7 +128,7 @@ public: // ------------------------------------------------------------------------------ -/** +/** * This class represent the interface to rekonq bookmarks system. * All rekonq needs (Bookmarks Menu, Bookmarks Toolbar) is provided * from this class. @@ -140,10 +140,10 @@ public: */ class BookmarksProvider : public QObject { -Q_OBJECT + Q_OBJECT public: - /** + /** * Class constructor. Connect BookmarksProvider with bookmarks source * (actually konqueror's bookmarks) * @@ -152,14 +152,14 @@ public: */ BookmarksProvider(KMainWindow* parent); - /** + /** * Customize bookmarks toolbar * * @param toolbar the toolbar to customize */ void provideBmToolbar(KToolBar* toolbar); - /** + /** * Generate the Bookmarks Menu * * @return the Bookmarks Menu -- cgit v1.2.1 From f3a8099e06aa212611a7988a2879d7bdfce87a56 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 21 Apr 2009 23:45:36 +0200 Subject: Bookmarks classes refactored --- src/bookmarks.h | 162 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 103 insertions(+), 59 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index f31cea62..6a476a97 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -22,54 +22,55 @@ #ifndef BOOKMARKS_H #define BOOKMARKS_H +// Qt Includes +#include // KDE Includes #include -#include -#include -#include -#include -#include -#include - // Forward Declarations -class MainWindow; +class BookmarkProvider; + +class KAction; +class KActionCollection; +class KActionMenu; +class KUrl; +class KToolBar; +class KBookmarkManager; /** - * Inherited from KBookmarkOwner, this class allows to manage + * Reimplementation of KBookmarkOwner, this class allows to manage * bookmarks as actions * - * @author Andrea Diamantini - * @since 4.x */ -class OwnBookMarks : public QObject , public KBookmarkOwner +class BookmarkOwner : public QObject , public KBookmarkOwner { Q_OBJECT public: /** - * The class ctor. + * @short The class constructor. * - * @param parent the pointer to the browser mainwindow. We need it - * to link bookmarks actions with the right window - * where load url in + * @param parent the pointer parent Bookmark provider. We need it + * to get pointer to MainWindow */ - OwnBookMarks(KMainWindow *parent); + BookmarkOwner(QObject *parent=0); + virtual ~BookmarkOwner() {} /** * This function is called when a bookmark is selected and belongs to * the ancestor class. - * This method actually emits signal to load bookmark's url without - * considering mousebuttons or keyboard modifiers. + * This method actually emits signal to load bookmark's url. * - * @param b the bookmark to open - * @param mb the mouse buttons clicked to select the bookmark - * @param km the keyboard modifiers pushed when the bookmark was selected + * @param bookmark the bookmark to open + * @param mouseButtons the mouse buttons clicked to select the bookmark + * @param keyboardModifiers the keyboard modifiers pushed when the bookmark was selected */ - virtual void openBookmark(const KBookmark &b , Qt::MouseButtons mb, Qt::KeyboardModifiers km); + virtual void openBookmark(const KBookmark &bookmark, + Qt::MouseButtons mouseButtons, + Qt::KeyboardModifiers keyboardModifiers); /** @@ -88,6 +89,11 @@ public: */ virtual QString currentTitle() const; + /** + * This function returns whether the owner supports tabs. + */ + virtual bool supportsTabs() const { return true; } + signals: /** * This signal is emitted when an url has to be loaded @@ -98,30 +104,36 @@ signals: void openUrl(const KUrl &); private: - // the MainWindow pointer - MainWindow *m_parent; -}; +}; // ------------------------------------------------------------------------------ +#include + + /** * This class represent the rekonq bookmarks menu. * It's just a simple class inherited from KBookmarkMenu * - * @author Andrea Diamantini - * @since 4.x - * */ -class BookmarksMenu : public KBookmarkMenu +class BookmarkMenu : public KBookmarkMenu { Q_OBJECT public: - BookmarksMenu(KBookmarkManager* manager, KBookmarkOwner* owner, KMenu* menu, KActionCollection* ac); - - KMenu *viewContextMenu(QAction* action); + BookmarkMenu(KBookmarkManager* manager, + KBookmarkOwner* owner, + KMenu* menu, + KActionCollection* actionCollection); + ~BookmarkMenu(); + + virtual KMenu *viewContextMenu(QAction* action); + +protected slots: + void slotAddBookmark(); + }; @@ -134,50 +146,82 @@ public: * from this class. * So it implements code to have each one * - * @author Andrea Diamantini - * @since 4.x * */ -class BookmarksProvider : public QObject +class BookmarkProvider : public QWidget { Q_OBJECT public: /** - * Class constructor. Connect BookmarksProvider with bookmarks source - * (actually konqueror's bookmarks) - * - * @param parent The MainWindow to provide bookmarks objects - * + * @short Class constructor. + * Connect BookmarksProvider with bookmarks source + * (actually konqueror's bookmarks) + * @param parent The MainWindow to provide bookmarks objects + * + */ + BookmarkProvider(QWidget* parent=0); + ~BookmarkProvider(); + + /** + * @short Get the Bookmarks Menu Action + * @return the Bookmarks Menu */ - BookmarksProvider(KMainWindow* parent); + KActionMenu *bookmarkActionMenu(); + /** - * Customize bookmarks toolbar - * - * @param toolbar the toolbar to customize - */ - void provideBmToolbar(KToolBar* toolbar); + * @short Get the Bookmarks Toolbar Action + * @return the Bookmarks Toolbar Action + */ + KAction *bookmarkToolBarAction(); + /** - * Generate the Bookmarks Menu - * - * @return the Bookmarks Menu - * + * @short Get action by name + * This method returns poiner bookmark action of given name. + * @pre m_actionCollection != NULL + * @param name Name of action you want to get + * @return It returns actions if one exists or empty object */ - KMenu *bookmarksMenu(); + QAction *actionByName(const QString &name); + +signals: + /** + * @short This signal is emitted when an url has to be loaded + * + * @param url the URL to load + */ + void openUrl(const KUrl &url); + public slots: - void contextMenu(const QPoint & point); - void slotBookmarksChanged(const QString &); + /** + * @short Opens the context menu on given position + * @param point Point on whitch you want to open this menu + */ + void contextMenu(const QPoint &point); + + /** + * @short Waits for signal that the group with the address has been modified by the caller. + * Waits for signal that the group (or any of its children) with the address + * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. + * + * @param group bookmark group adress + * @param caller caller that modified the bookmarks + * @see KBookmarkManager::changed + */ + void slotBookmarksChanged(const QString &group, const QString &caller); private: - KMainWindow *m_parent; - OwnBookMarks *m_owner; + void setupToolBar(); + KBookmarkManager *m_manager; - KActionCollection *m_ac; - BookmarksMenu *m_bmMenu; - KToolBar *m_bmToolbar; + BookmarkOwner *m_owner; + KMenu *m_menu; + KActionCollection *m_actionCollection; + BookmarkMenu *m_bookmarkMenu; + KToolBar *m_bookmarkToolBar; }; #endif -- cgit v1.2.1 From 7557af13f9f904cb9a6240d2101fb14e1ffdca99 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 22 Apr 2009 01:33:28 +0200 Subject: Fixing Copyrights --- src/bookmarks.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 6a476a97..9bebd4a3 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -2,7 +2,8 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2008 by Andrea Diamantini +* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2009 rekonq team. Please, see AUTHORS file for details * * * This program is free software; you can redistribute it -- cgit v1.2.1 From e657ef44ef1eef1f998101ab3dcce1a251d729fc Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 26 Apr 2009 01:45:38 +0200 Subject: Fixed copyright strings, per file, as decided --- src/bookmarks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 9bebd4a3..5ac1270d 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -2,8 +2,8 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2008-2009 by Andrea Diamantini -* Copyright (C) 2009 rekonq team. Please, see AUTHORS file for details +* Copyright (C) 2008 by Andrea Diamantini +* Copyright (C) 2009 by Paweł Prażak * * * This program is free software; you can redistribute it -- cgit v1.2.1 From fdbd70a77a8c294e0a578073c738f3bc4dfa6ab5 Mon Sep 17 00:00:00 2001 From: Alexandr Domrachev Date: Mon, 27 Apr 2009 17:05:43 +0000 Subject: Some changes ported for merge to mainline (bookmarks & links handling related) Added author: me :) Bookmark owner: openFolderinTabs implemented Links handling ported from Pawel branch Issue #1 fixed --- src/bookmarks.h | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 5ac1270d..32982c8a 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -23,6 +23,9 @@ #ifndef BOOKMARKS_H #define BOOKMARKS_H +// Local includes +#include "application.h" + // Qt Includes #include @@ -69,8 +72,8 @@ public: * @param mouseButtons the mouse buttons clicked to select the bookmark * @param keyboardModifiers the keyboard modifiers pushed when the bookmark was selected */ - virtual void openBookmark(const KBookmark &bookmark, - Qt::MouseButtons mouseButtons, + virtual void openBookmark(const KBookmark &bookmark, + Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); @@ -95,14 +98,23 @@ public: */ virtual bool supportsTabs() const { return true; } + /** + * Called if the user wants to open every bookmark in this folder in a new tab. + * The default implementation does nothing. + * This is only called if supportsTabs() returns true + */ + virtual void openFolderinTabs(const KBookmarkGroup &bm); + signals: /** * This signal is emitted when an url has to be loaded * * @param url the URL to load + * @param type type of load + * @see Application::OpenType * */ - void openUrl(const KUrl &); + void openUrl(const KUrl &url, Rekonq::OpenType type); private: @@ -124,17 +136,17 @@ class BookmarkMenu : public KBookmarkMenu Q_OBJECT public: - BookmarkMenu(KBookmarkManager* manager, - KBookmarkOwner* owner, - KMenu* menu, + BookmarkMenu(KBookmarkManager* manager, + KBookmarkOwner* owner, + KMenu* menu, KActionCollection* actionCollection); ~BookmarkMenu(); - + virtual KMenu *viewContextMenu(QAction* action); - + protected slots: void slotAddBookmark(); - + }; @@ -163,7 +175,7 @@ public: */ BookmarkProvider(QWidget* parent=0); ~BookmarkProvider(); - + /** * @short Get the Bookmarks Menu Action * @return the Bookmarks Menu @@ -189,11 +201,14 @@ public: signals: /** - * @short This signal is emitted when an url has to be loaded - * - * @param url the URL to load - */ - void openUrl(const KUrl &url); + * This signal is emitted when an url has to be loaded + * + * @param url the URL to load + * @param type type of load + * @see Application::OpenType + * + */ + void openUrl(const KUrl &url, Rekonq::OpenType type); public slots: @@ -202,12 +217,12 @@ public slots: * @param point Point on whitch you want to open this menu */ void contextMenu(const QPoint &point); - + /** * @short Waits for signal that the group with the address has been modified by the caller. * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. - * + * * @param group bookmark group adress * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed -- cgit v1.2.1 From 32da13f039241349c894f5c13cc1954c16c2e783 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 28 Apr 2009 03:19:14 +0200 Subject: Revert "Some changes ported for merge to mainline (bookmarks & links handling related)" links hadling problem This reverts commit fdbd70a77a8c294e0a578073c738f3bc4dfa6ab5. --- src/bookmarks.h | 49 +++++++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 32982c8a..5ac1270d 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -23,9 +23,6 @@ #ifndef BOOKMARKS_H #define BOOKMARKS_H -// Local includes -#include "application.h" - // Qt Includes #include @@ -72,8 +69,8 @@ public: * @param mouseButtons the mouse buttons clicked to select the bookmark * @param keyboardModifiers the keyboard modifiers pushed when the bookmark was selected */ - virtual void openBookmark(const KBookmark &bookmark, - Qt::MouseButtons mouseButtons, + virtual void openBookmark(const KBookmark &bookmark, + Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); @@ -98,23 +95,14 @@ public: */ virtual bool supportsTabs() const { return true; } - /** - * Called if the user wants to open every bookmark in this folder in a new tab. - * The default implementation does nothing. - * This is only called if supportsTabs() returns true - */ - virtual void openFolderinTabs(const KBookmarkGroup &bm); - signals: /** * This signal is emitted when an url has to be loaded * * @param url the URL to load - * @param type type of load - * @see Application::OpenType * */ - void openUrl(const KUrl &url, Rekonq::OpenType type); + void openUrl(const KUrl &); private: @@ -136,17 +124,17 @@ class BookmarkMenu : public KBookmarkMenu Q_OBJECT public: - BookmarkMenu(KBookmarkManager* manager, - KBookmarkOwner* owner, - KMenu* menu, + BookmarkMenu(KBookmarkManager* manager, + KBookmarkOwner* owner, + KMenu* menu, KActionCollection* actionCollection); ~BookmarkMenu(); - + virtual KMenu *viewContextMenu(QAction* action); - + protected slots: void slotAddBookmark(); - + }; @@ -175,7 +163,7 @@ public: */ BookmarkProvider(QWidget* parent=0); ~BookmarkProvider(); - + /** * @short Get the Bookmarks Menu Action * @return the Bookmarks Menu @@ -201,14 +189,11 @@ public: signals: /** - * This signal is emitted when an url has to be loaded - * - * @param url the URL to load - * @param type type of load - * @see Application::OpenType - * - */ - void openUrl(const KUrl &url, Rekonq::OpenType type); + * @short This signal is emitted when an url has to be loaded + * + * @param url the URL to load + */ + void openUrl(const KUrl &url); public slots: @@ -217,12 +202,12 @@ public slots: * @param point Point on whitch you want to open this menu */ void contextMenu(const QPoint &point); - + /** * @short Waits for signal that the group with the address has been modified by the caller. * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. - * + * * @param group bookmark group adress * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed -- cgit v1.2.1 From f7d0c1e847801b2ba303e6a0b60545779948fbbf Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 28 Apr 2009 03:40:54 +0200 Subject: Importing some reverted changes --- src/bookmarks.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 5ac1270d..e7875745 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -95,6 +95,13 @@ public: */ virtual bool supportsTabs() const { return true; } + /** + * Called if the user wants to open every bookmark in this folder in a new tab. + * The default implementation does nothing. + * This is only called if supportsTabs() returns true + */ + virtual void openFolderinTabs(const KBookmarkGroup &bm); + signals: /** * This signal is emitted when an url has to be loaded -- cgit v1.2.1 From 5fb7d909e87be4ea5a07b7a29271c96b7db4a9b3 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 29 Apr 2009 01:41:58 +0200 Subject: Fixed loading Url methods. Now in all rekonq code we have just a loadUrl method in mainview (doing the dirty job) and one in mainwindow, provided for convenience. Every class needing loading an url has a openUrl signal. Hope this should go well.. --- src/bookmarks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index e7875745..7a6eee7f 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2008 by Andrea Diamantini +* Copyright (C) 2008-2009 by Andrea Diamantini * Copyright (C) 2009 by Paweł Prażak * * -- cgit v1.2.1 From 82862fbd150afae0101757d1d6081e0e6ddf7baa Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 29 Apr 2009 11:24:11 +0200 Subject: astyle --- src/bookmarks.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index 7a6eee7f..d7213cb7 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -57,7 +57,7 @@ public: * @param parent the pointer parent Bookmark provider. We need it * to get pointer to MainWindow */ - BookmarkOwner(QObject *parent=0); + BookmarkOwner(QObject *parent = 0); virtual ~BookmarkOwner() {} /** @@ -69,8 +69,8 @@ public: * @param mouseButtons the mouse buttons clicked to select the bookmark * @param keyboardModifiers the keyboard modifiers pushed when the bookmark was selected */ - virtual void openBookmark(const KBookmark &bookmark, - Qt::MouseButtons mouseButtons, + virtual void openBookmark(const KBookmark &bookmark, + Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); @@ -93,7 +93,10 @@ public: /** * This function returns whether the owner supports tabs. */ - virtual bool supportsTabs() const { return true; } + virtual bool supportsTabs() const + { + return true; + } /** * Called if the user wants to open every bookmark in this folder in a new tab. @@ -131,17 +134,17 @@ class BookmarkMenu : public KBookmarkMenu Q_OBJECT public: - BookmarkMenu(KBookmarkManager* manager, - KBookmarkOwner* owner, - KMenu* menu, + BookmarkMenu(KBookmarkManager* manager, + KBookmarkOwner* owner, + KMenu* menu, KActionCollection* actionCollection); ~BookmarkMenu(); - + virtual KMenu *viewContextMenu(QAction* action); - + protected slots: void slotAddBookmark(); - + }; @@ -168,9 +171,9 @@ public: * @param parent The MainWindow to provide bookmarks objects * */ - BookmarkProvider(QWidget* parent=0); + BookmarkProvider(QWidget* parent = 0); ~BookmarkProvider(); - + /** * @short Get the Bookmarks Menu Action * @return the Bookmarks Menu @@ -209,12 +212,12 @@ public slots: * @param point Point on whitch you want to open this menu */ void contextMenu(const QPoint &point); - + /** * @short Waits for signal that the group with the address has been modified by the caller. * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. - * + * * @param group bookmark group adress * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed -- cgit v1.2.1 From 06b2dc0ce6ec6dd4cb090c22e2f9f8521138146b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 6 May 2009 03:09:23 +0200 Subject: EBN Krazy fixes. 1st round.. --- src/bookmarks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index d7213cb7..38655133 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -209,7 +209,7 @@ signals: public slots: /** * @short Opens the context menu on given position - * @param point Point on whitch you want to open this menu + * @param point Point on which you want to open this menu */ void contextMenu(const QPoint &point); @@ -218,7 +218,7 @@ public slots: * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. * - * @param group bookmark group adress + * @param group bookmark group address * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed */ -- cgit v1.2.1