Some advanced creation tools

This commit is contained in:
Jakub Melka
2020-12-05 17:51:54 +01:00
parent da95ffc748
commit 1d4e7d26ab
6 changed files with 269 additions and 1 deletions

View File

@ -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