7#ifndef CORE_FPDFDOC_CPDF_ANNOT_H_
8#define CORE_FPDFDOC_CPDF_ANNOT_H_
16#include "core/fpdfapi/parser/cpdf_stream.h"
17#include "core/fxcrt/bytestring.h"
18#include "core/fxcrt/fx_coordinates.h"
19#include "core/fxcrt/maybe_owned.h"
20#include "core/fxcrt/retain_ptr.h"
21#include "core/fxcrt/unowned_ptr.h"
22#include "third_party/abseil-cpp/absl/types/optional.h"
72 const CPDF_Dictionary* pAnnotDict);
83 const CPDF_Dictionary*
GetAnnotDict()
const {
return m_pAnnotDict.Get(); }
106 void GenerateAPIfNeeded();
107 bool ShouldGenerateAP()
const;
108 bool ShouldDrawAnnotation()
const;
112 RetainPtr<CPDF_Dictionary>
const m_pAnnotDict;
114 std::map<RetainPtr<CPDF_Stream>, std::unique_ptr<CPDF_Form>> m_APMap;
118 const bool m_bIsTextMarkupAnnotation;
120 bool m_bOpenState =
false;
121 bool m_bHasGeneratedAP;
constexpr CFX_FloatRect()=default
void Deflate(float x, float y)
void Union(const CFX_FloatRect &other_rect)
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src)
void Rotate(float fRadian)
void Concat(const CFX_Matrix &right)
void AppendFloatRect(const CFX_FloatRect &rect)
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)
DeviceType GetDeviceType() const
uint32_t GetFlags() const
static CFX_FloatRect RectFromQuadPoints(const CPDF_Dictionary *pAnnotDict, size_t nIndex)
CPDF_Form * GetAPForm(CPDF_Page *pPage, AppearanceMode mode)
bool DrawInContext(CPDF_Page *pPage, CPDF_RenderContext *pContext, const CFX_Matrix &mtUser2Device, AppearanceMode mode)
static ByteString AnnotSubtypeToString(Subtype nSubtype)
static CFX_FloatRect RectFromQuadPointsArray(const CPDF_Array *pArray, size_t nIndex)
static size_t QuadPointCount(const CPDF_Array *pArray)
absl::optional< CFX_FloatRect > GetPopupAnnotRect() const
Subtype GetSubtype() const
const CPDF_Dictionary * GetAnnotDict() const
static Subtype StringToAnnotSubtype(const ByteString &sSubtype)
void SetOpenState(bool bOpenState)
CFX_FloatRect GetRect() const
CPDF_Annot(RetainPtr< CPDF_Dictionary > pDict, CPDF_Document *pDocument)
bool DrawAppearance(CPDF_Page *pPage, CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, AppearanceMode mode)
RetainPtr< CPDF_Dictionary > GetMutableAnnotDict()
void DrawBorder(CFX_RenderDevice *pDevice, const CFX_Matrix *pUser2Device)
static CFX_FloatRect BoundingRectFromQuadPoints(const CPDF_Dictionary *pAnnotDict)
void SetPopupAnnot(CPDF_Annot *pAnnot)
void SetPopupAnnotOpenState(bool bOpenState)
bool KeyExist(const ByteString &key) const
RetainPtr< CPDF_Stream > GetMutableStreamFor(const ByteString &key)
ByteString GetByteStringFor(const ByteString &key) const
CPDF_Document * GetDocument() const override
int GetPageRotation() const
CPDF_PageImageCache * GetPageImageCache()
void AppendLayer(CPDF_PageObjectHolder *pObjectHolder, const CFX_Matrix &mtObject2Device)
void Render(CFX_RenderDevice *pDevice, const CPDF_PageObject *pStopObj, const CPDF_RenderOptions *pOptions, const CFX_Matrix *pLastMatrix)
bool operator==(const char *ptr) const
ByteString & operator=(ByteString &&that) noexcept
CharType operator[](const size_t index) const
RetainPtr< CPDF_Stream > GetAnnotAPNoFallback(CPDF_Dictionary *pAnnotDict, CPDF_Annot::AppearanceMode eMode)
RetainPtr< CPDF_Stream > GetAnnotAP(CPDF_Dictionary *pAnnotDict, CPDF_Annot::AppearanceMode eMode)
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
constexpr uint32_t kNoView
constexpr uint32_t kHidden
constexpr uint32_t kNoRotate
constexpr uint32_t kPrint
constexpr CFX_FillRenderOptions()