1 /***************************************************************************
2 * Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com> *
3 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
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. *
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. *
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 ***************************************************************************/
21 #ifndef _SIDEBARPAGE_H_
22 #define _SIDEBARPAGE_H_
24 #include <QtGui/QWidget>
26 #include <kfileitem.h>
29 * @brief Base widget for all pages that can be embedded into the Sidebar.
31 class SidebarPage
: public QWidget
35 explicit SidebarPage(QWidget
* parent
= 0);
36 virtual ~SidebarPage();
38 /** Returns the current set URL of the active Dolphin view. */
39 const KUrl
& url() const;
41 /** Returns the current selected items of the active Dolphin view. */
42 const KFileItemList
& selection() const;
46 * This is invoked every time the folder being displayed in the
47 * active Dolphin view changes.
49 virtual void setUrl(const KUrl
& url
);
52 * This is invoked to inform the sidebar that the user has selected a new
55 virtual void setSelection(const KFileItemList
& selection
);
59 * This signal is emitted when the sidebar requests an URL-change in the
60 * currently active file-management view. The view is not requested to
61 * accept this change, if it is accepted the sidebar will be informed via
64 void changeUrl(const KUrl
& url
);
67 * This signal is emitted when the sidebar requests a change in the
68 * current selection. The file-management view recieving this signal is
69 * not required to select all listed files, limiting the selection to
70 * e.g. the current folder. The new selection will be reported via the
73 void changeSelection(const KFileItemList
& selection
);
76 * This signal is emitted whenever a drop action on this widget needs the
77 * MainWindow's attention.
79 void urlsDropped(const KUrl::List
& urls
, const KUrl
& destination
);
83 KFileItemList m_currentSelection
;
86 #endif // _SIDEBARPAGE_H_