X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b1d5b6b7467d15417131c8df8fdecb22b2008db4..d6488887ecf69d7f192b94de8dce34fae0b7eb76:/src/sidebarpage.h diff --git a/src/sidebarpage.h b/src/sidebarpage.h index d83ef5e9a..697e8de58 100644 --- a/src/sidebarpage.h +++ b/src/sidebarpage.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2006 by Cvetoslav Ludmiloff * - * Copyright (C) 2006 by Peter Penz + * Copyright (C) 2006 by Peter Penz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -15,42 +15,72 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef _SIDEBARPAGE_H_ #define _SIDEBARPAGE_H_ -#include - -class DolphinMainWindow; -class Sidebar; +#include +#include +#include /** * @brief Base widget for all pages that can be embedded into the Sidebar. - * - * TODO */ class SidebarPage : public QWidget { - Q_OBJECT - + Q_OBJECT public: - SidebarPage(DolphinMainWindow* mainwindow, QWidget* parent=0); + explicit SidebarPage(QWidget* parent = 0); virtual ~SidebarPage(); -protected slots: + /** Returns the current set URL of the active Dolphin view. */ + const KUrl& url() const; + + /** Returns the current selected items of the active Dolphin view. */ + const KFileItemList& selection() const; + +public slots: /** - * Is invoked whenever the active view from Dolphin has been changed. - * The active view can be retrieved by Dolphin::mainWin().activeView(); + * This is invoked every time the folder being displayed in the + * active Dolphin view changes. */ - virtual void activeViewChanged(); + virtual void setUrl(const KUrl& url); -protected: - DolphinMainWindow* mainWindow() const; + /** + * This is invoked to inform the sidebar that the user has selected a new + * set of items. + */ + virtual void setSelection(const KFileItemList& selection); + +signals: + /** + * This signal is emitted when the sidebar requests an URL-change in the + * currently active file-management view. The view is not requested to + * accept this change, if it is accepted the sidebar will be informed via + * the setUrl() slot. + */ + void changeUrl(const KUrl& url); + + /** + * This signal is emitted when the sidebar requests a change in the + * current selection. The file-management view recieving this signal is + * not required to select all listed files, limiting the selection to + * e.g. the current folder. The new selection will be reported via the + * setSelection slot. + */ + void changeSelection(const KFileItemList& selection); + + /** + * This signal is emitted whenever a drop action on this widget needs the + * MainWindow's attention. + */ + void urlsDropped(const KUrl::List& urls, const KUrl& destination); private: - DolphinMainWindow *m_mainWindow; + KUrl m_url; + KFileItemList m_currentSelection; }; #endif // _SIDEBARPAGE_H_