summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpvt_generateap.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-16 15:34:05 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-16 21:00:57 +0000
commit90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f (patch)
tree38ac9992765ed34727da873eefe4ece39c0c63e2 /core/fpdfdoc/cpvt_generateap.h
parent9521036052646f60dc5c1ccd4821108eac4bca55 (diff)
downloadpdfium-90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f.tar.xz
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 <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.h')
-rw-r--r--core/fpdfdoc/cpvt_generateap.h46
1 files changed, 10 insertions, 36 deletions
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<CPDF_Dictionary> GenerateExtGStateDict(
- const CPDF_Dictionary& pAnnotDict,
- const ByteString& sExtGSDictName,
- const ByteString& sBlendMode);
- static std::unique_ptr<CPDF_Dictionary> GenerateResourceDict(
- CPDF_Document* pDoc,
- std::unique_ptr<CPDF_Dictionary> pExtGStateDict,
- std::unique_ptr<CPDF_Dictionary> pResourceFontDict);
- static void GenerateAndSetAPDict(
- CPDF_Document* pDoc,
- CPDF_Dictionary* pAnnotDict,
- std::ostringstream* psAppStream,
- std::unique_ptr<CPDF_Dictionary> 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_