1 /***************************************************************************
2 titlewidget.h - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
26 #include "ui_titlewidget_ui.h"
27 #include "titledocument.h"
29 #include "graphicsscenerectmove.h"
40 double scalex, scaley;
44 class TitleWidget : public QDialog , public Ui::TitleWidget_UI {
48 TitleWidget(KUrl url, QString projectPath, Render *render, QWidget *parent = 0);
50 void setXml(QDomDocument doc);
51 static QStringList getFreeTitleInfo(const KUrl &projectUrl);
52 static QString getTitleResourceFromName(const KUrl &projectUrl, const QString &titleName);
55 virtual void resizeEvent(QResizeEvent * event);
58 QGraphicsPolygonItem *startViewport, *endViewport;
59 GraphicsSceneRectMove *m_scene;
61 QMap<QGraphicsItem*, Transform > transformations;
62 TitleDocument m_titledocument;
63 QGraphicsRectItem *m_frameBorder;
64 QGraphicsPixmapItem *m_frameImage;
69 QAction *m_buttonRect;
70 QAction *m_buttonText;
71 QAction *m_buttonImage;
72 QAction *m_buttonCursor;
73 QAction *m_buttonSave;
74 QAction *m_buttonLoad;
75 /** project path for storing title clips */
76 QString m_projectPath;
79 void slotNewText(QGraphicsTextItem *tt);
80 void slotNewRect(QGraphicsRectItem *rect);
81 void slotChangeBackground();
82 void selectionChanged();
86 void setupViewports();
87 void zIndexChanged(int);
92 void saveTitle(KUrl url = KUrl());
94 QPixmap renderedPixmap();
97 void slotAdjustSelectedItem();
98 void slotUpdateZoom(int pos);
99 void slotZoom(bool up);
100 void slotAdjustZoom();
101 void slotZoomOneToOne();
102 void slotUpdateText();
103 void displayBackgroundFrame();
104 void setCurrentItem(QGraphicsItem *item);
107 void slotSelectTool();
108 void slotImageTool();