search/mag_sel search/close
GeneralFormatCollection.h
1 // Copyright 2001-2021 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/shared_ptr.h>
12 #include <system/collections/ienumerator.h>
13 #include <system/collections/ienumerable.h>
14 #include <cstdint>
15 
16 #include <Aspose.Words.Cpp/Fields/GeneralFormat.h>
17 #include <Aspose.Words.Cpp/aspose_words_api_defs.h>
18 
19 namespace Aspose { namespace Words { namespace Fields { class Field; } } }
20 namespace Aspose { namespace Words { namespace Fields { class FieldPageRef; } } }
21 namespace Aspose { namespace Words { namespace Fields { class FieldSeq; } } }
22 namespace Aspose { namespace Words { namespace Fields { class CharFormatProvider; } } }
23 namespace Aspose { namespace Words { namespace Fields { class FieldUpdater; } } }
24 namespace Aspose { namespace Words { namespace Fields { class FieldFormat; } } }
25 namespace Aspose { namespace Words { namespace Fields { class FieldCode; } } }
26 namespace Aspose { template <typename> class EnumeratorWrapperPalGeneric; }
27 namespace Aspose { namespace Words { namespace Fields { class FieldSwitch; } } }
28 namespace System { class String; }
29 
30 namespace Aspose {
31 
32 namespace Words {
33 
34 namespace Fields {
35 
101 class ASPOSE_WORDS_SHARED_CLASS GeneralFormatCollection : public System::Collections::Generic::IEnumerable<Aspose::Words::Fields::GeneralFormat>
102 {
105 
106  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
107  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
108 
109  friend class Aspose::Words::Fields::Field;
111  friend class Aspose::Words::Fields::FieldSeq;
112  friend class Aspose::Words::Fields::CharFormatProvider;
113  friend class Aspose::Words::Fields::FieldUpdater;
115 
116 private:
117 
118  class GeneralFormatEnumerator final : public System::Collections::Generic::IEnumerator<Aspose::Words::Fields::GeneralFormat>
119  {
120  typedef GeneralFormatEnumerator ThisType;
122 
123  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
124  RTTI_INFO_DECL();
125 
126  public:
127 
128  Aspose::Words::Fields::GeneralFormat get_Current() const override;
129 
131 
132  void Dispose() override;
133  bool MoveNext() override;
134  void Reset() override;
135 
136  private:
137 
139 
140  };
141 
142 public:
143 
209  ASPOSE_WORDS_SHARED_API int32_t get_Count();
210 
278  ASPOSE_WORDS_SHARED_API void Add(Aspose::Words::Fields::GeneralFormat item);
279 
347  ASPOSE_WORDS_SHARED_API void Remove(Aspose::Words::Fields::GeneralFormat item);
348 
414  ASPOSE_WORDS_SHARED_API void RemoveAt(int32_t index);
415 
485  ASPOSE_WORDS_SHARED_API Aspose::Words::Fields::GeneralFormat idx_get(int32_t index);
486 
553 
554 protected:
555 
557 
558  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(GeneralFormatCollection, CODEPORTING_ARGS(System::SharedPtr<Aspose::Words::Fields::FieldCode> fieldCode));
559  bool HasFormat(Aspose::Words::Fields::GeneralFormat format);
560  void AddOrRemove(Aspose::Words::Fields::GeneralFormat format, bool isAdd);
561  Aspose::Words::Fields::GeneralFormat GetNumericFormat();
562  System::String GetNumericFormatString();
563 
564  virtual ASPOSE_WORDS_SHARED_API ~GeneralFormatCollection();
565 
566 private:
567 
569 
570  static bool IsValidSwitch(System::SharedPtr<Aspose::Words::Fields::FieldSwitch> fieldSwitch);
571 
572 };
573 
574 }
575 }
576 }