]> git.sesse.net Git - kdenlive/blob - src/effectstack/collapsiblegroup.h
New widget for effect group
[kdenlive] / src / effectstack / collapsiblegroup.h
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef COLLAPSIBLEGROUP_H
22 #define COLLAPSIBLEGROUP_H
23
24
25 #include "ui_collapsiblegroup_ui.h"
26
27 #include "abstractcollapsiblewidget.h"
28 #include "collapsibleeffect.h"
29 #include "timecode.h"
30 #include "keyframeedit.h"
31
32 #include <QDomElement>
33 #include <QToolButton>
34
35 class QFrame;
36
37
38 /**)
39  * @class CollapsibleEffect
40  * @brief A dialog for editing markers and guides.
41  * @author Jean-Baptiste Mardelle
42  */
43
44 class CollapsibleGroup : public AbstractCollapsibleWidget, public Ui::CollapsibleGroup_UI
45 {
46     Q_OBJECT
47
48 public:
49     CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QWidget * parent = 0);
50     ~CollapsibleGroup();
51     void updateTimecodeFormat();
52     void setActive(bool activate);
53     int groupIndex() const;
54     bool isGroup() const;
55     QString infoString() const;
56     bool isActive() const;
57     void addGroupEffect(CollapsibleEffect *effect);
58     void removeGroup(int ix, QVBoxLayout *layout);
59
60 public slots:
61     void slotEnable(bool enable);
62
63 private slots:
64     void slotSwitch();
65     void slotShow(bool show);
66     void slotDeleteEffect();
67     void slotEffectUp();
68     void slotEffectDown();
69     void slotSaveEffect();
70     void slotResetEffect();
71     void slotUnGroup();
72
73 private:
74     //QList <CollapsibleEffect *> m_subParamWidgets;
75     QMenu *m_menu;
76     EffectInfo m_info;
77     int m_index;
78     void updateGroupIndex(int groupIndex);
79     
80 protected:
81     virtual void mouseDoubleClickEvent ( QMouseEvent * event );
82     virtual void dragEnterEvent(QDragEnterEvent *event);
83     virtual void dragLeaveEvent(QDragLeaveEvent *event);
84     virtual void dropEvent(QDropEvent *event);
85     
86 signals:
87     void syncEffectsPos(int);
88     void effectStateChanged(bool, int ix = -1);
89     void deleteGroup(int);
90     void changeGroupPosition(int, bool);
91     void activateEffect(int);
92     void moveEffect(int current_pos, int new_pos, int groupIndex);
93     void addEffect(QDomElement e);
94     void unGroup(CollapsibleGroup *);
95 };
96
97
98 #endif
99