]> git.sesse.net Git - kdenlive/blob - src/titlewidget.h
Comment out names of unused parameters [PATCH by Ray Lehtiniemi]
[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 "ui_titlewidget_ui.h"
23 #include "titledocument.h"
24 #include "renderer.h"
25 #include "graphicsscenerectmove.h"
26
27 #include <QMap>
28
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
44 public:
45     /** \brief Constructor
46      * \param projectPath Path to use when user requests loading or saving of titles as .kdenlivetitle documents */
47     TitleWidget(KUrl url, QString projectPath, Render *render, QWidget *parent = 0);
48     virtual ~TitleWidget();
49     QDomDocument xml();
50     void setXml(QDomDocument doc);
51
52     /** \brief Find first available filename of the form titleXXX.png in projectUrl + "/titles/" directory
53     * \param projectUrl Url to directory of project.
54      * \returns A list, with the name in the form of "/path/to/titles/titleXXX" as the first element, the extension
55      * ".png" as the second element.
56      *
57      * The path "/titles/" is appended to projectUrl to locate the actual directory that contains the title pngs. */
58     static QStringList getFreeTitleInfo(const KUrl &projectUrl);
59
60     /** \brief Build a filename from a projectUrl and a titleName
61      * \param projectUrl Url to directory of project.
62      * \param titleName Name of title, on the form "titleXXX"
63      *
64      * The path "/titles/" is appended to projectUrl to build the directoryname, then .pgn is appended to
65      * get the filename. It is not checked that the title png actually exists, only the name is build and
66      * returned. */
67     static QString getTitleResourceFromName(const KUrl &projectUrl, const QString &titleName);
68
69 protected:
70     virtual void resizeEvent(QResizeEvent * event);
71
72 private:
73     QGraphicsPolygonItem *startViewport, *endViewport;
74     GraphicsSceneRectMove *m_scene;
75     void initViewports();
76     QMap<QGraphicsItem*, Transform > transformations;
77     TitleDocument m_titledocument;
78     QGraphicsRectItem *m_frameBorder;
79     QGraphicsPixmapItem *m_frameImage;
80     int m_frameWidth;
81     int m_frameHeight;
82     Render *m_render;
83     int m_count;
84     QAction *m_buttonRect;
85     QAction *m_buttonText;
86     QAction *m_buttonImage;
87     QAction *m_buttonCursor;
88     QAction *m_buttonSave;
89     QAction *m_buttonLoad;
90     /** project path for storing title clips */
91     QString m_projectPath;
92     /** \brief Store the current choices of font, background and rect values */
93     void writeChoices();
94     /** \brief Read the last stored choices into the dialog */
95     void readChoices();
96
97 public slots:
98     void slotNewText(QGraphicsTextItem *tt);
99     void slotNewRect(QGraphicsRectItem *rect);
100     void slotChangeBackground();
101     void selectionChanged();
102     void textChanged();
103     void rectChanged();
104     void fontBold();
105     void setupViewports();
106     void zIndexChanged(int);
107     void itemScaled(int);
108     void itemRotate(int);
109     void itemHCenter();
110     void itemVCenter();
111     void saveTitle(KUrl url = KUrl());
112     void loadTitle();
113     QImage renderedPixmap();
114
115 private slots:
116     void slotAdjustSelectedItem();
117     void slotUpdateZoom(int pos);
118     void slotZoom(bool up);
119     void slotAdjustZoom();
120     void slotZoomOneToOne();
121     void slotUpdateText();
122     void displayBackgroundFrame();
123     void setCurrentItem(QGraphicsItem *item);
124     void slotTextTool();
125     void slotRectTool();
126     void slotSelectTool();
127     void slotImageTool();
128     /** \brief Called when accepted, stores the user selections for next time use */
129     void slotAccepted();
130 };
131
132
133 #endif