mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Signature plugin: text edit box
This commit is contained in:
@@ -27,8 +27,10 @@ class PDFPageContentScene;
|
||||
class PDFPageContentSvgElement;
|
||||
class PDFPageContentElementDot;
|
||||
class PDFPageContentElementLine;
|
||||
class PDFPageContentElementTextBox;
|
||||
class PDFPageContentElementRectangle;
|
||||
class PDFPageContentElementFreehandCurve;
|
||||
class PDFTextEditPseudowidget;
|
||||
|
||||
class PDFCreatePCElementTool : public PDFWidgetTool
|
||||
{
|
||||
@@ -201,6 +203,49 @@ private:
|
||||
PDFPageContentElementFreehandCurve* m_element;
|
||||
};
|
||||
|
||||
/// Tool that displays SVG image
|
||||
class PDF4QTLIBSHARED_EXPORT PDFCreatePCElementTextTool : public PDFCreatePCElementTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFCreatePCElementTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreatePCElementTextTool(PDFDrawWidgetProxy* proxy,
|
||||
PDFPageContentScene* scene,
|
||||
QAction* action,
|
||||
QObject* parent);
|
||||
virtual ~PDFCreatePCElementTextTool() override;
|
||||
|
||||
virtual void drawPage(QPainter* painter,
|
||||
PDFInteger pageIndex,
|
||||
const PDFPrecompiledPage* compiledPage,
|
||||
PDFTextLayoutGetter& layoutGetter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
QList<PDFRenderError>& errors) const override;
|
||||
|
||||
virtual void setActiveImpl(bool active) override;
|
||||
virtual void shortcutOverrideEvent(QWidget* widget, QKeyEvent* event) override;
|
||||
virtual void keyPressEvent(QWidget* widget, QKeyEvent* event) override;
|
||||
virtual void mousePressEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
virtual void mouseDoubleClickEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
virtual void mouseMoveEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
virtual void wheelEvent(QWidget* widget, QWheelEvent* event) override;
|
||||
|
||||
private:
|
||||
void onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRectangle);
|
||||
|
||||
void finishEditing();
|
||||
std::optional<QPointF> getPagePointUnderMouse(QMouseEvent* event) const;
|
||||
|
||||
bool isEditing() const;
|
||||
|
||||
PDFPickTool* m_pickTool;
|
||||
PDFPageContentElementTextBox* m_element;
|
||||
PDFTextEditPseudowidget* m_textEditWidget;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFPAGECONTENTEDITORTOOLS_H
|
||||
|
Reference in New Issue
Block a user