1 /* This file is part of the KDE project
2 Copyright (c) 2007 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
23 #include <kparts/part.h>
26 class DolphinPartBrowserExtension
;
27 class DolphinSortFilterProxyModel
;
34 class DolphinPart
: public KParts::ReadOnlyPart
39 explicit DolphinPart(QWidget
* parentWidget
, QObject
* parent
, const QStringList
& args
);
42 static KAboutData
* createAboutData();
44 virtual bool openUrl(const KUrl
& url
);
47 virtual bool openFile() { return true; }
50 void slotCompleted(const KUrl
& url
);
51 void slotCanceled(const KUrl
& url
);
52 void slotInfoMessage(const QString
& msg
);
53 void slotErrorMessage(const QString
& msg
);
55 * Shows the information for the item \a item inside the statusbar. If the
56 * item is null, the default statusbar information is shown.
58 void slotRequestItemInfo(const KFileItem
& item
);
60 * Handles clicking on an item
62 void slotItemTriggered(const KFileItem
& item
);
64 * Opens the context menu on the current mouse position.
65 * @item File item context. If item is 0, the context menu
66 * should be applied to \a url.
67 * @url URL which contains \a item.
69 void slotOpenContextMenu(const KFileItem
& item
, const KUrl
& url
);
71 * Emitted when the user requested a change of view mode
73 void slotViewModeActionTriggered(QAction
*);
76 * Asks the host to open the URL \a url if the current view has
79 void slotUrlChanged(const KUrl
& url
);
82 * Updates the state of the 'Edit' menu actions and emits
83 * the signal selectionChanged().
85 void slotSelectionChanged(const KFileItemList
& selection
);
88 * Same as in DolphinMainWindow: updates the view menu actions
90 void updateViewActions();
97 KDirLister
* m_dirLister
;
98 DolphinModel
* m_dolphinModel
;
99 DolphinSortFilterProxyModel
* m_proxyModel
;
100 DolphinPartBrowserExtension
* m_extension
;
101 Q_DISABLE_COPY(DolphinPart
)
104 #endif /* DOLPHINPART_H */