1 /***************************************************************************
2 * Copyright (C) 2008 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 COLLAPSIBLEGROUP_H
22 #define COLLAPSIBLEGROUP_H
25 #include "ui_collapsiblegroup_ui.h"
27 #include "abstractcollapsiblewidget.h"
28 #include "collapsibleeffect.h"
30 #include "keyframeedit.h"
32 #include <QDomElement>
33 #include <QToolButton>
38 class MyEditableLabel : public QLineEdit
43 MyEditableLabel(QWidget * parent = 0);
46 virtual void mouseDoubleClickEvent( QMouseEvent *e);
51 * @class CollapsibleEffect
52 * @brief A dialog for editing markers and guides.
53 * @author Jean-Baptiste Mardelle
56 class CollapsibleGroup : public AbstractCollapsibleWidget, public Ui::CollapsibleGroup_UI
61 CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QString groupName = QString(), QWidget * parent = 0);
63 void updateTimecodeFormat();
64 void setActive(bool activate);
65 int groupIndex() const;
67 QString infoString() const;
68 bool isActive() const;
69 void addGroupEffect(CollapsibleEffect *effect);
70 void removeGroup(int ix, QVBoxLayout *layout);
71 /** @brief Return all effects in group. */
72 QList <CollapsibleEffect*> effects();
73 /** @brief Return the editable title widget. */
74 QWidget *title() const;
75 /** @brief Return the XML data describing all effects in group. */
76 QDomDocument effectsData();
79 void slotEnable(bool enable);
83 void slotShow(bool show);
84 void slotDeleteEffect();
86 void slotEffectDown();
87 void slotSaveEffect();
88 void slotResetEffect();
90 void slotRenameGroup();
93 QList <CollapsibleEffect *> m_subWidgets;
97 MyEditableLabel *m_title;
100 virtual void mouseDoubleClickEvent ( QMouseEvent * event );
101 virtual void dragEnterEvent(QDragEnterEvent *event);
102 virtual void dragLeaveEvent(QDragLeaveEvent *event);
103 virtual void dropEvent(QDropEvent *event);
106 void syncEffectsPos(int);
107 void effectStateChanged(bool, int ix = -1);
108 void deleteGroup(int);
109 void changeGroupPosition(int, bool);
110 void activateEffect(int);
111 void moveEffect(int current_pos, int new_pos, int groupIndex, QString groupName);
112 void addEffect(QDomElement e);
113 void unGroup(CollapsibleGroup *);
114 void groupRenamed(CollapsibleGroup *);