1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef TREEVIEWSIDEBARPAGE_H
21 #define TREEVIEWSIDEBARPAGE_H
24 #include <sidebarpage.h>
29 class DolphinSortFilterProxyModel
;
30 class SidebarTreeView
;
34 * @brief Shows a tree view of the directories starting from
35 * the currently selected bookmark.
37 * The tree view is always synchronized with the currently active view
38 * from the main window.
40 class TreeViewSidebarPage
: public SidebarPage
45 TreeViewSidebarPage(QWidget
* parent
= 0);
46 virtual ~TreeViewSidebarPage();
50 * Changes the current selection inside the tree to \a url.
52 void setUrl(const KUrl
& url
);
55 /** @see QWidget::showEvent() */
56 virtual void showEvent(QShowEvent
* event
);
58 /** @see QWidget::contextMenuEvent() */
59 virtual void contextMenuEvent(QContextMenuEvent
* event
);
63 * Expands the tree in a way that the item with the URL m_selectedUrl
64 * gets visible. Is called by TreeViewSidebarPage::updateSelection()
65 * if the dir lister has been completed.
67 void expandSelectionParent();
70 * Updates the active view to the URL
71 * which is given by the item with the index \a index.
73 void updateActiveView(const QModelIndex
& index
);
76 * Is emitted if the URLs \a urls have been dropped
77 * to the index \a index. */
78 void dropUrls(const KUrl::List
& urls
,
79 const QModelIndex
& index
);
82 KDirLister
* m_dirLister
;
83 KDirModel
* m_dirModel
;
84 DolphinSortFilterProxyModel
* m_proxyModel
;
85 SidebarTreeView
* m_treeView
;
88 #endif // TREEVIEWSIDEBARPAGE_H