aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFAnnotationObjectHelper.hh5
-rw-r--r--include/qpdf/QPDFFormFieldObjectHelper.hh33
2 files changed, 38 insertions, 0 deletions
diff --git a/include/qpdf/QPDFAnnotationObjectHelper.hh b/include/qpdf/QPDFAnnotationObjectHelper.hh
index c5d24334..5e8af0c6 100644
--- a/include/qpdf/QPDFAnnotationObjectHelper.hh
+++ b/include/qpdf/QPDFAnnotationObjectHelper.hh
@@ -61,6 +61,11 @@ class QPDFAnnotationObjectHelper: public QPDFObjectHelper
QPDF_DLL
std::string getAppearanceState();
+ // Return flags from "/F". The value is a logical or of
+ // pdf_annotation_flag_e as defined in qpdf/Constants.h.
+ QPDF_DLL
+ int getFlags();
+
// Return a specific stream. "which" may be one of "/N", "/R", or
// "/D" to indicate the normal, rollover, or down appearance
// stream. (Any value may be passed to "which"; if an appearance
diff --git a/include/qpdf/QPDFFormFieldObjectHelper.hh b/include/qpdf/QPDFFormFieldObjectHelper.hh
index ec2c1f55..5b8a2d0e 100644
--- a/include/qpdf/QPDFFormFieldObjectHelper.hh
+++ b/include/qpdf/QPDFFormFieldObjectHelper.hh
@@ -29,6 +29,7 @@
#include <qpdf/QPDFObjectHelper.hh>
#include <qpdf/DLL.h>
+#include <vector>
class QPDFFormFieldObjectHelper: public QPDFObjectHelper
{
@@ -120,6 +121,38 @@ class QPDFFormFieldObjectHelper: public QPDFObjectHelper
QPDF_DLL
int getQuadding();
+ // Return field flags from /Ff. The value is a logical or of
+ // pdf_form_field_flag_e as defined in qpdf/Constants.h
+ QPDF_DLL
+ int getFlags();
+
+ // Methods for testing for particular types of form fields
+
+ // Returns true if field is of type /Tx
+ QPDF_DLL
+ bool isText();
+ // Returns true if field is of type /Btn and flags do not indicate
+ // some other type of button.
+ QPDF_DLL
+ bool isCheckbox();
+ // Returns true if field is a checkbox and is checked.
+ QPDF_DLL
+ bool isChecked();
+ // Returns true if field is of type /Btn and flags indicate that
+ // it is a radio button
+ QPDF_DLL
+ bool isRadioButton();
+ // Returns true if field is of type /Btn and flags indicate that
+ // it is a pushbutton
+ QPDF_DLL
+ bool isPushbutton();
+ // Returns true if fields if of type /Ch
+ QPDF_DLL
+ bool isChoice();
+ // Returns choices as UTF-8 strings
+ QPDF_DLL
+ std::vector<std::string> getChoices();
+
// Set an attribute to the given value
QPDF_DLL
void setFieldAttribute(std::string const& key, QPDFObjectHandle value);