]> git.sesse.net Git - kdenlive/blob - src/projectlist.h
add context menu
[kdenlive] / src / projectlist.h
1 /***************************************************************************
2  *   Copyright (C) 2007 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 PRJECTLIST_H
22 #define PRJECTLIST_H
23
24 #include <QDomNodeList>
25 #include <QToolBar>
26 #include <QTreeWidget>
27
28 #include <KUndoStack>
29 #include <KTreeWidgetSearchLine>
30
31 #include "docclipbase.h"
32 #include "kdenlivedoc.h"
33 #include "renderer.h"
34 #include "timecode.h"
35 #include "projectlistview.h"
36
37 class ProjectItem;
38
39 class ProjectList : public QWidget
40 {
41   Q_OBJECT
42   
43   public:
44     ProjectList(QWidget *parent=0);
45     virtual ~ProjectList();
46
47     QDomElement producersList();
48     void setRenderer(Render *projectRender);
49
50     void addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url = KUrl(), int parentId = -1);
51     void deleteClip(const int clipId);
52
53   public slots:
54     void setDocument(KdenliveDoc *doc);
55     void addProducer(QDomElement producer, int parentId = -1);
56     void slotReplyGetImage(int clipId, int pos, const QPixmap &pix, int w, int h);
57     void slotReplyGetFileProperties(int clipId, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata);
58
59
60   private:
61     ProjectListView *listView;
62     KTreeWidgetSearchLine *searchView;
63     Render *m_render;
64     Timecode m_timecode;
65     double m_fps;
66     QToolBar *m_toolbar;
67     QMenu *m_menu;
68     KUndoStack *m_commandStack;
69     int m_clipIdCounter;
70     void selectItemById(const int clipId);
71     ProjectItem *getItemById(int id);
72     QAction *m_editAction;
73     QAction *m_deleteAction;
74
75   private slots:
76     void slotAddClip();
77     void slotRemoveClip();
78     void slotEditClip();
79     void slotClipSelected();
80     void slotAddColorClip();
81     void slotEditClip(QTreeWidgetItem *, int);
82     void slotContextMenu( const QPoint &pos, QTreeWidgetItem * );
83     //void slotShowMenu(const QPoint &pos);
84
85
86
87   signals:
88     void clipSelected(const QDomElement &);
89     void getFileProperties(const QDomElement&, int);
90 };
91
92 #endif