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