summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_annothandlermgr.cpp
AgeCommit message (Collapse)Author
2016-09-09Define behaviors of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw.chromium/2858chromium/2857chromium/2856jaepark
Previously, PDFium only supported widget annotations to draw forms. As we've implemented other annotations, the behavior of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw changed. So, this CL clearly defines what needs to be done in FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw. This CL first assumes that PDFium users will always call FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw to render PDF pages, because otherwise they are not able to support PDF forms. FPDF_RenderPageBitmap_Retail should only deal with non-widget annotations, such as highlight, underline, text, etc. If FPDF_ANNOT flag is passed, non-widget annotations are drawn. Otherwise, they are hidden. FPDF_FFLDraw should only deal with annotations that requires user-interaction, such as widget annotations and popup annotation. Since popup annotation is associated with non-widget annotation, they should not be drawn if the associated annotation is hidden. Thus, if FPDF_ANNOT flag is passed, popup annotations are drawn. Otherwise, they are hidden. Widget annotations should be always drawn regardless of FPDF_ANNOT flag since they need to be always displayed for PDF forms. Also, roll DEPS for testing/corpus to 8485b30. BUG=pdfium:594 Review-Url: https://codereview.chromium.org/2323203002
2016-09-01Remove unused dwFlags parameter in CPDFSDK_AnnotHandlerMgr::OnDraw and its ↵jaepark
calls. Review-Url: https://codereview.chromium.org/2305443005
2016-08-31Use enum class for subtypes of CPDF_Annot.jaepark
Comparing CFX_ByteString for annotation subtypes is inefficient and error-prone. This CL uses enum class to compare annotation subtypes. Also, remove unused IPDFSDK_AnnotHandler::GetType() and FSDK_XFAWIDGET_TYPENAME. Review-Url: https://codereview.chromium.org/2295953002
2016-08-30Rename CPDFSDK_BFAnnotHandler and CPDFSDK_XFAAnnotHandler.jaepark
CPDFSDK_BFAnnotHandler handles CPDFSDK_Widget, so rename it to CPDFSDK_WidgetHandler. Similarly, CPDFSDK_XFAAnnotHandler handles CPDFSDK_XFAWidget, so rename it to CPDFSDK_XFAWidgetHandler. Review-Url: https://codereview.chromium.org/2298443002
2016-08-29Display content of the annotation when mouse hover.jaepark
Each annotation has its contents, and users should be able to see the contents. In this patch, PDFium creates a Popup annotation for each annotation and stores the author and the content. When a user mouse hover on the annotation, PDFium draws the corresponding Popup annotation and displays the content. Also, roll DEPS for testing/corpus to 5867fa6. BUG=62625 Review-Url: https://codereview.chromium.org/2273893002
2016-08-26Rename CPDFSDK_Annot::GetType to CPDFSDK_Annot::GetAnnotSubtype.jaepark
CPDFSDK_Annot::GetType should be renamed to GetAnnotSubtype as it returns annotation subtype. Also, CPDFSDK_Annot::GetSubType is only used to check if the annotation is signature widget. Thus, change the method to IsSignatureWidget. Lastly, rename CPDF_Annot::GetSubType to CPDF_Annot::GetSubtype to match with spec. Review-Url: https://codereview.chromium.org/2287703002
2016-08-17Split fpdfsdk/fsdk_baseform.h into individual classes.jaepark
This CL moves classes in fsdk_baseform.h to their own files. Classes include CPDFSDK_Widget, CBA_AnnotIterator, CPDFSDK_XFAWidget, PDFSDK_FieldAction, and CPDFSDK_Interform. Review-Url: https://codereview.chromium.org/2252723002
2016-08-15Split fpdfsdk/fsdk_annothandler.h into individual classes.jaepark
This CL moves classes in fsdk_annothandler.h, which are CPDFSDK_AnnotIterator, CPDFSDK_AnnotHandlerMgr, IPDFSDK_AnnotHandler, CPDFSDK_XFAAnnotHandler and CPDFSDK_BFAnnotHandler, to their own files. Review-Url: https://codereview.chromium.org/2243623002