]> git.sesse.net Git - kdenlive/blob - src/titlewidget.h
02e4a463587cb0da889acaefb0377f766ea42cf8
[kdenlive] / src / titlewidget.h
1 /***************************************************************************
2                           titlewidget.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
18 #ifndef TITLEWIDGET_H
19 #define TITLEWIDGET_H
20
21
22 #include <QDialog>
23 #include <QMap>
24
25 #include "ui_titlewidget_ui.h"
26 #include "titledocument.h"
27 #include "renderer.h"
28 #include "graphicsscenerectmove.h"
29
30 class Transform {
31 public:
32     Transform() {
33         scalex = 1.0;
34         scaley = 1.0;
35         rotate = 0.0;
36     }
37     double scalex, scaley;
38     double rotate;
39 };
40
41 class TitleWidget : public QDialog , public Ui::TitleWidget_UI {
42     Q_OBJECT
43 public:
44     TitleWidget(Render *render, QWidget *parent = 0);
45
46 protected:
47     virtual void resizeEvent(QResizeEvent * event);
48
49 private:
50     QGraphicsPolygonItem *startViewport, *endViewport;
51     GraphicsSceneRectMove *m_scene;
52     void initViewports();
53     QMap<QGraphicsItem*, Transform > transformations;
54     TitleDocument m_titledocument;
55     QGraphicsRectItem *m_frameBorder;
56     int m_frameWidth;
57     int m_frameHeight;
58
59 public slots:
60     void slotNewText();
61     void slotNewRect();
62     void slotChangeBackground();
63     void selectionChanged();
64     void textChanged();
65     void rectChanged();
66     void fontBold();
67     void setupViewports();
68     void zIndexChanged(int);
69     void svgSelected(const KUrl&);
70     void itemScaled(int);
71     void itemRotate(int);
72     void saveTitle();
73     void loadTitle();
74
75 private slots:
76     void slotAdjustSelectedItem();
77     void slotUpdateZoom(int pos);
78     void slotZoom(bool up);
79     void slotAdjustZoom();
80     void slotZoomOneToOne();
81 };
82
83
84 #endif