1 /* This file is part of the KDE project
2 Copyright (C) 2000 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef dirtree_module_h
20 #define dirtree_module_h
22 #include <konq_sidebartreemodule.h>
23 #include <kfileitem.h>
24 #include <QtGui/QPixmap>
25 #include <Qt3Support/Q3Dict>
26 #include <Qt3Support/Q3PtrDict>
29 class KonqSidebarTree
;
30 class KonqSidebarTreeItem
;
31 class KonqSidebarDirTreeItem
;
33 class KonqSidebarDirTreeModule
: public QObject
, public KonqSidebarTreeModule
37 KonqSidebarDirTreeModule( KonqSidebarTree
* parentTree
, bool );
38 virtual ~KonqSidebarDirTreeModule();
40 virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem
* item
);
42 virtual void openTopLevelItem( KonqSidebarTreeTopLevelItem
* item
);
44 virtual void followURL( const KUrl
& url
);
46 // Called by KonqSidebarDirTreeItem
47 void openSubFolder( KonqSidebarTreeItem
*item
);
48 void addSubDir( KonqSidebarTreeItem
*item
);
49 void removeSubDir( KonqSidebarTreeItem
*item
, bool childrenonly
= false );
52 void slotNewItems( const KFileItemList
& );
53 void slotRefreshItems( const QList
<QPair
<KFileItem
, KFileItem
> >& );
54 void slotDeleteItem( const KFileItem
&item
);
55 void slotRedirection( const KUrl
& oldUrl
, const KUrl
& newUrl
);
56 void slotListingStopped( const KUrl
& url
);
59 //KonqSidebarTreeItem * findDir( const KUrl &_url );
60 void listDirectory( KonqSidebarTreeItem
*item
);
61 KUrl::List
selectedUrls();
64 // Each KonqSidebarDirTreeItem is indexed on item->id() and
66 Q3Dict
<KonqSidebarTreeItem
> m_dictSubDirs
;
69 QHash
<KFileItem
, KonqSidebarTreeItem
*> m_ptrdictSubDirs
;
71 KDirLister
* m_dirLister
;
73 KUrl m_selectAfterOpening
;
75 KonqSidebarTreeTopLevelItem
* m_topLevelItem
;
77 bool m_showArchivesAsFolders
;