]>
cloud.milkyroute.net Git - dolphin.git/blob - src/iconmanager.h
1 /***************************************************************************
2 * Copyright (C) 2008 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 ***************************************************************************/
35 * @brief Manages the icon state of a directory model.
37 * Per default a preview is generated for each item.
38 * Additionally the clipboard is checked for cut items.
39 * The icon state for cut items gets dimmed automatically.
41 class IconManager
: public QObject
46 IconManager(QObject
* parent
, DolphinModel
* model
);
47 virtual ~IconManager();
48 void setShowPreview(bool show
);
49 bool showPreview() const;
53 * Generates a preview image for each file item in \a items.
54 * The current preview settings (maximum size, 'Show Preview' menu)
57 void generatePreviews(const KFileItemList
& items
);
60 * Replaces the icon of the item \a item by the preview pixmap
63 void replaceIcon(const KFileItem
& item
, const QPixmap
& pixmap
);
66 * Is invoked when the preview job has been finished and
67 * set m_previewJob to 0.
69 void slotPreviewJobFinished(KJob
* job
);
71 /** Synchronizes the item icon with the clipboard of cut items. */
72 void updateCutItems();
76 * Returns true, if the item \a item has been cut into
79 bool isCutItem(const KFileItem
& item
) const;
81 /** Applies an item effect to all cut items. */
82 void applyCutItemEffect();
86 * Remembers the original pixmap for an item before
87 * the cut effect is applied.
96 QList
<KJob
*> m_previewJobs
;
97 DolphinModel
* m_dolphinModel
;
99 QList
<CutItem
> m_cutItemsCache
;
102 inline bool IconManager::showPreview() const
104 return m_showPreview
;