Loading...
Searching...
No Matches
Field.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPPDFField
6#define PDFTRON_H_CPPPDFField
7
8#include <Common/UString.h>
9#include <SDF/Obj.h>
10#include <PDF/GState.h>
11#include <C/PDF/TRN_Field.h>
14
15namespace pdftron {
16 namespace PDF {
17
18class Page;
19
69class Field
70{
71public:
72
77 Field (SDF::Obj field_dict);
78
79 Field (const Field& p);
82
88 bool IsValid() const;
89
100 enum Type
101 {
102 e_button, // Pushbutton field
103 e_check, // Check box field
104 e_radio, // Radio button field
105 e_text, // Text field
106 e_choice, // Choice field
107 e_signature, // Digital signature field
108 e_null // Unknown field type
109 };
110
115 Type GetType() const;
116
125
131
159 ViewChangeCollection SetValue(const char* value);
160
162 {
163 e_action_trigger_keystroke = 13, //Triggered when user modifies text, or selection, in a text, combo or list field
164 e_action_trigger_format = 14, //Triggered before a field value is displayed.
165 e_action_trigger_validate = 15, //Triggered when a field value is changed
166 e_action_trigger_calculate = 16 //Triggered when field is recalculated due to a change in another field
167 };
168
177
185
201
206
215
221
227
234 void Rename(const UString& field_name);
235
241 bool IsAnnot() const;
242
351
355 bool GetFlag(Flag flag) const;
356
365 void SetFlag(Flag flag, bool value);
366
377
383
390
396 void SetMaxLen(int max_len);
397
401 int GetOptCount() const;
402
408 UString GetOpt(int index);
409
415 int GetMaxLen() const;
416
422
437 void Flatten(class Page page);
438
443
462 SDF::Obj FindInheritedAttribute (const char* attrib) const;
463
468
472 operator bool () { return IsValid();}
473
477 void Destroy();
478
492
499
500// @cond PRIVATE_DOC
501#ifndef SWIGHIDDEN
502 TRN_Field mp_field;
503 Field ();
504#endif
505// @endcond
506
507};
508
509
510
511 }; // namespace PDF
512}; // namespace pdftron
513
514
515#include <Impl/Page.inl>
516
517#endif // PDFTRON_H_CPPPDFField
ViewChangeCollection SetValue(const UString &value)
int GetMaxLen() const
Type GetType() const
bool IsLockedByDigitalSignature() const
void SetMaxLen(int max_len)
void SetFlag(Flag flag, bool value)
UString GetPartialName()
bool IsAnnot() const
@ e_action_trigger_calculate
Definition Field.h:166
@ e_action_trigger_keystroke
Definition Field.h:163
@ e_action_trigger_validate
Definition Field.h:165
SDF::Obj GetTriggerAction(Field::ActionTriggerEvent trigger)
SDF::Obj GetDefaultValue()
ViewChangeCollection SetValue(bool value)
Field & operator=(const Field &p)
bool IsValid() const
GState GetDefaultAppearance()
Rect GetUpdateRect() const
int GetOptCount() const
SDF::Obj UseSignatureHandler(const SDF::SignatureHandlerId signature_handler_id)
UString GetOpt(int index)
TextJustification GetJustification()
Field(const Field &p)
void SetJustification(TextJustification j)
bool GetFlag(Flag flag) const
void Rename(const UString &field_name)
ViewChangeCollection SetValue(SDF::Obj value)
UString GetValueAsString()
SDF::Obj GetSDFObj() const
SDF::Obj FindInheritedAttribute(const char *attrib) const
ViewChangeCollection SetValue(const char *value)
void Flatten(class Page page)
Field(SDF::Obj field_dict)
UString GetDefaultValueAsString()
size_t SignatureHandlerId