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