File indexing completed on 2024-02-18 04:53:07

0001 /*
0002     SPDX-FileCopyrightText: 2011 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003 
0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QTextEdit>
0010 
0011 /** @class NotesWidget
0012     @brief A small text editor to create project notes.
0013     @author Jean-Baptiste Mardelle
0014  */
0015 class NotesWidget : public QTextEdit
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit NotesWidget(QWidget *parent = nullptr);
0020     ~NotesWidget() override;
0021     /** @brief insert current timeline timecode and focus widget to allow entering quick note */
0022     void addProjectNote();
0023     /** @brief insert given text and focus widget to allow entering quick note
0024      * @param text the text
0025     */
0026     void addTextNote(const QString &text);
0027 
0028 protected:
0029     void mouseMoveEvent(QMouseEvent *e) override;
0030     void mousePressEvent(QMouseEvent *e) override;
0031     void insertFromMimeData(const QMimeData *source) override;
0032     void contextMenuEvent(QContextMenuEvent *event) override;
0033     bool event(QEvent *event) override;
0034 
0035 public Q_SLOTS:
0036     void createMarkers();
0037     void assignProjectNote();
0038 
0039 private:
0040     void createMarker(const QStringList &anchors);
0041     QPair <QStringList, QList <QPoint> > getSelectedAnchors();
0042 
0043 Q_SIGNALS:
0044     void insertNotesTimecode();
0045     void insertTextNote(const QString &text);
0046     void seekProject(const QString);
0047     void reAssign(QStringList anchors, QList <QPoint> points);
0048 };