1 /*
2 * This file is part of Converseen, an open-source batch image converter
3 * and resizer.
4 *
5 * (C) Francesco Mondello 2009 - 2021
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 *
20 * Contact e-mail: Francesco Mondello <faster3ck@gmail.com>
21 *
22 */
23 
24 #ifndef PIXTREEWIDGET_H
25 #define PIXTREEWIDGET_H
26 
27 #include <QTreeWidget>
28 #include <QList>
29 
30 class QKeyEvent;
31 class QDropEvent;
32 class QDragEnterEvent;
33 class QDragMoveEvent;
34 
35 class ImageAttributes
36 {
37 public:
38     QString completeFileName, fileName, suffix, path, format;
39     qint64 size;
40 };
41 
42 class PixTreeWidget : public QTreeWidget {
43 
44     Q_OBJECT
45 
46     public:
47         PixTreeWidget(QWidget *parent = 0);
48         void addItems(QList<ImageAttributes> *iAList);
49         void dropEvent(QDropEvent *event);
50         void dragEnterEvent(QDragEnterEvent *event);
51         void dragMoveEvent(QDragMoveEvent *event);
52         void setListItems(QList<ImageAttributes> *iAList);
53         void removeItems(QList<ImageAttributes> *iAList);
54         bool thereAreItemsChecked();
55         int countChecked();
56 
57     signals:
58         void dropped(QStringList);
59 
60     public slots:
61         void checkItems();
62         void checkAllItems();
63         void uncheckItems();
64         void uncheckAllItems();
65 };
66 
67 #endif // PIXTREEWIDGET_H
68