]> git.sesse.net Git - kdenlive/blobdiff - src/projectitem.h
If exporting to script: Use variables for the location of the playlist and the destin...
[kdenlive] / src / projectitem.h
index f08ac5f2849232ca14ce6d684c03c910c71cd70c..0ed280211ba20de6764e89678d373fef38337346 100644 (file)
 #include "definitions.h"
 
 class DocClipBase;
-class ProjectItem : public QTreeWidgetItem {
+
+/** \brief Represents a clip or a folder in the projecttree
+ *
+ * This class represents a clip or folder in the projecttree and in the document(?) */
+class ProjectItem : public QTreeWidgetItem
+{
 public:
-    ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId);
-    ProjectItem(QTreeWidgetItem * parent, const QStringList & strings, QDomElement xml, int clipId);
-    /** Create folder item */
-    ProjectItem(QTreeWidget * parent, const QStringList & strings, int clipId);
     ProjectItem(QTreeWidget * parent, DocClipBase *clip);
     ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip);
     virtual ~ProjectItem();
@@ -44,27 +45,34 @@ public:
     int numReferences() const;
 
     void setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata);
-    int clipId() const;
+
+    /** \brief The id of the clip or folder.
+     *
+     * The clipId is used both to identify clips and folders (groups) */
+    const QString &clipId() const;
     QStringList names() const;
-    bool isGroup() const;
-    const QString groupName() const;
-    void setGroupName(const QString name);
     const KUrl clipUrl() const;
     int clipMaxDuration() const;
     CLIPTYPE clipType() const;
-    void setGroup(const QString name, const QString id);
     void changeDuration(int frames);
     DocClipBase *referencedClip();
-    void setDescription(const QString &desc);
+    void setProperties(QMap <QString, QString> props);
+    void setProperty(const QString &key, const QString &value);
+    void clearProperty(const QString &key);
+    QString getClipHash() const;
+    static int itemDefaultHeight();
+    void slotSetToolTip();
+
+    virtual bool operator<(const QTreeWidgetItem &other)const {
+        int column = treeWidget()->sortColumn();
+        if (other.type() != PROJECTFOLDERTYPE)
+            return text(column).toLower() < other.text(column).toLower();
+        else return false;
+    }
 
 private:
-    QDomElement m_element;
-    GenTime m_duration;
-    QString m_groupName;
-    bool m_durationKnown;
     CLIPTYPE m_clipType;
-    int m_clipId;
-    void slotSetToolTip();
+    QString m_clipId;
     DocClipBase *m_clip;
 };