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>
30 class DolphinSortFilterProxyModel
;
31 class SidebarTreeView
;
35 * @brief Shows a tree view of the directories starting from
36 * the currently selected bookmark.
38 * The tree view is always synchronized with the currently active view
39 * from the main window.
41 class TreeViewSidebarPage
: public SidebarPage
46 TreeViewSidebarPage(DolphinMainWindow
* mainWindow
, QWidget
* parent
= 0);
47 virtual ~TreeViewSidebarPage();
50 /** @see SidebarPage::activeViewChanged() */
51 virtual void activeViewChanged();
53 /** @see QWidget::showEvent() */
54 virtual void showEvent(QShowEvent
* event
);
58 * Updates the current selection inside the tree to
61 void updateSelection(const KUrl
& url
);
64 * Expands the tree in a way that the item with the URL m_selectedUrl
65 * gets visible. Is called by TreeViewSidebarPage::updateSelection()
66 * if the dir lister has been completed.
68 void expandSelectionParent();
71 * Updates the active view to the URL
72 * which is given by the item with the index \a index.
74 void updateActiveView(const QModelIndex
& index
);
78 * Connects to signals from the currently active Dolphin view to get
79 * informed about highlighting changes.
81 void connectToActiveView();
84 KDirLister
* m_dirLister
;
85 KDirModel
* m_dirModel
;
86 DolphinSortFilterProxyModel
* m_proxyModel
;
87 SidebarTreeView
* m_treeView
;
91 #endif // BOOKMARKSSIDEBARPAGE_H