mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Some advanced creation tools
This commit is contained in:
@ -52,6 +52,62 @@ private:
|
||||
TextAnnotationIcon m_icon;
|
||||
};
|
||||
|
||||
class PDFFORQTLIBSHARED_EXPORT PDFCreateAnnotationTool : public PDFWidgetTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFWidgetTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreateAnnotationTool(PDFDrawWidgetProxy* proxy, QAction* action, QObject* parent);
|
||||
|
||||
protected:
|
||||
virtual void updateActions() override;
|
||||
};
|
||||
|
||||
/// Tool that creates url link annotation. Multiple types of link highlights
|
||||
/// are available, user can select a link highlight. When link annotation
|
||||
/// is clicked, url address is triggered.
|
||||
class PDFFORQTLIBSHARED_EXPORT PDFCreateHyperlinkTool : public PDFCreateAnnotationTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFCreateAnnotationTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreateHyperlinkTool(PDFDrawWidgetProxy* proxy, PDFToolManager* toolManager, QAction* action, QObject* parent);
|
||||
|
||||
LinkHighlightMode getHighlightMode() const;
|
||||
void setHighlightMode(const LinkHighlightMode& highlightMode);
|
||||
|
||||
private:
|
||||
void onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRectangle);
|
||||
|
||||
PDFToolManager* m_toolManager;
|
||||
PDFPickTool* m_pickTool;
|
||||
LinkHighlightMode m_highlightMode = LinkHighlightMode::Outline;
|
||||
};
|
||||
|
||||
/// Tool that creates free text note without callout line.
|
||||
class PDFFORQTLIBSHARED_EXPORT PDFCreateFreeTextTool : public PDFCreateAnnotationTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFCreateAnnotationTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreateFreeTextTool(PDFDrawWidgetProxy* proxy, PDFToolManager* toolManager, QAction* action, QObject* parent);
|
||||
|
||||
private:
|
||||
void onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRectangle);
|
||||
|
||||
PDFToolManager* m_toolManager;
|
||||
PDFPickTool* m_pickTool;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFADVANCEDTOOLS_H
|
||||
|
Reference in New Issue
Block a user