]> git.sesse.net Git - kdenlive/blob - src/titlewidget.h
42113f38903a4e7765eb00fd3352191ccfb41fb8
[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
24 #include <QMap>
25
26 #include "ui_titlewidget_ui.h"
27 #include "titledocument.h"
28 #include "renderer.h"
29 #include "graphicsscenerectmove.h"
30
31
32
33 class Transform {
34 public:
35     Transform() {
36         scalex = 1.0;
37         scaley = 1.0;
38         rotate = 0.0;
39     }
40     double scalex, scaley;
41     double rotate;
42 };
43
44 class TitleWidget : public QDialog , public Ui::TitleWidget_UI {
45     Q_OBJECT
46 public:
47     TitleWidget(Render *render, QWidget *parent = 0);
48
49 protected:
50     virtual void resizeEvent(QResizeEvent * event);
51
52 private:
53     QGraphicsPolygonItem *startViewport, *endViewport;
54     GraphicsSceneRectMove *m_scene;
55     void initViewports();
56     QMap<QGraphicsItem*, Transform > transformations;
57     TitleDocument m_titledocument;
58     QGraphicsRectItem *m_frameBorder;
59     QGraphicsPixmapItem *m_frameImage;
60     int m_frameWidth;
61     int m_frameHeight;
62     Render *m_render;
63     int m_count;
64
65 public slots:
66     void slotNewText(QGraphicsTextItem *tt);
67     void slotNewRect(QGraphicsRectItem *rect);
68     void slotChangeBackground();
69     void selectionChanged();
70     void textChanged();
71     void rectChanged();
72     void fontBold();
73     void setupViewports();
74     void zIndexChanged(int);
75     void svgSelected(const KUrl&);
76     void itemScaled(int);
77     void itemRotate(int);
78     void saveTitle();
79     void loadTitle();
80     QPixmap renderedPixmap();
81
82 private slots:
83     void slotAdjustSelectedItem();
84     void slotUpdateZoom(int pos);
85     void slotZoom(bool up);
86     void slotAdjustZoom();
87     void slotZoomOneToOne();
88     void slotUpdateText();
89     void displayBackgroundFrame();
90     void setCurrentItem(QGraphicsItem *item);
91     void slotTextTool();
92     void slotRectTool();
93     void slotSelectTool();
94 };
95
96
97 #endif