]> git.sesse.net Git - kdenlive/blobdiff - src/abstractgroupitem.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / abstractgroupitem.h
index 315563c5e11ddd9222290a8e5cd38aa7a8e20491..3e0594ec824ebd7ec03acb0fd7833b5611d41f25 100644 (file)
 #ifndef ABSTRACTGROUPITEM
 #define ABSTRACTGROUPITEM
 
-#include <QGraphicsItemGroup>
 #include "definitions.h"
 #include "gentime.h"
 
+#include <QGraphicsItemGroup>
+#include <QGraphicsSceneMouseEvent>
+
 class CustomTrackScene;
+class QGraphicsSceneMouseEvent;
 
-class AbstractGroupItem : public QObject , public QGraphicsItemGroup {
+class AbstractGroupItem : public QObject , public QGraphicsItemGroup
+{
     Q_OBJECT
 public:
     AbstractGroupItem(double fps);
     virtual int type() const;
     CustomTrackScene* projectScene();
     void addItem(QGraphicsItem * item);
+    void removeItem(QGraphicsItem * item);
     int track() const;
+    QPainterPath clipGroupShape(const QPointF &offset) const;
+    QPainterPath clipGroupSpacerShape(const QPointF &offset) const;
+    QPainterPath transitionGroupShape(const QPointF &offset) const;
+    void setItemLocked(bool locked);
+    bool isItemLocked() const;
+    //    ItemInfo info() const;
+
+    /** @brief Resizes all clips in this group from start.
+    *@param diff Difference to startPos stored in m_resizeInfos */
+    void resizeStart(int diff);
+    /** @brief Resizes all clips in this group from end.
+    * @param diff Difference to endPos stored in m_resizeInfos */
+    void resizeEnd(int diff);
+    /** @brief Gets m_resizeInfos */
+    QList <ItemInfo> resizeInfos();
+    /** @brief Clears m_resizeInfos */
+    void clearResizeInfos();
+
+    /** @brief Gets the duration (length) of the group. */
+    GenTime duration();
 
 protected:
     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
     virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
+    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
+    virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
-    QPainterPath groupShape(QPointF);
     void fixItemRect();
-    double m_fps;
+    QPainterPath groupShape(GraphicsRectItem type, const QPointF &offset) const;
+    QPainterPath spacerGroupShape(GraphicsRectItem type, const QPointF &offset) const;
+    /** Stores the original info of the items beeing resized. */
+    QList <ItemInfo> m_resizeInfos;
 };
 
 #endif