]> git.sesse.net Git - kdenlive/blobdiff - src/titledocument.h
Const'ref
[kdenlive] / src / titledocument.h
index f85e0679cf84428785df38205a22a9fec84b646d..d73760a06ba9779722cd39dd3f3ecad219e7ef8e 100644 (file)
@@ -23,6 +23,7 @@
 
 class QGraphicsScene;
 class QGraphicsRectItem;
+class QGraphicsItem;
 
 const int ROTATEFACTOR = 103;
 const int ZOOMFACTOR = 104;
@@ -33,20 +34,23 @@ class TitleDocument
 public:
     TitleDocument();
     void setScene(QGraphicsScene* scene, int width, int height);
-    bool saveDocument(const KUrl& url, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int out);
-    QDomDocument xml(QGraphicsRectItem* startv, QGraphicsRectItem* endv);
-    int loadFromXml(QDomDocument doc, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int *out);
+    bool saveDocument(const KUrl& url, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int duration, bool embed_images = false);
+    QDomDocument xml(QGraphicsRectItem* startv, QGraphicsRectItem* endv, bool embed_images = false);
+    int loadFromXml(const QDomDocument& doc, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int *duration, const QString& projectpath = QString());
     /** \brief Get the background color (incl. alpha) from the document, if possibly
      * \returns The background color of the document, inclusive alpha. If none found, returns (0,0,0,0) */
-    QColor getBackgroundColor();
+    QColor getBackgroundColor() const;
     int frameWidth() const;
     int frameHeight() const;
+    /** \brief Extract embeded images in project titles folder. */
+    static const QString extractBase64Image(const QString &titlePath, const QString &data);
 
     enum ItemOrigin {OriginXLeft = 0, OriginYTop = 1};
     enum AxisPosition {AxisDefault = 0, AxisInverted = 1};
 
 private:
     QGraphicsScene* m_scene;
+    QString m_projectPath;
     int m_width;
     int m_height;
     QString colorToString(const QColor&);
@@ -55,6 +59,7 @@ private:
     QColor stringToColor(const QString &);
     QTransform stringToTransform(const QString &);
     QList<QVariant> stringToList(const QString &);
+    int base64ToUrl(QGraphicsItem* item, QDomElement& content, bool embed);
 };
 
 #endif