Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konqueror / sidebar / trees / konq_sidebartreemodule.h
blob2e1d5cad2fce54bcb2c52d518a6e561cb4b256b6
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 KONQ_SIDEBARTREEMODULE_H
20 #define KONQ_SIDEBARTREEMODULE_H
22 #include <QtCore/QObject>
23 #include "konq_sidebartree.h"
25 class KonqSidebarTreeTopLevelItem;
26 class KonqSidebarTree;
28 /**
29 * The base class for KonqSidebarTree Modules. It defines the interface
30 * between the generic KonqSidebarTree and the particular modules
31 * (directory tree, history, bookmarks, ...)
33 class KonqSidebarTreeModule
35 public:
36 explicit KonqSidebarTreeModule( KonqSidebarTree * parentTree , bool showHidden=false)
37 : m_pTree( parentTree ), m_showHidden(showHidden) {}
38 virtual ~KonqSidebarTreeModule() {}
40 // Handle this new toplevel item [can only be called once currently]
41 virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) = 0;
43 // Open this toplevel item - you don't need to reimplement if
44 // you create the item's children right away
45 virtual void openTopLevelItem( KonqSidebarTreeTopLevelItem * ) {}
47 // Follow a URL opened in another view - only implement if the module
48 // has anything to do with URLs
49 virtual void followURL( const KUrl & ) {}
51 KonqSidebarTree *tree() const { return m_pTree; }
52 bool showHidden() { return m_showHidden;}
53 virtual void setShowHidden(bool showhidden) {m_showHidden=showhidden;}
55 virtual bool handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, const QPoint& ) { return false; }
57 protected:
58 KonqSidebarTree * m_pTree;
59 bool m_showHidden;
62 #endif // KONQ_SIDEBARTREEMODULE_H