X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftitledocument.h;h=d73760a06ba9779722cd39dd3f3ecad219e7ef8e;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=5fcc3d0350d794684aeab2e358746f8e309ef479;hpb=e44ebbaee1314e4088b03169273f66848c7795d7;p=kdenlive diff --git a/src/titledocument.h b/src/titledocument.h index 5fcc3d03..d73760a0 100644 --- a/src/titledocument.h +++ b/src/titledocument.h @@ -16,24 +16,50 @@ ***************************************************************************/ #ifndef TITLEDOCUMENT_H #define TITLEDOCUMENT_H + +#include + #include class QGraphicsScene; -class QGraphicsPolygonItem; +class QGraphicsRectItem; +class QGraphicsItem; + +const int ROTATEFACTOR = 103; +const int ZOOMFACTOR = 104; + +class TitleDocument +{ -class TitleDocument { - QGraphicsScene* scene; public: TitleDocument(); - void setScene(QGraphicsScene* scene); - bool saveDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv); - int loadDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv); + void setScene(QGraphicsScene* scene, int width, int height); + 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() 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&); QString rectFToString(const QRectF&); QRectF stringToRect(const QString &); QColor stringToColor(const QString &); QTransform stringToTransform(const QString &); + QList stringToList(const QString &); + int base64ToUrl(QGraphicsItem* item, QDomElement& content, bool embed); }; #endif