]> git.sesse.net Git - kdenlive/blob - src/effectstack/collapsiblegroup.h
Fix forward declaration
[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 "abstractcollapsiblewidget.h"
26 #include "collapsibleeffect.h"
27 #include "timecode.h"
28 #include "keyframeedit.h"
29
30 #include <QDomElement>
31 #include <QToolButton>
32 #include <QLineEdit>
33 #include <QMutex>
34
35
36 class MyEditableLabel : public QLineEdit
37 {
38     Q_OBJECT
39
40 public:
41     MyEditableLabel(QWidget * parent = 0);
42     
43 protected:
44     virtual void mouseDoubleClickEvent( QMouseEvent *e);
45 };
46
47
48 /**)
49  * @class CollapsibleEffect
50  * @brief A dialog for editing markers and guides.
51  * @author Jean-Baptiste Mardelle
52  */
53
54 class CollapsibleGroup : public AbstractCollapsibleWidget
55 {
56     Q_OBJECT
57
58 public:
59     CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, EffectInfo info, QWidget * parent = 0);
60     ~CollapsibleGroup();
61     void updateTimecodeFormat();
62     void setActive(bool activate);
63     int groupIndex() const;
64     bool isGroup() const;
65     QString infoString() const;
66     bool isActive() const;
67     void addGroupEffect(CollapsibleEffect *effect);
68     void removeGroup(int ix, QVBoxLayout *layout);
69     /** @brief Return all effects in group. */
70     QList <CollapsibleEffect*> effects();
71     /** @brief Return the editable title widget. */
72     QWidget *title() const;
73     /** @brief Return the XML data describing all effects in group. */
74     QDomDocument effectsData();
75     /** @brief Adjust sub effects buttons. */
76     void adjustEffects();
77
78 public slots:
79     void slotEnable(bool enable, bool emitInfo = true);
80
81 private slots:
82     void slotSwitch();
83     void slotShow(bool show);
84     void slotDeleteGroup();
85     void slotEffectUp();
86     void slotEffectDown();
87     void slotSaveGroup();
88     void slotResetGroup();
89     void slotUnGroup();
90     void slotRenameGroup();
91
92 private:
93     QList <CollapsibleEffect *> m_subWidgets;
94     QMenu *m_menu;
95     EffectInfo m_info;
96     MyEditableLabel *m_title;
97     QMutex m_mutex;
98     
99 protected:
100     virtual void mouseDoubleClickEvent ( QMouseEvent * event );
101     virtual void dragEnterEvent(QDragEnterEvent *event);
102     virtual void dragLeaveEvent(QDragLeaveEvent *event);
103     virtual void dropEvent(QDropEvent *event);
104     
105 signals:
106     void deleteGroup(QDomDocument);
107     void unGroup(CollapsibleGroup *);
108     void groupRenamed(CollapsibleGroup *);
109
110 };
111
112
113 #endif
114