2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2006 Chu Xiaodong <xiaodongchu@gmail.com>
|
|
|
|
SPDX-FileCopyrightText: 2006 Pino Toscano <pino@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB a KDAB Group
|
|
|
|
company, info@kdab.com. Work sponsored by the
|
|
|
|
LiMux project of the city of Munich
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2006-09-16 17:06:56 +00:00
|
|
|
|
2006-08-11 23:53:48 +00:00
|
|
|
#ifndef _ANNOTWINDOW_H_
|
|
|
|
#define _ANNOTWINDOW_H_
|
|
|
|
|
2020-07-08 11:54:37 +00:00
|
|
|
#include <QColor>
|
|
|
|
#include <QFrame>
|
2006-08-11 23:53:48 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
2006-09-16 17:06:56 +00:00
|
|
|
class Annotation;
|
2012-01-17 22:46:37 +00:00
|
|
|
class Document;
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2011-09-22 17:22:15 +00:00
|
|
|
namespace GuiUtils
|
|
|
|
{
|
|
|
|
class LatexRenderer;
|
|
|
|
}
|
|
|
|
|
2013-04-05 22:22:48 +00:00
|
|
|
class KTextEdit;
|
2006-09-17 16:09:10 +00:00
|
|
|
class MovableTitle;
|
2013-04-05 22:22:48 +00:00
|
|
|
class QMenu;
|
2006-09-16 17:06:56 +00:00
|
|
|
|
2006-09-17 16:09:10 +00:00
|
|
|
class AnnotWindow : public QFrame
|
2006-08-11 23:53:48 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2012-01-17 22:46:37 +00:00
|
|
|
AnnotWindow(QWidget *parent, Okular::Annotation *annot, Okular::Document *document, int page);
|
2019-12-18 11:51:13 +00:00
|
|
|
~AnnotWindow() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-03-24 00:08:08 +00:00
|
|
|
void reloadInfo();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2017-10-25 12:59:17 +00:00
|
|
|
Okular::Annotation *annotation() const;
|
2017-10-26 07:47:18 +00:00
|
|
|
int pageNumber() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2017-10-26 07:47:18 +00:00
|
|
|
void updateAnnotation(Okular::Annotation *a);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-08-11 23:53:48 +00:00
|
|
|
private:
|
2006-09-17 16:09:10 +00:00
|
|
|
MovableTitle *m_title;
|
2013-04-05 22:22:48 +00:00
|
|
|
KTextEdit *textEdit;
|
2008-03-24 00:08:08 +00:00
|
|
|
QColor m_color;
|
2011-09-22 17:22:15 +00:00
|
|
|
GuiUtils::LatexRenderer *m_latexRenderer;
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::Annotation *m_annot;
|
2012-01-17 22:46:37 +00:00
|
|
|
Okular::Document *m_document;
|
|
|
|
int m_page;
|
2013-04-05 22:22:48 +00:00
|
|
|
int m_prevCursorPos;
|
|
|
|
int m_prevAnchorPos;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-02-20 14:48:08 +00:00
|
|
|
public Q_SLOTS:
|
|
|
|
void renderLatex(bool render);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2009-03-04 14:30:42 +00:00
|
|
|
protected:
|
2017-03-02 19:39:24 +00:00
|
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2016-07-11 17:30:31 +00:00
|
|
|
private Q_SLOTS:
|
2013-04-05 22:22:48 +00:00
|
|
|
void slotUpdateUndoAndRedoInContextMenu(QMenu *menu);
|
2006-09-17 16:09:10 +00:00
|
|
|
void slotOptionBtn();
|
2006-08-11 23:53:48 +00:00
|
|
|
void slotsaveWindowText();
|
2019-04-25 21:10:48 +00:00
|
|
|
void slotHandleContentsChangedByUndoRedo(Okular::Annotation *annot, const QString &contents, int cursorPos, int anchorPos);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2016-07-11 17:30:31 +00:00
|
|
|
Q_SIGNALS:
|
2011-09-22 17:22:15 +00:00
|
|
|
void containsLatex(bool);
|
2006-08-11 23:53:48 +00:00
|
|
|
};
|
2006-09-21 08:45:36 +00:00
|
|
|
|
2006-08-11 23:53:48 +00:00
|
|
|
#endif
|