1 /***************************************************************************
2 * Copyright (C) 2010 by Till Theato (root@ttill.de) *
3 * This file is part of Kdenlive (www.kdenlive.org). *
5 * Kdenlive is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * Kdenlive is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with Kdenlive. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
19 #ifndef BEZIERSPLINEWIDGET_H
20 #define BEZIERSPLINEWIDGET_H
22 #include "cubicbezierspline.h"
23 #include "beziersplineeditor.h"
24 #include "ui_bezierspline_ui.h"
31 class BezierSplineWidget : public QWidget
36 /** @brief Sets up the UI and sets the spline to @param spline. */
37 BezierSplineWidget(const QString &spline, QWidget* parent = 0);
39 /** @brief Returns the current spline. */
42 /** The curvemodes refer to the usage of the spline.
43 * As this widget is currently only used for frei0r.curves the modes are the channels this filter accepts. */
44 enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB, ModeHue, ModeSaturation };
46 /** @brief Sets the mode to @param mode and updates the editors background pixmap if necessary. */
47 void setMode(CurveModes mode);
50 /** @brief Sets the spinboxes for modifing the selected point to @param p. */
51 void slotUpdatePointEntries(const BPoint &p);
53 /** @brief Updates the spline if the current point's p was modified using the spinboxes.
54 * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
55 * @param final (default = true) emit signal modified? */
56 void slotUpdatePointP(double value = 1, bool final = true);
57 /** @brief Updates the spline if the current point's h1 was modified using the spinboxes.
58 * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
59 * @param final (default = true) emit signal modified? */
60 void slotUpdatePointH1(double value = 1, bool final = true);
61 /** @brief Updates the spline if the current point's h2 was modified using the spinboxes.
62 * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
63 * @param final (default = true) emit signal modified? */
64 void slotUpdatePointH2(double value = 1, bool final = true);
66 /** @brief Increases the number of lines in the editor's grid. If there are already 8 lines the number is set to 0. */
67 void slotGridChange();
68 /** @brief Turns showing the background pixmap in the editor on/off. */
69 void slotShowPixmap(bool show = true);
70 /** @brief Resets the current spline. */
71 void slotResetSpline();
72 /** @brief Linkes the handles. This will always make them stay in one line through p. */
73 void slotSetHandlesLinked(bool linked);
75 void slotShowAllHandles(bool show);
78 Ui::BezierSpline_UI m_ui;
85 BezierSplineEditor m_edit;