ChoiceField.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/array.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/InteractiveFeatures/Forms/Field.h"
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 class Document;
15 namespace Engine
16 {
17 namespace Data
18 {
19 class IPdfObject;
20 } // namespace Data
21 } // namespace Engine
22 namespace Forms
23 {
24 class ComboBoxField;
25 class ListBoxField;
26 class OptionCollection;
27 class RadioButtonField;
28 } // namespace Forms
29 class Page;
30 class Rectangle;
31 } // namespace Pdf
32 } // namespace Aspose
33 namespace System
34 {
35 namespace Collections
36 {
37 namespace Generic
38 {
39 template <typename> class List;
40 } // namespace Generic
41 } // namespace Collections
42 } // namespace System
43 
44 namespace Aspose {
45 
46 namespace Pdf {
47 
48 namespace Forms {
49 
53 class ASPOSE_PDF_SHARED_CLASS ChoiceField : public Aspose::Pdf::Forms::Field
54 {
55  typedef ChoiceField ThisType;
57 
58  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
59  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
60 
64 
65 public:
66 
70  ASPOSE_PDF_SHARED_API bool get_CommitImmediately();
74  ASPOSE_PDF_SHARED_API void set_CommitImmediately(bool value);
78  ASPOSE_PDF_SHARED_API bool get_MultiSelect();
82  ASPOSE_PDF_SHARED_API void set_MultiSelect(bool value);
86  virtual ASPOSE_PDF_SHARED_API int32_t get_Selected();
90  virtual ASPOSE_PDF_SHARED_API void set_Selected(int32_t value);
94  virtual ASPOSE_PDF_SHARED_API System::ArrayPtr<int32_t> get_SelectedItems();
98  virtual ASPOSE_PDF_SHARED_API void set_SelectedItems(System::ArrayPtr<int32_t> value);
102  virtual ASPOSE_PDF_SHARED_API System::SharedPtr<OptionCollection> get_Options();
106  ASPOSE_PDF_SHARED_API System::String get_Value() override;
110  ASPOSE_PDF_SHARED_API void set_Value(System::String value) override;
111 
122  ASPOSE_PDF_SHARED_API ChoiceField(System::SharedPtr<Document> doc);
129 
134  virtual ASPOSE_PDF_SHARED_API void AddOption(System::String optionName);
140  virtual ASPOSE_PDF_SHARED_API void AddOption(System::String export_, System::String name);
145  virtual ASPOSE_PDF_SHARED_API void DeleteOption(System::String optionName);
146 
147 protected:
148 
149  static const ASPOSE_PDF_SHARED_API int32_t ValueNotSelected;
150 
156 
158  ChoiceField();
159 
160  ASPOSE_PDF_SHARED_API System::SharedPtr<Field> CreateCopy() override;
161 
162  virtual ASPOSE_PDF_SHARED_API ~ChoiceField();
163 
164 private:
165 
167 
168 };
169 
170 } // namespace Forms
171 } // namespace Pdf
172 } // namespace Aspose
173 
174 
virtual ASPOSE_PDF_SHARED_API void DeleteOption(System::String optionName)
Deletes option by its name.
ASPOSE_PDF_SHARED_API bool get_CommitImmediately()
Gets commit on selection change flag.
ASPOSE_PDF_SHARED_API bool get_MultiSelect()
Gets multiselection flag.
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
Class representing Combobox field of the form.
Definition: ComboBoxField.h:63
ASPOSE_PDF_SHARED_API void AddOption(System::String optionName, System::SharedPtr< Rectangle > rect)
Add to radio button option with specifed rectangle.
Definition: Artifact.h:67
void SetOptions(System::SharedPtr< System::Collections::Generic::List< System::String >> options)
Replaces the available options with those whose names are given in the options parameter.
ASPOSE_PDF_SHARED_API void set_Selected(int32_t value) override
Sets index of selected item. Numbering of items is started from 1.
virtual ASPOSE_PDF_SHARED_API System::ArrayPtr< int32_t > get_SelectedItems()
Gets array of selected items. For multiselect list array contains more then one item. For single selection list it contains single item.
Base class for acro form fields.
Definition: Field.h:126
ASPOSE_PDF_SHARED_API System::SharedPtr< Field > CreateCopy() override
This method is required for Generator support. This method creates copy of field "template" when gene...
ASPOSE_PDF_SHARED_API void set_MultiSelect(bool value)
Sets multiselection flag.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Represents base class for choice fields.
Definition: ChoiceField.h:53
Definition: AFRelationship.h:4
ASPOSE_PDF_SHARED_API System::SharedPtr< OptionCollection > get_Options() override
Gets collection of options of the radio button.
Class represents ListBox field.
Definition: ListBoxField.h:54
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:15
Class representing radio button field.
Definition: RadioButtonField.h:75
static const ASPOSE_PDF_SHARED_API int32_t ValueNotSelected
Definition: ChoiceField.h:149
ASPOSE_PDF_SHARED_API System::String get_Value() override
Gets value of field.
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
ASPOSE_PDF_SHARED_API void set_CommitImmediately(bool value)
Sets commit on selection change flag.
virtual ASPOSE_PDF_SHARED_API void set_SelectedItems(System::ArrayPtr< int32_t > value)
Sets array of selected items. For multiselect list array contains more then one item. For single selection list it contains single item.
ASPOSE_PDF_SHARED_API int32_t get_Selected() override
Gets index of selected item. Numbering of items is started from 1.
Represents a abstract base object can be added to the page(doc.Paragraphs.Add()). ...
Definition: BaseParagraph.h:66
ASPOSE_PDF_SHARED_API void set_Value(System::String value) override
Sets value of field.
virtual ASPOSE_PDF_SHARED_API ~ChoiceField()
Whole PDF file will be submitted.