Allow specializations to decide when re-indexing is necessary.
[kdepim.git] / incidenceeditor-ng / attachmenticonview.h
blob44faebd23c8137e96dbd94438e0170297a0bbc2b
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7 Copyright (c) 2010 Bertjan Broeksema <b.broeksema@home.nl>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 As a special exception, permission is given to link this program
24 with any edition of Qt, and distribute the resulting executable,
25 without including the source code for Qt in the source distribution.
27 NOTE: May, 2010. Extracted this code from
28 kdepim/incidenceeditors/editorattachments.{h,cpp}
31 #ifndef ATTACHMENTICONVIEW_H
32 #define ATTACHMENTICONVIEW_H
34 #include <QtGui/QListWidget>
36 class KUrl;
38 namespace KCal {
39 class Attachment;
42 namespace IncidenceEditorsNG {
44 class AttachmentIconView : public QListWidget
46 friend class EditorAttachments;
47 public:
48 AttachmentIconView( QWidget *parent );
50 KUrl tempFileForAttachment( KCal::Attachment *attachment ) const;
52 protected:
53 QMimeData* mimeData( const QList<QListWidgetItem*> items ) const;
54 QMimeData* mimeData() const;
55 void startDrag(Qt::DropActions supportedActions);
56 void keyPressEvent(QKeyEvent* event);
58 private:
59 mutable QHash<KCal::Attachment *, KUrl> mTempFiles;
64 #endif // ATTACHMENTICONVIEW_H