Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdfsdk_baannot.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef FPDFSDK_CPDFSDK_BAANNOT_H_
8#define FPDFSDK_CPDFSDK_BAANNOT_H_
9
10#include "core/fpdfdoc/cpdf_aaction.h"
11#include "core/fpdfdoc/cpdf_action.h"
12#include "core/fpdfdoc/cpdf_annot.h"
13#include "core/fxcrt/fx_coordinates.h"
14#include "core/fxcrt/fx_string.h"
15#include "core/fxcrt/unowned_ptr.h"
16#include "core/fxge/cfx_renderdevice.h"
17#include "fpdfsdk/cpdfsdk_annot.h"
18
19class CFX_Matrix;
20class CPDF_Dictionary;
21class CPDFSDK_PageView;
22
25 public:
26 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
27 ~CPDFSDK_BAAnnot() override;
28
29 // CPDFSDK_Annot:
30 CPDFSDK_BAAnnot* AsBAAnnot() override;
32 CPDF_Annot::Subtype GetAnnotSubtype() const override;
33 CFX_FloatRect GetRect() const override;
34 CPDF_Annot* GetPDFAnnot() const override;
35 int GetLayoutOrder() const override;
36 void OnDraw(CFX_RenderDevice* pDevice,
37 const CFX_Matrix& mtUser2Device,
38 bool bDrawAnnots) override;
39 bool DoHitTest(const CFX_PointF& point) override;
40 CFX_FloatRect GetViewBBox() override;
41 bool CanUndo() override;
42 bool CanRedo() override;
43 bool Undo() override;
44 bool Redo() override;
45 WideString GetText() override;
46 WideString GetSelectedText() override;
47 void ReplaceAndKeepSelection(const WideString& text) override;
48 void ReplaceSelection(const WideString& text) override;
49 bool SelectAllText() override;
50 bool SetIndexSelected(int index, bool selected) override;
51 bool IsIndexSelected(int index) override;
52
54 virtual bool IsAppearanceValid();
55 virtual void DrawAppearance(CFX_RenderDevice* pDevice,
56 const CFX_Matrix& mtUser2Device,
58
59 void SetAnnotName(const WideString& sName);
60 WideString GetAnnotName() const;
61
62 void SetFlags(uint32_t nFlags);
63 uint32_t GetFlags() const;
64
65 void SetAppStateOff();
66 ByteString GetAppState() const;
67
68 void SetBorderWidth(int nWidth);
69 int GetBorderWidth() const;
70
71 void SetBorderStyle(BorderStyle nStyle);
73
74 bool IsVisible() const;
75
76 CPDF_Action GetAction() const;
79
80 protected:
81 const CPDF_Dictionary* GetAnnotDict() const;
82 RetainPtr<CPDF_Dictionary> GetMutableAnnotDict();
83 RetainPtr<CPDF_Dictionary> GetAPDict();
84 void ClearCachedAnnotAP();
85 bool IsFocusableAnnot(const CPDF_Annot::Subtype& annot_type) const;
86
87 private:
88 // CPDFSDK_Annot::UnsafeInputHandlers:
89 void OnMouseEnter(Mask<FWL_EVENTFLAG> nFlags) override;
90 void OnMouseExit(Mask<FWL_EVENTFLAG> nFlags) override;
91 bool OnLButtonDown(Mask<FWL_EVENTFLAG> nFlags,
92 const CFX_PointF& point) override;
93 bool OnLButtonUp(Mask<FWL_EVENTFLAG> nFlags,
94 const CFX_PointF& point) override;
95 bool OnLButtonDblClk(Mask<FWL_EVENTFLAG> nFlags,
96 const CFX_PointF& point) override;
97 bool OnMouseMove(Mask<FWL_EVENTFLAG> nFlags,
98 const CFX_PointF& point) override;
99 bool OnMouseWheel(Mask<FWL_EVENTFLAG> nFlags,
100 const CFX_PointF& point,
101 const CFX_Vector& delta) override;
102 bool OnRButtonDown(Mask<FWL_EVENTFLAG> nFlags,
103 const CFX_PointF& point) override;
104 bool OnRButtonUp(Mask<FWL_EVENTFLAG> nFlags,
105 const CFX_PointF& point) override;
106 bool OnChar(uint32_t nChar, Mask<FWL_EVENTFLAG> nFlags) override;
107 bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask<FWL_EVENTFLAG> nFlags) override;
108 bool OnSetFocus(Mask<FWL_EVENTFLAG> nFlags) override;
109 bool OnKillFocus(Mask<FWL_EVENTFLAG> nFlags) override;
110
111 void SetOpenState(bool bOpenState);
112 void UpdateAnnotRects();
113 void InvalidateRect();
114
115 bool is_focused_ = false;
116 UnownedPtr<CPDF_Annot> const m_pAnnot;
117};
118
119#endif // FPDFSDK_CPDFSDK_BAANNOT_H_
BorderStyle
CPDFSDK_AnnotIterator(CPDFSDK_PageView *pPageView, const std::vector< CPDF_Annot::Subtype > &subtypes_to_iterate)
CPDFSDK_Annot * GetNextAnnot(CPDFSDK_Annot *pAnnot)
CPDFSDK_Annot * GetPrevAnnot(CPDFSDK_Annot *pAnnot)
virtual CPDF_Annot::Subtype GetAnnotSubtype() const =0
virtual CPDF_Annot * GetPDFAnnot() const
const CPDF_Dictionary * GetAnnotDict() const
CPDF_Annot * GetPDFAnnot() const override
CFX_FloatRect GetViewBBox() override
WideString GetAnnotName() const
void SetAnnotName(const WideString &sName)
void ReplaceSelection(const WideString &text) override
bool SetIndexSelected(int index, bool selected) override
bool OnChar(uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags) override
CPDF_Annot::Subtype GetAnnotSubtype() const override
bool CanUndo() override
bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta) override
bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool IsIndexSelected(int index) override
bool SelectAllText() override
bool IsVisible() const
virtual void DrawAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, CPDF_Annot::AppearanceMode mode)
bool DoHitTest(const CFX_PointF &point) override
int GetLayoutOrder() const override
CPDFSDK_BAAnnot(CPDF_Annot *pAnnot, CPDFSDK_PageView *pPageView)
bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
void ReplaceAndKeepSelection(const WideString &text) override
BorderStyle GetBorderStyle() const
bool OnSetFocus(Mask< FWL_EVENTFLAG > nFlags) override
int GetBorderWidth() const
void SetBorderStyle(BorderStyle nStyle)
CPDF_Action GetAction() const
void SetFlags(uint32_t nFlags)
CPDFSDK_BAAnnot * AsBAAnnot() override
virtual bool IsAppearanceValid()
WideString GetSelectedText() override
CFX_FloatRect GetRect() const override
bool OnLButtonDblClk(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CPDF_AAction GetAAction() const
bool OnRButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool Undo() override
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
~CPDFSDK_BAAnnot() override
WideString GetText() override
void OnDraw(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, bool bDrawAnnots) override
bool Redo() override
bool OnRButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CPDF_Dest GetDestination() const
bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags) override
ByteString GetAppState() const
bool IsFocusableAnnot(const CPDF_Annot::Subtype &annot_type) const
uint32_t GetFlags() const
bool CanRedo() override
void SetBorderWidth(int nWidth)
bool OnKillFocus(Mask< FWL_EVENTFLAG > nFlags) override
RetainPtr< CPDF_Dictionary > GetMutableAnnotDict()
RetainPtr< CPDF_Dictionary > GetAPDict()
virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT)
void OnMouseEnter(Mask< FWL_EVENTFLAG > nFlags) override
CPDFSDK_Annot::UnsafeInputHandlers * GetUnsafeInputHandlers() override
void OnMouseExit(Mask< FWL_EVENTFLAG > nFlags) override
CPDF_Page * GetPDFPage() const
void SetOptionSelection(int index)
WideString GetValue() const
bool CanUndo() override
int GetMaxLen() const
WideString GetSelectExportText(int nIndex) const
CPDF_FormField * GetFormField() const
bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode) const
void SetRect(const CFX_FloatRect &rect)
bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
WideString GetSelectedText() override
int GetSelectedIndex(int nIndex) const
int GetAlignment() const
bool OnAAction(CPDF_AAction::AActionType type, CFFL_FieldAction *data, const CPDFSDK_PageView *pPageView)
int GetTopVisibleIndex() const
bool Undo() override
bool IsIndexSelected(int index) override
bool OnRButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CFX_Matrix GetMatrix() const
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
void ResetAppearance(absl::optional< WideString > sValue, ValueChanged bValueChanged)
bool IsSignatureWidget() const
bool CanRedo() override
uint32_t GetValueAge() const
bool IsChecked() const
bool IsOptionSelected(int nIndex) const
void SetCheck(bool bChecked)
absl::optional< WideString > OnFormat()
int GetRotate() const
void OnMouseExit(Mask< FWL_EVENTFLAG > nFlags) override
int GetFieldFlags() const
int CountOptions() const
void ReplaceSelection(const WideString &text) override
void DrawShadow(CFX_RenderDevice *pDevice, CPDFSDK_PageView *pPageView)
CFX_FloatRect GetViewBBox() override
bool SetIndexSelected(int index, bool selected) override
bool OnSetFocus(Mask< FWL_EVENTFLAG > nFlags) override
void ReplaceAndKeepSelection(const WideString &text) override
bool IsAppearanceValid() override
absl::optional< FX_COLORREF > GetTextColor() const
WideString GetOptionLabel(int nIndex) const
CPDF_FormControl * GetFormControl() const
void SetTopVisibleIndex(int index)
void DrawAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, CPDF_Annot::AppearanceMode mode) override
bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta) override
bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags) override
CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override
bool OnLButtonDblClk(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CFX_FloatRect GetRotatedRect() const
bool IsAppModified() const
int GetLayoutOrder() const override
void OnMouseEnter(Mask< FWL_EVENTFLAG > nFlags) override
float GetFontSize() const
absl::optional< FX_COLORREF > GetBorderColor() const
absl::optional< FX_COLORREF > GetFillColor() const
~CPDFSDK_Widget() override
bool OnKillFocus(Mask< FWL_EVENTFLAG > nFlags) override
uint32_t GetAppearanceAge() const
void SetValue(const WideString &sValue)
CFX_Color GetFillPWLColor() const
void OnDraw(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, bool bDrawAnnots) override
bool SelectAllText() override
CFX_FloatRect GetClientRect() const
WideString GetText() override
CFX_Color GetTextPWLColor() const
bool IsPushHighlighted() const
CPDFSDK_Widget(CPDF_Annot *pAnnot, CPDFSDK_PageView *pPageView, CPDFSDK_InteractiveForm *pInteractiveForm)
bool OnRButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
WideString GetExportValue() const
CFX_Color GetBorderPWLColor() const
bool DoHitTest(const CFX_PointF &point) override
bool OnChar(uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags) override
FormFieldType GetFieldType() const
void OnLoad() override
bool Redo() override
CFX_FloatRect GetRect() const
bool operator==(const char *ptr) const
FormFieldType
CPDFSDK_Widget * ToCPDFSDKWidget(CPDFSDK_Annot *pAnnot)