From fe9d640ea90cfccac39b6475dad9df62072542fc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 14 Dec 2017 19:45:53 +0000 Subject: Create classes for XFA JS objects This CL creates classes for the various XFA JS objects. The method calls from xfa_basic_data_element_script have been modified to call these methods instead of methods in CJX_Object. Change-Id: Idb2de38656f7e8edc559d44921eba25073e6c806 Reviewed-on: https://pdfium-review.googlesource.com/21110 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- fxjs/xfa/cjx_arc.cpp | 49 +++ fxjs/xfa/cjx_arc.h | 27 ++ fxjs/xfa/cjx_area.cpp | 49 +++ fxjs/xfa/cjx_area.h | 27 ++ fxjs/xfa/cjx_assist.cpp | 31 ++ fxjs/xfa/cjx_assist.h | 24 ++ fxjs/xfa/cjx_barcode.cpp | 133 +++++++ fxjs/xfa/cjx_barcode.h | 41 +++ fxjs/xfa/cjx_bind.cpp | 49 +++ fxjs/xfa/cjx_bind.h | 27 ++ fxjs/xfa/cjx_binditems.cpp | 31 ++ fxjs/xfa/cjx_binditems.h | 24 ++ fxjs/xfa/cjx_bookend.cpp | 37 ++ fxjs/xfa/cjx_bookend.h | 25 ++ fxjs/xfa/cjx_boolean.cpp | 56 +++ fxjs/xfa/cjx_boolean.h | 25 ++ fxjs/xfa/cjx_border.cpp | 49 +++ fxjs/xfa/cjx_border.h | 27 ++ fxjs/xfa/cjx_break.cpp | 85 +++++ fxjs/xfa/cjx_break.h | 33 ++ fxjs/xfa/cjx_breakafter.cpp | 55 +++ fxjs/xfa/cjx_breakafter.h | 28 ++ fxjs/xfa/cjx_breakbefore.cpp | 55 +++ fxjs/xfa/cjx_breakbefore.h | 28 ++ fxjs/xfa/cjx_button.cpp | 31 ++ fxjs/xfa/cjx_button.h | 24 ++ fxjs/xfa/cjx_calculate.cpp | 31 ++ fxjs/xfa/cjx_calculate.h | 24 ++ fxjs/xfa/cjx_caption.cpp | 43 +++ fxjs/xfa/cjx_caption.h | 26 ++ fxjs/xfa/cjx_certificate.cpp | 25 ++ fxjs/xfa/cjx_certificate.h | 23 ++ fxjs/xfa/cjx_certificates.cpp | 43 +++ fxjs/xfa/cjx_certificates.h | 26 ++ fxjs/xfa/cjx_checkbutton.cpp | 49 +++ fxjs/xfa/cjx_checkbutton.h | 27 ++ fxjs/xfa/cjx_choicelist.cpp | 43 +++ fxjs/xfa/cjx_choicelist.h | 26 ++ fxjs/xfa/cjx_color.cpp | 37 ++ fxjs/xfa/cjx_color.h | 25 ++ fxjs/xfa/cjx_comb.cpp | 31 ++ fxjs/xfa/cjx_comb.h | 24 ++ fxjs/xfa/cjx_command.cpp | 31 ++ fxjs/xfa/cjx_command.h | 24 ++ fxjs/xfa/cjx_connect.cpp | 55 +++ fxjs/xfa/cjx_connect.h | 28 ++ fxjs/xfa/cjx_connectstring.cpp | 26 ++ fxjs/xfa/cjx_connectstring.h | 23 ++ fxjs/xfa/cjx_contentarea.cpp | 44 +++ fxjs/xfa/cjx_contentarea.h | 26 ++ fxjs/xfa/cjx_corner.cpp | 61 ++++ fxjs/xfa/cjx_corner.h | 29 ++ fxjs/xfa/cjx_datavalue.cpp | 43 +++ fxjs/xfa/cjx_datavalue.h | 26 ++ fxjs/xfa/cjx_datawindow.cpp | 8 +- fxjs/xfa/cjx_datawindow.h | 16 +- fxjs/xfa/cjx_date.cpp | 37 ++ fxjs/xfa/cjx_date.h | 25 ++ fxjs/xfa/cjx_datetime.cpp | 37 ++ fxjs/xfa/cjx_datetime.h | 25 ++ fxjs/xfa/cjx_datetimeedit.cpp | 31 ++ fxjs/xfa/cjx_datetimeedit.h | 24 ++ fxjs/xfa/cjx_decimal.cpp | 49 +++ fxjs/xfa/cjx_decimal.h | 27 ++ fxjs/xfa/cjx_defaultui.cpp | 25 ++ fxjs/xfa/cjx_defaultui.h | 23 ++ fxjs/xfa/cjx_delete.cpp | 25 ++ fxjs/xfa/cjx_delete.h | 23 ++ fxjs/xfa/cjx_delta.cpp | 12 + fxjs/xfa/cjx_delta.h | 4 + fxjs/xfa/cjx_deltas.cpp | 13 + fxjs/xfa/cjx_deltas.h | 20 ++ fxjs/xfa/cjx_desc.cpp | 12 + fxjs/xfa/cjx_desc.h | 3 + fxjs/xfa/cjx_digestmethod.cpp | 25 ++ fxjs/xfa/cjx_digestmethod.h | 23 ++ fxjs/xfa/cjx_digestmethods.cpp | 32 ++ fxjs/xfa/cjx_digestmethods.h | 24 ++ fxjs/xfa/cjx_draw.cpp | 153 +++++++++ fxjs/xfa/cjx_draw.h | 41 +++ fxjs/xfa/cjx_edge.cpp | 49 +++ fxjs/xfa/cjx_edge.h | 27 ++ fxjs/xfa/cjx_encoding.cpp | 25 ++ fxjs/xfa/cjx_encoding.h | 23 ++ fxjs/xfa/cjx_encodings.cpp | 31 ++ fxjs/xfa/cjx_encodings.h | 24 ++ fxjs/xfa/cjx_encrypt.cpp | 29 ++ fxjs/xfa/cjx_encrypt.h | 24 ++ fxjs/xfa/cjx_event.cpp | 37 ++ fxjs/xfa/cjx_event.h | 25 ++ fxjs/xfa/cjx_eventpseudomodel.cpp | 32 +- fxjs/xfa/cjx_eventpseudomodel.h | 42 +-- fxjs/xfa/cjx_exclgroup.cpp | 182 ++++++++++ fxjs/xfa/cjx_exclgroup.h | 29 ++ fxjs/xfa/cjx_exdata.cpp | 55 +++ fxjs/xfa/cjx_exdata.h | 28 ++ fxjs/xfa/cjx_execute.cpp | 43 +++ fxjs/xfa/cjx_execute.h | 26 ++ fxjs/xfa/cjx_exobject.cpp | 49 +++ fxjs/xfa/cjx_exobject.h | 27 ++ fxjs/xfa/cjx_extras.cpp | 29 ++ fxjs/xfa/cjx_extras.h | 24 ++ fxjs/xfa/cjx_field.cpp | 300 ++++++++++++++++ fxjs/xfa/cjx_field.h | 35 ++ fxjs/xfa/cjx_fill.cpp | 31 ++ fxjs/xfa/cjx_fill.h | 24 ++ fxjs/xfa/cjx_filter.cpp | 31 ++ fxjs/xfa/cjx_filter.h | 24 ++ fxjs/xfa/cjx_float.cpp | 37 ++ fxjs/xfa/cjx_float.h | 25 ++ fxjs/xfa/cjx_font.cpp | 115 +++++++ fxjs/xfa/cjx_font.h | 38 ++ fxjs/xfa/cjx_format.cpp | 25 ++ fxjs/xfa/cjx_format.h | 23 ++ fxjs/xfa/cjx_handler.cpp | 35 ++ fxjs/xfa/cjx_handler.h | 25 ++ fxjs/xfa/cjx_hostpseudomodel.cpp | 22 +- fxjs/xfa/cjx_hostpseudomodel.h | 33 +- fxjs/xfa/cjx_image.cpp | 61 ++++ fxjs/xfa/cjx_image.h | 29 ++ fxjs/xfa/cjx_imageedit.cpp | 31 ++ fxjs/xfa/cjx_imageedit.h | 24 ++ fxjs/xfa/cjx_insert.cpp | 25 ++ fxjs/xfa/cjx_insert.h | 23 ++ fxjs/xfa/cjx_instancemanager.cpp | 119 ++++++- fxjs/xfa/cjx_instancemanager.h | 8 + fxjs/xfa/cjx_integer.cpp | 37 ++ fxjs/xfa/cjx_integer.h | 25 ++ fxjs/xfa/cjx_issuers.cpp | 31 ++ fxjs/xfa/cjx_issuers.h | 24 ++ fxjs/xfa/cjx_items.cpp | 43 +++ fxjs/xfa/cjx_items.h | 26 ++ fxjs/xfa/cjx_keep.cpp | 43 +++ fxjs/xfa/cjx_keep.h | 26 ++ fxjs/xfa/cjx_keyusage.cpp | 85 +++++ fxjs/xfa/cjx_keyusage.h | 33 ++ fxjs/xfa/cjx_layoutpseudomodel.cpp | 2 +- fxjs/xfa/cjx_layoutpseudomodel.h | 4 +- fxjs/xfa/cjx_line.cpp | 37 ++ fxjs/xfa/cjx_line.h | 25 ++ fxjs/xfa/cjx_linear.cpp | 31 ++ fxjs/xfa/cjx_linear.h | 24 ++ fxjs/xfa/cjx_list.h | 2 +- fxjs/xfa/cjx_logpseudomodel.h | 2 + fxjs/xfa/cjx_manifest.cpp | 24 ++ fxjs/xfa/cjx_manifest.h | 5 + fxjs/xfa/cjx_map.cpp | 37 ++ fxjs/xfa/cjx_map.h | 25 ++ fxjs/xfa/cjx_margin.cpp | 49 +++ fxjs/xfa/cjx_margin.h | 27 ++ fxjs/xfa/cjx_mdp.cpp | 37 ++ fxjs/xfa/cjx_mdp.h | 25 ++ fxjs/xfa/cjx_medium.cpp | 55 +++ fxjs/xfa/cjx_medium.h | 28 ++ fxjs/xfa/cjx_message.cpp | 25 ++ fxjs/xfa/cjx_message.h | 23 ++ fxjs/xfa/cjx_model.cpp | 8 + fxjs/xfa/cjx_model.h | 3 + fxjs/xfa/cjx_node.cpp | 68 ++++ fxjs/xfa/cjx_node.h | 13 +- fxjs/xfa/cjx_numericedit.cpp | 31 ++ fxjs/xfa/cjx_numericedit.h | 24 ++ fxjs/xfa/cjx_object.cpp | 650 +++++------------------------------ fxjs/xfa/cjx_object.h | 152 ++------ fxjs/xfa/cjx_occur.cpp | 57 +++ fxjs/xfa/cjx_occur.h | 26 ++ fxjs/xfa/cjx_oid.cpp | 25 ++ fxjs/xfa/cjx_oid.h | 23 ++ fxjs/xfa/cjx_oids.cpp | 31 ++ fxjs/xfa/cjx_oids.h | 24 ++ fxjs/xfa/cjx_operation.cpp | 37 ++ fxjs/xfa/cjx_operation.h | 25 ++ fxjs/xfa/cjx_overflow.cpp | 43 +++ fxjs/xfa/cjx_overflow.h | 26 ++ fxjs/xfa/cjx_packet.cpp | 21 ++ fxjs/xfa/cjx_packet.h | 2 + fxjs/xfa/cjx_pagearea.cpp | 61 ++++ fxjs/xfa/cjx_pagearea.h | 29 ++ fxjs/xfa/cjx_pageset.cpp | 37 ++ fxjs/xfa/cjx_pageset.h | 25 ++ fxjs/xfa/cjx_para.cpp | 97 ++++++ fxjs/xfa/cjx_para.h | 35 ++ fxjs/xfa/cjx_password.cpp | 25 ++ fxjs/xfa/cjx_password.h | 23 ++ fxjs/xfa/cjx_passwordedit.cpp | 37 ++ fxjs/xfa/cjx_passwordedit.h | 25 ++ fxjs/xfa/cjx_pattern.cpp | 31 ++ fxjs/xfa/cjx_pattern.h | 24 ++ fxjs/xfa/cjx_picture.cpp | 37 ++ fxjs/xfa/cjx_picture.h | 25 ++ fxjs/xfa/cjx_query.cpp | 31 ++ fxjs/xfa/cjx_query.h | 24 ++ fxjs/xfa/cjx_radial.cpp | 31 ++ fxjs/xfa/cjx_radial.h | 24 ++ fxjs/xfa/cjx_reason.cpp | 25 ++ fxjs/xfa/cjx_reason.h | 23 ++ fxjs/xfa/cjx_reasons.cpp | 31 ++ fxjs/xfa/cjx_reasons.h | 24 ++ fxjs/xfa/cjx_recordset.cpp | 63 ++++ fxjs/xfa/cjx_recordset.h | 29 ++ fxjs/xfa/cjx_rectangle.cpp | 31 ++ fxjs/xfa/cjx_rectangle.h | 24 ++ fxjs/xfa/cjx_ref.cpp | 25 ++ fxjs/xfa/cjx_ref.h | 23 ++ fxjs/xfa/cjx_rootelement.cpp | 25 ++ fxjs/xfa/cjx_rootelement.h | 23 ++ fxjs/xfa/cjx_script.cpp | 66 ++++ fxjs/xfa/cjx_script.h | 29 ++ fxjs/xfa/cjx_select.cpp | 25 ++ fxjs/xfa/cjx_select.h | 23 ++ fxjs/xfa/cjx_setproperty.cpp | 25 ++ fxjs/xfa/cjx_setproperty.h | 23 ++ fxjs/xfa/cjx_signature.cpp | 25 ++ fxjs/xfa/cjx_signature.h | 23 ++ fxjs/xfa/cjx_signatureproperties.cpp | 26 ++ fxjs/xfa/cjx_signatureproperties.h | 24 ++ fxjs/xfa/cjx_signdata.cpp | 43 +++ fxjs/xfa/cjx_signdata.h | 26 ++ fxjs/xfa/cjx_signing.cpp | 31 ++ fxjs/xfa/cjx_signing.h | 24 ++ fxjs/xfa/cjx_soapaction.cpp | 25 ++ fxjs/xfa/cjx_soapaction.h | 23 ++ fxjs/xfa/cjx_soapaddress.cpp | 25 ++ fxjs/xfa/cjx_soapaddress.h | 23 ++ fxjs/xfa/cjx_solid.cpp | 25 ++ fxjs/xfa/cjx_solid.h | 23 ++ fxjs/xfa/cjx_source.cpp | 16 + fxjs/xfa/cjx_source.h | 4 + fxjs/xfa/cjx_sourceset.cpp | 25 ++ fxjs/xfa/cjx_sourceset.h | 23 ++ fxjs/xfa/cjx_speak.cpp | 37 ++ fxjs/xfa/cjx_speak.h | 25 ++ fxjs/xfa/cjx_stipple.cpp | 31 ++ fxjs/xfa/cjx_stipple.h | 24 ++ fxjs/xfa/cjx_subform.cpp | 151 ++++++++ fxjs/xfa/cjx_subform.h | 25 ++ fxjs/xfa/cjx_subformset.cpp | 43 +++ fxjs/xfa/cjx_subformset.h | 26 ++ fxjs/xfa/cjx_subjectdn.cpp | 19 + fxjs/xfa/cjx_subjectdn.h | 22 ++ fxjs/xfa/cjx_subjectdns.cpp | 19 + fxjs/xfa/cjx_subjectdns.h | 22 ++ fxjs/xfa/cjx_submit.cpp | 55 +++ fxjs/xfa/cjx_submit.h | 28 ++ fxjs/xfa/cjx_text.cpp | 43 +++ fxjs/xfa/cjx_text.h | 26 ++ fxjs/xfa/cjx_textedit.cpp | 49 +++ fxjs/xfa/cjx_textedit.h | 27 ++ fxjs/xfa/cjx_textnode.cpp | 12 + fxjs/xfa/cjx_textnode.h | 3 + fxjs/xfa/cjx_time.cpp | 37 ++ fxjs/xfa/cjx_time.h | 25 ++ fxjs/xfa/cjx_timestamp.cpp | 37 ++ fxjs/xfa/cjx_timestamp.h | 25 ++ fxjs/xfa/cjx_tooltip.cpp | 25 ++ fxjs/xfa/cjx_tooltip.h | 23 ++ fxjs/xfa/cjx_traversal.cpp | 25 ++ fxjs/xfa/cjx_traversal.h | 23 ++ fxjs/xfa/cjx_traverse.cpp | 37 ++ fxjs/xfa/cjx_traverse.h | 25 ++ fxjs/xfa/cjx_tree.cpp | 6 + fxjs/xfa/cjx_tree.h | 19 +- fxjs/xfa/cjx_ui.cpp | 25 ++ fxjs/xfa/cjx_ui.h | 23 ++ fxjs/xfa/cjx_update.cpp | 25 ++ fxjs/xfa/cjx_update.h | 23 ++ fxjs/xfa/cjx_uri.cpp | 25 ++ fxjs/xfa/cjx_uri.h | 23 ++ fxjs/xfa/cjx_user.cpp | 25 ++ fxjs/xfa/cjx_user.h | 23 ++ fxjs/xfa/cjx_validate.cpp | 43 +++ fxjs/xfa/cjx_validate.h | 26 ++ fxjs/xfa/cjx_value.cpp | 37 ++ fxjs/xfa/cjx_value.h | 25 ++ fxjs/xfa/cjx_variables.cpp | 25 ++ fxjs/xfa/cjx_variables.h | 23 ++ fxjs/xfa/cjx_wsdladdress.cpp | 25 ++ fxjs/xfa/cjx_wsdladdress.h | 23 ++ fxjs/xfa/cjx_wsdlconnection.cpp | 12 + fxjs/xfa/cjx_wsdlconnection.h | 3 + fxjs/xfa/cjx_xfa.cpp | 39 +++ fxjs/xfa/cjx_xfa.h | 24 ++ fxjs/xfa/cjx_xmlconnection.cpp | 20 ++ fxjs/xfa/cjx_xmlconnection.h | 22 ++ fxjs/xfa/cjx_xsdconnection.cpp | 20 ++ fxjs/xfa/cjx_xsdconnection.h | 22 ++ 286 files changed, 9245 insertions(+), 800 deletions(-) create mode 100644 fxjs/xfa/cjx_arc.cpp create mode 100644 fxjs/xfa/cjx_arc.h create mode 100644 fxjs/xfa/cjx_area.cpp create mode 100644 fxjs/xfa/cjx_area.h create mode 100644 fxjs/xfa/cjx_assist.cpp create mode 100644 fxjs/xfa/cjx_assist.h create mode 100644 fxjs/xfa/cjx_barcode.cpp create mode 100644 fxjs/xfa/cjx_barcode.h create mode 100644 fxjs/xfa/cjx_bind.cpp create mode 100644 fxjs/xfa/cjx_bind.h create mode 100644 fxjs/xfa/cjx_binditems.cpp create mode 100644 fxjs/xfa/cjx_binditems.h create mode 100644 fxjs/xfa/cjx_bookend.cpp create mode 100644 fxjs/xfa/cjx_bookend.h create mode 100644 fxjs/xfa/cjx_boolean.cpp create mode 100644 fxjs/xfa/cjx_boolean.h create mode 100644 fxjs/xfa/cjx_border.cpp create mode 100644 fxjs/xfa/cjx_border.h create mode 100644 fxjs/xfa/cjx_break.cpp create mode 100644 fxjs/xfa/cjx_break.h create mode 100644 fxjs/xfa/cjx_breakafter.cpp create mode 100644 fxjs/xfa/cjx_breakafter.h create mode 100644 fxjs/xfa/cjx_breakbefore.cpp create mode 100644 fxjs/xfa/cjx_breakbefore.h create mode 100644 fxjs/xfa/cjx_button.cpp create mode 100644 fxjs/xfa/cjx_button.h create mode 100644 fxjs/xfa/cjx_calculate.cpp create mode 100644 fxjs/xfa/cjx_calculate.h create mode 100644 fxjs/xfa/cjx_caption.cpp create mode 100644 fxjs/xfa/cjx_caption.h create mode 100644 fxjs/xfa/cjx_certificate.cpp create mode 100644 fxjs/xfa/cjx_certificate.h create mode 100644 fxjs/xfa/cjx_certificates.cpp create mode 100644 fxjs/xfa/cjx_certificates.h create mode 100644 fxjs/xfa/cjx_checkbutton.cpp create mode 100644 fxjs/xfa/cjx_checkbutton.h create mode 100644 fxjs/xfa/cjx_choicelist.cpp create mode 100644 fxjs/xfa/cjx_choicelist.h create mode 100644 fxjs/xfa/cjx_color.cpp create mode 100644 fxjs/xfa/cjx_color.h create mode 100644 fxjs/xfa/cjx_comb.cpp create mode 100644 fxjs/xfa/cjx_comb.h create mode 100644 fxjs/xfa/cjx_command.cpp create mode 100644 fxjs/xfa/cjx_command.h create mode 100644 fxjs/xfa/cjx_connect.cpp create mode 100644 fxjs/xfa/cjx_connect.h create mode 100644 fxjs/xfa/cjx_connectstring.cpp create mode 100644 fxjs/xfa/cjx_connectstring.h create mode 100644 fxjs/xfa/cjx_contentarea.cpp create mode 100644 fxjs/xfa/cjx_contentarea.h create mode 100644 fxjs/xfa/cjx_corner.cpp create mode 100644 fxjs/xfa/cjx_corner.h create mode 100644 fxjs/xfa/cjx_datavalue.cpp create mode 100644 fxjs/xfa/cjx_datavalue.h create mode 100644 fxjs/xfa/cjx_date.cpp create mode 100644 fxjs/xfa/cjx_date.h create mode 100644 fxjs/xfa/cjx_datetime.cpp create mode 100644 fxjs/xfa/cjx_datetime.h create mode 100644 fxjs/xfa/cjx_datetimeedit.cpp create mode 100644 fxjs/xfa/cjx_datetimeedit.h create mode 100644 fxjs/xfa/cjx_decimal.cpp create mode 100644 fxjs/xfa/cjx_decimal.h create mode 100644 fxjs/xfa/cjx_defaultui.cpp create mode 100644 fxjs/xfa/cjx_defaultui.h create mode 100644 fxjs/xfa/cjx_delete.cpp create mode 100644 fxjs/xfa/cjx_delete.h create mode 100644 fxjs/xfa/cjx_deltas.cpp create mode 100644 fxjs/xfa/cjx_deltas.h create mode 100644 fxjs/xfa/cjx_digestmethod.cpp create mode 100644 fxjs/xfa/cjx_digestmethod.h create mode 100644 fxjs/xfa/cjx_digestmethods.cpp create mode 100644 fxjs/xfa/cjx_digestmethods.h create mode 100644 fxjs/xfa/cjx_draw.cpp create mode 100644 fxjs/xfa/cjx_draw.h create mode 100644 fxjs/xfa/cjx_edge.cpp create mode 100644 fxjs/xfa/cjx_edge.h create mode 100644 fxjs/xfa/cjx_encoding.cpp create mode 100644 fxjs/xfa/cjx_encoding.h create mode 100644 fxjs/xfa/cjx_encodings.cpp create mode 100644 fxjs/xfa/cjx_encodings.h create mode 100644 fxjs/xfa/cjx_encrypt.cpp create mode 100644 fxjs/xfa/cjx_encrypt.h create mode 100644 fxjs/xfa/cjx_event.cpp create mode 100644 fxjs/xfa/cjx_event.h create mode 100644 fxjs/xfa/cjx_exdata.cpp create mode 100644 fxjs/xfa/cjx_exdata.h create mode 100644 fxjs/xfa/cjx_execute.cpp create mode 100644 fxjs/xfa/cjx_execute.h create mode 100644 fxjs/xfa/cjx_exobject.cpp create mode 100644 fxjs/xfa/cjx_exobject.h create mode 100644 fxjs/xfa/cjx_extras.cpp create mode 100644 fxjs/xfa/cjx_extras.h create mode 100644 fxjs/xfa/cjx_fill.cpp create mode 100644 fxjs/xfa/cjx_fill.h create mode 100644 fxjs/xfa/cjx_filter.cpp create mode 100644 fxjs/xfa/cjx_filter.h create mode 100644 fxjs/xfa/cjx_float.cpp create mode 100644 fxjs/xfa/cjx_float.h create mode 100644 fxjs/xfa/cjx_font.cpp create mode 100644 fxjs/xfa/cjx_font.h create mode 100644 fxjs/xfa/cjx_format.cpp create mode 100644 fxjs/xfa/cjx_format.h create mode 100644 fxjs/xfa/cjx_handler.cpp create mode 100644 fxjs/xfa/cjx_handler.h create mode 100644 fxjs/xfa/cjx_image.cpp create mode 100644 fxjs/xfa/cjx_image.h create mode 100644 fxjs/xfa/cjx_imageedit.cpp create mode 100644 fxjs/xfa/cjx_imageedit.h create mode 100644 fxjs/xfa/cjx_insert.cpp create mode 100644 fxjs/xfa/cjx_insert.h create mode 100644 fxjs/xfa/cjx_integer.cpp create mode 100644 fxjs/xfa/cjx_integer.h create mode 100644 fxjs/xfa/cjx_issuers.cpp create mode 100644 fxjs/xfa/cjx_issuers.h create mode 100644 fxjs/xfa/cjx_items.cpp create mode 100644 fxjs/xfa/cjx_items.h create mode 100644 fxjs/xfa/cjx_keep.cpp create mode 100644 fxjs/xfa/cjx_keep.h create mode 100644 fxjs/xfa/cjx_keyusage.cpp create mode 100644 fxjs/xfa/cjx_keyusage.h create mode 100644 fxjs/xfa/cjx_line.cpp create mode 100644 fxjs/xfa/cjx_line.h create mode 100644 fxjs/xfa/cjx_linear.cpp create mode 100644 fxjs/xfa/cjx_linear.h create mode 100644 fxjs/xfa/cjx_map.cpp create mode 100644 fxjs/xfa/cjx_map.h create mode 100644 fxjs/xfa/cjx_margin.cpp create mode 100644 fxjs/xfa/cjx_margin.h create mode 100644 fxjs/xfa/cjx_mdp.cpp create mode 100644 fxjs/xfa/cjx_mdp.h create mode 100644 fxjs/xfa/cjx_medium.cpp create mode 100644 fxjs/xfa/cjx_medium.h create mode 100644 fxjs/xfa/cjx_message.cpp create mode 100644 fxjs/xfa/cjx_message.h create mode 100644 fxjs/xfa/cjx_numericedit.cpp create mode 100644 fxjs/xfa/cjx_numericedit.h create mode 100644 fxjs/xfa/cjx_occur.cpp create mode 100644 fxjs/xfa/cjx_occur.h create mode 100644 fxjs/xfa/cjx_oid.cpp create mode 100644 fxjs/xfa/cjx_oid.h create mode 100644 fxjs/xfa/cjx_oids.cpp create mode 100644 fxjs/xfa/cjx_oids.h create mode 100644 fxjs/xfa/cjx_operation.cpp create mode 100644 fxjs/xfa/cjx_operation.h create mode 100644 fxjs/xfa/cjx_overflow.cpp create mode 100644 fxjs/xfa/cjx_overflow.h create mode 100644 fxjs/xfa/cjx_pagearea.cpp create mode 100644 fxjs/xfa/cjx_pagearea.h create mode 100644 fxjs/xfa/cjx_pageset.cpp create mode 100644 fxjs/xfa/cjx_pageset.h create mode 100644 fxjs/xfa/cjx_para.cpp create mode 100644 fxjs/xfa/cjx_para.h create mode 100644 fxjs/xfa/cjx_password.cpp create mode 100644 fxjs/xfa/cjx_password.h create mode 100644 fxjs/xfa/cjx_passwordedit.cpp create mode 100644 fxjs/xfa/cjx_passwordedit.h create mode 100644 fxjs/xfa/cjx_pattern.cpp create mode 100644 fxjs/xfa/cjx_pattern.h create mode 100644 fxjs/xfa/cjx_picture.cpp create mode 100644 fxjs/xfa/cjx_picture.h create mode 100644 fxjs/xfa/cjx_query.cpp create mode 100644 fxjs/xfa/cjx_query.h create mode 100644 fxjs/xfa/cjx_radial.cpp create mode 100644 fxjs/xfa/cjx_radial.h create mode 100644 fxjs/xfa/cjx_reason.cpp create mode 100644 fxjs/xfa/cjx_reason.h create mode 100644 fxjs/xfa/cjx_reasons.cpp create mode 100644 fxjs/xfa/cjx_reasons.h create mode 100644 fxjs/xfa/cjx_recordset.cpp create mode 100644 fxjs/xfa/cjx_recordset.h create mode 100644 fxjs/xfa/cjx_rectangle.cpp create mode 100644 fxjs/xfa/cjx_rectangle.h create mode 100644 fxjs/xfa/cjx_ref.cpp create mode 100644 fxjs/xfa/cjx_ref.h create mode 100644 fxjs/xfa/cjx_rootelement.cpp create mode 100644 fxjs/xfa/cjx_rootelement.h create mode 100644 fxjs/xfa/cjx_script.cpp create mode 100644 fxjs/xfa/cjx_script.h create mode 100644 fxjs/xfa/cjx_select.cpp create mode 100644 fxjs/xfa/cjx_select.h create mode 100644 fxjs/xfa/cjx_setproperty.cpp create mode 100644 fxjs/xfa/cjx_setproperty.h create mode 100644 fxjs/xfa/cjx_signature.cpp create mode 100644 fxjs/xfa/cjx_signature.h create mode 100644 fxjs/xfa/cjx_signatureproperties.cpp create mode 100644 fxjs/xfa/cjx_signatureproperties.h create mode 100644 fxjs/xfa/cjx_signdata.cpp create mode 100644 fxjs/xfa/cjx_signdata.h create mode 100644 fxjs/xfa/cjx_signing.cpp create mode 100644 fxjs/xfa/cjx_signing.h create mode 100644 fxjs/xfa/cjx_soapaction.cpp create mode 100644 fxjs/xfa/cjx_soapaction.h create mode 100644 fxjs/xfa/cjx_soapaddress.cpp create mode 100644 fxjs/xfa/cjx_soapaddress.h create mode 100644 fxjs/xfa/cjx_solid.cpp create mode 100644 fxjs/xfa/cjx_solid.h create mode 100644 fxjs/xfa/cjx_sourceset.cpp create mode 100644 fxjs/xfa/cjx_sourceset.h create mode 100644 fxjs/xfa/cjx_speak.cpp create mode 100644 fxjs/xfa/cjx_speak.h create mode 100644 fxjs/xfa/cjx_stipple.cpp create mode 100644 fxjs/xfa/cjx_stipple.h create mode 100644 fxjs/xfa/cjx_subformset.cpp create mode 100644 fxjs/xfa/cjx_subformset.h create mode 100644 fxjs/xfa/cjx_subjectdn.cpp create mode 100644 fxjs/xfa/cjx_subjectdn.h create mode 100644 fxjs/xfa/cjx_subjectdns.cpp create mode 100644 fxjs/xfa/cjx_subjectdns.h create mode 100644 fxjs/xfa/cjx_submit.cpp create mode 100644 fxjs/xfa/cjx_submit.h create mode 100644 fxjs/xfa/cjx_text.cpp create mode 100644 fxjs/xfa/cjx_text.h create mode 100644 fxjs/xfa/cjx_textedit.cpp create mode 100644 fxjs/xfa/cjx_textedit.h create mode 100644 fxjs/xfa/cjx_time.cpp create mode 100644 fxjs/xfa/cjx_time.h create mode 100644 fxjs/xfa/cjx_timestamp.cpp create mode 100644 fxjs/xfa/cjx_timestamp.h create mode 100644 fxjs/xfa/cjx_tooltip.cpp create mode 100644 fxjs/xfa/cjx_tooltip.h create mode 100644 fxjs/xfa/cjx_traversal.cpp create mode 100644 fxjs/xfa/cjx_traversal.h create mode 100644 fxjs/xfa/cjx_traverse.cpp create mode 100644 fxjs/xfa/cjx_traverse.h create mode 100644 fxjs/xfa/cjx_ui.cpp create mode 100644 fxjs/xfa/cjx_ui.h create mode 100644 fxjs/xfa/cjx_update.cpp create mode 100644 fxjs/xfa/cjx_update.h create mode 100644 fxjs/xfa/cjx_uri.cpp create mode 100644 fxjs/xfa/cjx_uri.h create mode 100644 fxjs/xfa/cjx_user.cpp create mode 100644 fxjs/xfa/cjx_user.h create mode 100644 fxjs/xfa/cjx_validate.cpp create mode 100644 fxjs/xfa/cjx_validate.h create mode 100644 fxjs/xfa/cjx_value.cpp create mode 100644 fxjs/xfa/cjx_value.h create mode 100644 fxjs/xfa/cjx_variables.cpp create mode 100644 fxjs/xfa/cjx_variables.h create mode 100644 fxjs/xfa/cjx_wsdladdress.cpp create mode 100644 fxjs/xfa/cjx_wsdladdress.h create mode 100644 fxjs/xfa/cjx_xfa.cpp create mode 100644 fxjs/xfa/cjx_xfa.h create mode 100644 fxjs/xfa/cjx_xmlconnection.cpp create mode 100644 fxjs/xfa/cjx_xmlconnection.h create mode 100644 fxjs/xfa/cjx_xsdconnection.cpp create mode 100644 fxjs/xfa/cjx_xsdconnection.h (limited to 'fxjs/xfa') diff --git a/fxjs/xfa/cjx_arc.cpp b/fxjs/xfa/cjx_arc.cpp new file mode 100644 index 0000000000..92b626dff7 --- /dev/null +++ b/fxjs/xfa/cjx_arc.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_arc.h" + +#include "xfa/fxfa/parser/cxfa_arc.h" + +CJX_Arc::CJX_Arc(CXFA_Arc* node) : CJX_Node(node) {} + +CJX_Arc::~CJX_Arc() = default; + +void CJX_Arc::circular(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Arc::hand(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Arc::startAngle(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Arc::sweepAngle(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Arc::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Arc::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_arc.h b/fxjs/xfa/cjx_arc.h new file mode 100644 index 0000000000..a9a6bb6733 --- /dev/null +++ b/fxjs/xfa/cjx_arc.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ARC_H_ +#define FXJS_XFA_CJX_ARC_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Arc; + +class CJX_Arc : public CJX_Node { + public: + explicit CJX_Arc(CXFA_Arc* node); + ~CJX_Arc() override; + + JS_PROP(circular); + JS_PROP(hand); + JS_PROP(startAngle); + JS_PROP(sweepAngle); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ARC_H_ diff --git a/fxjs/xfa/cjx_area.cpp b/fxjs/xfa/cjx_area.cpp new file mode 100644 index 0000000000..ee621943b6 --- /dev/null +++ b/fxjs/xfa/cjx_area.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_area.h" + +#include "xfa/fxfa/parser/cxfa_area.h" + +CJX_Area::CJX_Area(CXFA_Area* node) : CJX_Container(node) {} + +CJX_Area::~CJX_Area() = default; + +void CJX_Area::colSpan(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Area::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Area::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Area::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Area::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Area::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_area.h b/fxjs/xfa/cjx_area.h new file mode 100644 index 0000000000..94083b351a --- /dev/null +++ b/fxjs/xfa/cjx_area.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_AREA_H_ +#define FXJS_XFA_CJX_AREA_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_Area; + +class CJX_Area : public CJX_Container { + public: + explicit CJX_Area(CXFA_Area* node); + ~CJX_Area() override; + + JS_PROP(colSpan); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(x); + JS_PROP(y); +}; + +#endif // FXJS_XFA_CJX_AREA_H_ diff --git a/fxjs/xfa/cjx_assist.cpp b/fxjs/xfa/cjx_assist.cpp new file mode 100644 index 0000000000..fcd7f37d08 --- /dev/null +++ b/fxjs/xfa/cjx_assist.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_assist.h" + +#include "xfa/fxfa/parser/cxfa_assist.h" + +CJX_Assist::CJX_Assist(CXFA_Assist* node) : CJX_Node(node) {} + +CJX_Assist::~CJX_Assist() = default; + +void CJX_Assist::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Assist::role(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Assist::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_assist.h b/fxjs/xfa/cjx_assist.h new file mode 100644 index 0000000000..9e7c9c55e3 --- /dev/null +++ b/fxjs/xfa/cjx_assist.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ASSIST_H_ +#define FXJS_XFA_CJX_ASSIST_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Assist; + +class CJX_Assist : public CJX_Node { + public: + explicit CJX_Assist(CXFA_Assist* node); + ~CJX_Assist() override; + + JS_PROP(role); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ASSIST_H_ diff --git a/fxjs/xfa/cjx_barcode.cpp b/fxjs/xfa/cjx_barcode.cpp new file mode 100644 index 0000000000..7520cc3571 --- /dev/null +++ b/fxjs/xfa/cjx_barcode.cpp @@ -0,0 +1,133 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_barcode.h" + +#include "xfa/fxfa/parser/cxfa_barcode.h" + +CJX_Barcode::CJX_Barcode(CXFA_Barcode* node) : CJX_Node(node) {} + +CJX_Barcode::~CJX_Barcode() = default; + +void CJX_Barcode::charEncoding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::checksum(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::dataColumnCount(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::dataLength(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::dataPrep(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::dataRowCount(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::endChar(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::errorCorrectionLevel(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::moduleHeight(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::moduleWidth(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::printCheckDigit(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::rowColumnRatio(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::startChar(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::textLocation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::truncate(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::upsMode(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Barcode::wideNarrowRatio(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_barcode.h b/fxjs/xfa/cjx_barcode.h new file mode 100644 index 0000000000..f5d88816bd --- /dev/null +++ b/fxjs/xfa/cjx_barcode.h @@ -0,0 +1,41 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BARCODE_H_ +#define FXJS_XFA_CJX_BARCODE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Barcode; + +class CJX_Barcode : public CJX_Node { + public: + explicit CJX_Barcode(CXFA_Barcode* arc); + ~CJX_Barcode() override; + + JS_PROP(charEncoding); + JS_PROP(checksum); + JS_PROP(dataColumnCount); + JS_PROP(dataLength); + JS_PROP(dataPrep); + JS_PROP(dataRowCount); + JS_PROP(endChar); + JS_PROP(errorCorrectionLevel); + JS_PROP(moduleHeight); + JS_PROP(moduleWidth); + JS_PROP(printCheckDigit); + JS_PROP(rowColumnRatio); + JS_PROP(startChar); + JS_PROP(textLocation); + JS_PROP(truncate); + JS_PROP(type); + JS_PROP(upsMode); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(wideNarrowRatio); +}; + +#endif // FXJS_XFA_CJX_BARCODE_H_ diff --git a/fxjs/xfa/cjx_bind.cpp b/fxjs/xfa/cjx_bind.cpp new file mode 100644 index 0000000000..a73312dfd1 --- /dev/null +++ b/fxjs/xfa/cjx_bind.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_bind.h" + +#include "xfa/fxfa/parser/cxfa_bind.h" + +CJX_Bind::CJX_Bind(CXFA_Bind* node) : CJX_Node(node) {} + +CJX_Bind::~CJX_Bind() = default; + +void CJX_Bind::contentType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bind::match(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bind::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bind::transferEncoding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bind::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bind::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_bind.h b/fxjs/xfa/cjx_bind.h new file mode 100644 index 0000000000..9fc8ab8071 --- /dev/null +++ b/fxjs/xfa/cjx_bind.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BIND_H_ +#define FXJS_XFA_CJX_BIND_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Bind; + +class CJX_Bind : public CJX_Node { + public: + explicit CJX_Bind(CXFA_Bind* node); + ~CJX_Bind() override; + + JS_PROP(contentType); + JS_PROP(match); + JS_PROP(ref); + JS_PROP(transferEncoding); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BIND_H_ diff --git a/fxjs/xfa/cjx_binditems.cpp b/fxjs/xfa/cjx_binditems.cpp new file mode 100644 index 0000000000..dd1f30d814 --- /dev/null +++ b/fxjs/xfa/cjx_binditems.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_binditems.h" + +#include "xfa/fxfa/parser/cxfa_binditems.h" + +CJX_BindItems::CJX_BindItems(CXFA_BindItems* node) : CJX_Node(node) {} + +CJX_BindItems::~CJX_BindItems() = default; + +void CJX_BindItems::connection(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BindItems::labelRef(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BindItems::valueRef(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_binditems.h b/fxjs/xfa/cjx_binditems.h new file mode 100644 index 0000000000..e47b3faea5 --- /dev/null +++ b/fxjs/xfa/cjx_binditems.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BINDITEMS_H_ +#define FXJS_XFA_CJX_BINDITEMS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_BindItems; + +class CJX_BindItems : public CJX_Node { + public: + explicit CJX_BindItems(CXFA_BindItems* node); + ~CJX_BindItems() override; + + JS_PROP(connection); + JS_PROP(labelRef); + JS_PROP(valueRef); +}; + +#endif // FXJS_XFA_CJX_BINDITEMS_H_ diff --git a/fxjs/xfa/cjx_bookend.cpp b/fxjs/xfa/cjx_bookend.cpp new file mode 100644 index 0000000000..2399e26f58 --- /dev/null +++ b/fxjs/xfa/cjx_bookend.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_bookend.h" + +#include "xfa/fxfa/parser/cxfa_bookend.h" + +CJX_Bookend::CJX_Bookend(CXFA_Bookend* node) : CJX_Node(node) {} + +CJX_Bookend::~CJX_Bookend() = default; + +void CJX_Bookend::leader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bookend::trailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bookend::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Bookend::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_bookend.h b/fxjs/xfa/cjx_bookend.h new file mode 100644 index 0000000000..0165091f06 --- /dev/null +++ b/fxjs/xfa/cjx_bookend.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BOOKEND_H_ +#define FXJS_XFA_CJX_BOOKEND_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Bookend; + +class CJX_Bookend : public CJX_Node { + public: + explicit CJX_Bookend(CXFA_Bookend* node); + ~CJX_Bookend() override; + + JS_PROP(leader); + JS_PROP(trailer); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BOOKEND_H_ diff --git a/fxjs/xfa/cjx_boolean.cpp b/fxjs/xfa/cjx_boolean.cpp new file mode 100644 index 0000000000..f5af9547a7 --- /dev/null +++ b/fxjs/xfa/cjx_boolean.cpp @@ -0,0 +1,56 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_boolean.h" + +#include "fxjs/cfxjse_value.h" +#include "xfa/fxfa/parser/cxfa_boolean.h" + +CJX_Boolean::CJX_Boolean(CXFA_Boolean* node) : CJX_Content(node) {} + +CJX_Boolean::~CJX_Boolean() = default; + +void CJX_Boolean::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Boolean::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (!bSetting) { + WideString wsValue = GetContent(true); + pValue->SetBoolean(wsValue == L"1"); + return; + } + + ByteString newValue; + if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) + newValue = pValue->ToString(); + + int32_t iValue = FXSYS_atoi(newValue.c_str()); + WideString wsNewValue(iValue == 0 ? L"0" : L"1"); + WideString wsFormatValue(wsNewValue); + CXFA_WidgetData* pContainerWidgetData = + ToNode(GetXFAObject())->GetContainerWidgetData(); + if (pContainerWidgetData) + wsFormatValue = pContainerWidgetData->GetFormatDataValue(wsNewValue); + + SetContent(wsNewValue, wsFormatValue, true, true, true); +} + +void CJX_Boolean::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Boolean::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_boolean.h b/fxjs/xfa/cjx_boolean.h new file mode 100644 index 0000000000..c90291aa8a --- /dev/null +++ b/fxjs/xfa/cjx_boolean.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BOOLEAN_H_ +#define FXJS_XFA_CJX_BOOLEAN_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Boolean; + +class CJX_Boolean : public CJX_Content { + public: + explicit CJX_Boolean(CXFA_Boolean* node); + ~CJX_Boolean() override; + + JS_PROP(use); + JS_PROP(defaultValue); /* {default} */ + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_BOOLEAN_H_ diff --git a/fxjs/xfa/cjx_border.cpp b/fxjs/xfa/cjx_border.cpp new file mode 100644 index 0000000000..92355a85c1 --- /dev/null +++ b/fxjs/xfa/cjx_border.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_border.h" + +#include "xfa/fxfa/parser/cxfa_border.h" + +CJX_Border::CJX_Border(CXFA_Border* node) : CJX_Node(node) {} + +CJX_Border::~CJX_Border() = default; + +void CJX_Border::breakValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Border::hand(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Border::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Border::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Border::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Border::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_border.h b/fxjs/xfa/cjx_border.h new file mode 100644 index 0000000000..b95ca4c311 --- /dev/null +++ b/fxjs/xfa/cjx_border.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BORDER_H_ +#define FXJS_XFA_CJX_BORDER_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Border; + +class CJX_Border : public CJX_Node { + public: + explicit CJX_Border(CXFA_Border* node); + ~CJX_Border() override; + + JS_PROP(breakValue); /* break */ + JS_PROP(hand); + JS_PROP(presence); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BORDER_H_ diff --git a/fxjs/xfa/cjx_break.cpp b/fxjs/xfa/cjx_break.cpp new file mode 100644 index 0000000000..d04a05f189 --- /dev/null +++ b/fxjs/xfa/cjx_break.cpp @@ -0,0 +1,85 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_break.h" + +#include "xfa/fxfa/parser/cxfa_break.h" + +CJX_Break::CJX_Break(CXFA_Break* node) : CJX_Node(node) {} + +CJX_Break::~CJX_Break() = default; + +void CJX_Break::after(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::afterTarget(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::before(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::beforeTarget(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::bookendLeader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::bookendTrailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::overflowLeader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::overflowTarget(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::overflowTrailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::startNew(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Break::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_break.h b/fxjs/xfa/cjx_break.h new file mode 100644 index 0000000000..86cb249bf7 --- /dev/null +++ b/fxjs/xfa/cjx_break.h @@ -0,0 +1,33 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BREAK_H_ +#define FXJS_XFA_CJX_BREAK_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Break; + +class CJX_Break : public CJX_Node { + public: + explicit CJX_Break(CXFA_Break* node); + ~CJX_Break() override; + + JS_PROP(after); + JS_PROP(afterTarget); + JS_PROP(before); + JS_PROP(beforeTarget); + JS_PROP(bookendLeader); + JS_PROP(bookendTrailer); + JS_PROP(overflowLeader); + JS_PROP(overflowTarget); + JS_PROP(overflowTrailer); + JS_PROP(startNew); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BREAK_H_ diff --git a/fxjs/xfa/cjx_breakafter.cpp b/fxjs/xfa/cjx_breakafter.cpp new file mode 100644 index 0000000000..76a5a3bc45 --- /dev/null +++ b/fxjs/xfa/cjx_breakafter.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_breakafter.h" + +#include "xfa/fxfa/parser/cxfa_breakafter.h" + +CJX_BreakAfter::CJX_BreakAfter(CXFA_BreakAfter* node) : CJX_Node(node) {} + +CJX_BreakAfter::~CJX_BreakAfter() = default; + +void CJX_BreakAfter::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::startNew(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::trailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::targetType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakAfter::leader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_breakafter.h b/fxjs/xfa/cjx_breakafter.h new file mode 100644 index 0000000000..aa1eccc084 --- /dev/null +++ b/fxjs/xfa/cjx_breakafter.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BREAKAFTER_H_ +#define FXJS_XFA_CJX_BREAKAFTER_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_BreakAfter; + +class CJX_BreakAfter : public CJX_Node { + public: + explicit CJX_BreakAfter(CXFA_BreakAfter* node); + ~CJX_BreakAfter() override; + + JS_PROP(leader); + JS_PROP(startNew); + JS_PROP(target); + JS_PROP(targetType); + JS_PROP(trailer); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BREAKAFTER_H_ diff --git a/fxjs/xfa/cjx_breakbefore.cpp b/fxjs/xfa/cjx_breakbefore.cpp new file mode 100644 index 0000000000..83fa01e7cb --- /dev/null +++ b/fxjs/xfa/cjx_breakbefore.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_breakbefore.h" + +#include "xfa/fxfa/parser/cxfa_breakbefore.h" + +CJX_BreakBefore::CJX_BreakBefore(CXFA_BreakBefore* node) : CJX_Node(node) {} + +CJX_BreakBefore::~CJX_BreakBefore() = default; + +void CJX_BreakBefore::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::startNew(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::trailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::targetType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_BreakBefore::leader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_breakbefore.h b/fxjs/xfa/cjx_breakbefore.h new file mode 100644 index 0000000000..3f8dbbb3c6 --- /dev/null +++ b/fxjs/xfa/cjx_breakbefore.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BREAKBEFORE_H_ +#define FXJS_XFA_CJX_BREAKBEFORE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_BreakBefore; + +class CJX_BreakBefore : public CJX_Node { + public: + explicit CJX_BreakBefore(CXFA_BreakBefore* node); + ~CJX_BreakBefore() override; + + JS_PROP(leader); + JS_PROP(startNew); + JS_PROP(target); + JS_PROP(targetType); + JS_PROP(trailer); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BREAKBEFORE_H_ diff --git a/fxjs/xfa/cjx_button.cpp b/fxjs/xfa/cjx_button.cpp new file mode 100644 index 0000000000..b5bd6eb01e --- /dev/null +++ b/fxjs/xfa/cjx_button.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_button.h" + +#include "xfa/fxfa/parser/cxfa_button.h" + +CJX_Button::CJX_Button(CXFA_Button* node) : CJX_Node(node) {} + +CJX_Button::~CJX_Button() = default; + +void CJX_Button::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Button::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Button::highlight(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_button.h b/fxjs/xfa/cjx_button.h new file mode 100644 index 0000000000..3732aae674 --- /dev/null +++ b/fxjs/xfa/cjx_button.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_BUTTON_H_ +#define FXJS_XFA_CJX_BUTTON_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Button; + +class CJX_Button : public CJX_Node { + public: + explicit CJX_Button(CXFA_Button* node); + ~CJX_Button() override; + + JS_PROP(highlight); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_BUTTON_H_ diff --git a/fxjs/xfa/cjx_calculate.cpp b/fxjs/xfa/cjx_calculate.cpp new file mode 100644 index 0000000000..e5db4dffad --- /dev/null +++ b/fxjs/xfa/cjx_calculate.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_calculate.h" + +#include "xfa/fxfa/parser/cxfa_calculate.h" + +CJX_Calculate::CJX_Calculate(CXFA_Calculate* node) : CJX_Node(node) {} + +CJX_Calculate::~CJX_Calculate() = default; + +void CJX_Calculate::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Calculate::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Calculate::override(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_calculate.h b/fxjs/xfa/cjx_calculate.h new file mode 100644 index 0000000000..2410f1bf45 --- /dev/null +++ b/fxjs/xfa/cjx_calculate.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CALCULATE_H_ +#define FXJS_XFA_CJX_CALCULATE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Calculate; + +class CJX_Calculate : public CJX_Node { + public: + explicit CJX_Calculate(CXFA_Calculate* node); + ~CJX_Calculate() override; + + JS_PROP(override); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CALCULATE_H_ diff --git a/fxjs/xfa/cjx_caption.cpp b/fxjs/xfa/cjx_caption.cpp new file mode 100644 index 0000000000..5c7f6a8d04 --- /dev/null +++ b/fxjs/xfa/cjx_caption.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_caption.h" + +#include "xfa/fxfa/parser/cxfa_caption.h" + +CJX_Caption::CJX_Caption(CXFA_Caption* node) : CJX_Node(node) {} + +CJX_Caption::~CJX_Caption() = default; + +void CJX_Caption::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Caption::reserve(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Caption::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Caption::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Caption::placement(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_caption.h b/fxjs/xfa/cjx_caption.h new file mode 100644 index 0000000000..9af6915f35 --- /dev/null +++ b/fxjs/xfa/cjx_caption.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CAPTION_H_ +#define FXJS_XFA_CJX_CAPTION_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Caption; + +class CJX_Caption : public CJX_Node { + public: + explicit CJX_Caption(CXFA_Caption* node); + ~CJX_Caption() override; + + JS_PROP(placement); + JS_PROP(presence); + JS_PROP(reserve); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CAPTION_H_ diff --git a/fxjs/xfa/cjx_certificate.cpp b/fxjs/xfa/cjx_certificate.cpp new file mode 100644 index 0000000000..1d10565135 --- /dev/null +++ b/fxjs/xfa/cjx_certificate.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_certificate.h" + +#include "xfa/fxfa/parser/cxfa_certificate.h" + +CJX_Certificate::CJX_Certificate(CXFA_Certificate* node) : CJX_TextNode(node) {} + +CJX_Certificate::~CJX_Certificate() = default; + +void CJX_Certificate::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Certificate::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_certificate.h b/fxjs/xfa/cjx_certificate.h new file mode 100644 index 0000000000..af62b9135f --- /dev/null +++ b/fxjs/xfa/cjx_certificate.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CERTIFICATE_H_ +#define FXJS_XFA_CJX_CERTIFICATE_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Certificate; + +class CJX_Certificate : public CJX_TextNode { + public: + explicit CJX_Certificate(CXFA_Certificate* node); + ~CJX_Certificate() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CERTIFICATE_H_ diff --git a/fxjs/xfa/cjx_certificates.cpp b/fxjs/xfa/cjx_certificates.cpp new file mode 100644 index 0000000000..68286307b3 --- /dev/null +++ b/fxjs/xfa/cjx_certificates.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_certificates.h" + +#include "xfa/fxfa/parser/cxfa_certificates.h" + +CJX_Certificates::CJX_Certificates(CXFA_Certificates* node) : CJX_Node(node) {} + +CJX_Certificates::~CJX_Certificates() = default; + +void CJX_Certificates::url(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Certificates::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Certificates::credentialServerPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Certificates::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Certificates::urlPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_certificates.h b/fxjs/xfa/cjx_certificates.h new file mode 100644 index 0000000000..160d88d9a8 --- /dev/null +++ b/fxjs/xfa/cjx_certificates.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CERTIFICATES_H_ +#define FXJS_XFA_CJX_CERTIFICATES_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Certificates; + +class CJX_Certificates : public CJX_Node { + public: + explicit CJX_Certificates(CXFA_Certificates* node); + ~CJX_Certificates() override; + + JS_PROP(credentialServerPolicy); + JS_PROP(url); + JS_PROP(urlPolicy); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CERTIFICATES_H_ diff --git a/fxjs/xfa/cjx_checkbutton.cpp b/fxjs/xfa/cjx_checkbutton.cpp new file mode 100644 index 0000000000..8c5b1e6186 --- /dev/null +++ b/fxjs/xfa/cjx_checkbutton.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_checkbutton.h" + +#include "xfa/fxfa/parser/cxfa_checkbutton.h" + +CJX_CheckButton::CJX_CheckButton(CXFA_CheckButton* node) : CJX_Node(node) {} + +CJX_CheckButton::~CJX_CheckButton() = default; + +void CJX_CheckButton::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_CheckButton::allowNeutral(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_CheckButton::mark(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_CheckButton::shape(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_CheckButton::size(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_CheckButton::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_checkbutton.h b/fxjs/xfa/cjx_checkbutton.h new file mode 100644 index 0000000000..18cca68d23 --- /dev/null +++ b/fxjs/xfa/cjx_checkbutton.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CHECKBUTTON_H_ +#define FXJS_XFA_CJX_CHECKBUTTON_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_CheckButton; + +class CJX_CheckButton : public CJX_Node { + public: + explicit CJX_CheckButton(CXFA_CheckButton* node); + ~CJX_CheckButton() override; + + JS_PROP(allowNeutral); + JS_PROP(mark); + JS_PROP(shape); + JS_PROP(size); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CHECKBUTTON_H_ diff --git a/fxjs/xfa/cjx_choicelist.cpp b/fxjs/xfa/cjx_choicelist.cpp new file mode 100644 index 0000000000..3c85a03706 --- /dev/null +++ b/fxjs/xfa/cjx_choicelist.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_choicelist.h" + +#include "xfa/fxfa/parser/cxfa_choicelist.h" + +CJX_ChoiceList::CJX_ChoiceList(CXFA_ChoiceList* node) : CJX_Node(node) {} + +CJX_ChoiceList::~CJX_ChoiceList() = default; + +void CJX_ChoiceList::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ChoiceList::open(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ChoiceList::commitOn(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ChoiceList::textEntry(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ChoiceList::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_choicelist.h b/fxjs/xfa/cjx_choicelist.h new file mode 100644 index 0000000000..40336f2aac --- /dev/null +++ b/fxjs/xfa/cjx_choicelist.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CHOICELIST_H_ +#define FXJS_XFA_CJX_CHOICELIST_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_ChoiceList; + +class CJX_ChoiceList : public CJX_Node { + public: + explicit CJX_ChoiceList(CXFA_ChoiceList* node); + ~CJX_ChoiceList() override; + + JS_PROP(commitOn); + JS_PROP(open); + JS_PROP(textEntry); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CHOICELIST_H_ diff --git a/fxjs/xfa/cjx_color.cpp b/fxjs/xfa/cjx_color.cpp new file mode 100644 index 0000000000..fe7da0590c --- /dev/null +++ b/fxjs/xfa/cjx_color.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_color.h" + +#include "xfa/fxfa/parser/cxfa_color.h" + +CJX_Color::CJX_Color(CXFA_Color* node) : CJX_Node(node) {} + +CJX_Color::~CJX_Color() = default; + +void CJX_Color::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Color::cSpace(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Color::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Color::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_color.h b/fxjs/xfa/cjx_color.h new file mode 100644 index 0000000000..c625753556 --- /dev/null +++ b/fxjs/xfa/cjx_color.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_COLOR_H_ +#define FXJS_XFA_CJX_COLOR_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Color; + +class CJX_Color : public CJX_Node { + public: + explicit CJX_Color(CXFA_Color* node); + ~CJX_Color() override; + + JS_PROP(cSpace); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_COLOR_H_ diff --git a/fxjs/xfa/cjx_comb.cpp b/fxjs/xfa/cjx_comb.cpp new file mode 100644 index 0000000000..77144af33c --- /dev/null +++ b/fxjs/xfa/cjx_comb.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_comb.h" + +#include "xfa/fxfa/parser/cxfa_comb.h" + +CJX_Comb::CJX_Comb(CXFA_Comb* node) : CJX_Node(node) {} + +CJX_Comb::~CJX_Comb() = default; + +void CJX_Comb::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Comb::numberOfCells(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_Integer(pValue, bSetting, eAttribute); +} + +void CJX_Comb::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_comb.h b/fxjs/xfa/cjx_comb.h new file mode 100644 index 0000000000..1c8d631f1d --- /dev/null +++ b/fxjs/xfa/cjx_comb.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_COMB_H_ +#define FXJS_XFA_CJX_COMB_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Comb; + +class CJX_Comb : public CJX_Node { + public: + explicit CJX_Comb(CXFA_Comb* node); + ~CJX_Comb() override; + + JS_PROP(numberOfCells); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_COMB_H_ diff --git a/fxjs/xfa/cjx_command.cpp b/fxjs/xfa/cjx_command.cpp new file mode 100644 index 0000000000..30e654b8bd --- /dev/null +++ b/fxjs/xfa/cjx_command.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_command.h" + +#include "xfa/fxfa/parser/cxfa_command.h" + +CJX_Command::CJX_Command(CXFA_Command* node) : CJX_Node(node) {} + +CJX_Command::~CJX_Command() = default; + +void CJX_Command::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Command::timeout(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Command::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_command.h b/fxjs/xfa/cjx_command.h new file mode 100644 index 0000000000..c4605a31ef --- /dev/null +++ b/fxjs/xfa/cjx_command.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_COMMAND_H_ +#define FXJS_XFA_CJX_COMMAND_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Command; + +class CJX_Command : public CJX_Node { + public: + explicit CJX_Command(CXFA_Command* node); + ~CJX_Command() override; + + JS_PROP(timeout); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_COMMAND_H_ diff --git a/fxjs/xfa/cjx_connect.cpp b/fxjs/xfa/cjx_connect.cpp new file mode 100644 index 0000000000..d58420d1df --- /dev/null +++ b/fxjs/xfa/cjx_connect.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_connect.h" + +#include "xfa/fxfa/parser/cxfa_connect.h" + +CJX_Connect::CJX_Connect(CXFA_Connect* node) : CJX_Node(node) {} + +CJX_Connect::~CJX_Connect() = default; + +void CJX_Connect::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::timeout(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::connection(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::usage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::delayedOpen(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Connect::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_connect.h b/fxjs/xfa/cjx_connect.h new file mode 100644 index 0000000000..2c279175c7 --- /dev/null +++ b/fxjs/xfa/cjx_connect.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CONNECT_H_ +#define FXJS_XFA_CJX_CONNECT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Connect; + +class CJX_Connect : public CJX_Node { + public: + explicit CJX_Connect(CXFA_Connect* node); + ~CJX_Connect() override; + + JS_PROP(connection); + JS_PROP(delayedOpen); + JS_PROP(ref); + JS_PROP(timeout); + JS_PROP(usage); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CONNECT_H_ diff --git a/fxjs/xfa/cjx_connectstring.cpp b/fxjs/xfa/cjx_connectstring.cpp new file mode 100644 index 0000000000..75c6359f84 --- /dev/null +++ b/fxjs/xfa/cjx_connectstring.cpp @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_connectstring.h" + +#include "xfa/fxfa/parser/cxfa_connectstring.h" + +CJX_ConnectString::CJX_ConnectString(CXFA_ConnectString* node) + : CJX_TextNode(node) {} + +CJX_ConnectString::~CJX_ConnectString() = default; + +void CJX_ConnectString::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ConnectString::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_connectstring.h b/fxjs/xfa/cjx_connectstring.h new file mode 100644 index 0000000000..969c92b6d8 --- /dev/null +++ b/fxjs/xfa/cjx_connectstring.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CONNECTSTRING_H_ +#define FXJS_XFA_CJX_CONNECTSTRING_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_ConnectString; + +class CJX_ConnectString : public CJX_TextNode { + public: + explicit CJX_ConnectString(CXFA_ConnectString* node); + ~CJX_ConnectString() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_CONNECTSTRING_H_ diff --git a/fxjs/xfa/cjx_contentarea.cpp b/fxjs/xfa/cjx_contentarea.cpp new file mode 100644 index 0000000000..d1e74e7c99 --- /dev/null +++ b/fxjs/xfa/cjx_contentarea.cpp @@ -0,0 +1,44 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_contentarea.h" + +#include "xfa/fxfa/parser/cxfa_contentarea.h" + +CJX_ContentArea::CJX_ContentArea(CXFA_ContentArea* node) + : CJX_Container(node) {} + +CJX_ContentArea::~CJX_ContentArea() = default; + +void CJX_ContentArea::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ContentArea::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ContentArea::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ContentArea::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ContentArea::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_contentarea.h b/fxjs/xfa/cjx_contentarea.h new file mode 100644 index 0000000000..d97e108566 --- /dev/null +++ b/fxjs/xfa/cjx_contentarea.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CONTENTAREA_H_ +#define FXJS_XFA_CJX_CONTENTAREA_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_ContentArea; + +class CJX_ContentArea : public CJX_Container { + public: + explicit CJX_ContentArea(CXFA_ContentArea* node); + ~CJX_ContentArea() override; + + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(x); + JS_PROP(y); +}; + +#endif // FXJS_XFA_CJX_CONTENTAREA_H_ diff --git a/fxjs/xfa/cjx_corner.cpp b/fxjs/xfa/cjx_corner.cpp new file mode 100644 index 0000000000..2ed1922dd9 --- /dev/null +++ b/fxjs/xfa/cjx_corner.cpp @@ -0,0 +1,61 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_corner.h" + +#include "xfa/fxfa/parser/cxfa_corner.h" + +CJX_Corner::CJX_Corner(CXFA_Corner* node) : CJX_Node(node) {} + +CJX_Corner::~CJX_Corner() = default; + +void CJX_Corner::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::stroke(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::inverted(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::thickness(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::join(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Corner::radius(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_corner.h b/fxjs/xfa/cjx_corner.h new file mode 100644 index 0000000000..83251a5ba9 --- /dev/null +++ b/fxjs/xfa/cjx_corner.h @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_CORNER_H_ +#define FXJS_XFA_CJX_CORNER_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Corner; + +class CJX_Corner : public CJX_Node { + public: + explicit CJX_Corner(CXFA_Corner* node); + ~CJX_Corner() override; + + JS_PROP(inverted); + JS_PROP(join); + JS_PROP(presence); + JS_PROP(radius); + JS_PROP(stroke); + JS_PROP(thickness); + JS_PROP(usehref); + JS_PROP(use); +}; + +#endif // FXJS_XFA_CJX_CORNER_H_ diff --git a/fxjs/xfa/cjx_datavalue.cpp b/fxjs/xfa/cjx_datavalue.cpp new file mode 100644 index 0000000000..b90ed45e66 --- /dev/null +++ b/fxjs/xfa/cjx_datavalue.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_datavalue.h" + +#include "xfa/fxfa/parser/cxfa_datavalue.h" + +CJX_DataValue::CJX_DataValue(CXFA_DataValue* node) : CJX_Node(node) {} + +CJX_DataValue::~CJX_DataValue() = default; + +void CJX_DataValue::contentType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DataValue::contains(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DataValue::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_DataValue::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} + +void CJX_DataValue::isNull(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_BOOL(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_datavalue.h b/fxjs/xfa/cjx_datavalue.h new file mode 100644 index 0000000000..16e8ed41fb --- /dev/null +++ b/fxjs/xfa/cjx_datavalue.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DATAVALUE_H_ +#define FXJS_XFA_CJX_DATAVALUE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DataValue; + +class CJX_DataValue : public CJX_Node { + public: + explicit CJX_DataValue(CXFA_DataValue* node); + ~CJX_DataValue() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(contains); + JS_PROP(contentType); + JS_PROP(isNull); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_DATAVALUE_H_ diff --git a/fxjs/xfa/cjx_datawindow.cpp b/fxjs/xfa/cjx_datawindow.cpp index 47c743f8f7..5209cb47e6 100644 --- a/fxjs/xfa/cjx_datawindow.cpp +++ b/fxjs/xfa/cjx_datawindow.cpp @@ -48,18 +48,18 @@ CJS_Return CJX_DataWindow::isRecordGroup( return CJS_Return(true); } -void CJX_DataWindow::RecordsBefore(CFXJSE_Value* pValue, +void CJX_DataWindow::recordsBefore(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} -void CJX_DataWindow::CurrentRecordNumber(CFXJSE_Value* pValue, +void CJX_DataWindow::currentRecordNumber(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} -void CJX_DataWindow::RecordsAfter(CFXJSE_Value* pValue, +void CJX_DataWindow::recordsAfter(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} -void CJX_DataWindow::IsDefined(CFXJSE_Value* pValue, +void CJX_DataWindow::isDefined(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} diff --git a/fxjs/xfa/cjx_datawindow.h b/fxjs/xfa/cjx_datawindow.h index 82c5b1a9d1..dfaa6a44ba 100644 --- a/fxjs/xfa/cjx_datawindow.h +++ b/fxjs/xfa/cjx_datawindow.h @@ -19,22 +19,16 @@ class CJX_DataWindow : public CJX_Object { explicit CJX_DataWindow(CScript_DataWindow* window); ~CJX_DataWindow() override; - void RecordsBefore(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void CurrentRecordNumber(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void RecordsAfter(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void IsDefined(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - JS_METHOD(gotoRecord, CJX_DataWindow); JS_METHOD(isRecordGroup, CJX_DataWindow); JS_METHOD(moveCurrentRecord, CJX_DataWindow); JS_METHOD(record, CJX_DataWindow); + JS_PROP(currentRecordNumber); + JS_PROP(isDefined); + JS_PROP(recordsAfter); + JS_PROP(recordsBefore); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_date.cpp b/fxjs/xfa/cjx_date.cpp new file mode 100644 index 0000000000..ade95a915b --- /dev/null +++ b/fxjs/xfa/cjx_date.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_date.h" + +#include "xfa/fxfa/parser/cxfa_date.h" + +CJX_Date::CJX_Date(CXFA_Date* node) : CJX_Content(node) {} + +CJX_Date::~CJX_Date() = default; + +void CJX_Date::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Date::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Date::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Date::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_date.h b/fxjs/xfa/cjx_date.h new file mode 100644 index 0000000000..96dfd0e2c7 --- /dev/null +++ b/fxjs/xfa/cjx_date.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DATE_H_ +#define FXJS_XFA_CJX_DATE_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Date; + +class CJX_Date : public CJX_Content { + public: + explicit CJX_Date(CXFA_Date* node); + ~CJX_Date() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_DATE_H_ diff --git a/fxjs/xfa/cjx_datetime.cpp b/fxjs/xfa/cjx_datetime.cpp new file mode 100644 index 0000000000..35ffd05f8e --- /dev/null +++ b/fxjs/xfa/cjx_datetime.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_datetime.h" + +#include "xfa/fxfa/parser/cxfa_datetime.h" + +CJX_DateTime::CJX_DateTime(CXFA_DateTime* node) : CJX_Node(node) {} + +CJX_DateTime::~CJX_DateTime() = default; + +void CJX_DateTime::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DateTime::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_DateTime::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DateTime::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_datetime.h b/fxjs/xfa/cjx_datetime.h new file mode 100644 index 0000000000..9cf7d2fb18 --- /dev/null +++ b/fxjs/xfa/cjx_datetime.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DATETIME_H_ +#define FXJS_XFA_CJX_DATETIME_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DateTime; + +class CJX_DateTime : public CJX_Node { + public: + explicit CJX_DateTime(CXFA_DateTime* node); + ~CJX_DateTime() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_DATETIME_H_ diff --git a/fxjs/xfa/cjx_datetimeedit.cpp b/fxjs/xfa/cjx_datetimeedit.cpp new file mode 100644 index 0000000000..284dbf03c1 --- /dev/null +++ b/fxjs/xfa/cjx_datetimeedit.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_datetimeedit.h" + +#include "xfa/fxfa/parser/cxfa_datetimeedit.h" + +CJX_DateTimeEdit::CJX_DateTimeEdit(CXFA_DateTimeEdit* node) : CJX_Node(node) {} + +CJX_DateTimeEdit::~CJX_DateTimeEdit() = default; + +void CJX_DateTimeEdit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DateTimeEdit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DateTimeEdit::hScrollPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_datetimeedit.h b/fxjs/xfa/cjx_datetimeedit.h new file mode 100644 index 0000000000..067c6bba81 --- /dev/null +++ b/fxjs/xfa/cjx_datetimeedit.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DATETIMEEDIT_H_ +#define FXJS_XFA_CJX_DATETIMEEDIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DateTimeEdit; + +class CJX_DateTimeEdit : public CJX_Node { + public: + explicit CJX_DateTimeEdit(CXFA_DateTimeEdit* node); + ~CJX_DateTimeEdit() override; + + JS_PROP(hScrollPolicy); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_DATETIMEEDIT_H_ diff --git a/fxjs/xfa/cjx_decimal.cpp b/fxjs/xfa/cjx_decimal.cpp new file mode 100644 index 0000000000..66763baf94 --- /dev/null +++ b/fxjs/xfa/cjx_decimal.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_decimal.h" + +#include "xfa/fxfa/parser/cxfa_decimal.h" + +CJX_Decimal::CJX_Decimal(CXFA_Decimal* node) : CJX_Content(node) {} + +CJX_Decimal::~CJX_Decimal() = default; + +void CJX_Decimal::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Decimal::fracDigits(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Decimal::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Decimal::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Decimal::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Decimal::leadDigits(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_decimal.h b/fxjs/xfa/cjx_decimal.h new file mode 100644 index 0000000000..5753112d04 --- /dev/null +++ b/fxjs/xfa/cjx_decimal.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DECIMAL_H_ +#define FXJS_XFA_CJX_DECIMAL_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Decimal; + +class CJX_Decimal : public CJX_Content { + public: + explicit CJX_Decimal(CXFA_Decimal* node); + ~CJX_Decimal() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(fracDigits); + JS_PROP(leadDigits); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_DECIMAL_H_ diff --git a/fxjs/xfa/cjx_defaultui.cpp b/fxjs/xfa/cjx_defaultui.cpp new file mode 100644 index 0000000000..63995cd2ac --- /dev/null +++ b/fxjs/xfa/cjx_defaultui.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_defaultui.h" + +#include "xfa/fxfa/parser/cxfa_defaultui.h" + +CJX_DefaultUi::CJX_DefaultUi(CXFA_DefaultUi* node) : CJX_Node(node) {} + +CJX_DefaultUi::~CJX_DefaultUi() = default; + +void CJX_DefaultUi::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DefaultUi::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_defaultui.h b/fxjs/xfa/cjx_defaultui.h new file mode 100644 index 0000000000..8b8983b8b4 --- /dev/null +++ b/fxjs/xfa/cjx_defaultui.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DEFAULTUI_H_ +#define FXJS_XFA_CJX_DEFAULTUI_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DefaultUi; + +class CJX_DefaultUi : public CJX_Node { + public: + explicit CJX_DefaultUi(CXFA_DefaultUi* node); + ~CJX_DefaultUi() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_DEFAULTUI_H_ diff --git a/fxjs/xfa/cjx_delete.cpp b/fxjs/xfa/cjx_delete.cpp new file mode 100644 index 0000000000..35fe991f60 --- /dev/null +++ b/fxjs/xfa/cjx_delete.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_delete.h" + +#include "xfa/fxfa/parser/cxfa_delete.h" + +CJX_Delete::CJX_Delete(CXFA_Delete* node) : CJX_TextNode(node) {} + +CJX_Delete::~CJX_Delete() = default; + +void CJX_Delete::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Delete::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_delete.h b/fxjs/xfa/cjx_delete.h new file mode 100644 index 0000000000..413a140f44 --- /dev/null +++ b/fxjs/xfa/cjx_delete.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DELETE_H_ +#define FXJS_XFA_CJX_DELETE_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Delete; + +class CJX_Delete : public CJX_TextNode { + public: + explicit CJX_Delete(CXFA_Delete* node); + ~CJX_Delete() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_DELETE_H_ diff --git a/fxjs/xfa/cjx_delta.cpp b/fxjs/xfa/cjx_delta.cpp index c361bbb256..6d8cbd52f3 100644 --- a/fxjs/xfa/cjx_delta.cpp +++ b/fxjs/xfa/cjx_delta.cpp @@ -26,3 +26,15 @@ CJS_Return CJX_Delta::restore(CJS_V8* runtime, return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); return CJS_Return(true); } + +void CJX_Delta::currentValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Delta::savedValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Delta::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} diff --git a/fxjs/xfa/cjx_delta.h b/fxjs/xfa/cjx_delta.h index 29d3e8e788..2b981cd56b 100644 --- a/fxjs/xfa/cjx_delta.h +++ b/fxjs/xfa/cjx_delta.h @@ -19,6 +19,10 @@ class CJX_Delta : public CJX_Object { JS_METHOD(restore, CJX_Delta); + JS_PROP(currentValue); + JS_PROP(savedValue); + JS_PROP(target); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_deltas.cpp b/fxjs/xfa/cjx_deltas.cpp new file mode 100644 index 0000000000..e8969fb03c --- /dev/null +++ b/fxjs/xfa/cjx_deltas.cpp @@ -0,0 +1,13 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_deltas.h" + +#include "xfa/fxfa/parser/cxfa_deltas.h" + +CJX_Deltas::CJX_Deltas(CXFA_Deltas* src) : CJX_List(src) {} + +CJX_Deltas::~CJX_Deltas() {} diff --git a/fxjs/xfa/cjx_deltas.h b/fxjs/xfa/cjx_deltas.h new file mode 100644 index 0000000000..c94753f17b --- /dev/null +++ b/fxjs/xfa/cjx_deltas.h @@ -0,0 +1,20 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DELTAS_H_ +#define FXJS_XFA_CJX_DELTAS_H_ + +#include "fxjs/xfa/cjx_list.h" + +class CXFA_Deltas; + +class CJX_Deltas : public CJX_List { + public: + explicit CJX_Deltas(CXFA_Deltas* node); + ~CJX_Deltas() override; +}; + +#endif // FXJS_XFA_CJX_DELTAS_H_ diff --git a/fxjs/xfa/cjx_desc.cpp b/fxjs/xfa/cjx_desc.cpp index 03ab8f8d21..a49ae63323 100644 --- a/fxjs/xfa/cjx_desc.cpp +++ b/fxjs/xfa/cjx_desc.cpp @@ -26,3 +26,15 @@ CJS_Return CJX_Desc::metadata(CJS_V8* runtime, return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); return CJS_Return(runtime->NewString("")); } + +void CJX_Desc::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Desc::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_desc.h b/fxjs/xfa/cjx_desc.h index f3c9f46b4c..4d21c7ba32 100644 --- a/fxjs/xfa/cjx_desc.h +++ b/fxjs/xfa/cjx_desc.h @@ -19,6 +19,9 @@ class CJX_Desc : public CJX_Node { JS_METHOD(metadata, CJX_Desc); + JS_PROP(use); + JS_PROP(usehref); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_digestmethod.cpp b/fxjs/xfa/cjx_digestmethod.cpp new file mode 100644 index 0000000000..b85fc0082e --- /dev/null +++ b/fxjs/xfa/cjx_digestmethod.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_digestmethod.h" + +#include "xfa/fxfa/parser/cxfa_digestmethod.h" + +CJX_DigestMethod::CJX_DigestMethod(CXFA_DigestMethod* node) : CJX_Node(node) {} + +CJX_DigestMethod::~CJX_DigestMethod() = default; + +void CJX_DigestMethod::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DigestMethod::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_digestmethod.h b/fxjs/xfa/cjx_digestmethod.h new file mode 100644 index 0000000000..d14e6f17ad --- /dev/null +++ b/fxjs/xfa/cjx_digestmethod.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DIGESTMETHOD_H_ +#define FXJS_XFA_CJX_DIGESTMETHOD_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DigestMethod; + +class CJX_DigestMethod : public CJX_Node { + public: + explicit CJX_DigestMethod(CXFA_DigestMethod* node); + ~CJX_DigestMethod() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_DIGESTMETHOD_H_ diff --git a/fxjs/xfa/cjx_digestmethods.cpp b/fxjs/xfa/cjx_digestmethods.cpp new file mode 100644 index 0000000000..ae7cbcd3e1 --- /dev/null +++ b/fxjs/xfa/cjx_digestmethods.cpp @@ -0,0 +1,32 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_digestmethods.h" + +#include "xfa/fxfa/parser/cxfa_digestmethods.h" + +CJX_DigestMethods::CJX_DigestMethods(CXFA_DigestMethods* node) + : CJX_Node(node) {} + +CJX_DigestMethods::~CJX_DigestMethods() = default; + +void CJX_DigestMethods::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DigestMethods::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_DigestMethods::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_digestmethods.h b/fxjs/xfa/cjx_digestmethods.h new file mode 100644 index 0000000000..b3addc367e --- /dev/null +++ b/fxjs/xfa/cjx_digestmethods.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DIGESTMETHODS_H_ +#define FXJS_XFA_CJX_DIGESTMETHODS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_DigestMethods; + +class CJX_DigestMethods : public CJX_Node { + public: + explicit CJX_DigestMethods(CXFA_DigestMethods* node); + ~CJX_DigestMethods() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_DIGESTMETHODS_H_ diff --git a/fxjs/xfa/cjx_draw.cpp b/fxjs/xfa/cjx_draw.cpp new file mode 100644 index 0000000000..0752bf7457 --- /dev/null +++ b/fxjs/xfa/cjx_draw.cpp @@ -0,0 +1,153 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_draw.h" + +#include "fxjs/cfxjse_value.h" +#include "xfa/fxfa/parser/cxfa_draw.h" + +CJX_Draw::CJX_Draw(CXFA_Draw* node) : CJX_Container(node) {} + +CJX_Draw::~CJX_Draw() = default; + +void CJX_Draw::h(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::w(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::hAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::rotate(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::vAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::maxH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::maxW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::minH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::minW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::rawValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Draw::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (!bSetting) { + WideString content = GetContent(true); + if (content.IsEmpty()) + pValue->SetNull(); + else + pValue->SetString(content.UTF8Encode().AsStringView()); + + return; + } + + if (!pValue || !pValue->IsString()) + return; + + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + XFA_Element uiType = pWidgetData->GetUIType(); + if (uiType != XFA_Element::Text) + return; + + WideString wsNewValue = pValue->ToWideString(); + SetContent(wsNewValue, wsNewValue, true, true, true); +} + +void CJX_Draw::colSpan(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::locale(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Draw::anchorType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_draw.h b/fxjs/xfa/cjx_draw.h new file mode 100644 index 0000000000..1d5603aefe --- /dev/null +++ b/fxjs/xfa/cjx_draw.h @@ -0,0 +1,41 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_DRAW_H_ +#define FXJS_XFA_CJX_DRAW_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_Draw; + +class CJX_Draw : public CJX_Container { + public: + explicit CJX_Draw(CXFA_Draw* node); + ~CJX_Draw() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(anchorType); + JS_PROP(colSpan); + JS_PROP(h); + JS_PROP(hAlign); + JS_PROP(locale); + JS_PROP(maxH); + JS_PROP(maxW); + JS_PROP(minH); + JS_PROP(minW); + JS_PROP(presence); + JS_PROP(rawValue); + JS_PROP(relevant); + JS_PROP(rotate); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(vAlign); + JS_PROP(w); + JS_PROP(x); + JS_PROP(y); +}; + +#endif // FXJS_XFA_CJX_DRAW_H_ diff --git a/fxjs/xfa/cjx_edge.cpp b/fxjs/xfa/cjx_edge.cpp new file mode 100644 index 0000000000..ea1fa35c49 --- /dev/null +++ b/fxjs/xfa/cjx_edge.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_edge.h" + +#include "xfa/fxfa/parser/cxfa_edge.h" + +CJX_Edge::CJX_Edge(CXFA_Edge* node) : CJX_Node(node) {} + +CJX_Edge::~CJX_Edge() = default; + +void CJX_Edge::cap(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Edge::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Edge::stroke(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Edge::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Edge::thickness(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Edge::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_edge.h b/fxjs/xfa/cjx_edge.h new file mode 100644 index 0000000000..ef4ddeb275 --- /dev/null +++ b/fxjs/xfa/cjx_edge.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EDGE_H_ +#define FXJS_XFA_CJX_EDGE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Edge; + +class CJX_Edge : public CJX_Node { + public: + explicit CJX_Edge(CXFA_Edge* node); + ~CJX_Edge() override; + + JS_PROP(cap); + JS_PROP(presence); + JS_PROP(stroke); + JS_PROP(thickness); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EDGE_H_ diff --git a/fxjs/xfa/cjx_encoding.cpp b/fxjs/xfa/cjx_encoding.cpp new file mode 100644 index 0000000000..debfe4042a --- /dev/null +++ b/fxjs/xfa/cjx_encoding.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_encoding.h" + +#include "xfa/fxfa/parser/cxfa_encoding.h" + +CJX_Encoding::CJX_Encoding(CXFA_Encoding* node) : CJX_Node(node) {} + +CJX_Encoding::~CJX_Encoding() = default; + +void CJX_Encoding::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Encoding::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_encoding.h b/fxjs/xfa/cjx_encoding.h new file mode 100644 index 0000000000..ea82333d44 --- /dev/null +++ b/fxjs/xfa/cjx_encoding.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ENCODING_H_ +#define FXJS_XFA_CJX_ENCODING_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Encoding; + +class CJX_Encoding : public CJX_Node { + public: + explicit CJX_Encoding(CXFA_Encoding* node); + ~CJX_Encoding() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ENCODING_H_ diff --git a/fxjs/xfa/cjx_encodings.cpp b/fxjs/xfa/cjx_encodings.cpp new file mode 100644 index 0000000000..667929f194 --- /dev/null +++ b/fxjs/xfa/cjx_encodings.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_encodings.h" + +#include "xfa/fxfa/parser/cxfa_encodings.h" + +CJX_Encodings::CJX_Encodings(CXFA_Encodings* node) : CJX_Node(node) {} + +CJX_Encodings::~CJX_Encodings() = default; + +void CJX_Encodings::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Encodings::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Encodings::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_encodings.h b/fxjs/xfa/cjx_encodings.h new file mode 100644 index 0000000000..da4f617c18 --- /dev/null +++ b/fxjs/xfa/cjx_encodings.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ENCODINGS_H_ +#define FXJS_XFA_CJX_ENCODINGS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Encodings; + +class CJX_Encodings : public CJX_Node { + public: + explicit CJX_Encodings(CXFA_Encodings* node); + ~CJX_Encodings() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ENCODINGS_H_ diff --git a/fxjs/xfa/cjx_encrypt.cpp b/fxjs/xfa/cjx_encrypt.cpp new file mode 100644 index 0000000000..dbed1f243a --- /dev/null +++ b/fxjs/xfa/cjx_encrypt.cpp @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_encrypt.h" + +#include "xfa/fxfa/parser/cxfa_encrypt.h" + +CJX_Encrypt::CJX_Encrypt(CXFA_Encrypt* node) : CJX_Node(node) {} + +CJX_Encrypt::~CJX_Encrypt() = default; + +void CJX_Encrypt::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Encrypt::format(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Encrypt::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_encrypt.h b/fxjs/xfa/cjx_encrypt.h new file mode 100644 index 0000000000..85fac15252 --- /dev/null +++ b/fxjs/xfa/cjx_encrypt.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ENCRYPT_H_ +#define FXJS_XFA_CJX_ENCRYPT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Encrypt; + +class CJX_Encrypt : public CJX_Node { + public: + explicit CJX_Encrypt(CXFA_Encrypt* node); + ~CJX_Encrypt() override; + + JS_PROP(format); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ENCRYPT_H_ diff --git a/fxjs/xfa/cjx_event.cpp b/fxjs/xfa/cjx_event.cpp new file mode 100644 index 0000000000..8cb2bce36d --- /dev/null +++ b/fxjs/xfa/cjx_event.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_event.h" + +#include "xfa/fxfa/parser/cxfa_event.h" + +CJX_Event::CJX_Event(CXFA_Event* node) : CJX_Node(node) {} + +CJX_Event::~CJX_Event() = default; + +void CJX_Event::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Event::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Event::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Event::activity(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_event.h b/fxjs/xfa/cjx_event.h new file mode 100644 index 0000000000..6c6d92064d --- /dev/null +++ b/fxjs/xfa/cjx_event.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EVENT_H_ +#define FXJS_XFA_CJX_EVENT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Event; + +class CJX_Event : public CJX_Node { + public: + explicit CJX_Event(CXFA_Event* node); + ~CJX_Event() override; + + JS_PROP(activity); + JS_PROP(ref); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EVENT_H_ diff --git a/fxjs/xfa/cjx_eventpseudomodel.cpp b/fxjs/xfa/cjx_eventpseudomodel.cpp index 449153c548..3b2d9777d0 100644 --- a/fxjs/xfa/cjx_eventpseudomodel.cpp +++ b/fxjs/xfa/cjx_eventpseudomodel.cpp @@ -54,97 +54,97 @@ CJX_EventPseudoModel::CJX_EventPseudoModel(CScript_EventPseudoModel* model) CJX_EventPseudoModel::~CJX_EventPseudoModel() {} -void CJX_EventPseudoModel::Change(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::change(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Change, bSetting); } -void CJX_EventPseudoModel::CommitKey(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::commitKey(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::CommitKey, bSetting); } -void CJX_EventPseudoModel::FullText(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::fullText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::FullText, bSetting); } -void CJX_EventPseudoModel::KeyDown(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::keyDown(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Keydown, bSetting); } -void CJX_EventPseudoModel::Modifier(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::modifier(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Modifier, bSetting); } -void CJX_EventPseudoModel::NewContentType(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::newContentType(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::NewContentType, bSetting); } -void CJX_EventPseudoModel::NewText(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::newText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::NewText, bSetting); } -void CJX_EventPseudoModel::PrevContentType(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::prevContentType(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::PreviousContentType, bSetting); } -void CJX_EventPseudoModel::PrevText(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::prevText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::PreviousText, bSetting); } -void CJX_EventPseudoModel::Reenter(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::reenter(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Reenter, bSetting); } -void CJX_EventPseudoModel::SelEnd(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::selEnd(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::SelectionEnd, bSetting); } -void CJX_EventPseudoModel::SelStart(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::selStart(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::SelectionStart, bSetting); } -void CJX_EventPseudoModel::Shift(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::shift(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Shift, bSetting); } -void CJX_EventPseudoModel::SoapFaultCode(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::soapFaultCode(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::SoapFaultCode, bSetting); } -void CJX_EventPseudoModel::SoapFaultString(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::soapFaultString(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::SoapFaultString, bSetting); } -void CJX_EventPseudoModel::Target(CFXJSE_Value* pValue, +void CJX_EventPseudoModel::target(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Property(pValue, XFA_Event::Target, bSetting); diff --git a/fxjs/xfa/cjx_eventpseudomodel.h b/fxjs/xfa/cjx_eventpseudomodel.h index d9615c3269..92d731c289 100644 --- a/fxjs/xfa/cjx_eventpseudomodel.h +++ b/fxjs/xfa/cjx_eventpseudomodel.h @@ -38,34 +38,26 @@ class CJX_EventPseudoModel : public CJX_Object { explicit CJX_EventPseudoModel(CScript_EventPseudoModel* model); ~CJX_EventPseudoModel() override; - void Change(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void CommitKey(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void FullText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void KeyDown(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Modifier(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void NewContentType(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void NewText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void PrevContentType(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void PrevText(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Reenter(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void SelEnd(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void SelStart(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Shift(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void SoapFaultCode(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void SoapFaultString(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Target(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - JS_METHOD(emit, CJX_EventPseudoModel); JS_METHOD(reset, CJX_EventPseudoModel); + JS_PROP(change); + JS_PROP(commitKey); + JS_PROP(fullText); + JS_PROP(keyDown); + JS_PROP(modifier); + JS_PROP(newContentType); + JS_PROP(newText); + JS_PROP(prevContentType); + JS_PROP(prevText); + JS_PROP(reenter); + JS_PROP(selEnd); + JS_PROP(selStart); + JS_PROP(shift); + JS_PROP(soapFaultCode); + JS_PROP(soapFaultString); + JS_PROP(target); + private: void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting); diff --git a/fxjs/xfa/cjx_exclgroup.cpp b/fxjs/xfa/cjx_exclgroup.cpp index 1041e3ffbb..fac58ff054 100644 --- a/fxjs/xfa/cjx_exclgroup.cpp +++ b/fxjs/xfa/cjx_exclgroup.cpp @@ -107,3 +107,185 @@ CJS_Return CJX_ExclGroup::selectedMember( return CJS_Return(value->DirectGetValue().Get(runtime->GetIsolate())); } + +void CJX_ExclGroup::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + if (!pWidgetData) + return; + + if (bSetting) { + pWidgetData->SetSelectedMemberByValue(pValue->ToWideString().AsStringView(), + true, true, true); + return; + } + + WideString wsValue = GetContent(true); + XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); + if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { + pValue->SetNull(); + return; + } + pValue->SetString(wsValue.UTF8Encode().AsStringView()); +} + +void CJX_ExclGroup::rawValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::transient(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_ExclGroup::access(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::accessKey(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::anchorType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::borderColor(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_BorderColor(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::borderWidth(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_BorderWidth(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::colSpan(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::fillColor(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_FillColor(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::h(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::hAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::layout(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::mandatory(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_Mandatory(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::mandatoryMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_MandatoryMessage(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::maxH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::maxW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::minH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::minW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::validationMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_ValidationMessage(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::vAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::w(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExclGroup::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_exclgroup.h b/fxjs/xfa/cjx_exclgroup.h index f44446762f..a972fba5ff 100644 --- a/fxjs/xfa/cjx_exclgroup.h +++ b/fxjs/xfa/cjx_exclgroup.h @@ -23,6 +23,35 @@ class CJX_ExclGroup : public CJX_Node { JS_METHOD(execValidate, CJX_ExclGroup); JS_METHOD(selectedMember, CJX_ExclGroup); + JS_PROP(defaultValue); /* {default} */ + JS_PROP(access); + JS_PROP(accessKey); + JS_PROP(anchorType); + JS_PROP(borderColor); + JS_PROP(borderWidth); + JS_PROP(colSpan); + JS_PROP(fillColor); + JS_PROP(h); + JS_PROP(hAlign); + JS_PROP(layout); + JS_PROP(mandatory); + JS_PROP(mandatoryMessage); + JS_PROP(maxH); + JS_PROP(maxW); + JS_PROP(minH); + JS_PROP(minW); + JS_PROP(presence); + JS_PROP(rawValue); + JS_PROP(relevant); + JS_PROP(transient); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(validationMessage); + JS_PROP(vAlign); + JS_PROP(w); + JS_PROP(x); + JS_PROP(y); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_exdata.cpp b/fxjs/xfa/cjx_exdata.cpp new file mode 100644 index 0000000000..6ce72c4943 --- /dev/null +++ b/fxjs/xfa/cjx_exdata.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_exdata.h" + +#include "xfa/fxfa/parser/cxfa_exdata.h" + +CJX_ExData::CJX_ExData(CXFA_ExData* node) : CJX_Content(node) {} + +CJX_ExData::~CJX_ExData() = default; + +void CJX_ExData::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExData::contentType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExData::transferEncoding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExData::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_ExData::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExData::maxLength(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExData::href(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_exdata.h b/fxjs/xfa/cjx_exdata.h new file mode 100644 index 0000000000..e059da8b9d --- /dev/null +++ b/fxjs/xfa/cjx_exdata.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EXDATA_H_ +#define FXJS_XFA_CJX_EXDATA_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_ExData; + +class CJX_ExData : public CJX_Content { + public: + explicit CJX_ExData(CXFA_ExData* node); + ~CJX_ExData() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(contentType); + JS_PROP(href); + JS_PROP(maxLength); + JS_PROP(transferEncoding); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EXDATA_H_ diff --git a/fxjs/xfa/cjx_execute.cpp b/fxjs/xfa/cjx_execute.cpp new file mode 100644 index 0000000000..5fc4a77859 --- /dev/null +++ b/fxjs/xfa/cjx_execute.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_execute.h" + +#include "xfa/fxfa/parser/cxfa_execute.h" + +CJX_Execute::CJX_Execute(CXFA_Execute* node) : CJX_Node(node) {} + +CJX_Execute::~CJX_Execute() = default; + +void CJX_Execute::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Execute::connection(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Execute::runAt(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Execute::executeType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Execute::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_execute.h b/fxjs/xfa/cjx_execute.h new file mode 100644 index 0000000000..ef7f629e36 --- /dev/null +++ b/fxjs/xfa/cjx_execute.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EXECUTE_H_ +#define FXJS_XFA_CJX_EXECUTE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Execute; + +class CJX_Execute : public CJX_Node { + public: + explicit CJX_Execute(CXFA_Execute* node); + ~CJX_Execute() override; + + JS_PROP(connection); + JS_PROP(executeType); + JS_PROP(runAt); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EXECUTE_H_ diff --git a/fxjs/xfa/cjx_exobject.cpp b/fxjs/xfa/cjx_exobject.cpp new file mode 100644 index 0000000000..2252d53d06 --- /dev/null +++ b/fxjs/xfa/cjx_exobject.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_exobject.h" + +#include "xfa/fxfa/parser/cxfa_exobject.h" + +CJX_ExObject::CJX_ExObject(CXFA_ExObject* node) : CJX_Node(node) {} + +CJX_ExObject::~CJX_ExObject() = default; + +void CJX_ExObject::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExObject::codeType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExObject::archive(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExObject::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExObject::codeBase(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ExObject::classId(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_exobject.h b/fxjs/xfa/cjx_exobject.h new file mode 100644 index 0000000000..2fec24a6fb --- /dev/null +++ b/fxjs/xfa/cjx_exobject.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EXOBJECT_H_ +#define FXJS_XFA_CJX_EXOBJECT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_ExObject; + +class CJX_ExObject : public CJX_Node { + public: + explicit CJX_ExObject(CXFA_ExObject* node); + ~CJX_ExObject() override; + + JS_PROP(archive); + JS_PROP(classId); + JS_PROP(codeBase); + JS_PROP(codeType); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EXOBJECT_H_ diff --git a/fxjs/xfa/cjx_extras.cpp b/fxjs/xfa/cjx_extras.cpp new file mode 100644 index 0000000000..73ea8ea5ba --- /dev/null +++ b/fxjs/xfa/cjx_extras.cpp @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_extras.h" + +#include "xfa/fxfa/parser/cxfa_extras.h" + +CJX_Extras::CJX_Extras(CXFA_Extras* node) : CJX_Node(node) {} + +CJX_Extras::~CJX_Extras() = default; + +void CJX_Extras::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Extras::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Extras::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_extras.h b/fxjs/xfa/cjx_extras.h new file mode 100644 index 0000000000..9f5790369e --- /dev/null +++ b/fxjs/xfa/cjx_extras.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_EXTRAS_H_ +#define FXJS_XFA_CJX_EXTRAS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Extras; + +class CJX_Extras : public CJX_Node { + public: + explicit CJX_Extras(CXFA_Extras* node); + ~CJX_Extras() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_EXTRAS_H_ diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index 857aa50d40..059aead0f9 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -8,6 +8,7 @@ #include +#include "core/fxcrt/cfx_decimal.h" #include "fxjs/cfxjse_value.h" #include "fxjs/js_resources.h" #include "xfa/fxfa/cxfa_eventparam.h" @@ -233,3 +234,302 @@ CJS_Return CJX_Field::execValidate( false, false); return CJS_Return(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error)); } + +void CJX_Field::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + if (!pWidgetData) + return; + + if (bSetting) { + if (pValue) { + pWidgetData->SetPreNull(pWidgetData->IsNull()); + pWidgetData->SetIsNull(pValue->IsNull()); + } + + WideString wsNewText; + if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) + wsNewText = pValue->ToWideString(); + + CXFA_Node* pUIChild = pWidgetData->GetUIChild(); + if (pUIChild->GetElementType() == XFA_Element::NumericEdit) { + wsNewText = + pWidgetData->NumericLimit(wsNewText, pWidgetData->GetLeadDigits(), + pWidgetData->GetFracDigits()); + } + + CXFA_WidgetData* pContainerWidgetData = + GetXFANode()->GetContainerWidgetData(); + WideString wsFormatText(wsNewText); + if (pContainerWidgetData) + wsFormatText = pContainerWidgetData->GetFormatDataValue(wsNewText); + + SetContent(wsNewText, wsFormatText, true, true, true); + return; + } + + WideString content = GetContent(true); + if (content.IsEmpty()) { + pValue->SetNull(); + return; + } + + CXFA_Node* pUIChild = pWidgetData->GetUIChild(); + CXFA_Node* pNode = pWidgetData->GetFormValueData().GetNode()->GetNodeItem( + XFA_NODEITEM_FirstChild); + if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { + if (pUIChild->GetElementType() == XFA_Element::NumericEdit && + (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { + pValue->SetString(content.UTF8Encode().AsStringView()); + } else { + CFX_Decimal decimal(content.AsStringView()); + pValue->SetFloat((float)(double)decimal); + } + } else if (pNode && pNode->GetElementType() == XFA_Element::Integer) { + pValue->SetInteger(FXSYS_wtoi(content.c_str())); + } else if (pNode && pNode->GetElementType() == XFA_Element::Boolean) { + pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? false : true); + } else if (pNode && pNode->GetElementType() == XFA_Element::Float) { + CFX_Decimal decimal(content.AsStringView()); + pValue->SetFloat((float)(double)decimal); + } else { + pValue->SetString(content.UTF8Encode().AsStringView()); + } +} + +void CJX_Field::editValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + if (!pWidgetData) + return; + + if (bSetting) { + pWidgetData->SetValue(XFA_VALUEPICTURE_Edit, pValue->ToWideString()); + return; + } + pValue->SetString( + pWidgetData->GetValue(XFA_VALUEPICTURE_Edit).UTF8Encode().AsStringView()); +} + +void CJX_Field::formatMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage); +} + +void CJX_Field::formattedValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + if (!pWidgetData) + return; + + if (bSetting) { + pWidgetData->SetValue(XFA_VALUEPICTURE_Display, pValue->ToWideString()); + return; + } + pValue->SetString(pWidgetData->GetValue(XFA_VALUEPICTURE_Display) + .UTF8Encode() + .AsStringView()); +} + +void CJX_Field::parentSubform(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetNull(); +} + +void CJX_Field::selectedIndex(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); + if (!pWidgetData) + return; + + if (!bSetting) { + pValue->SetInteger(pWidgetData->GetSelectedItem(0)); + return; + } + + int32_t iIndex = pValue->ToInteger(); + if (iIndex == -1) { + pWidgetData->ClearAllSelections(); + return; + } + + pWidgetData->SetItemState(iIndex, true, true, true, true); +} + +void CJX_Field::access(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::accessKey(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::anchorType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::borderColor(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_BorderColor(pValue, bSetting, eAttribute); +} + +void CJX_Field::borderWidth(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_BorderWidth(pValue, bSetting, eAttribute); +} + +void CJX_Field::colSpan(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::fillColor(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_FillColor(pValue, bSetting, eAttribute); +} + +void CJX_Field::fontColor(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_FontColor(pValue, bSetting, eAttribute); +} + +void CJX_Field::h(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::hAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::locale(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::mandatory(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_Mandatory(pValue, bSetting, eAttribute); +} + +void CJX_Field::mandatoryMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_MandatoryMessage(pValue, bSetting, eAttribute); +} + +void CJX_Field::maxH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::maxW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::minH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::minW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::rawValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Field::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::rotate(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::validationMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_ValidationMessage(pValue, bSetting, eAttribute); +} + +void CJX_Field::vAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::w(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Field::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_field.h b/fxjs/xfa/cjx_field.h index 524a6afdaa..4f7238fc19 100644 --- a/fxjs/xfa/cjx_field.h +++ b/fxjs/xfa/cjx_field.h @@ -30,6 +30,41 @@ class CJX_Field : public CJX_Container { JS_METHOD(getSaveItem, CJX_Field); JS_METHOD(setItemState, CJX_Field); + JS_PROP(defaultValue); /* {default} */ + JS_PROP(access); + JS_PROP(accessKey); + JS_PROP(anchorType); + JS_PROP(borderColor); + JS_PROP(borderWidth); + JS_PROP(colSpan); + JS_PROP(editValue); + JS_PROP(fillColor); + JS_PROP(fontColor); + JS_PROP(formatMessage); + JS_PROP(formattedValue); + JS_PROP(h); + JS_PROP(hAlign); + JS_PROP(locale); + JS_PROP(mandatory); + JS_PROP(mandatoryMessage); + JS_PROP(maxH); + JS_PROP(maxW); + JS_PROP(minH); + JS_PROP(minW); + JS_PROP(parentSubform); + JS_PROP(presence); + JS_PROP(rawValue); + JS_PROP(relevant); + JS_PROP(rotate); + JS_PROP(selectedIndex); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(validationMessage); + JS_PROP(vAlign); + JS_PROP(w); + JS_PROP(x); + JS_PROP(y); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_fill.cpp b/fxjs/xfa/cjx_fill.cpp new file mode 100644 index 0000000000..1c6aa957c8 --- /dev/null +++ b/fxjs/xfa/cjx_fill.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_fill.h" + +#include "xfa/fxfa/parser/cxfa_fill.h" + +CJX_Fill::CJX_Fill(CXFA_Fill* node) : CJX_Node(node) {} + +CJX_Fill::~CJX_Fill() = default; + +void CJX_Fill::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Fill::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Fill::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_fill.h b/fxjs/xfa/cjx_fill.h new file mode 100644 index 0000000000..869e3cc2b5 --- /dev/null +++ b/fxjs/xfa/cjx_fill.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_FILL_H_ +#define FXJS_XFA_CJX_FILL_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Fill; + +class CJX_Fill : public CJX_Node { + public: + explicit CJX_Fill(CXFA_Fill* node); + ~CJX_Fill() override; + + JS_PROP(presence); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_FILL_H_ diff --git a/fxjs/xfa/cjx_filter.cpp b/fxjs/xfa/cjx_filter.cpp new file mode 100644 index 0000000000..e43dfa8aed --- /dev/null +++ b/fxjs/xfa/cjx_filter.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_filter.h" + +#include "xfa/fxfa/parser/cxfa_filter.h" + +CJX_Filter::CJX_Filter(CXFA_Filter* node) : CJX_Node(node) {} + +CJX_Filter::~CJX_Filter() = default; + +void CJX_Filter::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Filter::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Filter::addRevocationInfo(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_filter.h b/fxjs/xfa/cjx_filter.h new file mode 100644 index 0000000000..275d509bbc --- /dev/null +++ b/fxjs/xfa/cjx_filter.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_FILTER_H_ +#define FXJS_XFA_CJX_FILTER_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Filter; + +class CJX_Filter : public CJX_Node { + public: + explicit CJX_Filter(CXFA_Filter* node); + ~CJX_Filter() override; + + JS_PROP(addRevocationInfo); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_FILTER_H_ diff --git a/fxjs/xfa/cjx_float.cpp b/fxjs/xfa/cjx_float.cpp new file mode 100644 index 0000000000..0480812937 --- /dev/null +++ b/fxjs/xfa/cjx_float.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_float.h" + +#include "xfa/fxfa/parser/cxfa_float.h" + +CJX_Float::CJX_Float(CXFA_Float* node) : CJX_Content(node) {} + +CJX_Float::~CJX_Float() = default; + +void CJX_Float::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Float::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Float::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Float::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_float.h b/fxjs/xfa/cjx_float.h new file mode 100644 index 0000000000..1c9489b35f --- /dev/null +++ b/fxjs/xfa/cjx_float.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_FLOAT_H_ +#define FXJS_XFA_CJX_FLOAT_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Float; + +class CJX_Float : public CJX_Content { + public: + explicit CJX_Float(CXFA_Float* node); + ~CJX_Float() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_FLOAT_H_ diff --git a/fxjs/xfa/cjx_font.cpp b/fxjs/xfa/cjx_font.cpp new file mode 100644 index 0000000000..d0c62374d8 --- /dev/null +++ b/fxjs/xfa/cjx_font.cpp @@ -0,0 +1,115 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_font.h" + +#include "xfa/fxfa/parser/cxfa_font.h" + +CJX_Font::CJX_Font(CXFA_Font* node) : CJX_Node(node) {} + +CJX_Font::~CJX_Font() = default; + +void CJX_Font::lineThrough(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::typeface(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::fontHorizontalScale(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::kerningMode(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::underline(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::baselineShift(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::overlinePeriod(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::letterSpacing(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::lineThroughPeriod(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::fontVerticalScale(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::size(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::posture(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::weight(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::underlinePeriod(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Font::overline(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_font.h b/fxjs/xfa/cjx_font.h new file mode 100644 index 0000000000..65b40e4508 --- /dev/null +++ b/fxjs/xfa/cjx_font.h @@ -0,0 +1,38 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_FONT_H_ +#define FXJS_XFA_CJX_FONT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Font; + +class CJX_Font : public CJX_Node { + public: + explicit CJX_Font(CXFA_Font* node); + ~CJX_Font() override; + + JS_PROP(baselineShift); + JS_PROP(fontHorizontalScale); + JS_PROP(fontVerticalScale); + JS_PROP(kerningMode); + JS_PROP(letterSpacing); + JS_PROP(lineThrough); + JS_PROP(lineThroughPeriod); + JS_PROP(overline); + JS_PROP(overlinePeriod); + JS_PROP(posture); + JS_PROP(size); + JS_PROP(typeface); + JS_PROP(underline); + JS_PROP(underlinePeriod); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(weight); +}; + +#endif // FXJS_XFA_CJX_FONT_H_ diff --git a/fxjs/xfa/cjx_format.cpp b/fxjs/xfa/cjx_format.cpp new file mode 100644 index 0000000000..9786502901 --- /dev/null +++ b/fxjs/xfa/cjx_format.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_format.h" + +#include "xfa/fxfa/parser/cxfa_format.h" + +CJX_Format::CJX_Format(CXFA_Format* node) : CJX_Node(node) {} + +CJX_Format::~CJX_Format() = default; + +void CJX_Format::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Format::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_format.h b/fxjs/xfa/cjx_format.h new file mode 100644 index 0000000000..5e8c971b96 --- /dev/null +++ b/fxjs/xfa/cjx_format.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_FORMAT_H_ +#define FXJS_XFA_CJX_FORMAT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Format; + +class CJX_Format : public CJX_Node { + public: + explicit CJX_Format(CXFA_Format* node); + ~CJX_Format() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_FORMAT_H_ diff --git a/fxjs/xfa/cjx_handler.cpp b/fxjs/xfa/cjx_handler.cpp new file mode 100644 index 0000000000..3e09a7550d --- /dev/null +++ b/fxjs/xfa/cjx_handler.cpp @@ -0,0 +1,35 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_handler.h" + +#include "xfa/fxfa/parser/cxfa_handler.h" + +CJX_Handler::CJX_Handler(CXFA_Handler* node) : CJX_TextNode(node) {} + +CJX_Handler::~CJX_Handler() = default; + +void CJX_Handler::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Handler::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Handler::version(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Handler::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_handler.h b/fxjs/xfa/cjx_handler.h new file mode 100644 index 0000000000..373328b85f --- /dev/null +++ b/fxjs/xfa/cjx_handler.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_HANDLER_H_ +#define FXJS_XFA_CJX_HANDLER_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Handler; + +class CJX_Handler : public CJX_TextNode { + public: + explicit CJX_Handler(CXFA_Handler* node); + ~CJX_Handler() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(version); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_HANDLER_H_ diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp index 555381f623..f862accbe0 100644 --- a/fxjs/xfa/cjx_hostpseudomodel.cpp +++ b/fxjs/xfa/cjx_hostpseudomodel.cpp @@ -70,7 +70,7 @@ CJX_HostPseudoModel::CJX_HostPseudoModel(CScript_HostPseudoModel* model) CJX_HostPseudoModel::~CJX_HostPseudoModel() {} -void CJX_HostPseudoModel::AppType(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::appType(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -84,7 +84,7 @@ void CJX_HostPseudoModel::AppType(CFXJSE_Value* pValue, pValue->SetString("Exchange"); } -void CJX_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::calculationsEnabled(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -100,7 +100,7 @@ void CJX_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue, pValue->SetBoolean(pNotify->GetDocEnvironment()->IsCalculationsEnabled(hDoc)); } -void CJX_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::currentPage(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -115,7 +115,7 @@ void CJX_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue, pValue->SetInteger(pNotify->GetDocEnvironment()->GetCurrentPage(hDoc)); } -void CJX_HostPseudoModel::Language(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::language(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -130,7 +130,7 @@ void CJX_HostPseudoModel::Language(CFXJSE_Value* pValue, pNotify->GetAppProvider()->GetLanguage().UTF8Encode().AsStringView()); } -void CJX_HostPseudoModel::NumPages(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::numPages(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -145,7 +145,7 @@ void CJX_HostPseudoModel::NumPages(CFXJSE_Value* pValue, pValue->SetInteger(pNotify->GetDocEnvironment()->CountPages(hDoc)); } -void CJX_HostPseudoModel::Platform(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::platform(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -160,7 +160,7 @@ void CJX_HostPseudoModel::Platform(CFXJSE_Value* pValue, pNotify->GetAppProvider()->GetPlatform().UTF8Encode().AsStringView()); } -void CJX_HostPseudoModel::Title(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::title(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { if (!GetDocument()->GetScriptContext()->IsRunAtClient()) @@ -181,7 +181,7 @@ void CJX_HostPseudoModel::Title(CFXJSE_Value* pValue, pValue->SetString(wsTitle.UTF8Encode().AsStringView()); } -void CJX_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::validationsEnabled(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -199,7 +199,7 @@ void CJX_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue, pValue->SetBoolean(bEnabled); } -void CJX_HostPseudoModel::Variation(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::variation(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { if (!GetDocument()->GetScriptContext()->IsRunAtClient()) @@ -216,7 +216,7 @@ void CJX_HostPseudoModel::Variation(CFXJSE_Value* pValue, pValue->SetString("Full"); } -void CJX_HostPseudoModel::Version(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::version(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); @@ -230,7 +230,7 @@ void CJX_HostPseudoModel::Version(CFXJSE_Value* pValue, pValue->SetString("11"); } -void CJX_HostPseudoModel::Name(CFXJSE_Value* pValue, +void CJX_HostPseudoModel::name(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); diff --git a/fxjs/xfa/cjx_hostpseudomodel.h b/fxjs/xfa/cjx_hostpseudomodel.h index fa3277a2c9..b4d6fe66e2 100644 --- a/fxjs/xfa/cjx_hostpseudomodel.h +++ b/fxjs/xfa/cjx_hostpseudomodel.h @@ -19,24 +19,6 @@ class CJX_HostPseudoModel : public CJX_Object { explicit CJX_HostPseudoModel(CScript_HostPseudoModel* model); ~CJX_HostPseudoModel() override; - void AppType(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void CalculationsEnabled(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void CurrentPage(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Language(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void NumPages(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Platform(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Title(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void ValidationsEnabled(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Variation(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Version(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Name(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - JS_METHOD(beep, CJX_HostPseudoModel); JS_METHOD(documentCountInBatch, CJX_HostPseudoModel); JS_METHOD(documentInBatch, CJX_HostPseudoModel); @@ -53,6 +35,21 @@ class CJX_HostPseudoModel : public CJX_Object { JS_METHOD(response, CJX_HostPseudoModel); JS_METHOD(setFocus, CJX_HostPseudoModel); + JS_PROP(appType); + JS_PROP(calculationsEnabled); + JS_PROP(currentPage); + JS_PROP(language); + JS_PROP(numPages); + JS_PROP(platform); + JS_PROP(title); + JS_PROP(validationsEnabled); + JS_PROP(variation); + JS_PROP(version); + + // TODO(dsinclair): Remove when xfa_basic_data_element_script is removed. + // Doesn't exist in spec + JS_PROP(name); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_image.cpp b/fxjs/xfa/cjx_image.cpp new file mode 100644 index 0000000000..0ea2131c8f --- /dev/null +++ b/fxjs/xfa/cjx_image.cpp @@ -0,0 +1,61 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_image.h" + +#include "xfa/fxfa/parser/cxfa_image.h" + +CJX_Image::CJX_Image(CXFA_Image* node) : CJX_Node(node) {} + +CJX_Image::~CJX_Image() = default; + +void CJX_Image::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Image::contentType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Image::transferEncoding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Image::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue_Read(pValue, bSetting, eAttribute); +} + +void CJX_Image::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Image::aspect(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Image::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue_Read(pValue, bSetting, eAttribute); +} + +void CJX_Image::href(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_image.h b/fxjs/xfa/cjx_image.h new file mode 100644 index 0000000000..5cd120a674 --- /dev/null +++ b/fxjs/xfa/cjx_image.h @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_IMAGE_H_ +#define FXJS_XFA_CJX_IMAGE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Image; + +class CJX_Image : public CJX_Node { + public: + explicit CJX_Image(CXFA_Image* node); + ~CJX_Image() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(aspect); + JS_PROP(contentType); + JS_PROP(href); + JS_PROP(transferEncoding); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_IMAGE_H_ diff --git a/fxjs/xfa/cjx_imageedit.cpp b/fxjs/xfa/cjx_imageedit.cpp new file mode 100644 index 0000000000..a325eca6dc --- /dev/null +++ b/fxjs/xfa/cjx_imageedit.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_imageedit.h" + +#include "xfa/fxfa/parser/cxfa_imageedit.h" + +CJX_ImageEdit::CJX_ImageEdit(CXFA_ImageEdit* node) : CJX_Node(node) {} + +CJX_ImageEdit::~CJX_ImageEdit() = default; + +void CJX_ImageEdit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ImageEdit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ImageEdit::data(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_imageedit.h b/fxjs/xfa/cjx_imageedit.h new file mode 100644 index 0000000000..ebf4fa3e8c --- /dev/null +++ b/fxjs/xfa/cjx_imageedit.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_IMAGEEDIT_H_ +#define FXJS_XFA_CJX_IMAGEEDIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_ImageEdit; + +class CJX_ImageEdit : public CJX_Node { + public: + explicit CJX_ImageEdit(CXFA_ImageEdit* node); + ~CJX_ImageEdit() override; + + JS_PROP(data); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_IMAGEEDIT_H_ diff --git a/fxjs/xfa/cjx_insert.cpp b/fxjs/xfa/cjx_insert.cpp new file mode 100644 index 0000000000..cf2ae32489 --- /dev/null +++ b/fxjs/xfa/cjx_insert.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_insert.h" + +#include "xfa/fxfa/parser/cxfa_insert.h" + +CJX_Insert::CJX_Insert(CXFA_Insert* node) : CJX_TextNode(node) {} + +CJX_Insert::~CJX_Insert() = default; + +void CJX_Insert::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Insert::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_insert.h b/fxjs/xfa/cjx_insert.h new file mode 100644 index 0000000000..3b73df8f7d --- /dev/null +++ b/fxjs/xfa/cjx_insert.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_INSERT_H_ +#define FXJS_XFA_CJX_INSERT_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Insert; + +class CJX_Insert : public CJX_TextNode { + public: + explicit CJX_Insert(CXFA_Insert* node); + ~CJX_Insert() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_INSERT_H_ diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp index 23048f98a5..86f8cf3e88 100644 --- a/fxjs/xfa/cjx_instancemanager.cpp +++ b/fxjs/xfa/cjx_instancemanager.cpp @@ -6,6 +6,7 @@ #include "fxjs/xfa/cjx_instancemanager.h" +#include #include #include "fxjs/cfxjse_engine.h" @@ -31,6 +32,90 @@ CJX_InstanceManager::CJX_InstanceManager(CXFA_InstanceManager* mgr) CJX_InstanceManager::~CJX_InstanceManager() {} +int32_t CJX_InstanceManager::SetInstances(int32_t iDesired) { + CXFA_OccurData occurData(GetXFANode()->GetOccurNode()); + if (iDesired < occurData.GetMin()) { + ThrowTooManyOccurancesException(L"min"); + return 1; + } + + int32_t iMax = occurData.GetMax(); + if (iMax >= 0 && iDesired > iMax) { + ThrowTooManyOccurancesException(L"max"); + return 2; + } + + int32_t iCount = GetXFANode()->GetCount(); + if (iDesired == iCount) + return 0; + + if (iDesired < iCount) { + WideString wsInstManagerName = GetCData(XFA_Attribute::Name); + WideString wsInstanceName = WideString( + wsInstManagerName.IsEmpty() + ? wsInstManagerName + : wsInstManagerName.Right(wsInstManagerName.GetLength() - 1)); + uint32_t dInstanceNameHash = + FX_HashCode_GetW(wsInstanceName.AsStringView(), false); + CXFA_Node* pPrevSibling = + iDesired == 0 ? GetXFANode() : GetXFANode()->GetItem(iDesired - 1); + while (iCount > iDesired) { + CXFA_Node* pRemoveInstance = + pPrevSibling->GetNodeItem(XFA_NODEITEM_NextSibling); + if (pRemoveInstance->GetElementType() != XFA_Element::Subform && + pRemoveInstance->GetElementType() != XFA_Element::SubformSet) { + continue; + } + if (pRemoveInstance->GetElementType() == XFA_Element::InstanceManager) { + NOTREACHED(); + break; + } + if (pRemoveInstance->GetNameHash() == dInstanceNameHash) { + GetXFANode()->RemoveItem(pRemoveInstance, true); + iCount--; + } + } + } else { + while (iCount < iDesired) { + CXFA_Node* pNewInstance = GetXFANode()->CreateInstance(true); + GetXFANode()->InsertItem(pNewInstance, iCount, iCount, false); + iCount++; + CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); + if (!pNotify) + return 0; + + pNotify->RunNodeInitialize(pNewInstance); + } + } + + CXFA_LayoutProcessor* pLayoutPro = GetDocument()->GetLayoutProcessor(); + if (pLayoutPro) { + pLayoutPro->AddChangedContainer( + ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form))); + } + return 0; +} + +int32_t CJX_InstanceManager::MoveInstance(int32_t iTo, int32_t iFrom) { + int32_t iCount = GetXFANode()->GetCount(); + if (iFrom > iCount || iTo > iCount - 1) { + ThrowIndexOutOfBoundsException(); + return 1; + } + if (iFrom < 0 || iTo < 0 || iFrom == iTo) + return 0; + + CXFA_Node* pMoveInstance = GetXFANode()->GetItem(iFrom); + GetXFANode()->RemoveItem(pMoveInstance, false); + GetXFANode()->InsertItem(pMoveInstance, iTo, iCount - 1, true); + CXFA_LayoutProcessor* pLayoutPro = GetDocument()->GetLayoutProcessor(); + if (pLayoutPro) { + pLayoutPro->AddChangedContainer( + ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form))); + } + return 0; +} + CJS_Return CJX_InstanceManager::moveInstance( CJS_V8* runtime, const std::vector>& params) { @@ -39,7 +124,7 @@ CJS_Return CJX_InstanceManager::moveInstance( int32_t iFrom = runtime->ToInt32(params[0]); int32_t iTo = runtime->ToInt32(params[1]); - InstanceManager_MoveInstance(iTo, iFrom); + MoveInstance(iTo, iFrom); CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (!pNotify) @@ -100,7 +185,7 @@ CJS_Return CJX_InstanceManager::setInstances( if (params.size() != 1) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - InstanceManager_SetInstances(runtime->ToInt32(params[0])); + SetInstances(runtime->ToInt32(params[0])); return CJS_Return(true); } @@ -180,3 +265,33 @@ CJS_Return CJX_InstanceManager::insertInstance( return CJS_Return(value->DirectGetValue().Get(runtime->GetIsolate())); } + +void CJX_InstanceManager::max(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetInteger(CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMax()); +} + +void CJX_InstanceManager::min(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetInteger(CXFA_OccurData(GetXFANode()->GetOccurNode()).GetMin()); +} + +void CJX_InstanceManager::count(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + pValue->SetInteger(GetXFANode()->GetCount()); + return; + } + SetInstances(pValue->ToInteger()); +} diff --git a/fxjs/xfa/cjx_instancemanager.h b/fxjs/xfa/cjx_instancemanager.h index 1fd41a6402..74efad5ba9 100644 --- a/fxjs/xfa/cjx_instancemanager.h +++ b/fxjs/xfa/cjx_instancemanager.h @@ -23,7 +23,15 @@ class CJX_InstanceManager : public CJX_Node { JS_METHOD(removeInstance, CJX_InstanceManager); JS_METHOD(setInstances, CJX_InstanceManager); + JS_PROP(count); + JS_PROP(max); + JS_PROP(min); + + int32_t MoveInstance(int32_t iTo, int32_t iFrom); + private: + int32_t SetInstances(int32_t iDesired); + static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_integer.cpp b/fxjs/xfa/cjx_integer.cpp new file mode 100644 index 0000000000..f1840dd36a --- /dev/null +++ b/fxjs/xfa/cjx_integer.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_integer.h" + +#include "xfa/fxfa/parser/cxfa_integer.h" + +CJX_Integer::CJX_Integer(CXFA_Integer* node) : CJX_Content(node) {} + +CJX_Integer::~CJX_Integer() = default; + +void CJX_Integer::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Integer::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Integer::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Integer::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_integer.h b/fxjs/xfa/cjx_integer.h new file mode 100644 index 0000000000..90daabfc6f --- /dev/null +++ b/fxjs/xfa/cjx_integer.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_INTEGER_H_ +#define FXJS_XFA_CJX_INTEGER_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Integer; + +class CJX_Integer : public CJX_Content { + public: + explicit CJX_Integer(CXFA_Integer* node); + ~CJX_Integer() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_INTEGER_H_ diff --git a/fxjs/xfa/cjx_issuers.cpp b/fxjs/xfa/cjx_issuers.cpp new file mode 100644 index 0000000000..5cd381d640 --- /dev/null +++ b/fxjs/xfa/cjx_issuers.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_issuers.h" + +#include "xfa/fxfa/parser/cxfa_issuers.h" + +CJX_Issuers::CJX_Issuers(CXFA_Issuers* node) : CJX_Node(node) {} + +CJX_Issuers::~CJX_Issuers() = default; + +void CJX_Issuers::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Issuers::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Issuers::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_issuers.h b/fxjs/xfa/cjx_issuers.h new file mode 100644 index 0000000000..5d76e72b93 --- /dev/null +++ b/fxjs/xfa/cjx_issuers.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ISSUERS_H_ +#define FXJS_XFA_CJX_ISSUERS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Issuers; + +class CJX_Issuers : public CJX_Node { + public: + explicit CJX_Issuers(CXFA_Issuers* node); + ~CJX_Issuers() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ISSUERS_H_ diff --git a/fxjs/xfa/cjx_items.cpp b/fxjs/xfa/cjx_items.cpp new file mode 100644 index 0000000000..e4afdd04f4 --- /dev/null +++ b/fxjs/xfa/cjx_items.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_items.h" + +#include "xfa/fxfa/parser/cxfa_items.h" + +CJX_Items::CJX_Items(CXFA_Items* node) : CJX_Node(node) {} + +CJX_Items::~CJX_Items() = default; + +void CJX_Items::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Items::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Items::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Items::save(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Items::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_items.h b/fxjs/xfa/cjx_items.h new file mode 100644 index 0000000000..94f2b4374d --- /dev/null +++ b/fxjs/xfa/cjx_items.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ITEMS_H_ +#define FXJS_XFA_CJX_ITEMS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Items; + +class CJX_Items : public CJX_Node { + public: + explicit CJX_Items(CXFA_Items* node); + ~CJX_Items() override; + + JS_PROP(presence); + JS_PROP(ref); + JS_PROP(save); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ITEMS_H_ diff --git a/fxjs/xfa/cjx_keep.cpp b/fxjs/xfa/cjx_keep.cpp new file mode 100644 index 0000000000..25238e3c58 --- /dev/null +++ b/fxjs/xfa/cjx_keep.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_keep.h" + +#include "xfa/fxfa/parser/cxfa_keep.h" + +CJX_Keep::CJX_Keep(CXFA_Keep* node) : CJX_Node(node) {} + +CJX_Keep::~CJX_Keep() = default; + +void CJX_Keep::next(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Keep::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Keep::previous(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Keep::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Keep::intact(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_keep.h b/fxjs/xfa/cjx_keep.h new file mode 100644 index 0000000000..fa8a1119f2 --- /dev/null +++ b/fxjs/xfa/cjx_keep.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_KEEP_H_ +#define FXJS_XFA_CJX_KEEP_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Keep; + +class CJX_Keep : public CJX_Node { + public: + explicit CJX_Keep(CXFA_Keep* node); + ~CJX_Keep() override; + + JS_PROP(intact); + JS_PROP(next); + JS_PROP(previous); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_KEEP_H_ diff --git a/fxjs/xfa/cjx_keyusage.cpp b/fxjs/xfa/cjx_keyusage.cpp new file mode 100644 index 0000000000..99947e9e7d --- /dev/null +++ b/fxjs/xfa/cjx_keyusage.cpp @@ -0,0 +1,85 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_keyusage.h" + +#include "xfa/fxfa/parser/cxfa_keyusage.h" + +CJX_KeyUsage::CJX_KeyUsage(CXFA_KeyUsage* node) : CJX_Node(node) {} + +CJX_KeyUsage::~CJX_KeyUsage() = default; + +void CJX_KeyUsage::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::nonRepudiation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::encipherOnly(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::digitalSignature(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::crlSign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::keyAgreement(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::keyEncipherment(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::dataEncipherment(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::keyCertSign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_KeyUsage::decipherOnly(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_keyusage.h b/fxjs/xfa/cjx_keyusage.h new file mode 100644 index 0000000000..3ff546de18 --- /dev/null +++ b/fxjs/xfa/cjx_keyusage.h @@ -0,0 +1,33 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_KEYUSAGE_H_ +#define FXJS_XFA_CJX_KEYUSAGE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_KeyUsage; + +class CJX_KeyUsage : public CJX_Node { + public: + explicit CJX_KeyUsage(CXFA_KeyUsage* node); + ~CJX_KeyUsage() override; + + JS_PROP(crlSign); + JS_PROP(dataEncipherment); + JS_PROP(decipherOnly); + JS_PROP(digitalSignature); + JS_PROP(encipherOnly); + JS_PROP(keyAgreement); + JS_PROP(keyCertSign); + JS_PROP(keyEncipherment); + JS_PROP(nonRepudiation); + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_KEYUSAGE_H_ diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp index e3e0fea5f9..638da41eea 100644 --- a/fxjs/xfa/cjx_layoutpseudomodel.cpp +++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp @@ -52,7 +52,7 @@ CJX_LayoutPseudoModel::CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model) CJX_LayoutPseudoModel::~CJX_LayoutPseudoModel() {} -void CJX_LayoutPseudoModel::Ready(CFXJSE_Value* pValue, +void CJX_LayoutPseudoModel::ready(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); diff --git a/fxjs/xfa/cjx_layoutpseudomodel.h b/fxjs/xfa/cjx_layoutpseudomodel.h index 63dc789190..6dbef6038a 100644 --- a/fxjs/xfa/cjx_layoutpseudomodel.h +++ b/fxjs/xfa/cjx_layoutpseudomodel.h @@ -29,8 +29,6 @@ class CJX_LayoutPseudoModel : public CJX_Object { explicit CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model); ~CJX_LayoutPseudoModel() override; - void Ready(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - JS_METHOD(absPage, CJX_LayoutPseudoModel); JS_METHOD(absPageCount, CJX_LayoutPseudoModel); JS_METHOD(absPageCountInBatch, CJX_LayoutPseudoModel); @@ -51,6 +49,8 @@ class CJX_LayoutPseudoModel : public CJX_Object { JS_METHOD(x, CJX_LayoutPseudoModel); JS_METHOD(y, CJX_LayoutPseudoModel); + JS_PROP(ready); + private: CJS_Return NumberedPageCount(CJS_V8* runtime, bool bNumbered); CJS_Return HWXY(CJS_V8* runtime, diff --git a/fxjs/xfa/cjx_line.cpp b/fxjs/xfa/cjx_line.cpp new file mode 100644 index 0000000000..48569390a4 --- /dev/null +++ b/fxjs/xfa/cjx_line.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_line.h" + +#include "xfa/fxfa/parser/cxfa_line.h" + +CJX_Line::CJX_Line(CXFA_Line* node) : CJX_Node(node) {} + +CJX_Line::~CJX_Line() = default; + +void CJX_Line::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Line::slope(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Line::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Line::hand(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_line.h b/fxjs/xfa/cjx_line.h new file mode 100644 index 0000000000..7041c1259c --- /dev/null +++ b/fxjs/xfa/cjx_line.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_LINE_H_ +#define FXJS_XFA_CJX_LINE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Line; + +class CJX_Line : public CJX_Node { + public: + explicit CJX_Line(CXFA_Line* node); + ~CJX_Line() override; + + JS_PROP(hand); + JS_PROP(slope); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_LINE_H_ diff --git a/fxjs/xfa/cjx_linear.cpp b/fxjs/xfa/cjx_linear.cpp new file mode 100644 index 0000000000..1c22699054 --- /dev/null +++ b/fxjs/xfa/cjx_linear.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_linear.h" + +#include "xfa/fxfa/parser/cxfa_linear.h" + +CJX_Linear::CJX_Linear(CXFA_Linear* node) : CJX_Node(node) {} + +CJX_Linear::~CJX_Linear() = default; + +void CJX_Linear::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Linear::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Linear::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_linear.h b/fxjs/xfa/cjx_linear.h new file mode 100644 index 0000000000..30a54bff47 --- /dev/null +++ b/fxjs/xfa/cjx_linear.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_LINEAR_H_ +#define FXJS_XFA_CJX_LINEAR_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Linear; + +class CJX_Linear : public CJX_Node { + public: + explicit CJX_Linear(CXFA_Linear* node); + ~CJX_Linear() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_LINEAR_H_ diff --git a/fxjs/xfa/cjx_list.h b/fxjs/xfa/cjx_list.h index 45d827c21e..83801b7e08 100644 --- a/fxjs/xfa/cjx_list.h +++ b/fxjs/xfa/cjx_list.h @@ -22,7 +22,7 @@ class CJX_List : public CJX_Object { JS_METHOD(item, CJX_List); JS_METHOD(remove, CJX_List); - void length(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); + JS_PROP(length); private: CXFA_List* GetXFAList(); diff --git a/fxjs/xfa/cjx_logpseudomodel.h b/fxjs/xfa/cjx_logpseudomodel.h index 2d98241c5a..772bf30540 100644 --- a/fxjs/xfa/cjx_logpseudomodel.h +++ b/fxjs/xfa/cjx_logpseudomodel.h @@ -12,6 +12,8 @@ class CScript_LogPseudoModel; +// TODO(dsinclair): This doesn't exist in the spec. Remove after +// xfa_basic_data_element_script is removed. class CJX_LogPseudoModel : public CJX_Object { public: explicit CJX_LogPseudoModel(CScript_LogPseudoModel* model); diff --git a/fxjs/xfa/cjx_manifest.cpp b/fxjs/xfa/cjx_manifest.cpp index d5c986a83b..bd482d0f4b 100644 --- a/fxjs/xfa/cjx_manifest.cpp +++ b/fxjs/xfa/cjx_manifest.cpp @@ -30,3 +30,27 @@ CJS_Return CJX_Manifest::evaluate( CXFA_WidgetData* pWidgetData = GetWidgetData(); return CJS_Return(runtime->NewBoolean(!!pWidgetData)); } + +void CJX_Manifest::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Manifest::action(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Manifest::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Manifest::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_manifest.h b/fxjs/xfa/cjx_manifest.h index fd28e4065a..75fcacdfb1 100644 --- a/fxjs/xfa/cjx_manifest.h +++ b/fxjs/xfa/cjx_manifest.h @@ -19,6 +19,11 @@ class CJX_Manifest : public CJX_Node { JS_METHOD(evaluate, CJX_Manifest); + JS_PROP(defaultValue); /* {default} */ + JS_PROP(action); + JS_PROP(use); + JS_PROP(usehref); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_map.cpp b/fxjs/xfa/cjx_map.cpp new file mode 100644 index 0000000000..7a1fa14264 --- /dev/null +++ b/fxjs/xfa/cjx_map.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_map.h" + +#include "xfa/fxfa/parser/cxfa_map.h" + +CJX_Map::CJX_Map(CXFA_Map* node) : CJX_Node(node) {} + +CJX_Map::~CJX_Map() = default; + +void CJX_Map::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Map::bind(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Map::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Map::from(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_map.h b/fxjs/xfa/cjx_map.h new file mode 100644 index 0000000000..dba7eb63e2 --- /dev/null +++ b/fxjs/xfa/cjx_map.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_MAP_H_ +#define FXJS_XFA_CJX_MAP_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Map; + +class CJX_Map : public CJX_Node { + public: + explicit CJX_Map(CXFA_Map* node); + ~CJX_Map() override; + + JS_PROP(bind); + JS_PROP(from); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_MAP_H_ diff --git a/fxjs/xfa/cjx_margin.cpp b/fxjs/xfa/cjx_margin.cpp new file mode 100644 index 0000000000..62a180b324 --- /dev/null +++ b/fxjs/xfa/cjx_margin.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_margin.h" + +#include "xfa/fxfa/parser/cxfa_margin.h" + +CJX_Margin::CJX_Margin(CXFA_Margin* node) : CJX_Node(node) {} + +CJX_Margin::~CJX_Margin() = default; + +void CJX_Margin::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Margin::leftInset(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Margin::bottomInset(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Margin::topInset(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Margin::rightInset(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Margin::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_margin.h b/fxjs/xfa/cjx_margin.h new file mode 100644 index 0000000000..0ca884f708 --- /dev/null +++ b/fxjs/xfa/cjx_margin.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_MARGIN_H_ +#define FXJS_XFA_CJX_MARGIN_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Margin; + +class CJX_Margin : public CJX_Node { + public: + explicit CJX_Margin(CXFA_Margin* node); + ~CJX_Margin() override; + + JS_PROP(bottomInset); + JS_PROP(leftInset); + JS_PROP(rightInset); + JS_PROP(topInset); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_MARGIN_H_ diff --git a/fxjs/xfa/cjx_mdp.cpp b/fxjs/xfa/cjx_mdp.cpp new file mode 100644 index 0000000000..59730f68e6 --- /dev/null +++ b/fxjs/xfa/cjx_mdp.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_mdp.h" + +#include "xfa/fxfa/parser/cxfa_mdp.h" + +CJX_Mdp::CJX_Mdp(CXFA_Mdp* node) : CJX_Node(node) {} + +CJX_Mdp::~CJX_Mdp() = default; + +void CJX_Mdp::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Mdp::signatureType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Mdp::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Mdp::permissions(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_mdp.h b/fxjs/xfa/cjx_mdp.h new file mode 100644 index 0000000000..bdce2b83fd --- /dev/null +++ b/fxjs/xfa/cjx_mdp.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_MDP_H_ +#define FXJS_XFA_CJX_MDP_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Mdp; + +class CJX_Mdp : public CJX_Node { + public: + explicit CJX_Mdp(CXFA_Mdp* node); + ~CJX_Mdp() override; + + JS_PROP(permissions); + JS_PROP(signatureType); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_MDP_H_ diff --git a/fxjs/xfa/cjx_medium.cpp b/fxjs/xfa/cjx_medium.cpp new file mode 100644 index 0000000000..e8986d9bbb --- /dev/null +++ b/fxjs/xfa/cjx_medium.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_medium.h" + +#include "xfa/fxfa/parser/cxfa_medium.h" + +CJX_Medium::CJX_Medium(CXFA_Medium* node) : CJX_Node(node) {} + +CJX_Medium::~CJX_Medium() = default; + +void CJX_Medium::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::orientation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::imagingBBox(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::shortValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::stock(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Medium::longValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_medium.h b/fxjs/xfa/cjx_medium.h new file mode 100644 index 0000000000..99023dc4ab --- /dev/null +++ b/fxjs/xfa/cjx_medium.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_MEDIUM_H_ +#define FXJS_XFA_CJX_MEDIUM_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Medium; + +class CJX_Medium : public CJX_Node { + public: + explicit CJX_Medium(CXFA_Medium* node); + ~CJX_Medium() override; + + JS_PROP(imagingBBox); + JS_PROP(longValue); /* long */ + JS_PROP(orientation); + JS_PROP(shortValue); /* short */ + JS_PROP(stock); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_MEDIUM_H_ diff --git a/fxjs/xfa/cjx_message.cpp b/fxjs/xfa/cjx_message.cpp new file mode 100644 index 0000000000..c9f3f6afdc --- /dev/null +++ b/fxjs/xfa/cjx_message.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_message.h" + +#include "xfa/fxfa/parser/cxfa_message.h" + +CJX_Message::CJX_Message(CXFA_Message* node) : CJX_Node(node) {} + +CJX_Message::~CJX_Message() = default; + +void CJX_Message::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Message::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_message.h b/fxjs/xfa/cjx_message.h new file mode 100644 index 0000000000..a2a461ebad --- /dev/null +++ b/fxjs/xfa/cjx_message.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_MESSAGE_H_ +#define FXJS_XFA_CJX_MESSAGE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Message; + +class CJX_Message : public CJX_Node { + public: + explicit CJX_Message(CXFA_Message* node); + ~CJX_Message() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_MESSAGE_H_ diff --git a/fxjs/xfa/cjx_model.cpp b/fxjs/xfa/cjx_model.cpp index 4ac6280c44..aa5d6b21fa 100644 --- a/fxjs/xfa/cjx_model.cpp +++ b/fxjs/xfa/cjx_model.cpp @@ -82,3 +82,11 @@ CJS_Return CJX_Model::isCompatibleNS( return CJS_Return( runtime->NewBoolean(TryNamespace().value_or(WideString()) == nameSpace)); } + +void CJX_Model::context(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Model::aliasNode(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} diff --git a/fxjs/xfa/cjx_model.h b/fxjs/xfa/cjx_model.h index 17b8d3d6f5..fae1cc7cfd 100644 --- a/fxjs/xfa/cjx_model.h +++ b/fxjs/xfa/cjx_model.h @@ -21,6 +21,9 @@ class CJX_Model : public CJX_Node { JS_METHOD(createNode, CJX_Model); JS_METHOD(isCompatibleNS, CJX_Model); + JS_PROP(aliasNode); + JS_PROP(context); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index b2743f0176..1216177f02 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -386,6 +386,74 @@ CJS_Return CJX_Node::setElement( return CJS_Return(true); } +void CJX_Node::id(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Node::ns(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetString( + TryNamespace().value_or(WideString()).UTF8Encode().AsStringView()); +} + +void CJX_Node::model(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap( + GetXFANode()->GetModelNode())); +} + +void CJX_Node::isContainer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetBoolean(GetXFANode()->IsContainerNode()); +} + +void CJX_Node::isNull(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + if (GetXFANode()->GetElementType() == XFA_Element::Subform) { + pValue->SetBoolean(false); + return; + } + pValue->SetBoolean(GetContent(false).IsEmpty()); +} + +void CJX_Node::oneOfChild(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + + std::vector properties = GetXFANode()->GetNodeList( + XFA_NODEFILTER_OneOfProperty, XFA_Element::Unknown); + if (!properties.empty()) { + pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap( + properties.front())); + } +} + int32_t CJX_Node::execSingleEventByName(const WideStringView& wsEventName, XFA_Element eType) { CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); diff --git a/fxjs/xfa/cjx_node.h b/fxjs/xfa/cjx_node.h index f54239aa67..f7cbce855b 100644 --- a/fxjs/xfa/cjx_node.h +++ b/fxjs/xfa/cjx_node.h @@ -19,9 +19,6 @@ class CJX_Node : public CJX_Tree { explicit CJX_Node(CXFA_Node* node); ~CJX_Node() override; - CXFA_Node* GetXFANode(); - const CXFA_Node* GetXFANode() const; - JS_METHOD(applyXSL, CJX_Node); JS_METHOD(assignNode, CJX_Node); JS_METHOD(clone, CJX_Node); @@ -34,6 +31,16 @@ class CJX_Node : public CJX_Tree { JS_METHOD(setAttribute, CJX_Node); JS_METHOD(setElement, CJX_Node); + JS_PROP(id); + JS_PROP(isContainer); + JS_PROP(isNull); + JS_PROP(model); + JS_PROP(ns); + JS_PROP(oneOfChild); + + CXFA_Node* GetXFANode(); + const CXFA_Node* GetXFANode() const; + protected: int32_t execSingleEventByName(const WideStringView& wsEventName, XFA_Element eType); diff --git a/fxjs/xfa/cjx_numericedit.cpp b/fxjs/xfa/cjx_numericedit.cpp new file mode 100644 index 0000000000..c76cc66bf8 --- /dev/null +++ b/fxjs/xfa/cjx_numericedit.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_numericedit.h" + +#include "xfa/fxfa/parser/cxfa_numericedit.h" + +CJX_NumericEdit::CJX_NumericEdit(CXFA_NumericEdit* node) : CJX_Node(node) {} + +CJX_NumericEdit::~CJX_NumericEdit() = default; + +void CJX_NumericEdit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_NumericEdit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_NumericEdit::hScrollPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_numericedit.h b/fxjs/xfa/cjx_numericedit.h new file mode 100644 index 0000000000..43f9d001dc --- /dev/null +++ b/fxjs/xfa/cjx_numericedit.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_NUMERICEDIT_H_ +#define FXJS_XFA_CJX_NUMERICEDIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_NumericEdit; + +class CJX_NumericEdit : public CJX_Node { + public: + explicit CJX_NumericEdit(CXFA_NumericEdit* node); + ~CJX_NumericEdit() override; + + JS_PROP(hScrollPolicy); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_NUMERICEDIT_H_ diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index fc708584d7..c1503af22d 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -14,6 +14,10 @@ #include "fxjs/cfxjse_engine.h" #include "fxjs/cfxjse_value.h" #include "fxjs/cjs_return.h" +#include "fxjs/xfa/cjx_boolean.h" +#include "fxjs/xfa/cjx_draw.h" +#include "fxjs/xfa/cjx_field.h" +#include "fxjs/xfa/cjx_instancemanager.h" #include "third_party/base/ptr_util.h" #include "xfa/fxfa/cxfa_ffnotify.h" #include "xfa/fxfa/cxfa_ffwidget.h" @@ -125,9 +129,9 @@ CXFA_Document* CJX_Object::GetDocument() const { return object_->GetDocument(); } -void CJX_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { +void CJX_Object::className(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { if (bSetting) { ThrowInvalidPropertyException(); return; @@ -136,6 +140,20 @@ void CJX_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue, FX_UTF8Encode(GetXFAObject()->GetClassName()).AsStringView()); } +int32_t CJX_Object::Subform_and_SubformSet_InstanceIndex() { + int32_t index = 0; + for (CXFA_Node* pNode = + ToNode(GetXFAObject())->GetNodeItem(XFA_NODEITEM_PrevSibling); + pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { + if ((pNode->GetElementType() != XFA_Element::Subform) && + (pNode->GetElementType() != XFA_Element::SubformSet)) { + break; + } + index++; + } + return index; +} + bool CJX_Object::HasMethod(const WideString& func) const { return pdfium::ContainsKey(method_specs_, func.UTF8Encode()); } @@ -844,6 +862,36 @@ pdfium::Optional CJX_Object::TryContent(bool bScriptModify, return {}; } +pdfium::Optional CJX_Object::TryNamespace() { + if (ToNode(GetXFAObject())->IsModelNode() || + ToNode(GetXFAObject())->GetElementType() == XFA_Element::Packet) { + CFX_XMLNode* pXMLNode = ToNode(GetXFAObject())->GetXMLMappingNode(); + if (!pXMLNode || pXMLNode->GetType() != FX_XMLNODE_Element) + return {}; + + return {static_cast(pXMLNode)->GetNamespaceURI()}; + } + + if (ToNode(GetXFAObject())->GetPacketType() != XFA_PacketType::Datasets) + return ToNode(GetXFAObject())->GetModelNode()->JSObject()->TryNamespace(); + + CFX_XMLNode* pXMLNode = ToNode(GetXFAObject())->GetXMLMappingNode(); + if (!pXMLNode || pXMLNode->GetType() != FX_XMLNODE_Element) + return {}; + + if (ToNode(GetXFAObject())->GetElementType() == XFA_Element::DataValue && + GetEnum(XFA_Attribute::Contains) == XFA_AttributeEnum::MetaData) { + WideString wsNamespace; + bool ret = XFA_FDEExtension_ResolveNamespaceQualifier( + static_cast(pXMLNode), + GetCData(XFA_Attribute::QualifiedName), &wsNamespace); + if (!ret) + return {}; + return {wsNamespace}; + } + return {static_cast(pXMLNode)->GetNamespaceURI()}; +} + CXFA_Node* CJX_Object::GetProperty(int32_t index, XFA_Element eProperty, bool bCreateProperty) { @@ -1408,32 +1456,47 @@ void CJX_Object::Script_Som_ValidationMessage(CFXJSE_Value* pValue, Script_Som_Message(pValue, bSetting, XFA_SOM_ValidationMessage); } -void CJX_Object::Script_Field_FormatMessage(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage); -} - void CJX_Object::Script_Som_MandatoryMessage(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage); } +void CJX_Object::Script_Field_Length(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + if (!widget_data_) { + pValue->SetInteger(0); + return; + } + pValue->SetInteger(widget_data_->CountChoiceListItems(true)); +} + void CJX_Object::Script_Som_DefaultValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute /* unused */) { XFA_Element eType = ToNode(GetXFAObject())->GetElementType(); + + // TODO(dsinclair): This should look through the properties on the node to see + // if defaultValue is defined and, if so, call that one. Just have to make + // sure that those defaultValue calls don't call back to this one .... if (eType == XFA_Element::Field) { - Script_Field_DefaultValue(pValue, bSetting, XFA_Attribute::Unknown); + static_cast(this)->defaultValue(pValue, bSetting, + XFA_Attribute::Unknown); return; } if (eType == XFA_Element::Draw) { - Script_Draw_DefaultValue(pValue, bSetting, XFA_Attribute::Unknown); + static_cast(this)->defaultValue(pValue, bSetting, + XFA_Attribute::Unknown); return; } if (eType == XFA_Element::Boolean) { - Script_Boolean_DefaultValue(pValue, bSetting, XFA_Attribute::Unknown); + static_cast(this)->defaultValue(pValue, bSetting, + XFA_Attribute::Unknown); return; } @@ -1558,7 +1621,8 @@ void CJX_Object::Script_Som_InstanceIndex(CFXJSE_Value* pValue, if (!pManagerNode) return; - pManagerNode->JSObject()->InstanceManager_MoveInstance(iTo, iFrom); + auto* mgr = static_cast(pManagerNode->JSObject()); + mgr->MoveInstance(iTo, iFrom); CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (!pNotify) return; @@ -1575,322 +1639,9 @@ void CJX_Object::Script_Som_InstanceIndex(CFXJSE_Value* pValue, } } -void CJX_Object::Script_Field_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!widget_data_) - return; - - if (bSetting) { - if (pValue) { - widget_data_->SetPreNull(widget_data_->IsNull()); - widget_data_->SetIsNull(pValue->IsNull()); - } - - WideString wsNewText; - if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) - wsNewText = pValue->ToWideString(); - - CXFA_Node* pUIChild = widget_data_->GetUIChild(); - if (pUIChild->GetElementType() == XFA_Element::NumericEdit) { - wsNewText = - widget_data_->NumericLimit(wsNewText, widget_data_->GetLeadDigits(), - widget_data_->GetFracDigits()); - } - - CXFA_WidgetData* pContainerWidgetData = - ToNode(GetXFAObject())->GetContainerWidgetData(); - WideString wsFormatText(wsNewText); - if (pContainerWidgetData) - wsFormatText = pContainerWidgetData->GetFormatDataValue(wsNewText); - - SetContent(wsNewText, wsFormatText, true, true, true); - return; - } - - WideString content = GetContent(true); - if (content.IsEmpty()) { - pValue->SetNull(); - return; - } - - CXFA_Node* pUIChild = widget_data_->GetUIChild(); - CXFA_Node* pNode = widget_data_->GetFormValueData().GetNode()->GetNodeItem( - XFA_NODEITEM_FirstChild); - if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { - if (pUIChild->GetElementType() == XFA_Element::NumericEdit && - (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { - pValue->SetString(content.UTF8Encode().AsStringView()); - } else { - CFX_Decimal decimal(content.AsStringView()); - pValue->SetFloat((float)(double)decimal); - } - } else if (pNode && pNode->GetElementType() == XFA_Element::Integer) { - pValue->SetInteger(FXSYS_wtoi(content.c_str())); - } else if (pNode && pNode->GetElementType() == XFA_Element::Boolean) { - pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? false : true); - } else if (pNode && pNode->GetElementType() == XFA_Element::Float) { - CFX_Decimal decimal(content.AsStringView()); - pValue->SetFloat((float)(double)decimal); - } else { - pValue->SetString(content.UTF8Encode().AsStringView()); - } -} - -void CJX_Object::Script_Boolean_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!bSetting) { - WideString wsValue = GetContent(true); - pValue->SetBoolean(wsValue == L"1"); - return; - } - - ByteString newValue; - if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) - newValue = pValue->ToString(); - - int32_t iValue = FXSYS_atoi(newValue.c_str()); - WideString wsNewValue(iValue == 0 ? L"0" : L"1"); - WideString wsFormatValue(wsNewValue); - CXFA_WidgetData* pContainerWidgetData = - ToNode(GetXFAObject())->GetContainerWidgetData(); - if (pContainerWidgetData) - wsFormatValue = pContainerWidgetData->GetFormatDataValue(wsNewValue); - - SetContent(wsNewValue, wsFormatValue, true, true, true); -} - -void CJX_Object::Script_Draw_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!bSetting) { - WideString content = GetContent(true); - if (content.IsEmpty()) - pValue->SetNull(); - else - pValue->SetString(content.UTF8Encode().AsStringView()); - - return; - } - - if (!pValue || !pValue->IsString()) - return; - if (widget_data_->GetUIType() != XFA_Element::Text) - return; - - WideString wsNewValue = pValue->ToWideString(); - SetContent(wsNewValue, wsNewValue, true, true, true); -} - -int32_t CJX_Object::Subform_and_SubformSet_InstanceIndex() { - int32_t index = 0; - for (CXFA_Node* pNode = - ToNode(GetXFAObject())->GetNodeItem(XFA_NODEITEM_PrevSibling); - pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { - if ((pNode->GetElementType() != XFA_Element::Subform) && - (pNode->GetElementType() != XFA_Element::SubformSet)) { - break; - } - index++; - } - return index; -} - -void CJX_Object::Script_NodeClass_Ns(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - pValue->SetString( - TryNamespace().value_or(WideString()).UTF8Encode().AsStringView()); -} - -void CJX_Object::Script_NodeClass_Model(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - - pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap( - ToNode(GetXFAObject())->GetModelNode())); -} - -void CJX_Object::Script_NodeClass_IsContainer(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - - pValue->SetBoolean(GetXFAObject()->IsContainerNode()); -} - -void CJX_Object::Script_NodeClass_IsNull(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - if (ToNode(GetXFAObject())->GetElementType() == XFA_Element::Subform) { - pValue->SetBoolean(false); - return; - } - pValue->SetBoolean(GetContent(false).IsEmpty()); -} - -void CJX_Object::Script_NodeClass_OneOfChild(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - - std::vector properties = - ToNode(GetXFAObject()) - ->GetNodeList(XFA_NODEFILTER_OneOfProperty, XFA_Element::Unknown); - if (!properties.empty()) { - pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap( - properties.front())); - } -} - -void CJX_Object::Script_ModelClass_Context(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_ModelClass_AliasNode(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Delta_CurrentValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Delta_SavedValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Delta_Target(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Field_Length(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - if (!widget_data_) { - pValue->SetInteger(0); - return; - } - pValue->SetInteger(widget_data_->CountChoiceListItems(true)); -} - -void CJX_Object::Script_Field_EditValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!widget_data_) - return; - - if (bSetting) { - widget_data_->SetValue(XFA_VALUEPICTURE_Edit, pValue->ToWideString()); - return; - } - pValue->SetString(widget_data_->GetValue(XFA_VALUEPICTURE_Edit) - .UTF8Encode() - .AsStringView()); -} - -void CJX_Object::Script_Field_FormattedValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!widget_data_) - return; - - if (bSetting) { - widget_data_->SetValue(XFA_VALUEPICTURE_Display, pValue->ToWideString()); - return; - } - pValue->SetString(widget_data_->GetValue(XFA_VALUEPICTURE_Display) - .UTF8Encode() - .AsStringView()); -} - -void CJX_Object::Script_Field_ParentSubform(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - pValue->SetNull(); -} - -void CJX_Object::Script_Field_SelectedIndex(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!widget_data_) - return; - - if (!bSetting) { - pValue->SetInteger(widget_data_->GetSelectedItem(0)); - return; - } - - int32_t iIndex = pValue->ToInteger(); - if (iIndex == -1) { - widget_data_->ClearAllSelections(); - return; - } - - widget_data_->SetItemState(iIndex, true, true, true, true); -} - -void CJX_Object::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) - ThrowInvalidPropertyException(); -} - -void CJX_Object::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (!widget_data_) - return; - - if (bSetting) { - widget_data_->SetSelectedMemberByValue( - pValue->ToWideString().AsStringView(), true, true, true); - return; - } - - WideString wsValue = GetContent(true); - XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); - if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { - pValue->SetNull(); - return; - } - pValue->SetString(wsValue.UTF8Encode().AsStringView()); -} - -void CJX_Object::Script_ExclGroup_Transient(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - void CJX_Object::Script_Subform_InstanceManager(CFXJSE_Value* pValue, bool bSetting, - XFA_Attribute eAttribute) { + XFA_AttributeEnum eAttribute) { if (bSetting) { ThrowInvalidPropertyException(); return; @@ -1920,72 +1671,9 @@ void CJX_Object::Script_Subform_InstanceManager(CFXJSE_Value* pValue, GetDocument()->GetScriptContext()->GetJSValueFromMap(pInstanceMgr)); } -void CJX_Object::Script_Subform_Locale(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - SetCData(XFA_Attribute::Locale, pValue->ToWideString(), true, true); - return; - } - - WideString wsLocaleName; - ToNode(GetXFAObject())->GetLocaleName(wsLocaleName); - pValue->SetString(wsLocaleName.UTF8Encode().AsStringView()); -} - -void CJX_Object::Script_InstanceManager_Max(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - pValue->SetInteger( - CXFA_OccurData(ToNode(GetXFAObject())->GetOccurNode()).GetMax()); -} - -void CJX_Object::Script_InstanceManager_Min(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - ThrowInvalidPropertyException(); - return; - } - pValue->SetInteger( - CXFA_OccurData(ToNode(GetXFAObject())->GetOccurNode()).GetMin()); -} - -void CJX_Object::Script_InstanceManager_Count(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - pValue->SetInteger(ToNode(GetXFAObject())->GetCount()); - return; - } - InstanceManager_SetInstances(pValue->ToInteger()); -} - -void CJX_Object::Script_Occur_Max(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - CXFA_OccurData occurData(ToNode(GetXFAObject())); - if (!bSetting) { - pValue->SetInteger(occurData.GetMax()); - return; - } - occurData.SetMax(pValue->ToInteger()); -} - -void CJX_Object::Script_Occur_Min(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - CXFA_OccurData occurData(ToNode(GetXFAObject())); - if (!bSetting) { - pValue->SetInteger(occurData.GetMin()); - return; - } - occurData.SetMin(pValue->ToInteger()); -} +void CJX_Object::Script_SubmitFormat_Mode(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} void CJX_Object::Script_Form_Checksum(CFXJSE_Value* pValue, bool bSetting, @@ -2001,179 +1689,9 @@ void CJX_Object::Script_Form_Checksum(CFXJSE_Value* pValue, pValue->SetString(checksum ? checksum->UTF8Encode().AsStringView() : ""); } -void CJX_Object::Script_Packet_Content(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - CFX_XMLNode* pXMLNode = ToNode(GetXFAObject())->GetXMLMappingNode(); - if (bSetting) { - if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { - CFX_XMLElement* pXMLElement = static_cast(pXMLNode); - pXMLElement->SetTextData(pValue->ToWideString()); - } - return; - } - - WideString wsTextData; - if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { - CFX_XMLElement* pXMLElement = static_cast(pXMLNode); - wsTextData = pXMLElement->GetTextData(); - } - - pValue->SetString(wsTextData.UTF8Encode().AsStringView()); -} - -void CJX_Object::Script_Source_Db(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Xfa_This(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { +void CJX_Object::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { if (bSetting) - return; - - CXFA_Object* pThis = GetDocument()->GetScriptContext()->GetThisObject(); - ASSERT(pThis); - pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap(pThis)); -} - -void CJX_Object::Script_Handler_Version(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_SubmitFormat_Mode(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Extras_Type(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -void CJX_Object::Script_Script_Stateless(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { ThrowInvalidPropertyException(); - return; - } - pValue->SetString(FX_UTF8Encode(WideStringView(L"0", 1)).AsStringView()); -} - -void CJX_Object::Script_Encrypt_Format(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) {} - -pdfium::Optional CJX_Object::TryNamespace() { - if (ToNode(GetXFAObject())->IsModelNode() || - ToNode(GetXFAObject())->GetElementType() == XFA_Element::Packet) { - CFX_XMLNode* pXMLNode = ToNode(GetXFAObject())->GetXMLMappingNode(); - if (!pXMLNode || pXMLNode->GetType() != FX_XMLNODE_Element) - return {}; - - return {static_cast(pXMLNode)->GetNamespaceURI()}; - } - - if (ToNode(GetXFAObject())->GetPacketType() != XFA_PacketType::Datasets) - return ToNode(GetXFAObject())->GetModelNode()->JSObject()->TryNamespace(); - - CFX_XMLNode* pXMLNode = ToNode(GetXFAObject())->GetXMLMappingNode(); - if (!pXMLNode || pXMLNode->GetType() != FX_XMLNODE_Element) - return {}; - - if (ToNode(GetXFAObject())->GetElementType() == XFA_Element::DataValue && - GetEnum(XFA_Attribute::Contains) == XFA_AttributeEnum::MetaData) { - WideString wsNamespace; - bool ret = XFA_FDEExtension_ResolveNamespaceQualifier( - static_cast(pXMLNode), - GetCData(XFA_Attribute::QualifiedName), &wsNamespace); - if (!ret) - return {}; - return {wsNamespace}; - } - return {static_cast(pXMLNode)->GetNamespaceURI()}; -} - -int32_t CJX_Object::InstanceManager_SetInstances(int32_t iDesired) { - CXFA_OccurData occurData(ToNode(GetXFAObject())->GetOccurNode()); - if (iDesired < occurData.GetMin()) { - ThrowTooManyOccurancesException(L"min"); - return 1; - } - - int32_t iMax = occurData.GetMax(); - if (iMax >= 0 && iDesired > iMax) { - ThrowTooManyOccurancesException(L"max"); - return 2; - } - - int32_t iCount = ToNode(GetXFAObject())->GetCount(); - if (iDesired == iCount) - return 0; - - if (iDesired < iCount) { - WideString wsInstManagerName = GetCData(XFA_Attribute::Name); - WideString wsInstanceName = WideString( - wsInstManagerName.IsEmpty() - ? wsInstManagerName - : wsInstManagerName.Right(wsInstManagerName.GetLength() - 1)); - uint32_t dInstanceNameHash = - FX_HashCode_GetW(wsInstanceName.AsStringView(), false); - CXFA_Node* pPrevSibling = - iDesired == 0 ? ToNode(GetXFAObject()) - : ToNode(GetXFAObject())->GetItem(iDesired - 1); - while (iCount > iDesired) { - CXFA_Node* pRemoveInstance = - pPrevSibling->GetNodeItem(XFA_NODEITEM_NextSibling); - if (pRemoveInstance->GetElementType() != XFA_Element::Subform && - pRemoveInstance->GetElementType() != XFA_Element::SubformSet) { - continue; - } - if (pRemoveInstance->GetElementType() == XFA_Element::InstanceManager) { - NOTREACHED(); - break; - } - if (pRemoveInstance->GetNameHash() == dInstanceNameHash) { - ToNode(GetXFAObject())->RemoveItem(pRemoveInstance, true); - iCount--; - } - } - } else { - while (iCount < iDesired) { - CXFA_Node* pNewInstance = ToNode(GetXFAObject())->CreateInstance(true); - ToNode(GetXFAObject())->InsertItem(pNewInstance, iCount, iCount, false); - iCount++; - CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); - if (!pNotify) - return 0; - - pNotify->RunNodeInitialize(pNewInstance); - } - } - - CXFA_LayoutProcessor* pLayoutPro = GetDocument()->GetLayoutProcessor(); - if (pLayoutPro) { - pLayoutPro->AddChangedContainer( - ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form))); - } - return 0; -} - -int32_t CJX_Object::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) { - int32_t iCount = ToNode(GetXFAObject())->GetCount(); - if (iFrom > iCount || iTo > iCount - 1) { - ThrowIndexOutOfBoundsException(); - return 1; - } - if (iFrom < 0 || iTo < 0 || iFrom == iTo) - return 0; - - CXFA_Node* pMoveInstance = ToNode(GetXFAObject())->GetItem(iFrom); - ToNode(GetXFAObject())->RemoveItem(pMoveInstance, false); - ToNode(GetXFAObject())->InsertItem(pMoveInstance, iTo, iCount - 1, true); - CXFA_LayoutProcessor* pLayoutPro = GetDocument()->GetLayoutProcessor(); - if (pLayoutPro) { - pLayoutPro->AddChangedContainer( - ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form))); - } - return 0; } diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index b704037e4f..cf2ede7abf 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h @@ -15,6 +15,7 @@ #include "core/fxcrt/unowned_ptr.h" #include "core/fxcrt/widestring.h" #include "core/fxcrt/xml/cfx_xmlelement.h" +#include "fxjs/CJX_Define.h" #include "third_party/base/optional.h" #include "xfa/fxfa/fxfa_basic.h" #include "xfa/fxfa/parser/cxfa_widgetdata.h" @@ -44,11 +45,19 @@ struct XFA_MAPDATABLOCKCALLBACKINFO { PD_CALLBACK_DUPLICATEDATA pCopy; }; +enum XFA_SOM_MESSAGETYPE { + XFA_SOM_ValidationMessage, + XFA_SOM_FormatMessage, + XFA_SOM_MandatoryMessage +}; + class CJX_Object { public: explicit CJX_Object(CXFA_Object* obj); virtual ~CJX_Object(); + JS_PROP(className); + CXFA_Object* GetXFAObject() { return object_.Get(); } const CXFA_Object* GetXFAObject() const { return object_.Get(); } @@ -129,9 +138,9 @@ class CJX_Object { void Script_Som_MandatoryMessage(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Script_Field_FormatMessage(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); + void Script_Field_Length(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute); void Script_Som_DefaultValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); @@ -147,114 +156,21 @@ class CJX_Object { void Script_Som_InstanceIndex(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - - void Script_NodeClass_Ns(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_NodeClass_Model(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_NodeClass_IsContainer(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_NodeClass_IsNull(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_NodeClass_OneOfChild(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_ModelClass_Context(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_ModelClass_AliasNode(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Delta_CurrentValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Delta_SavedValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Delta_Target(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_Length(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_EditValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_FormattedValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_ParentSubform(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_SelectedIndex(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_ExclGroup_Transient(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - + void Script_Som_Message(CFXJSE_Value* pValue, + bool bSetting, + XFA_SOM_MESSAGETYPE iMessageType); void Script_Subform_InstanceManager(CFXJSE_Value* pValue, bool bSetting, - XFA_Attribute eAttribute); - void Script_Subform_Locale(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_InstanceManager_Count(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_InstanceManager_Max(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_InstanceManager_Min(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - - void Script_Occur_Max(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Occur_Min(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - - void Script_Form_Checksum(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - - void Script_Packet_Content(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - - void Script_Source_Db(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Xfa_This(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Handler_Version(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); + XFA_AttributeEnum eAttribute); void Script_SubmitFormat_Mode(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Script_Extras_Type(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Encrypt_Format(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Script_Stateless(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); + void Script_Form_Checksum(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute); + void Script_ExclGroup_ErrorText(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute); pdfium::Optional TryNamespace(); @@ -283,10 +199,6 @@ class CJX_Object { bool SetMeasure(XFA_Attribute eAttr, CXFA_Measurement mValue, bool bNotify); CXFA_Measurement GetMeasure(XFA_Attribute eAttr) const; - void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void MergeAllData(CXFA_Object* pDstModule); void SetCalcData(std::unique_ptr data); @@ -310,25 +222,6 @@ class CJX_Object { void ThrowException(const wchar_t* str, ...) const; private: - enum XFA_SOM_MESSAGETYPE { - XFA_SOM_ValidationMessage, - XFA_SOM_FormatMessage, - XFA_SOM_MandatoryMessage - }; - void Script_Som_Message(CFXJSE_Value* pValue, - bool bSetting, - XFA_SOM_MESSAGETYPE iMessageType); - void Script_Boolean_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Draw_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void Script_Field_DefaultValue(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - int32_t Subform_and_SubformSet_InstanceIndex(); - void OnChanged(XFA_Attribute eAttr, bool bNotify, bool bScriptModify); void OnChanging(XFA_Attribute eAttr, bool bNotify); bool SetUserData(void* pKey, @@ -341,6 +234,7 @@ class CJX_Object { XFA_AttributeType eType, void* pValue, bool bNotify); + int32_t Subform_and_SubformSet_InstanceIndex(); XFA_MAPMODULEDATA* CreateMapModuleData(); XFA_MAPMODULEDATA* GetMapModuleData() const; diff --git a/fxjs/xfa/cjx_occur.cpp b/fxjs/xfa/cjx_occur.cpp new file mode 100644 index 0000000000..f5540c0c7a --- /dev/null +++ b/fxjs/xfa/cjx_occur.cpp @@ -0,0 +1,57 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_occur.h" + +#include + +#include "fxjs/cfxjse_value.h" +#include "xfa/fxfa/parser/cxfa_occur.h" +#include "xfa/fxfa/parser/cxfa_occurdata.h" + +CJX_Occur::CJX_Occur(CXFA_Occur* node) : CJX_Node(node) {} + +CJX_Occur::~CJX_Occur() = default; + +void CJX_Occur::max(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_OccurData occurData(GetXFANode()); + if (!bSetting) { + pValue->SetInteger(occurData.GetMax()); + return; + } + occurData.SetMax(pValue->ToInteger()); +} + +void CJX_Occur::min(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CXFA_OccurData occurData(GetXFANode()); + if (!bSetting) { + pValue->SetInteger(occurData.GetMin()); + return; + } + occurData.SetMin(pValue->ToInteger()); +} + +void CJX_Occur::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Occur::initial(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Occur::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_occur.h b/fxjs/xfa/cjx_occur.h new file mode 100644 index 0000000000..fe174238ec --- /dev/null +++ b/fxjs/xfa/cjx_occur.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_OCCUR_H_ +#define FXJS_XFA_CJX_OCCUR_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Occur; + +class CJX_Occur : public CJX_Node { + public: + explicit CJX_Occur(CXFA_Occur* node); + ~CJX_Occur() override; + + JS_PROP(initial); + JS_PROP(max); + JS_PROP(min); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_OCCUR_H_ diff --git a/fxjs/xfa/cjx_oid.cpp b/fxjs/xfa/cjx_oid.cpp new file mode 100644 index 0000000000..1320f8df7e --- /dev/null +++ b/fxjs/xfa/cjx_oid.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_oid.h" + +#include "xfa/fxfa/parser/cxfa_oid.h" + +CJX_Oid::CJX_Oid(CXFA_Oid* node) : CJX_TextNode(node) {} + +CJX_Oid::~CJX_Oid() = default; + +void CJX_Oid::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Oid::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_oid.h b/fxjs/xfa/cjx_oid.h new file mode 100644 index 0000000000..2578388c2f --- /dev/null +++ b/fxjs/xfa/cjx_oid.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_OID_H_ +#define FXJS_XFA_CJX_OID_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Oid; + +class CJX_Oid : public CJX_TextNode { + public: + explicit CJX_Oid(CXFA_Oid* node); + ~CJX_Oid() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_OID_H_ diff --git a/fxjs/xfa/cjx_oids.cpp b/fxjs/xfa/cjx_oids.cpp new file mode 100644 index 0000000000..a00697479b --- /dev/null +++ b/fxjs/xfa/cjx_oids.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_oids.h" + +#include "xfa/fxfa/parser/cxfa_oids.h" + +CJX_Oids::CJX_Oids(CXFA_Oids* node) : CJX_Node(node) {} + +CJX_Oids::~CJX_Oids() = default; + +void CJX_Oids::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Oids::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Oids::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_oids.h b/fxjs/xfa/cjx_oids.h new file mode 100644 index 0000000000..9951206420 --- /dev/null +++ b/fxjs/xfa/cjx_oids.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_OIDS_H_ +#define FXJS_XFA_CJX_OIDS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Oids; + +class CJX_Oids : public CJX_Node { + public: + explicit CJX_Oids(CXFA_Oids* node); + ~CJX_Oids() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_OIDS_H_ diff --git a/fxjs/xfa/cjx_operation.cpp b/fxjs/xfa/cjx_operation.cpp new file mode 100644 index 0000000000..bb412bd71f --- /dev/null +++ b/fxjs/xfa/cjx_operation.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_operation.h" + +#include "xfa/fxfa/parser/cxfa_operation.h" + +CJX_Operation::CJX_Operation(CXFA_Operation* node) : CJX_TextNode(node) {} + +CJX_Operation::~CJX_Operation() = default; + +void CJX_Operation::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Operation::output(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Operation::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Operation::input(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_operation.h b/fxjs/xfa/cjx_operation.h new file mode 100644 index 0000000000..b32ea62594 --- /dev/null +++ b/fxjs/xfa/cjx_operation.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_OPERATION_H_ +#define FXJS_XFA_CJX_OPERATION_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Operation; + +class CJX_Operation : public CJX_TextNode { + public: + explicit CJX_Operation(CXFA_Operation* node); + ~CJX_Operation() override; + + JS_PROP(input); + JS_PROP(output); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_OPERATION_H_ diff --git a/fxjs/xfa/cjx_overflow.cpp b/fxjs/xfa/cjx_overflow.cpp new file mode 100644 index 0000000000..b6572d4e7c --- /dev/null +++ b/fxjs/xfa/cjx_overflow.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_overflow.h" + +#include "xfa/fxfa/parser/cxfa_overflow.h" + +CJX_Overflow::CJX_Overflow(CXFA_Overflow* node) : CJX_Node(node) {} + +CJX_Overflow::~CJX_Overflow() = default; + +void CJX_Overflow::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Overflow::trailer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Overflow::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Overflow::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Overflow::leader(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_overflow.h b/fxjs/xfa/cjx_overflow.h new file mode 100644 index 0000000000..c4f94b8599 --- /dev/null +++ b/fxjs/xfa/cjx_overflow.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_OVERFLOW_H_ +#define FXJS_XFA_CJX_OVERFLOW_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Overflow; + +class CJX_Overflow : public CJX_Node { + public: + explicit CJX_Overflow(CXFA_Overflow* node); + ~CJX_Overflow() override; + + JS_PROP(leader); + JS_PROP(target); + JS_PROP(trailer); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_OVERFLOW_H_ diff --git a/fxjs/xfa/cjx_packet.cpp b/fxjs/xfa/cjx_packet.cpp index 2203d9bc9e..fdebe626ab 100644 --- a/fxjs/xfa/cjx_packet.cpp +++ b/fxjs/xfa/cjx_packet.cpp @@ -68,3 +68,24 @@ CJS_Return CJX_Packet::removeAttribute( } return CJS_Return(runtime->NewNull()); } + +void CJX_Packet::content(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + CFX_XMLNode* pXMLNode = GetXFANode()->GetXMLMappingNode(); + if (bSetting) { + if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { + CFX_XMLElement* pXMLElement = static_cast(pXMLNode); + pXMLElement->SetTextData(pValue->ToWideString()); + } + return; + } + + WideString wsTextData; + if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { + CFX_XMLElement* pXMLElement = static_cast(pXMLNode); + wsTextData = pXMLElement->GetTextData(); + } + + pValue->SetString(wsTextData.UTF8Encode().AsStringView()); +} diff --git a/fxjs/xfa/cjx_packet.h b/fxjs/xfa/cjx_packet.h index b014a9d9ac..ac1c170fdd 100644 --- a/fxjs/xfa/cjx_packet.h +++ b/fxjs/xfa/cjx_packet.h @@ -21,6 +21,8 @@ class CJX_Packet : public CJX_Node { JS_METHOD(removeAttribute, CJX_Packet); JS_METHOD(setAttribute, CJX_Packet); + JS_PROP(content); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_pagearea.cpp b/fxjs/xfa/cjx_pagearea.cpp new file mode 100644 index 0000000000..4085d38798 --- /dev/null +++ b/fxjs/xfa/cjx_pagearea.cpp @@ -0,0 +1,61 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_pagearea.h" + +#include "xfa/fxfa/parser/cxfa_pagearea.h" + +CJX_PageArea::CJX_PageArea(CXFA_PageArea* node) : CJX_Container(node) {} + +CJX_PageArea::~CJX_PageArea() = default; + +void CJX_PageArea::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::pagePosition(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::oddOrEven(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::initialNumber(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::numbered(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageArea::blankOrNotBlank(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_pagearea.h b/fxjs/xfa/cjx_pagearea.h new file mode 100644 index 0000000000..8935fa6362 --- /dev/null +++ b/fxjs/xfa/cjx_pagearea.h @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PAGEAREA_H_ +#define FXJS_XFA_CJX_PAGEAREA_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_PageArea; + +class CJX_PageArea : public CJX_Container { + public: + explicit CJX_PageArea(CXFA_PageArea* node); + ~CJX_PageArea() override; + + JS_PROP(blankOrNotBlank); + JS_PROP(initialNumber); + JS_PROP(numbered); + JS_PROP(oddOrEven); + JS_PROP(pagePosition); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_PAGEAREA_H_ diff --git a/fxjs/xfa/cjx_pageset.cpp b/fxjs/xfa/cjx_pageset.cpp new file mode 100644 index 0000000000..cfab7904ed --- /dev/null +++ b/fxjs/xfa/cjx_pageset.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_pageset.h" + +#include "xfa/fxfa/parser/cxfa_pageset.h" + +CJX_PageSet::CJX_PageSet(CXFA_PageSet* node) : CJX_Container(node) {} + +CJX_PageSet::~CJX_PageSet() = default; + +void CJX_PageSet::relation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageSet::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageSet::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PageSet::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_pageset.h b/fxjs/xfa/cjx_pageset.h new file mode 100644 index 0000000000..7e0ab17443 --- /dev/null +++ b/fxjs/xfa/cjx_pageset.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PAGESET_H_ +#define FXJS_XFA_CJX_PAGESET_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_PageSet; + +class CJX_PageSet : public CJX_Container { + public: + explicit CJX_PageSet(CXFA_PageSet* node); + ~CJX_PageSet() override; + + JS_PROP(relation); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_PAGESET_H_ diff --git a/fxjs/xfa/cjx_para.cpp b/fxjs/xfa/cjx_para.cpp new file mode 100644 index 0000000000..3a12e4736f --- /dev/null +++ b/fxjs/xfa/cjx_para.cpp @@ -0,0 +1,97 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_para.h" + +#include "xfa/fxfa/parser/cxfa_para.h" + +CJX_Para::CJX_Para(CXFA_Para* node) : CJX_Node(node) {} + +CJX_Para::~CJX_Para() = default; + +void CJX_Para::hAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::textIndent(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::marginRight(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::marginLeft(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::radixOffset(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::preserve(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::spaceBelow(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::vAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::tabDefault(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::tabStops(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::lineHeight(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Para::spaceAbove(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_para.h b/fxjs/xfa/cjx_para.h new file mode 100644 index 0000000000..6bf2841cf9 --- /dev/null +++ b/fxjs/xfa/cjx_para.h @@ -0,0 +1,35 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PARA_H_ +#define FXJS_XFA_CJX_PARA_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Para; + +class CJX_Para : public CJX_Node { + public: + explicit CJX_Para(CXFA_Para* node); + ~CJX_Para() override; + + JS_PROP(hAlign); + JS_PROP(lineHeight); + JS_PROP(marginLeft); + JS_PROP(marginRight); + JS_PROP(preserve); + JS_PROP(radixOffset); + JS_PROP(spaceAbove); + JS_PROP(spaceBelow); + JS_PROP(tabDefault); + JS_PROP(tabStops); + JS_PROP(textIndent); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(vAlign); +}; + +#endif // FXJS_XFA_CJX_PARA_H_ diff --git a/fxjs/xfa/cjx_password.cpp b/fxjs/xfa/cjx_password.cpp new file mode 100644 index 0000000000..a44354beec --- /dev/null +++ b/fxjs/xfa/cjx_password.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_password.h" + +#include "xfa/fxfa/parser/cxfa_password.h" + +CJX_Password::CJX_Password(CXFA_Password* node) : CJX_TextNode(node) {} + +CJX_Password::~CJX_Password() = default; + +void CJX_Password::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Password::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_password.h b/fxjs/xfa/cjx_password.h new file mode 100644 index 0000000000..ede93cc5ab --- /dev/null +++ b/fxjs/xfa/cjx_password.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PASSWORD_H_ +#define FXJS_XFA_CJX_PASSWORD_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Password; + +class CJX_Password : public CJX_TextNode { + public: + explicit CJX_Password(CXFA_Password* node); + ~CJX_Password() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_PASSWORD_H_ diff --git a/fxjs/xfa/cjx_passwordedit.cpp b/fxjs/xfa/cjx_passwordedit.cpp new file mode 100644 index 0000000000..8b1c591a7a --- /dev/null +++ b/fxjs/xfa/cjx_passwordedit.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_passwordedit.h" + +#include "xfa/fxfa/parser/cxfa_passwordedit.h" + +CJX_PasswordEdit::CJX_PasswordEdit(CXFA_PasswordEdit* node) : CJX_Node(node) {} + +CJX_PasswordEdit::~CJX_PasswordEdit() = default; + +void CJX_PasswordEdit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PasswordEdit::passwordChar(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PasswordEdit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_PasswordEdit::hScrollPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_passwordedit.h b/fxjs/xfa/cjx_passwordedit.h new file mode 100644 index 0000000000..e4a5fcb9e5 --- /dev/null +++ b/fxjs/xfa/cjx_passwordedit.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PASSWORDEDIT_H_ +#define FXJS_XFA_CJX_PASSWORDEDIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_PasswordEdit; + +class CJX_PasswordEdit : public CJX_Node { + public: + explicit CJX_PasswordEdit(CXFA_PasswordEdit* node); + ~CJX_PasswordEdit() override; + + JS_PROP(hScrollPolicy); + JS_PROP(passwordChar); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_PASSWORDEDIT_H_ diff --git a/fxjs/xfa/cjx_pattern.cpp b/fxjs/xfa/cjx_pattern.cpp new file mode 100644 index 0000000000..5acaa84f14 --- /dev/null +++ b/fxjs/xfa/cjx_pattern.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_pattern.h" + +#include "xfa/fxfa/parser/cxfa_pattern.h" + +CJX_Pattern::CJX_Pattern(CXFA_Pattern* node) : CJX_Node(node) {} + +CJX_Pattern::~CJX_Pattern() = default; + +void CJX_Pattern::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Pattern::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Pattern::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_pattern.h b/fxjs/xfa/cjx_pattern.h new file mode 100644 index 0000000000..81754b8ebc --- /dev/null +++ b/fxjs/xfa/cjx_pattern.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PATTERN_H_ +#define FXJS_XFA_CJX_PATTERN_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Pattern; + +class CJX_Pattern : public CJX_Node { + public: + explicit CJX_Pattern(CXFA_Pattern* node); + ~CJX_Pattern() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_PATTERN_H_ diff --git a/fxjs/xfa/cjx_picture.cpp b/fxjs/xfa/cjx_picture.cpp new file mode 100644 index 0000000000..81f5ec41f7 --- /dev/null +++ b/fxjs/xfa/cjx_picture.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_picture.h" + +#include "xfa/fxfa/parser/cxfa_picture.h" + +CJX_Picture::CJX_Picture(CXFA_Picture* node) : CJX_Node(node) {} + +CJX_Picture::~CJX_Picture() = default; + +void CJX_Picture::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Picture::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Picture::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Picture::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_picture.h b/fxjs/xfa/cjx_picture.h new file mode 100644 index 0000000000..25497c3313 --- /dev/null +++ b/fxjs/xfa/cjx_picture.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_PICTURE_H_ +#define FXJS_XFA_CJX_PICTURE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Picture; + +class CJX_Picture : public CJX_Node { + public: + explicit CJX_Picture(CXFA_Picture* node); + ~CJX_Picture() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_PICTURE_H_ diff --git a/fxjs/xfa/cjx_query.cpp b/fxjs/xfa/cjx_query.cpp new file mode 100644 index 0000000000..f6f255fd12 --- /dev/null +++ b/fxjs/xfa/cjx_query.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_query.h" + +#include "xfa/fxfa/parser/cxfa_query.h" + +CJX_Query::CJX_Query(CXFA_Query* node) : CJX_Node(node) {} + +CJX_Query::~CJX_Query() = default; + +void CJX_Query::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Query::commandType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Query::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_query.h b/fxjs/xfa/cjx_query.h new file mode 100644 index 0000000000..1057fa2040 --- /dev/null +++ b/fxjs/xfa/cjx_query.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_QUERY_H_ +#define FXJS_XFA_CJX_QUERY_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Query; + +class CJX_Query : public CJX_Node { + public: + explicit CJX_Query(CXFA_Query* node); + ~CJX_Query() override; + + JS_PROP(commandType); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_QUERY_H_ diff --git a/fxjs/xfa/cjx_radial.cpp b/fxjs/xfa/cjx_radial.cpp new file mode 100644 index 0000000000..bd8b1a207b --- /dev/null +++ b/fxjs/xfa/cjx_radial.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_radial.h" + +#include "xfa/fxfa/parser/cxfa_radial.h" + +CJX_Radial::CJX_Radial(CXFA_Radial* node) : CJX_Node(node) {} + +CJX_Radial::~CJX_Radial() = default; + +void CJX_Radial::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Radial::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Radial::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_radial.h b/fxjs/xfa/cjx_radial.h new file mode 100644 index 0000000000..30737976e5 --- /dev/null +++ b/fxjs/xfa/cjx_radial.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_RADIAL_H_ +#define FXJS_XFA_CJX_RADIAL_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Radial; + +class CJX_Radial : public CJX_Node { + public: + explicit CJX_Radial(CXFA_Radial* node); + ~CJX_Radial() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_RADIAL_H_ diff --git a/fxjs/xfa/cjx_reason.cpp b/fxjs/xfa/cjx_reason.cpp new file mode 100644 index 0000000000..c9bb6c3d5d --- /dev/null +++ b/fxjs/xfa/cjx_reason.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_reason.h" + +#include "xfa/fxfa/parser/cxfa_reason.h" + +CJX_Reason::CJX_Reason(CXFA_Reason* node) : CJX_TextNode(node) {} + +CJX_Reason::~CJX_Reason() = default; + +void CJX_Reason::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Reason::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_reason.h b/fxjs/xfa/cjx_reason.h new file mode 100644 index 0000000000..465cedecbc --- /dev/null +++ b/fxjs/xfa/cjx_reason.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_REASON_H_ +#define FXJS_XFA_CJX_REASON_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Reason; + +class CJX_Reason : public CJX_TextNode { + public: + explicit CJX_Reason(CXFA_Reason* node); + ~CJX_Reason() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_REASON_H_ diff --git a/fxjs/xfa/cjx_reasons.cpp b/fxjs/xfa/cjx_reasons.cpp new file mode 100644 index 0000000000..11a986812a --- /dev/null +++ b/fxjs/xfa/cjx_reasons.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_reasons.h" + +#include "xfa/fxfa/parser/cxfa_reasons.h" + +CJX_Reasons::CJX_Reasons(CXFA_Reasons* node) : CJX_Node(node) {} + +CJX_Reasons::~CJX_Reasons() = default; + +void CJX_Reasons::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Reasons::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Reasons::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_reasons.h b/fxjs/xfa/cjx_reasons.h new file mode 100644 index 0000000000..a5da62ab3e --- /dev/null +++ b/fxjs/xfa/cjx_reasons.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_REASONS_H_ +#define FXJS_XFA_CJX_REASONS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Reasons; + +class CJX_Reasons : public CJX_Node { + public: + explicit CJX_Reasons(CXFA_Reasons* node); + ~CJX_Reasons() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_REASONS_H_ diff --git a/fxjs/xfa/cjx_recordset.cpp b/fxjs/xfa/cjx_recordset.cpp new file mode 100644 index 0000000000..c4fe21f60c --- /dev/null +++ b/fxjs/xfa/cjx_recordset.cpp @@ -0,0 +1,63 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_recordset.h" + +#include + +#include "xfa/fxfa/parser/cxfa_recordset.h" + +CJX_RecordSet::CJX_RecordSet(CXFA_RecordSet* node) : CJX_Node(node) {} + +CJX_RecordSet::~CJX_RecordSet() = default; + +void CJX_RecordSet::max(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::eofAction(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::cursorType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::lockType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::bofAction(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RecordSet::cursorLocation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_recordset.h b/fxjs/xfa/cjx_recordset.h new file mode 100644 index 0000000000..7c34f6e472 --- /dev/null +++ b/fxjs/xfa/cjx_recordset.h @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_RECORDSET_H_ +#define FXJS_XFA_CJX_RECORDSET_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_RecordSet; + +class CJX_RecordSet : public CJX_Node { + public: + explicit CJX_RecordSet(CXFA_RecordSet* node); + ~CJX_RecordSet() override; + + JS_PROP(bofAction); + JS_PROP(cursorLocation); + JS_PROP(cursorType); + JS_PROP(eofAction); + JS_PROP(lockType); + JS_PROP(max); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_RECORDSET_H_ diff --git a/fxjs/xfa/cjx_rectangle.cpp b/fxjs/xfa/cjx_rectangle.cpp new file mode 100644 index 0000000000..155a29f935 --- /dev/null +++ b/fxjs/xfa/cjx_rectangle.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_rectangle.h" + +#include "xfa/fxfa/parser/cxfa_rectangle.h" + +CJX_Rectangle::CJX_Rectangle(CXFA_Rectangle* node) : CJX_Node(node) {} + +CJX_Rectangle::~CJX_Rectangle() = default; + +void CJX_Rectangle::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Rectangle::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Rectangle::hand(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_rectangle.h b/fxjs/xfa/cjx_rectangle.h new file mode 100644 index 0000000000..c08f7a9eb1 --- /dev/null +++ b/fxjs/xfa/cjx_rectangle.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_RECTANGLE_H_ +#define FXJS_XFA_CJX_RECTANGLE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Rectangle; + +class CJX_Rectangle : public CJX_Node { + public: + explicit CJX_Rectangle(CXFA_Rectangle* node); + ~CJX_Rectangle() override; + + JS_PROP(hand); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_RECTANGLE_H_ diff --git a/fxjs/xfa/cjx_ref.cpp b/fxjs/xfa/cjx_ref.cpp new file mode 100644 index 0000000000..5930815334 --- /dev/null +++ b/fxjs/xfa/cjx_ref.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_ref.h" + +#include "xfa/fxfa/parser/cxfa_ref.h" + +CJX_Ref::CJX_Ref(CXFA_Ref* node) : CJX_TextNode(node) {} + +CJX_Ref::~CJX_Ref() = default; + +void CJX_Ref::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Ref::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_ref.h b/fxjs/xfa/cjx_ref.h new file mode 100644 index 0000000000..4366282eed --- /dev/null +++ b/fxjs/xfa/cjx_ref.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_REF_H_ +#define FXJS_XFA_CJX_REF_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Ref; + +class CJX_Ref : public CJX_TextNode { + public: + explicit CJX_Ref(CXFA_Ref* node); + ~CJX_Ref() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_REF_H_ diff --git a/fxjs/xfa/cjx_rootelement.cpp b/fxjs/xfa/cjx_rootelement.cpp new file mode 100644 index 0000000000..31fbb006b6 --- /dev/null +++ b/fxjs/xfa/cjx_rootelement.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_rootelement.h" + +#include "xfa/fxfa/parser/cxfa_rootelement.h" + +CJX_RootElement::CJX_RootElement(CXFA_RootElement* node) : CJX_TextNode(node) {} + +CJX_RootElement::~CJX_RootElement() = default; + +void CJX_RootElement::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_RootElement::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_rootelement.h b/fxjs/xfa/cjx_rootelement.h new file mode 100644 index 0000000000..40790df64e --- /dev/null +++ b/fxjs/xfa/cjx_rootelement.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_ROOTELEMENT_H_ +#define FXJS_XFA_CJX_ROOTELEMENT_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_RootElement; + +class CJX_RootElement : public CJX_TextNode { + public: + explicit CJX_RootElement(CXFA_RootElement* node); + ~CJX_RootElement() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_ROOTELEMENT_H_ diff --git a/fxjs/xfa/cjx_script.cpp b/fxjs/xfa/cjx_script.cpp new file mode 100644 index 0000000000..4016c137af --- /dev/null +++ b/fxjs/xfa/cjx_script.cpp @@ -0,0 +1,66 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_script.h" + +#include "fxjs/cfxjse_value.h" +#include "xfa/fxfa/parser/cxfa_script.h" + +CJX_Script::CJX_Script(CXFA_Script* node) : CJX_Node(node) {} + +CJX_Script::~CJX_Script() = default; + +void CJX_Script::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Script::contentType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Script::runAt(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Script::stateless(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + ThrowInvalidPropertyException(); + return; + } + pValue->SetString(FX_UTF8Encode(WideStringView(L"0", 1)).AsStringView()); +} + +void CJX_Script::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Script::binding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Script::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Script::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + defaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_script.h b/fxjs/xfa/cjx_script.h new file mode 100644 index 0000000000..ad5f99418d --- /dev/null +++ b/fxjs/xfa/cjx_script.h @@ -0,0 +1,29 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SCRIPT_H_ +#define FXJS_XFA_CJX_SCRIPT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Script; + +class CJX_Script : public CJX_Node { + public: + explicit CJX_Script(CXFA_Script* node); + ~CJX_Script() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(binding); + JS_PROP(contentType); + JS_PROP(runAt); + JS_PROP(stateless); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_SCRIPT_H_ diff --git a/fxjs/xfa/cjx_select.cpp b/fxjs/xfa/cjx_select.cpp new file mode 100644 index 0000000000..d1cb25992e --- /dev/null +++ b/fxjs/xfa/cjx_select.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_select.h" + +#include "xfa/fxfa/parser/cxfa_select.h" + +CJX_Select::CJX_Select(CXFA_Select* node) : CJX_TextNode(node) {} + +CJX_Select::~CJX_Select() = default; + +void CJX_Select::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Select::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_select.h b/fxjs/xfa/cjx_select.h new file mode 100644 index 0000000000..334c003f2d --- /dev/null +++ b/fxjs/xfa/cjx_select.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SELECT_H_ +#define FXJS_XFA_CJX_SELECT_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Select; + +class CJX_Select : public CJX_TextNode { + public: + explicit CJX_Select(CXFA_Select* node); + ~CJX_Select() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SELECT_H_ diff --git a/fxjs/xfa/cjx_setproperty.cpp b/fxjs/xfa/cjx_setproperty.cpp new file mode 100644 index 0000000000..871fc4dece --- /dev/null +++ b/fxjs/xfa/cjx_setproperty.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_setproperty.h" + +#include "xfa/fxfa/parser/cxfa_setproperty.h" + +CJX_SetProperty::CJX_SetProperty(CXFA_SetProperty* node) : CJX_Node(node) {} + +CJX_SetProperty::~CJX_SetProperty() = default; + +void CJX_SetProperty::connection(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SetProperty::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_setproperty.h b/fxjs/xfa/cjx_setproperty.h new file mode 100644 index 0000000000..9929fefeb7 --- /dev/null +++ b/fxjs/xfa/cjx_setproperty.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SETPROPERTY_H_ +#define FXJS_XFA_CJX_SETPROPERTY_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_SetProperty; + +class CJX_SetProperty : public CJX_Node { + public: + explicit CJX_SetProperty(CXFA_SetProperty* node); + ~CJX_SetProperty() override; + + JS_PROP(connection); + JS_PROP(target); +}; + +#endif // FXJS_XFA_CJX_SETPROPERTY_H_ diff --git a/fxjs/xfa/cjx_signature.cpp b/fxjs/xfa/cjx_signature.cpp new file mode 100644 index 0000000000..912d9d871c --- /dev/null +++ b/fxjs/xfa/cjx_signature.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_signature.h" + +#include "xfa/fxfa/parser/cxfa_signature.h" + +CJX_Signature::CJX_Signature(CXFA_Signature* node) : CJX_Node(node) {} + +CJX_Signature::~CJX_Signature() = default; + +void CJX_Signature::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Signature::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_signature.h b/fxjs/xfa/cjx_signature.h new file mode 100644 index 0000000000..bed0b1a2b4 --- /dev/null +++ b/fxjs/xfa/cjx_signature.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SIGNATURE_H_ +#define FXJS_XFA_CJX_SIGNATURE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Signature; + +class CJX_Signature : public CJX_Node { + public: + explicit CJX_Signature(CXFA_Signature* node); + ~CJX_Signature() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SIGNATURE_H_ diff --git a/fxjs/xfa/cjx_signatureproperties.cpp b/fxjs/xfa/cjx_signatureproperties.cpp new file mode 100644 index 0000000000..6f2e7a7fd0 --- /dev/null +++ b/fxjs/xfa/cjx_signatureproperties.cpp @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_signatureproperties.h" + +#include "xfa/fxfa/parser/cxfa_signatureproperties.h" + +CJX_SignatureProperties::CJX_SignatureProperties(CXFA_SignatureProperties* node) + : CJX_Node(node) {} + +CJX_SignatureProperties::~CJX_SignatureProperties() = default; + +void CJX_SignatureProperties::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SignatureProperties::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_signatureproperties.h b/fxjs/xfa/cjx_signatureproperties.h new file mode 100644 index 0000000000..ffd47a3dc6 --- /dev/null +++ b/fxjs/xfa/cjx_signatureproperties.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SIGNATUREPROPERTIES_H_ +#define FXJS_XFA_CJX_SIGNATUREPROPERTIES_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_SignatureProperties; + +/* Deprecated */ +class CJX_SignatureProperties : public CJX_Node { + public: + explicit CJX_SignatureProperties(CXFA_SignatureProperties* node); + ~CJX_SignatureProperties() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SIGNATUREPROPERTIES_H_ diff --git a/fxjs/xfa/cjx_signdata.cpp b/fxjs/xfa/cjx_signdata.cpp new file mode 100644 index 0000000000..eca7430d17 --- /dev/null +++ b/fxjs/xfa/cjx_signdata.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_signdata.h" + +#include "xfa/fxfa/parser/cxfa_signdata.h" + +CJX_SignData::CJX_SignData(CXFA_SignData* node) : CJX_Node(node) {} + +CJX_SignData::~CJX_SignData() = default; + +void CJX_SignData::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SignData::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SignData::operation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SignData::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SignData::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_signdata.h b/fxjs/xfa/cjx_signdata.h new file mode 100644 index 0000000000..7d9b1755ff --- /dev/null +++ b/fxjs/xfa/cjx_signdata.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SIGNDATA_H_ +#define FXJS_XFA_CJX_SIGNDATA_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_SignData; + +class CJX_SignData : public CJX_Node { + public: + explicit CJX_SignData(CXFA_SignData* node); + ~CJX_SignData() override; + + JS_PROP(operation); + JS_PROP(ref); + JS_PROP(target); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SIGNDATA_H_ diff --git a/fxjs/xfa/cjx_signing.cpp b/fxjs/xfa/cjx_signing.cpp new file mode 100644 index 0000000000..378f725330 --- /dev/null +++ b/fxjs/xfa/cjx_signing.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_signing.h" + +#include "xfa/fxfa/parser/cxfa_signing.h" + +CJX_Signing::CJX_Signing(CXFA_Signing* node) : CJX_Node(node) {} + +CJX_Signing::~CJX_Signing() = default; + +void CJX_Signing::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Signing::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Signing::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_signing.h b/fxjs/xfa/cjx_signing.h new file mode 100644 index 0000000000..8b355097c7 --- /dev/null +++ b/fxjs/xfa/cjx_signing.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SIGNING_H_ +#define FXJS_XFA_CJX_SIGNING_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Signing; + +class CJX_Signing : public CJX_Node { + public: + explicit CJX_Signing(CXFA_Signing* node); + ~CJX_Signing() override; + + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SIGNING_H_ diff --git a/fxjs/xfa/cjx_soapaction.cpp b/fxjs/xfa/cjx_soapaction.cpp new file mode 100644 index 0000000000..854d2d78a7 --- /dev/null +++ b/fxjs/xfa/cjx_soapaction.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_soapaction.h" + +#include "xfa/fxfa/parser/cxfa_soapaction.h" + +CJX_SoapAction::CJX_SoapAction(CXFA_SoapAction* node) : CJX_TextNode(node) {} + +CJX_SoapAction::~CJX_SoapAction() = default; + +void CJX_SoapAction::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SoapAction::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_soapaction.h b/fxjs/xfa/cjx_soapaction.h new file mode 100644 index 0000000000..efc90e4f6b --- /dev/null +++ b/fxjs/xfa/cjx_soapaction.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SOAPACTION_H_ +#define FXJS_XFA_CJX_SOAPACTION_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_SoapAction; + +class CJX_SoapAction : public CJX_TextNode { + public: + explicit CJX_SoapAction(CXFA_SoapAction* node); + ~CJX_SoapAction() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SOAPACTION_H_ diff --git a/fxjs/xfa/cjx_soapaddress.cpp b/fxjs/xfa/cjx_soapaddress.cpp new file mode 100644 index 0000000000..be7e84cb4c --- /dev/null +++ b/fxjs/xfa/cjx_soapaddress.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_soapaddress.h" + +#include "xfa/fxfa/parser/cxfa_soapaddress.h" + +CJX_SoapAddress::CJX_SoapAddress(CXFA_SoapAddress* node) : CJX_TextNode(node) {} + +CJX_SoapAddress::~CJX_SoapAddress() = default; + +void CJX_SoapAddress::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SoapAddress::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_soapaddress.h b/fxjs/xfa/cjx_soapaddress.h new file mode 100644 index 0000000000..3e6e004715 --- /dev/null +++ b/fxjs/xfa/cjx_soapaddress.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SOAPADDRESS_H_ +#define FXJS_XFA_CJX_SOAPADDRESS_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_SoapAddress; + +class CJX_SoapAddress : public CJX_TextNode { + public: + explicit CJX_SoapAddress(CXFA_SoapAddress* node); + ~CJX_SoapAddress() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SOAPADDRESS_H_ diff --git a/fxjs/xfa/cjx_solid.cpp b/fxjs/xfa/cjx_solid.cpp new file mode 100644 index 0000000000..e692153ec6 --- /dev/null +++ b/fxjs/xfa/cjx_solid.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_solid.h" + +#include "xfa/fxfa/parser/cxfa_solid.h" + +CJX_Solid::CJX_Solid(CXFA_Solid* node) : CJX_Node(node) {} + +CJX_Solid::~CJX_Solid() = default; + +void CJX_Solid::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Solid::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_solid.h b/fxjs/xfa/cjx_solid.h new file mode 100644 index 0000000000..3b8dd5eb63 --- /dev/null +++ b/fxjs/xfa/cjx_solid.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SOLID_H_ +#define FXJS_XFA_CJX_SOLID_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Solid; + +class CJX_Solid : public CJX_Node { + public: + explicit CJX_Solid(CXFA_Solid* node); + ~CJX_Solid() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SOLID_H_ diff --git a/fxjs/xfa/cjx_source.cpp b/fxjs/xfa/cjx_source.cpp index 85742fee18..399a6c3664 100644 --- a/fxjs/xfa/cjx_source.cpp +++ b/fxjs/xfa/cjx_source.cpp @@ -161,3 +161,19 @@ CJS_Return CJX_Source::hasDataChanged( return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); return CJS_Return(true); } + +void CJX_Source::db(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) {} + +void CJX_Source::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Source::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_source.h b/fxjs/xfa/cjx_source.h index 8b35fac428..de84912910 100644 --- a/fxjs/xfa/cjx_source.h +++ b/fxjs/xfa/cjx_source.h @@ -35,6 +35,10 @@ class CJX_Source : public CJX_Node { JS_METHOD(update, CJX_Source); JS_METHOD(updateBatch, CJX_Source); + JS_PROP(db); + JS_PROP(use); + JS_PROP(usehref); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_sourceset.cpp b/fxjs/xfa/cjx_sourceset.cpp new file mode 100644 index 0000000000..5bfabdea62 --- /dev/null +++ b/fxjs/xfa/cjx_sourceset.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_sourceset.h" + +#include "xfa/fxfa/parser/cxfa_sourceset.h" + +CJX_SourceSet::CJX_SourceSet(CXFA_SourceSet* node) : CJX_Model(node) {} + +CJX_SourceSet::~CJX_SourceSet() = default; + +void CJX_SourceSet::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SourceSet::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_sourceset.h b/fxjs/xfa/cjx_sourceset.h new file mode 100644 index 0000000000..de4ac68bed --- /dev/null +++ b/fxjs/xfa/cjx_sourceset.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SOURCESET_H_ +#define FXJS_XFA_CJX_SOURCESET_H_ + +#include "fxjs/xfa/cjx_model.h" + +class CXFA_SourceSet; + +class CJX_SourceSet : public CJX_Model { + public: + explicit CJX_SourceSet(CXFA_SourceSet* node); + ~CJX_SourceSet() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SOURCESET_H_ diff --git a/fxjs/xfa/cjx_speak.cpp b/fxjs/xfa/cjx_speak.cpp new file mode 100644 index 0000000000..161b245439 --- /dev/null +++ b/fxjs/xfa/cjx_speak.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_speak.h" + +#include "xfa/fxfa/parser/cxfa_speak.h" + +CJX_Speak::CJX_Speak(CXFA_Speak* node) : CJX_TextNode(node) {} + +CJX_Speak::~CJX_Speak() = default; + +void CJX_Speak::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Speak::priority(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Speak::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Speak::disable(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_speak.h b/fxjs/xfa/cjx_speak.h new file mode 100644 index 0000000000..56981054bc --- /dev/null +++ b/fxjs/xfa/cjx_speak.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SPEAK_H_ +#define FXJS_XFA_CJX_SPEAK_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Speak; + +class CJX_Speak : public CJX_TextNode { + public: + explicit CJX_Speak(CXFA_Speak* node); + ~CJX_Speak() override; + + JS_PROP(disable); + JS_PROP(priority); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SPEAK_H_ diff --git a/fxjs/xfa/cjx_stipple.cpp b/fxjs/xfa/cjx_stipple.cpp new file mode 100644 index 0000000000..ae520c9ad9 --- /dev/null +++ b/fxjs/xfa/cjx_stipple.cpp @@ -0,0 +1,31 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_stipple.h" + +#include "xfa/fxfa/parser/cxfa_stipple.h" + +CJX_Stipple::CJX_Stipple(CXFA_Stipple* node) : CJX_Node(node) {} + +CJX_Stipple::~CJX_Stipple() = default; + +void CJX_Stipple::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Stipple::rate(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Stipple::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_stipple.h b/fxjs/xfa/cjx_stipple.h new file mode 100644 index 0000000000..68ddd83589 --- /dev/null +++ b/fxjs/xfa/cjx_stipple.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_STIPPLE_H_ +#define FXJS_XFA_CJX_STIPPLE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Stipple; + +class CJX_Stipple : public CJX_Node { + public: + explicit CJX_Stipple(CXFA_Stipple* node); + ~CJX_Stipple() override; + + JS_PROP(rate); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_STIPPLE_H_ diff --git a/fxjs/xfa/cjx_subform.cpp b/fxjs/xfa/cjx_subform.cpp index fcf4cffd3e..a38850575c 100644 --- a/fxjs/xfa/cjx_subform.cpp +++ b/fxjs/xfa/cjx_subform.cpp @@ -77,3 +77,154 @@ CJS_Return CJX_Subform::execValidate( pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate); return CJS_Return(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error)); } + +void CJX_Subform::locale(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + SetCData(XFA_Attribute::Locale, pValue->ToWideString(), true, true); + return; + } + + WideString wsLocaleName; + GetXFANode()->GetLocaleName(wsLocaleName); + pValue->SetString(wsLocaleName.UTF8Encode().AsStringView()); +} + +void CJX_Subform::instanceIndex(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_InstanceIndex(pValue, bSetting, eAttribute); +} + +void CJX_Subform::allowMacro(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::anchorType(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::colSpan(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::columnWidths(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::h(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::hAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::layout(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::maxH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::maxW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::minH(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::minW(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::presence(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::restoreState(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::scope(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::validationMessage(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_ValidationMessage(pValue, bSetting, eAttribute); +} + +void CJX_Subform::vAlign(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::w(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::x(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Subform::y(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_subform.h b/fxjs/xfa/cjx_subform.h index a0227f08dd..a1c535b643 100644 --- a/fxjs/xfa/cjx_subform.h +++ b/fxjs/xfa/cjx_subform.h @@ -22,6 +22,31 @@ class CJX_Subform : public CJX_Container { JS_METHOD(execInitialize, CJX_Subform); JS_METHOD(execValidate, CJX_Subform); + JS_PROP(allowMacro); + JS_PROP(anchorType); + JS_PROP(colSpan); + JS_PROP(columnWidths); + JS_PROP(h); + JS_PROP(hAlign); + JS_PROP(instanceIndex); + JS_PROP(layout); + JS_PROP(locale); + JS_PROP(maxH); + JS_PROP(maxW); + JS_PROP(minH); + JS_PROP(minW); + JS_PROP(presence); + JS_PROP(relevant); + JS_PROP(restoreState); + JS_PROP(scope); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(validationMessage); + JS_PROP(vAlign); + JS_PROP(w); + JS_PROP(x); + JS_PROP(y); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_subformset.cpp b/fxjs/xfa/cjx_subformset.cpp new file mode 100644 index 0000000000..cd36abb3df --- /dev/null +++ b/fxjs/xfa/cjx_subformset.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_subformset.h" + +#include "xfa/fxfa/parser/cxfa_subformset.h" + +CJX_SubformSet::CJX_SubformSet(CXFA_SubformSet* node) : CJX_Container(node) {} + +CJX_SubformSet::~CJX_SubformSet() = default; + +void CJX_SubformSet::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SubformSet::relation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SubformSet::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SubformSet::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_SubformSet::instanceIndex(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_InstanceIndex(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_subformset.h b/fxjs/xfa/cjx_subformset.h new file mode 100644 index 0000000000..589b44d460 --- /dev/null +++ b/fxjs/xfa/cjx_subformset.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SUBFORMSET_H_ +#define FXJS_XFA_CJX_SUBFORMSET_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_SubformSet; + +class CJX_SubformSet : public CJX_Container { + public: + explicit CJX_SubformSet(CXFA_SubformSet* node); + ~CJX_SubformSet() override; + + JS_PROP(instanceIndex); + JS_PROP(relation); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_SUBFORMSET_H_ diff --git a/fxjs/xfa/cjx_subjectdn.cpp b/fxjs/xfa/cjx_subjectdn.cpp new file mode 100644 index 0000000000..0a5b4ab58d --- /dev/null +++ b/fxjs/xfa/cjx_subjectdn.cpp @@ -0,0 +1,19 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_subjectdn.h" + +#include "xfa/fxfa/parser/cxfa_subjectdn.h" + +CJX_SubjectDN::CJX_SubjectDN(CXFA_SubjectDN* node) : CJX_Node(node) {} + +CJX_SubjectDN::~CJX_SubjectDN() = default; + +void CJX_SubjectDN::delimiter(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_subjectdn.h b/fxjs/xfa/cjx_subjectdn.h new file mode 100644 index 0000000000..d13218b225 --- /dev/null +++ b/fxjs/xfa/cjx_subjectdn.h @@ -0,0 +1,22 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SUBJECTDN_H_ +#define FXJS_XFA_CJX_SUBJECTDN_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_SubjectDN; + +class CJX_SubjectDN : public CJX_Node { + public: + explicit CJX_SubjectDN(CXFA_SubjectDN* node); + ~CJX_SubjectDN() override; + + JS_PROP(delimiter); +}; + +#endif // FXJS_XFA_CJX_SUBJECTDN_H_ diff --git a/fxjs/xfa/cjx_subjectdns.cpp b/fxjs/xfa/cjx_subjectdns.cpp new file mode 100644 index 0000000000..e7d9db5622 --- /dev/null +++ b/fxjs/xfa/cjx_subjectdns.cpp @@ -0,0 +1,19 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_subjectdns.h" + +#include "xfa/fxfa/parser/cxfa_subjectdns.h" + +CJX_SubjectDNs::CJX_SubjectDNs(CXFA_SubjectDNs* node) : CJX_Node(node) {} + +CJX_SubjectDNs::~CJX_SubjectDNs() = default; + +void CJX_SubjectDNs::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_subjectdns.h b/fxjs/xfa/cjx_subjectdns.h new file mode 100644 index 0000000000..104d826285 --- /dev/null +++ b/fxjs/xfa/cjx_subjectdns.h @@ -0,0 +1,22 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SUBJECTDNS_H_ +#define FXJS_XFA_CJX_SUBJECTDNS_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_SubjectDNs; + +class CJX_SubjectDNs : public CJX_Node { + public: + explicit CJX_SubjectDNs(CXFA_SubjectDNs* node); + ~CJX_SubjectDNs() override; + + JS_PROP(type); +}; + +#endif // FXJS_XFA_CJX_SUBJECTDNS_H_ diff --git a/fxjs/xfa/cjx_submit.cpp b/fxjs/xfa/cjx_submit.cpp new file mode 100644 index 0000000000..292e4320c8 --- /dev/null +++ b/fxjs/xfa/cjx_submit.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_submit.h" + +#include "xfa/fxfa/parser/cxfa_submit.h" + +CJX_Submit::CJX_Submit(CXFA_Submit* node) : CJX_Node(node) {} + +CJX_Submit::~CJX_Submit() = default; + +void CJX_Submit::format(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::embedPDF(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::target(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::textEncoding(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Submit::xdpContent(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_submit.h b/fxjs/xfa/cjx_submit.h new file mode 100644 index 0000000000..aefec32b8e --- /dev/null +++ b/fxjs/xfa/cjx_submit.h @@ -0,0 +1,28 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_SUBMIT_H_ +#define FXJS_XFA_CJX_SUBMIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Submit; + +class CJX_Submit : public CJX_Node { + public: + explicit CJX_Submit(CXFA_Submit* node); + ~CJX_Submit() override; + + JS_PROP(embedPDF); + JS_PROP(format); + JS_PROP(target); + JS_PROP(textEncoding); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(xdpContent); +}; + +#endif // FXJS_XFA_CJX_SUBMIT_H_ diff --git a/fxjs/xfa/cjx_text.cpp b/fxjs/xfa/cjx_text.cpp new file mode 100644 index 0000000000..eda2ff8b22 --- /dev/null +++ b/fxjs/xfa/cjx_text.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_text.h" + +#include "xfa/fxfa/parser/cxfa_text.h" + +CJX_Text::CJX_Text(CXFA_Text* node) : CJX_Content(node) {} + +CJX_Text::~CJX_Text() = default; + +void CJX_Text::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Text::maxChars(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Text::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Text::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Text::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_text.h b/fxjs/xfa/cjx_text.h new file mode 100644 index 0000000000..386a7a9679 --- /dev/null +++ b/fxjs/xfa/cjx_text.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TEXT_H_ +#define FXJS_XFA_CJX_TEXT_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Text; + +class CJX_Text : public CJX_Content { + public: + explicit CJX_Text(CXFA_Text* node); + ~CJX_Text() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(maxChars); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_TEXT_H_ diff --git a/fxjs/xfa/cjx_textedit.cpp b/fxjs/xfa/cjx_textedit.cpp new file mode 100644 index 0000000000..e1a6faa13b --- /dev/null +++ b/fxjs/xfa/cjx_textedit.cpp @@ -0,0 +1,49 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_textedit.h" + +#include "xfa/fxfa/parser/cxfa_textedit.h" + +CJX_TextEdit::CJX_TextEdit(CXFA_TextEdit* node) : CJX_Node(node) {} + +CJX_TextEdit::~CJX_TextEdit() = default; + +void CJX_TextEdit::vScrollPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TextEdit::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TextEdit::allowRichText(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TextEdit::multiLine(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TextEdit::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TextEdit::hScrollPolicy(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_textedit.h b/fxjs/xfa/cjx_textedit.h new file mode 100644 index 0000000000..c7f42c963b --- /dev/null +++ b/fxjs/xfa/cjx_textedit.h @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TEXTEDIT_H_ +#define FXJS_XFA_CJX_TEXTEDIT_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_TextEdit; + +class CJX_TextEdit : public CJX_Node { + public: + explicit CJX_TextEdit(CXFA_TextEdit* node); + ~CJX_TextEdit() override; + + JS_PROP(allowRichText); + JS_PROP(hScrollPolicy); + JS_PROP(multiLine); + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(vScrollPolicy); +}; + +#endif // FXJS_XFA_CJX_TEXTEDIT_H_ diff --git a/fxjs/xfa/cjx_textnode.cpp b/fxjs/xfa/cjx_textnode.cpp index 604682f2ee..133510c30e 100644 --- a/fxjs/xfa/cjx_textnode.cpp +++ b/fxjs/xfa/cjx_textnode.cpp @@ -12,3 +12,15 @@ CJX_TextNode::CJX_TextNode(CXFA_Node* node) : CJX_Node(node) {} CJX_TextNode::~CJX_TextNode() {} + +void CJX_TextNode::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute attr) { + Script_Som_DefaultValue(pValue, bSetting, attr); +} + +void CJX_TextNode::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute attr) { + Script_Som_DefaultValue(pValue, bSetting, attr); +} diff --git a/fxjs/xfa/cjx_textnode.h b/fxjs/xfa/cjx_textnode.h index c0a01d651e..12d44d7814 100644 --- a/fxjs/xfa/cjx_textnode.h +++ b/fxjs/xfa/cjx_textnode.h @@ -16,6 +16,9 @@ class CJX_TextNode : public CJX_Node { public: explicit CJX_TextNode(CXFA_Node* node); ~CJX_TextNode() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(value); }; #endif // FXJS_XFA_CJX_TEXTNODE_H_ diff --git a/fxjs/xfa/cjx_time.cpp b/fxjs/xfa/cjx_time.cpp new file mode 100644 index 0000000000..74855fd3d7 --- /dev/null +++ b/fxjs/xfa/cjx_time.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_time.h" + +#include "xfa/fxfa/parser/cxfa_time.h" + +CJX_Time::CJX_Time(CXFA_Time* node) : CJX_Content(node) {} + +CJX_Time::~CJX_Time() = default; + +void CJX_Time::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Time::defaultValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} + +void CJX_Time::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Time::value(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Som_DefaultValue(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_time.h b/fxjs/xfa/cjx_time.h new file mode 100644 index 0000000000..95b05cc107 --- /dev/null +++ b/fxjs/xfa/cjx_time.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TIME_H_ +#define FXJS_XFA_CJX_TIME_H_ + +#include "fxjs/xfa/cjx_content.h" + +class CXFA_Time; + +class CJX_Time : public CJX_Content { + public: + explicit CJX_Time(CXFA_Time* node); + ~CJX_Time() override; + + JS_PROP(defaultValue); /* {default} */ + JS_PROP(use); + JS_PROP(usehref); + JS_PROP(value); +}; + +#endif // FXJS_XFA_CJX_TIME_H_ diff --git a/fxjs/xfa/cjx_timestamp.cpp b/fxjs/xfa/cjx_timestamp.cpp new file mode 100644 index 0000000000..011d696cc1 --- /dev/null +++ b/fxjs/xfa/cjx_timestamp.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_timestamp.h" + +#include "xfa/fxfa/parser/cxfa_timestamp.h" + +CJX_TimeStamp::CJX_TimeStamp(CXFA_TimeStamp* node) : CJX_Node(node) {} + +CJX_TimeStamp::~CJX_TimeStamp() = default; + +void CJX_TimeStamp::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TimeStamp::type(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TimeStamp::server(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_TimeStamp::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_timestamp.h b/fxjs/xfa/cjx_timestamp.h new file mode 100644 index 0000000000..ad7ab02a29 --- /dev/null +++ b/fxjs/xfa/cjx_timestamp.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TIMESTAMP_H_ +#define FXJS_XFA_CJX_TIMESTAMP_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_TimeStamp; + +class CJX_TimeStamp : public CJX_Node { + public: + explicit CJX_TimeStamp(CXFA_TimeStamp* node); + ~CJX_TimeStamp() override; + + JS_PROP(server); + JS_PROP(type); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_TIMESTAMP_H_ diff --git a/fxjs/xfa/cjx_tooltip.cpp b/fxjs/xfa/cjx_tooltip.cpp new file mode 100644 index 0000000000..5d6e2427c8 --- /dev/null +++ b/fxjs/xfa/cjx_tooltip.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_tooltip.h" + +#include "xfa/fxfa/parser/cxfa_tooltip.h" + +CJX_ToolTip::CJX_ToolTip(CXFA_ToolTip* node) : CJX_TextNode(node) {} + +CJX_ToolTip::~CJX_ToolTip() = default; + +void CJX_ToolTip::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_ToolTip::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_tooltip.h b/fxjs/xfa/cjx_tooltip.h new file mode 100644 index 0000000000..178d11b0e9 --- /dev/null +++ b/fxjs/xfa/cjx_tooltip.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TOOLTIP_H_ +#define FXJS_XFA_CJX_TOOLTIP_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_ToolTip; + +class CJX_ToolTip : public CJX_TextNode { + public: + explicit CJX_ToolTip(CXFA_ToolTip* node); + ~CJX_ToolTip() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_TOOLTIP_H_ diff --git a/fxjs/xfa/cjx_traversal.cpp b/fxjs/xfa/cjx_traversal.cpp new file mode 100644 index 0000000000..ffdcd35272 --- /dev/null +++ b/fxjs/xfa/cjx_traversal.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_traversal.h" + +#include "xfa/fxfa/parser/cxfa_traversal.h" + +CJX_Traversal::CJX_Traversal(CXFA_Traversal* node) : CJX_Node(node) {} + +CJX_Traversal::~CJX_Traversal() = default; + +void CJX_Traversal::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Traversal::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_traversal.h b/fxjs/xfa/cjx_traversal.h new file mode 100644 index 0000000000..d9072f3456 --- /dev/null +++ b/fxjs/xfa/cjx_traversal.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TRAVERSAL_H_ +#define FXJS_XFA_CJX_TRAVERSAL_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Traversal; + +class CJX_Traversal : public CJX_Node { + public: + explicit CJX_Traversal(CXFA_Traversal* node); + ~CJX_Traversal() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_TRAVERSAL_H_ diff --git a/fxjs/xfa/cjx_traverse.cpp b/fxjs/xfa/cjx_traverse.cpp new file mode 100644 index 0000000000..f0d5345ea4 --- /dev/null +++ b/fxjs/xfa/cjx_traverse.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_traverse.h" + +#include "xfa/fxfa/parser/cxfa_traverse.h" + +CJX_Traverse::CJX_Traverse(CXFA_Traverse* node) : CJX_Node(node) {} + +CJX_Traverse::~CJX_Traverse() = default; + +void CJX_Traverse::ref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Traverse::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Traverse::operation(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Traverse::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_traverse.h b/fxjs/xfa/cjx_traverse.h new file mode 100644 index 0000000000..2eef88eb6f --- /dev/null +++ b/fxjs/xfa/cjx_traverse.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_TRAVERSE_H_ +#define FXJS_XFA_CJX_TRAVERSE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Traverse; + +class CJX_Traverse : public CJX_Node { + public: + explicit CJX_Traverse(CXFA_Traverse* node); + ~CJX_Traverse() override; + + JS_PROP(operation); + JS_PROP(ref); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_TRAVERSE_H_ diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp index 8e3143ecc7..1a20611cad 100644 --- a/fxjs/xfa/cjx_tree.cpp +++ b/fxjs/xfa/cjx_tree.cpp @@ -127,6 +127,12 @@ void CJX_Tree::classAll(CFXJSE_Value* pValue, XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_ALL, nullptr); } +void CJX_Tree::name(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + void CJX_Tree::nodes(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { diff --git a/fxjs/xfa/cjx_tree.h b/fxjs/xfa/cjx_tree.h index 72468d6c75..9389d2ec4f 100644 --- a/fxjs/xfa/cjx_tree.h +++ b/fxjs/xfa/cjx_tree.h @@ -21,17 +21,14 @@ class CJX_Tree : public CJX_Object { JS_METHOD(resolveNode, CJX_Tree); JS_METHOD(resolveNodes, CJX_Tree); - void all(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void nodes(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void classAll(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void parent(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void index(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void classIndex(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); - void somExpression(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); + JS_PROP(all); + JS_PROP(classAll); + JS_PROP(classIndex); + JS_PROP(index); + JS_PROP(name); + JS_PROP(nodes); + JS_PROP(parent); + JS_PROP(somExpression); private: void ResolveNodeList(CFXJSE_Value* pValue, diff --git a/fxjs/xfa/cjx_ui.cpp b/fxjs/xfa/cjx_ui.cpp new file mode 100644 index 0000000000..90db789dd7 --- /dev/null +++ b/fxjs/xfa/cjx_ui.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_ui.h" + +#include "xfa/fxfa/parser/cxfa_ui.h" + +CJX_Ui::CJX_Ui(CXFA_Ui* node) : CJX_Node(node) {} + +CJX_Ui::~CJX_Ui() = default; + +void CJX_Ui::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Ui::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_ui.h b/fxjs/xfa/cjx_ui.h new file mode 100644 index 0000000000..e82b1deacb --- /dev/null +++ b/fxjs/xfa/cjx_ui.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_UI_H_ +#define FXJS_XFA_CJX_UI_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Ui; + +class CJX_Ui : public CJX_Node { + public: + explicit CJX_Ui(CXFA_Ui* node); + ~CJX_Ui() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_UI_H_ diff --git a/fxjs/xfa/cjx_update.cpp b/fxjs/xfa/cjx_update.cpp new file mode 100644 index 0000000000..e5d1ef27c9 --- /dev/null +++ b/fxjs/xfa/cjx_update.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_update.h" + +#include "xfa/fxfa/parser/cxfa_update.h" + +CJX_Update::CJX_Update(CXFA_Update* node) : CJX_TextNode(node) {} + +CJX_Update::~CJX_Update() = default; + +void CJX_Update::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Update::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_update.h b/fxjs/xfa/cjx_update.h new file mode 100644 index 0000000000..c1acb4bd90 --- /dev/null +++ b/fxjs/xfa/cjx_update.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_UPDATE_H_ +#define FXJS_XFA_CJX_UPDATE_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Update; + +class CJX_Update : public CJX_TextNode { + public: + explicit CJX_Update(CXFA_Update* node); + ~CJX_Update() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_UPDATE_H_ diff --git a/fxjs/xfa/cjx_uri.cpp b/fxjs/xfa/cjx_uri.cpp new file mode 100644 index 0000000000..6ffbb68e8f --- /dev/null +++ b/fxjs/xfa/cjx_uri.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_uri.h" + +#include "xfa/fxfa/parser/cxfa_uri.h" + +CJX_Uri::CJX_Uri(CXFA_Uri* node) : CJX_TextNode(node) {} + +CJX_Uri::~CJX_Uri() = default; + +void CJX_Uri::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Uri::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_uri.h b/fxjs/xfa/cjx_uri.h new file mode 100644 index 0000000000..805bc5c1ab --- /dev/null +++ b/fxjs/xfa/cjx_uri.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_URI_H_ +#define FXJS_XFA_CJX_URI_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_Uri; + +class CJX_Uri : public CJX_TextNode { + public: + explicit CJX_Uri(CXFA_Uri* node); + ~CJX_Uri() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_URI_H_ diff --git a/fxjs/xfa/cjx_user.cpp b/fxjs/xfa/cjx_user.cpp new file mode 100644 index 0000000000..a42f927d47 --- /dev/null +++ b/fxjs/xfa/cjx_user.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_user.h" + +#include "xfa/fxfa/parser/cxfa_user.h" + +CJX_User::CJX_User(CXFA_User* node) : CJX_TextNode(node) {} + +CJX_User::~CJX_User() = default; + +void CJX_User::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_User::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_user.h b/fxjs/xfa/cjx_user.h new file mode 100644 index 0000000000..6111df8535 --- /dev/null +++ b/fxjs/xfa/cjx_user.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_USER_H_ +#define FXJS_XFA_CJX_USER_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_User; + +class CJX_User : public CJX_TextNode { + public: + explicit CJX_User(CXFA_User* node); + ~CJX_User() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_USER_H_ diff --git a/fxjs/xfa/cjx_validate.cpp b/fxjs/xfa/cjx_validate.cpp new file mode 100644 index 0000000000..16c264e23e --- /dev/null +++ b/fxjs/xfa/cjx_validate.cpp @@ -0,0 +1,43 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_validate.h" + +#include "xfa/fxfa/parser/cxfa_validate.h" + +CJX_Validate::CJX_Validate(CXFA_Validate* node) : CJX_Node(node) {} + +CJX_Validate::~CJX_Validate() = default; + +void CJX_Validate::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Validate::scriptTest(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Validate::nullTest(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Validate::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Validate::formatTest(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_validate.h b/fxjs/xfa/cjx_validate.h new file mode 100644 index 0000000000..c54923d5b0 --- /dev/null +++ b/fxjs/xfa/cjx_validate.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_VALIDATE_H_ +#define FXJS_XFA_CJX_VALIDATE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Validate; + +class CJX_Validate : public CJX_Node { + public: + explicit CJX_Validate(CXFA_Validate* node); + ~CJX_Validate() override; + + JS_PROP(formatTest); + JS_PROP(nullTest); + JS_PROP(scriptTest); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_VALIDATE_H_ diff --git a/fxjs/xfa/cjx_value.cpp b/fxjs/xfa/cjx_value.cpp new file mode 100644 index 0000000000..8fe3b239f5 --- /dev/null +++ b/fxjs/xfa/cjx_value.cpp @@ -0,0 +1,37 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_value.h" + +#include "xfa/fxfa/parser/cxfa_value.h" + +CJX_Value::CJX_Value(CXFA_Value* node) : CJX_Node(node) {} + +CJX_Value::~CJX_Value() = default; + +void CJX_Value::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Value::relevant(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Value::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Value::override(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_BOOL(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_value.h b/fxjs/xfa/cjx_value.h new file mode 100644 index 0000000000..f9c2a2ceb9 --- /dev/null +++ b/fxjs/xfa/cjx_value.h @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_VALUE_H_ +#define FXJS_XFA_CJX_VALUE_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_Value; + +class CJX_Value : public CJX_Node { + public: + explicit CJX_Value(CXFA_Value* node); + ~CJX_Value() override; + + JS_PROP(override); + JS_PROP(relevant); + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_VALUE_H_ diff --git a/fxjs/xfa/cjx_variables.cpp b/fxjs/xfa/cjx_variables.cpp new file mode 100644 index 0000000000..0904c9f3fe --- /dev/null +++ b/fxjs/xfa/cjx_variables.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_variables.h" + +#include "xfa/fxfa/parser/cxfa_variables.h" + +CJX_Variables::CJX_Variables(CXFA_Variables* node) : CJX_Container(node) {} + +CJX_Variables::~CJX_Variables() = default; + +void CJX_Variables::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Variables::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_variables.h b/fxjs/xfa/cjx_variables.h new file mode 100644 index 0000000000..8ed373e5cd --- /dev/null +++ b/fxjs/xfa/cjx_variables.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_VARIABLES_H_ +#define FXJS_XFA_CJX_VARIABLES_H_ + +#include "fxjs/xfa/cjx_container.h" + +class CXFA_Variables; + +class CJX_Variables : public CJX_Container { + public: + explicit CJX_Variables(CXFA_Variables* node); + ~CJX_Variables() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_VARIABLES_H_ diff --git a/fxjs/xfa/cjx_wsdladdress.cpp b/fxjs/xfa/cjx_wsdladdress.cpp new file mode 100644 index 0000000000..fc6a77c2e4 --- /dev/null +++ b/fxjs/xfa/cjx_wsdladdress.cpp @@ -0,0 +1,25 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_wsdladdress.h" + +#include "xfa/fxfa/parser/cxfa_wsdladdress.h" + +CJX_WsdlAddress::CJX_WsdlAddress(CXFA_WsdlAddress* node) : CJX_TextNode(node) {} + +CJX_WsdlAddress::~CJX_WsdlAddress() = default; + +void CJX_WsdlAddress::use(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_WsdlAddress::usehref(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_wsdladdress.h b/fxjs/xfa/cjx_wsdladdress.h new file mode 100644 index 0000000000..a742d1a973 --- /dev/null +++ b/fxjs/xfa/cjx_wsdladdress.h @@ -0,0 +1,23 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_WSDLADDRESS_H_ +#define FXJS_XFA_CJX_WSDLADDRESS_H_ + +#include "fxjs/xfa/cjx_textnode.h" + +class CXFA_WsdlAddress; + +class CJX_WsdlAddress : public CJX_TextNode { + public: + explicit CJX_WsdlAddress(CXFA_WsdlAddress* node); + ~CJX_WsdlAddress() override; + + JS_PROP(use); + JS_PROP(usehref); +}; + +#endif // FXJS_XFA_CJX_WSDLADDRESS_H_ diff --git a/fxjs/xfa/cjx_wsdlconnection.cpp b/fxjs/xfa/cjx_wsdlconnection.cpp index 1d0c306f14..4c6ca46dd9 100644 --- a/fxjs/xfa/cjx_wsdlconnection.cpp +++ b/fxjs/xfa/cjx_wsdlconnection.cpp @@ -29,3 +29,15 @@ CJS_Return CJX_WsdlConnection::execute( return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); return CJS_Return(runtime->NewBoolean(false)); } + +void CJX_WsdlConnection::dataDescription(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_WsdlConnection::execute(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_wsdlconnection.h b/fxjs/xfa/cjx_wsdlconnection.h index 82760170a7..d755b5d075 100644 --- a/fxjs/xfa/cjx_wsdlconnection.h +++ b/fxjs/xfa/cjx_wsdlconnection.h @@ -19,6 +19,9 @@ class CJX_WsdlConnection : public CJX_Node { JS_METHOD(execute, CJX_WsdlConnection); + JS_PROP(dataDescription); + JS_PROP(execute); + private: static const CJX_MethodSpec MethodSpecs[]; }; diff --git a/fxjs/xfa/cjx_xfa.cpp b/fxjs/xfa/cjx_xfa.cpp new file mode 100644 index 0000000000..bc0d7f118e --- /dev/null +++ b/fxjs/xfa/cjx_xfa.cpp @@ -0,0 +1,39 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_xfa.h" + +#include "fxjs/cfxjse_engine.h" +#include "fxjs/cfxjse_value.h" +#include "xfa/fxfa/parser/cxfa_document.h" +#include "xfa/fxfa/parser/cxfa_xfa.h" + +CJX_Xfa::CJX_Xfa(CXFA_Xfa* node) : CJX_Model(node) {} + +CJX_Xfa::~CJX_Xfa() = default; + +void CJX_Xfa::thisValue(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) + return; + + CXFA_Object* pThis = GetDocument()->GetScriptContext()->GetThisObject(); + ASSERT(pThis); + pValue->Assign(GetDocument()->GetScriptContext()->GetJSValueFromMap(pThis)); +} + +void CJX_Xfa::timeStamp(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} + +void CJX_Xfa::uuid(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_xfa.h b/fxjs/xfa/cjx_xfa.h new file mode 100644 index 0000000000..0c8ed7efff --- /dev/null +++ b/fxjs/xfa/cjx_xfa.h @@ -0,0 +1,24 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_XFA_H_ +#define FXJS_XFA_CJX_XFA_H_ + +#include "fxjs/xfa/cjx_model.h" + +class CXFA_Xfa; + +class CJX_Xfa : public CJX_Model { + public: + explicit CJX_Xfa(CXFA_Xfa* node); + ~CJX_Xfa() override; + + JS_PROP(thisValue); /* this */ + JS_PROP(timeStamp); + JS_PROP(uuid); +}; + +#endif // FXJS_XFA_CJX_XFA_H_ diff --git a/fxjs/xfa/cjx_xmlconnection.cpp b/fxjs/xfa/cjx_xmlconnection.cpp new file mode 100644 index 0000000000..6622aab12e --- /dev/null +++ b/fxjs/xfa/cjx_xmlconnection.cpp @@ -0,0 +1,20 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_xmlconnection.h" + +#include "xfa/fxfa/parser/cxfa_xmlconnection.h" + +CJX_XmlConnection::CJX_XmlConnection(CXFA_XmlConnection* node) + : CJX_Node(node) {} + +CJX_XmlConnection::~CJX_XmlConnection() = default; + +void CJX_XmlConnection::dataDescription(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_xmlconnection.h b/fxjs/xfa/cjx_xmlconnection.h new file mode 100644 index 0000000000..03c5c37320 --- /dev/null +++ b/fxjs/xfa/cjx_xmlconnection.h @@ -0,0 +1,22 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_XMLCONNECTION_H_ +#define FXJS_XFA_CJX_XMLCONNECTION_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_XmlConnection; + +class CJX_XmlConnection : public CJX_Node { + public: + explicit CJX_XmlConnection(CXFA_XmlConnection* node); + ~CJX_XmlConnection() override; + + JS_PROP(dataDescription); +}; + +#endif // FXJS_XFA_CJX_XMLCONNECTION_H_ diff --git a/fxjs/xfa/cjx_xsdconnection.cpp b/fxjs/xfa/cjx_xsdconnection.cpp new file mode 100644 index 0000000000..aa7d42ae13 --- /dev/null +++ b/fxjs/xfa/cjx_xsdconnection.cpp @@ -0,0 +1,20 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fxjs/xfa/cjx_xsdconnection.h" + +#include "xfa/fxfa/parser/cxfa_xsdconnection.h" + +CJX_XsdConnection::CJX_XsdConnection(CXFA_XsdConnection* node) + : CJX_Node(node) {} + +CJX_XsdConnection::~CJX_XsdConnection() = default; + +void CJX_XsdConnection::dataDescription(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + Script_Attribute_String(pValue, bSetting, eAttribute); +} diff --git a/fxjs/xfa/cjx_xsdconnection.h b/fxjs/xfa/cjx_xsdconnection.h new file mode 100644 index 0000000000..66c79a14fa --- /dev/null +++ b/fxjs/xfa/cjx_xsdconnection.h @@ -0,0 +1,22 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_XFA_CJX_XSDCONNECTION_H_ +#define FXJS_XFA_CJX_XSDCONNECTION_H_ + +#include "fxjs/xfa/cjx_node.h" + +class CXFA_XsdConnection; + +class CJX_XsdConnection : public CJX_Node { + public: + explicit CJX_XsdConnection(CXFA_XsdConnection* node); + ~CJX_XsdConnection() override; + + JS_PROP(dataDescription); +}; + +#endif // FXJS_XFA_CJX_XSDCONNECTION_H_ -- cgit v1.2.3