ListBoxField.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include "Aspose.PDF.Cpp/InteractiveFeatures/Forms/ChoiceField.h"
5 #include "Aspose.PDF.Cpp/InteractiveFeatures/Annotations/Annotation.h"
6 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
7 
8 namespace Aspose
9 {
10 namespace Pdf
11 {
12 class Document;
13 namespace Engine
14 {
15 namespace Data
16 {
17 class IPdfObject;
18 class ITrailerable;
19 } // namespace Data
20 } // namespace Engine
21 namespace Forms
22 {
23 class Field;
24 } // namespace Forms
25 class Operator;
26 class Page;
27 class Rectangle;
28 namespace Text
29 {
30 class Font;
31 } // namespace Text
32 } // namespace Pdf
33 } // namespace Aspose
34 namespace System
35 {
36 namespace Collections
37 {
38 namespace Generic
39 {
40 template <typename> class List;
41 } // namespace Generic
42 } // namespace Collections
43 } // namespace System
44 
45 namespace Aspose {
46 
47 namespace Pdf {
48 
49 namespace Forms {
50 
54 class ASPOSE_PDF_SHARED_CLASS ListBoxField final : public Aspose::Pdf::Forms::ChoiceField
55 {
56  typedef ListBoxField ThisType;
58 
59  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
60  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
61 
63 
64 public:
65 
69  ASPOSE_PDF_SHARED_API int32_t get_TopIndex();
73  ASPOSE_PDF_SHARED_API void set_TopIndex(int32_t value);
77  ASPOSE_PDF_SHARED_API void set_Selected(int32_t value) override;
81  ASPOSE_PDF_SHARED_API void set_SelectedItems(System::ArrayPtr<int32_t> value) override;
82 
86  ASPOSE_PDF_SHARED_API ListBoxField();
99 
100 protected:
101 
108 
114  ASPOSE_PDF_SHARED_API void Initialize(System::SharedPtr<Aspose::Pdf::Engine::Data::ITrailerable> trailer) override;
115  ASPOSE_PDF_SHARED_API void UpdateAppearance(System::SharedPtr<Aspose::Pdf::Annotations::Annotation> annotation) override;
116  ASPOSE_PDF_SHARED_API bool AppearanceSupported() override;
124  ASPOSE_PDF_SHARED_API System::SharedPtr<Field> CreateCopy() override;
125 
126  virtual ASPOSE_PDF_SHARED_API ~ListBoxField();
127 
128 private:
129 
130  double GetTextWidth(System::String text, System::SharedPtr<Aspose::Pdf::Text::Font> font, double fontSize);
131 
132 };
133 
134 } // namespace Forms
135 } // namespace Pdf
136 } // namespace Aspose
137 
138 
virtual ASPOSE_PDF_SHARED_API System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Operator > > > CreateAppearanceProgram(System::SharedPtr< Annotation::AppearanceParameters > parameters, System::SharedPtr< Annotation > annotation)
Create program for displaying this annotation.
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
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Field, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfObject > annotation, System::SharedPtr< Document > document))
Definition: Artifact.h:67
Base class for acro form fields.
Definition: Field.h:130
Specifies that the member is a field.
ASPOSE_PDF_SHARED_API void Initialize(System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable > trailer, System::SharedPtr< Rectangle > rect) override
Initialize the annotation.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Represents a text type.
ASPOSE_PDF_SHARED_API void UpdateAppearance(System::SharedPtr< Annotation > annotation) override
Updated appearance dictionary of the field.
Represents base class for choice fields.
Definition: ChoiceField.h:57
Definition: AFRelationship.h:4
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
virtual ASPOSE_PDF_SHARED_API System::SharedPtr< Field > CreateCopy()
This method is required for Generator support. This method creates copy of field "template" when gene...
The coordinates are in the page coordinate context.
ASPOSE_PDF_SHARED_API bool AppearanceSupported() override
This method must be overriden to return true in classes where apperance generation is supported...
Represents a abstract base object can be added to the page(doc.Paragraphs.Add()). ...
Definition: BaseParagraph.h:66
Whole PDF file will be submitted.