]> cloud.milkyroute.net Git - dolphin.git/blob - src/sidebarpage.h
No need to call rowCount() all the time.
[dolphin.git] / src / sidebarpage.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com> *
3 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #ifndef _SIDEBARPAGE_H_
22 #define _SIDEBARPAGE_H_
23
24 #include <QWidget>
25 #include <kurl.h>
26 #include <kfileitem.h>
27
28 /**
29 * @brief Base widget for all pages that can be embedded into the Sidebar.
30 *
31 */
32 class SidebarPage : public QWidget
33 {
34 Q_OBJECT
35 public:
36 explicit SidebarPage(QWidget* parent=0);
37 virtual ~SidebarPage();
38
39 public slots:
40 /**
41 * This is invoked every time the folder being displayed in the
42 * file-management views changes.
43 */
44 virtual void setUrl(const KUrl& url);
45
46 /**
47 * This is invoked to inform the sidebar that the user has selected a new
48 * set of files.
49 */
50 virtual void setSelection(const KFileItemList& selection);
51
52 signals:
53 /**
54 * This signal is emited when the sidebar requests an URL-change in the
55 * currently active file-management view. The view is not requested to
56 * accept this change, if it is accepted the sidebar will be informed via
57 * the setUrl() slot.
58 */
59 void changeUrl(const KUrl& url);
60
61 /**
62 * This signal is emitted when the sidebar requests a change in the
63 * current selection. The file-management view recieving this signal is
64 * not required to select all listed files, limiting the selection to
65 * e.g. the current folder. The new selection will be reported via the
66 * setSelection slot.
67 */
68 void changeSelection(const KFileItemList& selection);
69
70 /**
71 * This signal is emitted whenever a drop action on this widget needs the
72 * MainWindow's attention.
73 */
74 void urlsDropped(const KUrl::List& urls, const KUrl& destination);
75
76 protected:
77 KUrl m_url;
78 KFileItemList m_currentSelection;
79 };
80
81 #endif // _SIDEBARPAGE_H_