]> git.sesse.net Git - kdenlive/blob - src/titledocument.h
[PATCH by Ray Lehtiniemi] Fix up &&/& confusion
[kdenlive] / src / titledocument.h
1 /***************************************************************************
2                           titledocument.h  -  description
3                              -------------------
4     begin                : Feb 28 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 #ifndef TITLEDOCUMENT_H
18 #define TITLEDOCUMENT_H
19
20 #include <QDomDocument>
21
22 #include <KUrl>
23
24 class QGraphicsScene;
25 class QGraphicsPolygonItem;
26
27 class TitleDocument {
28     QGraphicsScene* scene;
29 public:
30     TitleDocument();
31     void setScene(QGraphicsScene* scene);
32     bool saveDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv);
33     int loadDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv);
34     QDomDocument xml(QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv);
35     int loadFromXml(QDomDocument doc, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv);
36     /** \brief Get the background color (incl. alpha) from the document, if possibly
37      * \returns The background color of the document, inclusive alpha. If none found, returns (0,0,0,0) */
38     QColor getBackgroundColor();
39
40 private:
41     QString colorToString(const QColor&);
42     QString rectFToString(const QRectF&);
43     QRectF stringToRect(const QString &);
44     QColor stringToColor(const QString &);
45     QTransform stringToTransform(const QString &);
46 };
47
48 #endif
49
50