]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart.h
remove unnecessary forward declaration
[dolphin.git] / src / dolphinpart.h
1 /* This file is part of the KDE project
2 Copyright (c) 2007 David Faure <faure@kde.org>
3
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.
8
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.
13
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.
18 */
19
20 #ifndef DOLPHINPART_H
21 #define DOLPHINPART_H
22
23 #include <kparts/part.h>
24 class KFileItem;
25 class DolphinPartBrowserExtension;
26 class DolphinSortFilterProxyModel;
27 class DolphinModel;
28 class KDirLister;
29 class DolphinView;
30 class QLineEdit;
31 class KAboutData;
32
33 class DolphinPart : public KParts::ReadOnlyPart
34 {
35 Q_OBJECT
36
37 public:
38 explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QStringList& args);
39 ~DolphinPart();
40
41 static KAboutData* createAboutData();
42
43 virtual bool openUrl(const KUrl& url);
44
45 protected:
46 virtual bool openFile() { return true; }
47
48 private Q_SLOTS:
49 void slotCompleted(const KUrl& url);
50 void slotCanceled(const KUrl& url);
51 void slotInfoMessage(const QString& msg);
52 void slotErrorMessage(const QString& msg);
53 /**
54 * Shows the information for the item \a item inside the statusbar. If the
55 * item is null, the default statusbar information is shown.
56 */
57 void slotRequestItemInfo(const KFileItem& item);
58 /**
59 * Handles clicking on an item
60 */
61 void slotItemTriggered(const KFileItem& item);
62 /**
63 * Opens the context menu on the current mouse position.
64 * @item File item context. If item is 0, the context menu
65 * should be applied to \a url.
66 * @url URL which contains \a item.
67 */
68 void slotOpenContextMenu(const KFileItem& item, const KUrl& url);
69 /**
70 * Emitted when the user requested a change of view mode
71 */
72 void slotViewModeActionTriggered(QAction*);
73
74 /**
75 * Asks the host to open the URL \a url if the current view has
76 * a different URL.
77 */
78 void slotUrlChanged(const KUrl& url);
79
80 private:
81 void createActions();
82 void updateViewActions();
83
84 private:
85 DolphinView* m_view;
86 KDirLister* m_dirLister;
87 DolphinModel* m_dolphinModel;
88 DolphinSortFilterProxyModel* m_proxyModel;
89 DolphinPartBrowserExtension* m_extension;
90 Q_DISABLE_COPY(DolphinPart)
91 };
92
93
94 #endif /* DOLPHINPART_H */
95