1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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 ***************************************************************************/
21 #ifndef EFFECTSLISTWIDGET_H
22 #define EFFECTSLISTWIDGET_H
24 #include <QTreeWidget>
25 #include <QDomElement>
27 #include <KActionCategory>
32 class EffectsListWidget : public QTreeWidget
37 explicit EffectsListWidget(QMenu *contextMenu, QWidget *parent = 0);
38 virtual ~EffectsListWidget();
39 const QDomElement currentEffect() const;
40 QString currentInfo();
41 const QDomElement itemEffect(QTreeWidgetItem *item) const;
42 void initList(QMenu *effectsMenu, KActionCategory *effectActions);
45 virtual void dragMoveEvent(QDragMoveEvent *event);
46 virtual void contextMenuEvent(QContextMenuEvent * event);
47 virtual QMimeData *mimeData(const QList<QTreeWidgetItem *> list) const;
48 virtual void keyPressEvent(QKeyEvent *e);
52 /** @brief Returns the folder item whose name == @param name. */
53 QTreeWidgetItem *findFolder(const QString name);
55 /** @brief Loads the effects from the given effectlist as item of this widget.
56 * @param effectlist effectlist containing the effects that should be loaded
57 * @param icon the icon to be used for the QTreeWidgetItems
58 * @param defaultFolder parent item which will be used by default
59 * @param folders list of folders which might be used instead for specific effects
60 * @param type type of the effects
61 * @param current name of selected effect before reload; if an effect name matches this one it will become selected
62 * @param found will be set to true if an effect name matches current
64 void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found);
67 void slotExpandItem(const QModelIndex & index);
70 void applyEffect(const QDomElement);