summaryrefslogtreecommitdiffstats
path: root/kicker/menuext/konsole/konsolebookmarkhandler.h
blob: 43ef82105327ab902f70b3feadce2deed97febf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Born as kdelibs/kio/kfile/kfilebookmarkhandler.h

#ifndef KONSOLEBOOKMARKHANDLER_H
#define KONSOLEBOOKMARKHANDLER_H

#include <kbookmarkmanager.h>
#include "konsolebookmarkmenu.h"


class TQTextStream;
class KPopupMenu;
class KonsoleBookmarkMenu;
class KonsoleMenu;

class KonsoleBookmarkHandler : public TQObject, public KBookmarkOwner
{
    Q_OBJECT

public:
    KonsoleBookmarkHandler( KonsoleMenu *konsole, bool toplevel );

    TQPopupMenu * popupMenu();

    // KBookmarkOwner interface:
    virtual void openBookmarkURL( const TQString& url, const TQString& title )
                                { emit openURL( url, title ); }
    virtual TQString currentURL() const;

    KPopupMenu *menu() const { return m_menu; }

signals:
    void openURL( const TQString& url, const TQString& title );

private slots:
    // for importing
    void slotNewBookmark( const TQString& text, const TQCString& url,
                          const TQString& additionalInfo );
    void slotNewFolder( const TQString& text, bool open,
                        const TQString& additionalInfo );
    void slotBookmarksChanged( const TQString &, const TQString & caller );
    void newSeparator();
    void endFolder();

private:
    void importOldBookmarks( const TQString& path, const TQString& destinationPath );

    KonsoleMenu *m_konsole;
    KPopupMenu *m_menu;
    KonsoleBookmarkMenu *m_bookmarkMenu;
    TQTextStream *m_importStream;

protected:
    virtual void virtual_hook( int id, void* data );
private:
    class KonsoleBookmarkHandlerPrivate;
    KonsoleBookmarkHandlerPrivate *d;
};


#endif // KONSOLEBOOKMARKHANDLER_H