From 90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 16 Oct 2017 15:34:05 -0400 Subject: Simplify CPVT_GenerateAP interface This CL moves the annotation decision inside GenerateAnnotAP and hides the individual annotation AP generation methods. The form methods are hidden inside GenerateFormAP and a general GenerateEmptyAP has been added. Change-Id: I9e761cb10ceca70681df4e546631a7859f1bfc7c Reviewed-on: https://pdfium-review.googlesource.com/16130 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- core/fpdfdoc/cpvt_generateap.h | 46 +++++++++--------------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) (limited to 'core/fpdfdoc/cpvt_generateap.h') diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h index 828e8596f1..6f56993575 100644 --- a/core/fpdfdoc/cpvt_generateap.h +++ b/core/fpdfdoc/cpvt_generateap.h @@ -22,42 +22,16 @@ struct CPVT_Dash; class CPVT_GenerateAP { public: - static bool GenerateCircleAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static void GenerateComboBoxAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateHighlightAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateInkAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); - static void GenerateListBoxAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GeneratePopupAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); - static bool GenerateSquareAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateSquigglyAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateStrikeOutAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateTextAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); - static void GenerateTextFieldAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - static bool GenerateUnderlineAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict); - - static std::unique_ptr GenerateExtGStateDict( - const CPDF_Dictionary& pAnnotDict, - const ByteString& sExtGSDictName, - const ByteString& sBlendMode); - static std::unique_ptr GenerateResourceDict( - CPDF_Document* pDoc, - std::unique_ptr pExtGStateDict, - std::unique_ptr pResourceFontDict); - static void GenerateAndSetAPDict( - CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict, - std::ostringstream* psAppStream, - std::unique_ptr pResourceDict, - bool bIsTextMarkupAnnotation); + enum Type { kTextField, kComboBox, kListBox }; + + static void GenerateFormAP(Type type, + CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict); + static void GenerateEmptyAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); + + static bool GenerateAnnotAP(CPDF_Annot::Subtype subtype, + CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict); }; #endif // CORE_FPDFDOC_CPVT_GENERATEAP_H_ -- cgit v1.2.3