KIO
konqbookmarkmenu.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 00003 Copyright (C) 2006 Daniel Teske <teske@squorn.de> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef __konqbookmarkmenu_h__ 00022 #define __konqbookmarkmenu_h__ 00023 #include "kbookmarkmenu.h" 00024 00025 class KIO_EXPORT KonqBookmarkOwner : public KBookmarkOwner // KDE5 TODO: merge with KBookmarkOwner 00026 { 00027 public: 00028 virtual ~KonqBookmarkOwner(); 00029 virtual void openInNewTab(const KBookmark &bm) = 0; 00030 virtual void openInNewWindow(const KBookmark &bm) = 0; 00031 }; 00032 00033 class KIO_EXPORT KonqBookmarkMenu : public KBookmarkMenu 00034 { 00035 //friend class KBookmarkBar; 00036 Q_OBJECT 00037 public: 00050 KonqBookmarkMenu( KBookmarkManager* mgr, KonqBookmarkOwner * owner, KBookmarkActionMenu * parentMenu, KActionCollection *collec) 00051 : KBookmarkMenu( mgr, owner, parentMenu->menu(), collec) 00052 { 00053 } 00054 ~KonqBookmarkMenu() 00055 {} 00056 00061 KonqBookmarkMenu( KBookmarkManager* mgr, KonqBookmarkOwner * owner, KBookmarkActionMenu * parentMenu, QString parentAddress) 00062 : KBookmarkMenu( mgr, owner, parentMenu->menu(), parentAddress) 00063 { 00064 } 00065 00066 protected: 00071 struct DynMenuInfo { 00072 bool show; 00073 QString location; 00074 QString type; 00075 QString name; 00076 class DynMenuInfoPrivate *d; 00077 }; 00078 00082 static DynMenuInfo showDynamicBookmarks( const QString &id ); 00083 00091 static void setDynamicBookmarks( const QString &id, const DynMenuInfo &info ); 00092 00096 static QStringList dynamicBookmarksList(); 00097 00098 virtual void refill(); 00099 virtual QAction* actionForBookmark(const KBookmark &bm); 00100 virtual KMenu * contextMenu(QAction * act); 00101 void fillDynamicBookmarks(); 00102 private: 00103 KonqBookmarkOwner * owner() 00104 { return static_cast<KonqBookmarkOwner *>(KBookmarkMenu::owner());} 00105 }; 00106 00107 class KIO_EXPORT KonqBookmarkContextMenu : public KBookmarkContextMenu 00108 { 00109 Q_OBJECT 00110 public: 00111 KonqBookmarkContextMenu(const KBookmark & bm, KBookmarkManager * mgr, KonqBookmarkOwner * owner ); 00112 virtual ~KonqBookmarkContextMenu(); 00113 virtual void addActions(); 00114 00115 public Q_SLOTS: 00116 void openInNewTab(); 00117 void openInNewWindow(); 00118 void toggleShowInToolbar(); 00119 private: 00120 KonqBookmarkOwner * owner() 00121 { return static_cast<KonqBookmarkOwner *>(KBookmarkContextMenu::owner());} 00122 }; 00123 #endif 00124
KDE 4.6 API Reference