• Skip to content
  • Skip to link menu
KDE 4.3 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 
00155   // This is used to "export" our actions into an actionlist
00156   // we got in the constructor. So that the program can show our 
00157   // actions in their shortcut dialog
00158   KActionCollection * m_actionCollection;
00162   QList<QAction *> m_actions;
00163 
00164 
00165 private Q_SLOTS:
00166   void slotCustomContextMenu( const QPoint & );
00167 
00168 private:
00169   KBookmarkMenuPrivate* d;
00170 
00171   bool m_bIsRoot;
00172   bool m_bDirty;
00173   KBookmarkManager * m_pManager;
00174   KBookmarkOwner * m_pOwner;
00175 
00176   KMenu * m_parentMenu;
00177 
00178 private:
00179   QString m_parentAddress;
00180 };
00181 
00182 class KIO_EXPORT KBookmarkContextMenu : public KMenu
00183 {
00184     Q_OBJECT
00185     
00186 public:
00187     KBookmarkContextMenu(const KBookmark & bm, KBookmarkManager * manager, KBookmarkOwner *owner, QWidget * parent = 0);
00188     virtual ~KBookmarkContextMenu();
00189     virtual void addActions();
00190 
00191 public Q_SLOTS:
00192     void slotEditAt();
00193     void slotProperties();
00194     void slotInsert();
00195     void slotRemove();
00196     void slotCopyLocation();
00197     void slotOpenFolderInTabs();
00198 
00199 protected:
00200     void addBookmark();
00201     void addFolderActions();
00202     void addProperties();
00203     void addBookmarkActions();
00204     void addOpenFolderInTabs();
00205 
00206     KBookmarkManager * manager() const;
00207     KBookmarkOwner * owner() const;
00208     KBookmark bookmark() const;
00209 
00210 private Q_SLOTS:
00211     void slotAboutToShow();
00212 
00213 private:
00214     KBookmark bm;
00215     KBookmarkManager * m_pManager;
00216     KBookmarkOwner * m_pOwner;
00217 };
00218 
00219 class KIO_EXPORT KBookmarkActionInterface
00220 {
00221 public:
00222   KBookmarkActionInterface(const KBookmark &bk);
00223   virtual ~KBookmarkActionInterface();
00224   const KBookmark bookmark() const;
00225 private:
00226   KBookmark bm;
00227 };
00228 
00229 /***
00230  * A wrapper around KActionMenu to provide a nice constructor for bookmark groups.
00231  *
00232  */
00233 
00234 class KIO_EXPORT KBookmarkActionMenu : public KActionMenu, public KBookmarkActionInterface
00235 {
00236 public:
00237   KBookmarkActionMenu(const KBookmark &bm, QObject *parent);
00238   KBookmarkActionMenu(const KBookmark &bm, const QString & text, QObject *parent);
00239   virtual ~KBookmarkActionMenu();
00240 };
00241 
00242 /***
00243  * This class is a KAction for bookmarks.
00244  * It provides a nice constructor.
00245  * And on triggered uses the owner to open the bookmark.
00246  *
00247  */
00248 
00249 class KIO_EXPORT KBookmarkAction : public KAction, public KBookmarkActionInterface
00250 {
00251   Q_OBJECT
00252 public:
00253   KBookmarkAction(const KBookmark &bk, KBookmarkOwner* owner, QObject *parent);
00254   virtual ~KBookmarkAction();
00255 
00256 public Q_SLOTS:
00257   void slotSelected(Qt::MouseButtons mb, Qt::KeyboardModifiers km);
00258 
00259 private:
00260   KBookmarkOwner* m_pOwner;
00261 };
00262 
00263 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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