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>
39 class MyEditableLabel : public QLineEdit
44 MyEditableLabel(QWidget * parent = 0);
47 virtual void mouseDoubleClickEvent( QMouseEvent *e);
52 * @class CollapsibleEffect
53 * @brief A dialog for editing markers and guides.
54 * @author Jean-Baptiste Mardelle
57 class CollapsibleGroup : public AbstractCollapsibleWidget, public Ui::CollapsibleGroup_UI
62 CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QString groupName = QString(), QWidget * parent = 0);
64 void updateTimecodeFormat();
65 void setActive(bool activate);
66 int groupIndex() const;
68 QString infoString() const;
69 bool isActive() const;
70 void addGroupEffect(CollapsibleEffect *effect);
71 void removeGroup(int ix, QVBoxLayout *layout);
72 /** @brief Return all effects in group. */
73 QList <CollapsibleEffect*> effects();
74 /** @brief Return the editable title widget. */
75 QWidget *title() const;
76 /** @brief Return the XML data describing all effects in group. */
77 QDomDocument effectsData();
80 void slotEnable(bool enable);
84 void slotShow(bool show);
85 void slotDeleteGroup();
87 void slotEffectDown();
89 void slotResetGroup();
91 void slotRenameGroup();
94 QList <CollapsibleEffect *> m_subWidgets;
98 MyEditableLabel *m_title;
102 virtual void mouseDoubleClickEvent ( QMouseEvent * event );
103 virtual void dragEnterEvent(QDragEnterEvent *event);
104 virtual void dragLeaveEvent(QDragLeaveEvent *event);
105 virtual void dropEvent(QDropEvent *event);
108 void syncEffectsPos(int);
109 void effectStateChanged(bool, int ix = -1);
110 void deleteGroup(QDomDocument);
111 void changeGroupPosition(int, bool);
112 void activateEffect(int);
113 void moveEffect(int current_pos, int new_pos, int groupIndex, QString groupName);
114 void addEffect(QDomElement e);
115 void unGroup(CollapsibleGroup *);
116 void groupRenamed(CollapsibleGroup *);
117 void reloadEffects();