1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz19@gmail.com> *
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 FOLDERSPANEL_H
21 #define FOLDERSPANEL_H
24 #include <panels/panel.h>
27 class KItemListController
;
28 class QGraphicsSceneDragDropEvent
;
31 * @brief Shows a tree view of the directories starting from
32 * the currently selected place.
34 * The tree view is always synchronized with the currently active view
35 * from the main window.
37 class FoldersPanel
: public Panel
42 FoldersPanel(QWidget
* parent
= 0);
43 virtual ~FoldersPanel();
45 void setShowHiddenFiles(bool show
);
46 bool showHiddenFiles() const;
48 void setAutoScrolling(bool enable
);
49 bool autoScrolling() const;
51 void rename(const KFileItem
& item
);
54 void folderActivated(const KUrl
& url
);
55 void folderMiddleClicked(const KUrl
& url
);
56 void errorMessage(const QString
& error
);
59 /** @see Panel::urlChanged() */
60 virtual bool urlChanged();
62 /** @see QWidget::showEvent() */
63 virtual void showEvent(QShowEvent
* event
);
65 /** @see QWidget::keyPressEvent() */
66 virtual void keyPressEvent(QKeyEvent
* event
);
69 void slotItemActivated(int index
);
70 void slotItemMiddleClicked(int index
);
71 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
72 void slotViewContextMenuRequested(const QPointF
& pos
);
73 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
74 void slotRoleEditingFinished(int index
, const QByteArray
& role
, const QVariant
& value
);
76 void slotLoadingCompleted();
79 * Increases the opacity of the view step by step until it is fully
82 void startFadeInAnimation();
86 * Initializes the base URL of the tree and expands all
87 * directories until \a url.
88 * @param url URL of the leaf directory that should get expanded.
90 void loadTree(const KUrl
& url
);
93 * Sets the item with the index \a index as current item, selects
94 * the item and assures that the item will be visible.
96 void updateCurrentItem(int index
);
99 bool m_updateCurrentItem
;
100 KItemListController
* m_controller
;
101 KFileItemModel
* m_model
;
104 #endif // FOLDERSPANEL_H