]>
cloud.milkyroute.net Git - dolphin.git/blob - src/viewextensionsfactory.h
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program 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 *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef VIEWEXTENSIONSFACTORY_H
21 #define VIEWEXTENSIONSFACTORY_H
25 class DolphinController
;
26 class DolphinFileItemDelegate
;
27 class DolphinViewAutoScroller
;
28 class KFilePreviewGenerator
;
30 class SelectionManager
;
32 class QAbstractItemView
;
35 * @brief Responsible for creating extensions like tooltips and previews
36 * that are available in all view implementations.
38 * Each view implementation (iconsview, detailsview, columnview) must
39 * instantiate an instance of this class to assure having
40 * a common behavior that is independent from the custom functionality of
41 * a view implementation.
43 class ViewExtensionsFactory
: public QObject
48 explicit ViewExtensionsFactory(QAbstractItemView
* view
,
49 DolphinController
* controller
);
50 virtual ~ViewExtensionsFactory();
53 * Must be invoked by the item view, when QAbstractItemView::currentChanged()
54 * has been called. Assures that the current item stays visible when it has been
55 * changed by the keyboard.
57 void handleCurrentIndexChange(const QModelIndex
& current
, const QModelIndex
& previous
);
59 DolphinFileItemDelegate
* fileItemDelegate() const;
62 virtual bool eventFilter(QObject
* watched
, QEvent
* event
);
65 void slotZoomLevelChanged();
66 void cancelPreviews();
67 void slotShowPreviewChanged();
68 void requestActivation();
71 DolphinController
* m_controller
;
72 ToolTipManager
* m_toolTipManager
;
73 KFilePreviewGenerator
* m_previewGenerator
;
74 SelectionManager
* m_selectionManager
;
75 DolphinViewAutoScroller
* m_autoScroller
;
76 DolphinFileItemDelegate
* m_fileItemDelegate
;