kbookmarkmenu.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __kbookmarkmenu_h__
00023 #define __kbookmarkmenu_h__
00024
00025 #include <sys/types.h>
00026
00027 #include <qptrlist.h>
00028 #include <qptrstack.h>
00029 #include <qobject.h>
00030 #include <qlistview.h>
00031
00032 #include <kdialogbase.h>
00033 #include <klocale.h>
00034 #include <kaction.h>
00035
00036 #include "kbookmark.h"
00037 #include "kbookmarkmanager.h"
00038
00039 class QString;
00040 class QPopupMenu;
00041 class QPushButton;
00042 class QListView;
00043 class KLineEdit;
00044 class KBookmark;
00045 class KBookmarkGroup;
00046 class KAction;
00047 class KActionMenu;
00048 class KActionCollection;
00049 class KBookmarkOwner;
00050 class KBookmarkMenu;
00051 class KPopupMenu;
00052
00053 namespace KIO { class Job; }
00054
00079 class KIO_EXPORT KBookmarkMenu : public QObject
00080 {
00081 Q_OBJECT
00082 friend class KBookmarkMenuNSImporter;
00083 friend class RMB;
00084 public:
00103 KBookmarkMenu( KBookmarkManager* mgr,
00104 KBookmarkOwner * owner, KPopupMenu * parentMenu,
00105 KActionCollection * collec, bool root, bool add = true,
00106 const QString & parentAddress = "" );
00107
00108 ~KBookmarkMenu();
00109
00115 void fillBookmarkMenu();
00116
00121 void ensureUpToDate();
00122
00128
00129 struct DynMenuInfo {
00130 bool show;
00131 QString location;
00132 QString type;
00133 QString name;
00134 class DynMenuInfoPrivate *d;
00135 };
00136
00141 static DynMenuInfo showDynamicBookmarks( const QString &id );
00142
00151 static void setDynamicBookmarks( const QString &id, const DynMenuInfo &info );
00152
00157 static QStringList dynamicBookmarksList();
00158
00159 signals:
00160 void aboutToShowContextMenu( const KBookmark &, QPopupMenu * );
00161
00162 public slots:
00163 void slotBookmarksChanged( const QString & );
00164
00165 protected slots:
00166 void slotAboutToShow();
00167 void slotAboutToShowContextMenu( KPopupMenu *, int, QPopupMenu * );
00168 void slotActionHighlighted( KAction * );
00169
00170 void slotRMBActionRemove( int );
00171 void slotRMBActionInsert( int );
00172 void slotRMBActionCopyLocation( int );
00173 void slotRMBActionEditAt( int );
00174 void slotRMBActionProperties( int );
00175
00176 void slotBookmarkSelected();
00177 void slotAddBookmarksList();
00178 void slotAddBookmark();
00179 void slotNewFolder();
00180
00184 void slotNSLoad();
00185
00186 protected:
00187 KExtendedBookmarkOwner* extOwner();
00188 void refill();
00189 void addAddBookmark();
00190 void addAddBookmarksList();
00191 void addEditBookmarks();
00192 void addNewFolder();
00193
00194 void fillContextMenu( QPopupMenu *, const QString &, int );
00195
00196 bool m_bIsRoot:1;
00197 bool m_bAddBookmark:1;
00198 bool m_bDirty:1;
00199 bool m_bNSBookmark:1;
00200 bool m_bAddShortcuts:1;
00201
00202 KBookmarkManager * m_pManager;
00203 KBookmarkOwner *m_pOwner;
00208 KPopupMenu * m_parentMenu;
00212 QPtrList<KBookmarkMenu> m_lstSubMenus;
00213 KActionCollection * m_actionCollection;
00217 QPtrList<KAction> m_actions;
00221 QString m_parentAddress;
00222
00223
00224 static QString s_highlightedAddress;
00225 static QString s_highlightedImportLocation;
00226 static QString s_highlightedImportType;
00227 };
00228
00232 class KIO_EXPORT KBookmarkMenuNSImporter : public QObject
00233 {
00234 Q_OBJECT
00235 public:
00236 KBookmarkMenuNSImporter( KBookmarkManager* mgr, KBookmarkMenu * menu, KActionCollection * act ) :
00237 m_menu(menu), m_actionCollection(act), m_pManager(mgr) {}
00238
00239 void openNSBookmarks();
00240 void openBookmarks( const QString &location, const QString &type );
00241 void connectToImporter( const QObject &importer );
00242
00243 protected slots:
00244 void newBookmark( const QString & text, const QCString & url, const QString & );
00245 void newFolder( const QString & text, bool, const QString & );
00246 void newSeparator();
00247 void endFolder();
00248
00249 protected:
00250 QPtrStack<KBookmarkMenu> mstack;
00251 KBookmarkMenu * m_menu;
00252 KActionCollection * m_actionCollection;
00253 KBookmarkManager* m_pManager;
00254 };
00255
00256 #endif
This file is part of the documentation for kio Library Version 3.3.90.