• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

kbookmarkmenu.h

Go to the documentation of this file.
00001 //  -*- c-basic-offset:4; indent-tabs-mode:nil -*-
00002 // vim: set ts=4 sts=4 sw=4 et:
00003 /* This file is part of the KDE project
00004    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00005    Copyright (C) 2006 Daniel Teske <teske@squorn.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef __kbookmarkmenu_h__
00024 #define __kbookmarkmenu_h__
00025 
00026 #include <sys/types.h>
00027 
00028 #include <QtCore/QObject>
00029 #include <QtCore/QStack>
00030 
00031 #include <klocale.h>
00032 #include <kaction.h>
00033 #include <kactionmenu.h>
00034 #include <kicon.h>
00035 #include <krun.h>
00036 #include <kmenu.h>
00037 
00038 #include "kbookmark.h"
00039 #include "kbookmarkmanager.h"
00040 
00041 class QString;
00042 class QMenu;
00043 class KBookmark;
00044 class KAction;
00045 class QAction;
00046 class KActionMenu;
00047 class KActionCollection;
00048 class KBookmarkOwner;
00049 class KBookmarkMenu;
00050 class KMenu;
00051 class KBookmarkActionInterface;
00052 
00053 class KBookmarkMenuPrivate; // Not implemented
00054 
00055 namespace KIO { class Job; }
00056 
00076 class KIO_EXPORT KBookmarkMenu : public QObject
00077 {
00078   Q_OBJECT
00079 public:
00092   KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * owner, KMenu * parentMenu, KActionCollection *collec);
00093 
00097   KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * owner,
00098                  KMenu * parentMenu, const QString & parentAddress);
00099 
00100   ~KBookmarkMenu();
00101 
00106   void ensureUpToDate();
00107 
00108 public Q_SLOTS:
00109     // public for KonqBookmarkBar
00110   void slotBookmarksChanged( const QString & ); 
00111 
00112 protected Q_SLOTS:
00113   void slotAboutToShow();
00114   void slotAddBookmarksList();
00115   void slotAddBookmark();
00116   void slotNewFolder();
00117   void slotOpenFolderInTabs();
00118 
00119 protected:
00120   virtual void clear();
00121   virtual void refill();
00122   virtual QAction* actionForBookmark(const KBookmark &bm);
00123   virtual KMenu * contextMenu(QAction * action );
00124 
00125   void addActions();
00126   void fillBookmarks();
00127   void addAddBookmark();
00128   void addAddBookmarksList();
00129   void addEditBookmarks();
00130   void addNewFolder();
00131   void addOpenInTabs();
00132 
00133 
00134   bool isRoot() const;
00135   bool isDirty() const;
00136 
00140   QString parentAddress() const;
00141 
00142   KBookmarkManager * manager() const;
00143   KBookmarkOwner * owner() const;
00148   KMenu * parentMenu() const;
00149 
00153   QList<KBookmarkMenu *> m_lstSubMenus;
00154   KActionCollection * m_actionCollection;
00158   QList<QAction *> m_actions;
00159 
00160 
00161 private Q_SLOTS:
00162   void slotCustomContextMenu( const QPoint & );
00163 
00164 private:
00165   KBookmarkMenuPrivate* d;
00166 
00167   bool m_bIsRoot;
00168   bool m_bDirty;
00169   KBookmarkManager * m_pManager;
00170   KBookmarkOwner * m_pOwner;
00171 
00172   KMenu * m_parentMenu;
00173 
00174 private:
00175   QString m_parentAddress;
00176 };
00177 
00178 class KIO_EXPORT KBookmarkContextMenu : public KMenu
00179 {
00180     Q_OBJECT
00181     
00182 public:
00183     KBookmarkContextMenu(const KBookmark & bm, KBookmarkManager * manager, KBookmarkOwner *owner, QWidget * parent = 0);
00184     virtual ~KBookmarkContextMenu();
00185     virtual void addActions();
00186 
00187 public Q_SLOTS:
00188     void slotEditAt();
00189     void slotProperties();
00190     void slotInsert();
00191     void slotRemove();
00192     void slotCopyLocation();
00193     void slotOpenFolderInTabs();
00194 
00195 protected:
00196     void addBookmark();
00197     void addFolderActions();
00198     void addProperties();
00199     void addBookmarkActions();
00200     void addOpenFolderInTabs();
00201 
00202     KBookmarkManager * manager() const;
00203     KBookmarkOwner * owner() const;
00204     KBookmark bookmark() const;
00205 
00206 private Q_SLOTS:
00207     void slotAboutToShow();
00208 
00209 private:
00210     KBookmark bm;
00211     KBookmarkManager * m_pManager;
00212     KBookmarkOwner * m_pOwner;
00213 };
00214 
00215 class KIO_EXPORT KBookmarkActionInterface
00216 {
00217 public:
00218   KBookmarkActionInterface(const KBookmark &bk);
00219   virtual ~KBookmarkActionInterface();
00220   const KBookmark bookmark() const;
00221 private:
00222   KBookmark bm;
00223 };
00224 
00225 /***
00226  * A wrapper around KActionMenu to provide a nice constructor for bookmark groups.
00227  *
00228  */
00229 
00230 class KIO_EXPORT KBookmarkActionMenu : public KActionMenu, public KBookmarkActionInterface
00231 {
00232 public:
00233   KBookmarkActionMenu(const KBookmark &bm, QObject *parent);
00234   KBookmarkActionMenu(const KBookmark &bm, const QString & text, QObject *parent);
00235   virtual ~KBookmarkActionMenu();
00236 };
00237 
00238 /***
00239  * This class is a KAction for bookmarks.
00240  * It provides a nice constructor.
00241  * And on triggered uses the owner to open the bookmark.
00242  *
00243  */
00244 
00245 class KIO_EXPORT KBookmarkAction : public KAction, public KBookmarkActionInterface
00246 {
00247   Q_OBJECT
00248 public:
00249   KBookmarkAction(const KBookmark &bk, KBookmarkOwner* owner, QObject *parent);
00250   virtual ~KBookmarkAction();
00251 
00252 public Q_SLOTS:
00253   void slotSelected(Qt::MouseButtons mb, Qt::KeyboardModifiers km);
00254 
00255 private:
00256   KBookmarkOwner* m_pOwner;
00257 };
00258 
00259 #endif

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal