File indexing completed on 2021-12-21 13:27:51

0001 /**
0002  * Copyright (C) 2005 Michael Pyne <mpyne@kde.org>
0003  * Copyright (C) 2014 Arnold Dumas <contact@arnolddumas.fr>
0004  *
0005  * This program is free software; you can redistribute it and/or modify it under
0006  * the terms of the GNU General Public License as published by the Free Software
0007  * Foundation; either version 2 of the License, or (at your option) any later
0008  * version.
0009  *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along with
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #ifndef JUK_COVERICONVIEW_H
0019 #define JUK_COVERICONVIEW_H
0020 
0021 #include <QListWidget>
0022 
0023 #include "covermanager.h"
0024 
0025 // The WebImageFetcher dialog also has a class named CoverIconViewItem and I
0026 // don't like the idea of naming it "CoverIVI" or something, so just namespace
0027 // it out.  I would merge them except for webimagefetcher's dependence on KIO
0028 // and such.
0029 
0030 namespace CoverUtility
0031 {
0032     class CoverIconViewItem : public QListWidgetItem
0033     {
0034     public:
0035         CoverIconViewItem(coverKey id, QListWidget *parent);
0036 
0037         coverKey id() const { return m_id; }
0038 
0039     private:
0040         coverKey m_id;
0041     };
0042 }
0043 
0044 using CoverUtility::CoverIconViewItem;
0045 
0046 /**
0047  * This class subclasses QListWidget in order to provide cover drag-and-drop
0048  * support.
0049  *
0050  * @author Michael Pyne <mpyne@kde.org>
0051  */
0052 class CoverIconView : public QListWidget
0053 {
0054 public:
0055     explicit CoverIconView(QWidget *parent, const char *name = 0);
0056 
0057     CoverIconViewItem *currentItem() const;
0058 
0059 protected:
0060     // virtual Q3DragObject *dragObject();
0061 };
0062 
0063 #endif /* JUK_COVERICONVIEW_H */
0064 
0065 // vim: set et sw=4 tw=0 sta: