FormField.h
1 // Copyright 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
9 #pragma once
10 
11 #include <system/string.h>
12 #include <system/shared_ptr.h>
13 #include <system/object.h>
14 #include <cstdint>
15 
16 #include "Aspose.Words.Cpp/Model/Text/SpecialChar.h"
17 #include "Aspose.Words.Cpp/Model/Nodes/NodeType.h"
18 #include "Aspose.Words.Cpp/Model/Fields/FormFields/TextFormFieldType.h"
19 #include "Aspose.Words.Cpp/Model/Fields/FieldType.h"
20 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
21 
22 namespace Aspose { namespace Words { namespace Comparison { class FieldComparer; } } }
23 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxFieldsWriter; } } } } }
24 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlControlAsFormFieldReader; } } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlFieldsWriter; } } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Reader { class NrxFldCharReaderBase; } } } } }
27 namespace Aspose { namespace Words { class RangeDocumentBuilder; } }
28 namespace Aspose { namespace Words { namespace Layout { namespace Core { class SpanFormField; } } } }
29 namespace Aspose { namespace Words { namespace Layout { namespace PreAps { class LayoutSpanFormFieldControl; } } } }
30 namespace Aspose { namespace Words { namespace Fields { class FieldFormText; } } }
31 namespace Aspose { namespace Words { class DocumentBuilder; } }
32 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlFieldWriter; } } } } }
33 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtFieldReader; } } } } }
34 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtFieldWriter; } } } } }
35 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
36 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class DocWriter; } } } } }
37 namespace Aspose { namespace Words { namespace RW { namespace Doc { class FfDataFiler; } } } }
38 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtTextBodyWriter; } } } } }
39 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfModelBuilder; } } } } }
40 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfFieldWriter; } } } } }
41 namespace Aspose { namespace Words { namespace Fields { enum class FormFieldType; } } }
42 namespace Aspose { namespace Words { namespace Fields { class Field; } } }
43 namespace Aspose { namespace Words { namespace Fields { class DropDownItemCollection; } } }
44 namespace Aspose { namespace Words { class BookmarkStart; } }
45 namespace Aspose { namespace Words { namespace Fields { class FormFieldPr; } } }
46 namespace Aspose { namespace Words { class DocumentBase; } }
47 namespace Aspose { namespace Words { class RunPr; } }
48 namespace Aspose { namespace Words { class Node; } }
49 namespace Aspose { namespace Words { class INodeCloningListener; } }
50 namespace Aspose { namespace Words { class DocumentVisitor; } }
51 namespace Aspose { enum class CharCase; }
52 namespace Aspose { namespace Words { namespace Fields { class FieldStart; } } }
53 
54 namespace Aspose {
55 
56 namespace Words {
57 
58 namespace Fields {
59 
79 {
80  typedef FormField ThisType;
82 
83  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
84  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
85 
86  FRIEND_FUNCTION_System_MakeObject;
87  friend class Aspose::Words::Comparison::FieldComparer;
88  friend class Aspose::Words::RW::Docx::Writer::DocxFieldsWriter;
89  friend class Aspose::Words::RW::Html::Reader::HtmlControlAsFormFieldReader;
90  friend class Aspose::Words::RW::Wml::Writer::WmlFieldsWriter;
91  friend class Aspose::Words::RW::Nrx::Reader::NrxFldCharReaderBase;
92  friend class Aspose::Words::RangeDocumentBuilder;
93  friend class Aspose::Words::Layout::Core::SpanFormField;
94  friend class Aspose::Words::Layout::PreAps::LayoutSpanFormFieldControl;
96  friend class Aspose::Words::DocumentBuilder;
97  friend class Aspose::Words::RW::Html::Writer::HtmlFieldWriter;
98  friend class Aspose::Words::RW::Odt::Reader::OdtFieldReader;
99  friend class Aspose::Words::RW::Odt::Writer::OdtFieldWriter;
100  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
101  friend class Aspose::Words::RW::Doc::Writer::DocWriter;
102  friend class Aspose::Words::RW::Doc::FfDataFiler;
103  friend class Aspose::Words::RW::Odt::Writer::OdtTextBodyWriter;
104  friend class Aspose::Words::RW::Rtf::Reader::RtfModelBuilder;
105  friend class Aspose::Words::RW::Rtf::Writer::RtfFieldWriter;
106 
107 public:
109 
110 public:
111 
115  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::NodeType get_NodeType() const;
116 
123  ASPOSE_WORDS_SHARED_API System::String get_Name();
124 
126  ASPOSE_WORDS_SHARED_API void set_Name(System::String value);
127 
131  ASPOSE_WORDS_SHARED_API Aspose::Words::Fields::FieldType get_Type();
132 
144  ASPOSE_WORDS_SHARED_API System::String get_Result();
145 
147  ASPOSE_WORDS_SHARED_API void set_Result(System::String value);
148 
158  ASPOSE_WORDS_SHARED_API System::String get_StatusText();
159 
161  ASPOSE_WORDS_SHARED_API void set_StatusText(System::String value);
162 
170  ASPOSE_WORDS_SHARED_API bool get_OwnStatus();
171 
173  ASPOSE_WORDS_SHARED_API void set_OwnStatus(bool value);
174 
184  ASPOSE_WORDS_SHARED_API System::String get_HelpText();
185 
187  ASPOSE_WORDS_SHARED_API void set_HelpText(System::String value);
188 
196  ASPOSE_WORDS_SHARED_API bool get_OwnHelp();
197 
199  ASPOSE_WORDS_SHARED_API void set_OwnHelp(bool value);
200 
209  ASPOSE_WORDS_SHARED_API bool get_CalculateOnExit();
210 
212  ASPOSE_WORDS_SHARED_API void set_CalculateOnExit(bool value);
213 
221  ASPOSE_WORDS_SHARED_API System::String get_EntryMacro();
222 
224  ASPOSE_WORDS_SHARED_API void set_EntryMacro(System::String value);
225 
233  ASPOSE_WORDS_SHARED_API System::String get_ExitMacro();
234 
236  ASPOSE_WORDS_SHARED_API void set_ExitMacro(System::String value);
237 
244  ASPOSE_WORDS_SHARED_API bool get_Enabled();
245 
247  ASPOSE_WORDS_SHARED_API void set_Enabled(bool value);
248 
260  ASPOSE_WORDS_SHARED_API System::String get_TextInputFormat();
261 
263  ASPOSE_WORDS_SHARED_API void set_TextInputFormat(System::String value);
264 
269 
273  ASPOSE_WORDS_SHARED_API void set_TextInputType(Aspose::Words::Fields::TextFormFieldType value);
274 
289  ASPOSE_WORDS_SHARED_API System::String get_TextInputDefault();
290 
292  ASPOSE_WORDS_SHARED_API void set_TextInputDefault(System::String value);
293 
297  ASPOSE_WORDS_SHARED_API int32_t get_MaxLength();
298 
302  ASPOSE_WORDS_SHARED_API void set_MaxLength(int32_t value);
303 
311 
315  ASPOSE_WORDS_SHARED_API int32_t get_DropDownSelectedIndex();
316 
320  ASPOSE_WORDS_SHARED_API void set_DropDownSelectedIndex(int32_t value);
321 
329  ASPOSE_WORDS_SHARED_API bool get_Checked();
330 
332  ASPOSE_WORDS_SHARED_API void set_Checked(bool value);
333 
341  ASPOSE_WORDS_SHARED_API bool get_Default();
342 
344  ASPOSE_WORDS_SHARED_API void set_Default(bool value);
345 
353  ASPOSE_WORDS_SHARED_API bool get_IsCheckBoxExactSize();
354 
356  ASPOSE_WORDS_SHARED_API void set_IsCheckBoxExactSize(bool value);
357 
365  ASPOSE_WORDS_SHARED_API double get_CheckBoxSize();
366 
368  ASPOSE_WORDS_SHARED_API void set_CheckBoxSize(double value);
369 
379  virtual ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
380 
387  ASPOSE_WORDS_SHARED_API void RemoveField();
388 
393  ASPOSE_WORDS_SHARED_API void SetTextInputValue(System::SharedPtr<System::Object> newValue);
394 
395 protected:
396 
397  Aspose::Words::Fields::FormFieldType get_FormFieldType();
399  System::String get_DropDownValue();
400  void set_DropDownValue(System::String value);
403 
404  static System::String& DefaultTextInputValue();
405 
407 
408  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> Clone(bool isCloneChildren, System::SharedPtr<Aspose::Words::INodeCloningListener> cloningListener);
409 
410  virtual ASPOSE_WORDS_SHARED_API ~FormField();
411 
412  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
413 
414 private:
415 
417 
418  void set_FormFieldPr(System::SharedPtr<Aspose::Words::Fields::FormFieldPr> value);
419 
421 
422  static Aspose::CharCase StringToCharCase(System::String charCase);
425  ThisType* CppMemberwiseClone() const override { return new ThisType(*this); }
426 
427 };
428 
429 }
430 }
431 }
void set_TextInputFormat(System::String value)
Setter for Aspose::Words::Fields::FormField::get_TextInputFormat.
@ Doc
Microsoft Word 95 or Word 97 - 2003 Document.
void set_Enabled(bool value)
Setter for Aspose::Words::Fields::FormField::get_Enabled.
System::Details::SharedMembersType shared_members_type
void set_TextInputDefault(System::String value)
Setter for Aspose::Words::Fields::FormField::get_TextInputDefault.
System::String get_Name()
Gets or sets the form field name.
@ Odt
ODF Text Document.
void set_Default(bool value)
Setter for Aspose::Words::Fields::FormField::get_Default.
void set_IsCheckBoxExactSize(bool value)
Setter for Aspose::Words::Fields::FormField::get_IsCheckBoxExactSize.
void set_TextInputType(Aspose::Words::Fields::TextFormFieldType value)
Sets the type of a text form field.
@ Html
void set_OwnStatus(bool value)
Setter for Aspose::Words::Fields::FormField::get_OwnStatus.
System::String get_HelpText()
Returns or sets the text that's displayed in a message box when the form field has the focus and the ...
System::String get_ExitMacro()
Returns or sets an exit macro name for the form field.
@ Nrx
Common modules that are shared between DOCX/WML reader/writer modules.
System::String get_TextInputDefault()
Gets or sets the default string or a calculation expression of a text form field.
System::String get_EntryMacro()
Returns or sets an entry macro name for the form field.
System::String get_TextInputFormat()
Returns or sets the text formatting for a text form field.
void set_CheckBoxSize(double value)
Setter for Aspose::Words::Fields::FormField::get_CheckBoxSize.
void set_ExitMacro(System::String value)
Setter for Aspose::Words::Fields::FormField::get_ExitMacro.
virtual Aspose::Words::NodeType get_NodeType() const
Returns NodeType.FormField.
int32_t get_MaxLength()
Maximum length for the text field. Zero when the length is not limited.
bool get_Enabled()
True if a form field is enabled.
Base class for special characters in the document.
Definition: SpecialChar.h:48
@ Rtf
RTF format.
bool get_OwnStatus()
Specifies the source of the text that's displayed in the status bar when a form field has the focus.
@ Words
void set_OwnHelp(bool value)
Setter for Aspose::Words::Fields::FormField::get_OwnHelp.
double get_CheckBoxSize()
Gets or sets the size of the checkbox in points. Has effect only when IsCheckBoxExactSize is true.
void set_EntryMacro(System::String value)
Setter for Aspose::Words::Fields::FormField::get_EntryMacro.
void set_StatusText(System::String value)
Setter for Aspose::Words::Fields::FormField::get_StatusText.
void set_DropDownSelectedIndex(int32_t value)
Sets the index specifying the currently selected item in a dropdown form field.
int32_t get_DropDownSelectedIndex()
Gets the index specifying the currently selected item in a dropdown form field.
bool get_OwnHelp()
Specifies the source of the text that's displayed in a message box when a form field has the focus an...
bool get_Default()
Gets or sets the default value of the check box form field. Default value for this property is false.
void RemoveField()
Removes the complete form field, not just the form field special character.
System::SharedPtr< Aspose::Words::Node > Clone(bool isCloneChildren)
TextFormFieldType
Specifies the type of a text form field.
Definition: TextFormFieldType.h:25
Provides methods to insert text, images and other content, specify font, paragraph and section format...
Definition: DocumentBuilder.h:130
FieldType
Specifies Microsoft Word field types.
Definition: FieldType.h:25
@ Docx
Office Open XML WordprocessingML Document (macro-free).
NodeType
Specifies the type of a Word document node.
Definition: NodeType.h:23
@ FieldStart
A special character that designates the start of a Word field.
void set_HelpText(System::String value)
Setter for Aspose::Words::Fields::FormField::get_HelpText.
virtual bool Accept(System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)
Accepts a visitor.
System::String get_StatusText()
Returns or sets the text that's displayed in the status bar when a form field has the focus.
void set_Name(System::String value)
Setter for Aspose::Words::Fields::FormField::get_Name.
bool get_IsCheckBoxExactSize()
Gets or sets the boolean value that indicates whether the size of the textbox is automatic or specifi...
@ Node
Aspose::Words::Fields::TextFormFieldType get_TextInputType()
Gets the type of a text form field.
void set_MaxLength(int32_t value)
Maximum length for the text field. Zero when the length is not limited.
@ BookmarkStart
A beginning of a bookmark marker.
@ Layout
Module that builds a document layout.
Implements the FORMTEXT field.
Definition: FieldFormText.h:32
void set_Checked(bool value)
Setter for Aspose::Words::Fields::FormField::get_Checked.
void set_CalculateOnExit(bool value)
Setter for Aspose::Words::Fields::FormField::get_CalculateOnExit.
System::String get_Result()
Gets or sets a string that represents the result of this form field.
void set_Result(System::String value)
Setter for Aspose::Words::Fields::FormField::get_Result.
Represents a single form field.
Definition: FormField.h:79
bool get_Checked()
Gets or sets the checked status of the check box form field. Default value for this property is false...
System::SharedPtr< Aspose::Words::Fields::DropDownItemCollection > get_DropDownItems()
Provides access to the items of a dropdown form field.
bool get_CalculateOnExit()
True if references to the specified form field are automatically updated whenever the field is exited...
Aspose::Words::Fields::FieldType get_Type()
Returns the form field type.
void SetTextInputValue(System::SharedPtr< System::Object > newValue)
Applies the text format specified in TextInputFormat and stores the value in Result.