]>
cloud.milkyroute.net Git - dolphin.git/blob - src/itemeffectsmanager.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef ITEMEFFECTSMANAGER_H
22 #define ITEMEFFECTSMANAGER_H
27 #include <q3valuelist.h>
31 * @brief Abstract class to implement item effects for a Dolphin view.
33 * Derived classes must implement the following pure virtual methods:
34 * - ItemEffectsManager::setContextPixmap()
35 * - ItemEffectsManager::contextPixmap()
36 * - ItemEffectsManager::firstContext()
37 * - ItemEffectsManager::nextContext()
38 * - ItemEffectsManager::contextFileInfo()
40 * The item effects manager highlights currently active items and also
41 * respects cutted items. A 'context' is defined as abstract data type,
42 * which usually is represented by a KFileListViewItem or
43 * a KFileIconViewItem.
45 * In Qt4 the item effects manager should get integrated as part of Interview
46 * and hence no abstract context handling should be necessary anymore. The main
47 * purpose of the current interface is to prevent code duplication as there is
48 * no common model shared by QListView and QIconView of Qt3.
50 * @see DolphinIconsView
51 * @see DolphinDetailsView
52 * @author Peter Penz <peter.penz@gmx.at>
54 class ItemEffectsManager
58 virtual ~ItemEffectsManager();
60 /** Is invoked before the items get updated. */
61 virtual void beginItemUpdates() = 0;
63 /** Is invoked after the items have been updated. */
64 virtual void endItemUpdates() = 0;
67 * Increases the size of the current set view mode and refreshes
68 * all views. Derived implementations must invoke the base implementation
69 * if zooming in had been done.
71 virtual void zoomIn();
74 * Decreases the size of the current set view mode and refreshes
75 * all views. Derived implementations must invoke the base implementation
76 * if zooming out had been done.
78 virtual void zoomOut();
81 * Returns true, if zooming in is possible. If false is returned,
82 * the minimal zoom size is possible.
84 virtual bool isZoomInPossible() const = 0;
87 * Returns true, if zooming in is possible. If false is returned,
88 * the minimal zoom size is possible.
90 virtual bool isZoomOutPossible() const = 0;
93 virtual void setContextPixmap(void* context
,
94 const QPixmap
& pixmap
) = 0;
95 virtual const QPixmap
* contextPixmap(void* context
) = 0;
96 virtual void* firstContext() = 0;
97 virtual void* nextContext(void* context
) = 0;
98 virtual KFileItem
* contextFileInfo(void* context
) = 0;
100 void activateItem(void* context
);
101 void resetActivatedItem();
102 void updateDisabledItems();
105 struct DisabledItem
{
110 QPixmap
* m_pixmapCopy
;
111 KUrl m_highlightedURL
;
113 // contains all items which have been disabled by a 'cut' operation
114 Q3ValueList
<DisabledItem
> m_disabledItems
;
116 /** Returns the text for the statusbar for an activated item. */
117 QString
statusBarText(KFileItem
* fileInfo
) const;