00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef bookmark_module_h
00020 #define bookmark_module_h
00021
00022 #include <tqmap.h>
00023 #include <tqobject.h>
00024 #include <konq_sidebartreemodule.h>
00025 #include <kbookmark.h>
00026 #include <kdialogbase.h>
00027 class KonqSidebarBookmarkItem;
00028
00029 class KActionCollection;
00030 class KLineEdit;
00031
00035 class KonqSidebarBookmarkModule : public TQObject, public KonqSidebarTreeModule
00036 {
00037 Q_OBJECT
00038 public:
00039 KonqSidebarBookmarkModule( KonqSidebarTree * parentTree );
00040 virtual ~KonqSidebarBookmarkModule();
00041
00042
00043 virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item );
00044 virtual bool handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, const TQPoint& );
00045
00046 void showPopupMenu();
00047
00048
00049 protected slots:
00050 void slotBookmarksChanged( const TQString & );
00051 void slotMoved(TQListViewItem*,TQListViewItem*,TQListViewItem*);
00052 void slotDropped(KListView*,TQDropEvent*,TQListViewItem*,TQListViewItem*);
00053 void slotCreateFolder();
00054 void slotDelete();
00055 void slotProperties(KonqSidebarBookmarkItem *bi = 0);
00056 void slotOpenNewWindow();
00057 void slotOpenTab();
00058 void slotCopyLocation();
00059
00060 protected:
00061 void fillListView();
00062 void fillGroup( KonqSidebarTreeItem * parentItem, KBookmarkGroup group );
00063 KonqSidebarBookmarkItem * findByAddress( const TQString & address ) const;
00064
00065 private slots:
00066 void slotOpenChange(TQListViewItem*);
00067
00068 private:
00069 KonqSidebarTreeTopLevelItem * m_topLevelItem;
00070 KonqSidebarBookmarkItem * m_rootItem;
00071
00072 KActionCollection *m_collection;
00073
00074 bool m_ignoreOpenChange;
00075 TQMap<TQString, bool> m_folderOpenState;
00076 };
00077
00078 class BookmarkEditDialog : public KDialogBase
00079 {
00080 Q_OBJECT
00081
00082 public:
00083 BookmarkEditDialog( const TQString& title, const TQString& url,
00084 TQWidget * = 0, const char * = 0,
00085 const TQString& caption = i18n( "Add Bookmark" ) );
00086
00087 TQString finalUrl() const;
00088 TQString finalTitle() const;
00089
00090 protected slots:
00091 void slotOk();
00092 void slotCancel();
00093
00094 private:
00095 KLineEdit *m_title, *m_location;
00096 };
00097
00098 #endif