search/mag_sel search/close
FieldRef.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/string.h>
12 #include <cstdint>
13 
14 #include <Aspose.Words.Cpp/Fields/FieldSwitchType.h>
15 #include <Aspose.Words.Cpp/Lists/ListLabelUtil.h>
16 #include <Aspose.Words.Cpp/Fields/IMergeFieldSurrogate.h>
17 #include <Aspose.Words.Cpp/Fields/IFieldCodeTokenInfoProvider.h>
18 #include <Aspose.Words.Cpp/Fields/Field.h>
19 #include <Aspose.Words.Cpp/aspose_words_api_defs.h>
20 
21 namespace Aspose { namespace Words { namespace Fields { class FieldStyleRef; } } }
22 namespace Aspose { namespace Words { namespace Fields { class FieldStart; } } }
23 namespace Aspose { namespace Words { namespace Fields { class FieldSeparator; } } }
24 namespace Aspose { namespace Words { namespace Fields { class FieldEnd; } } }
25 namespace Aspose { namespace Words { namespace Fields { enum class FieldUpdateStage; } } }
26 namespace Aspose { namespace Words { namespace Fields { class FieldUpdateAction; } } }
27 namespace Aspose { namespace Words { class Paragraph; } }
28 namespace Aspose { namespace Words { class Bookmark; } }
29 namespace Aspose { namespace Words { namespace Lists { class ListNumberState; } } }
30 namespace Aspose { namespace Words { namespace Fields { class FieldUpdateActionApplyResult; } } }
31 namespace System { namespace Collections { namespace Generic { template <typename> class IList; } } }
32 
33 namespace Aspose {
34 
35 namespace Words {
36 
37 namespace Fields {
38 
151 class ASPOSE_WORDS_SHARED_CLASS FieldRef : public Aspose::Words::Fields::Field, public Aspose::Words::Fields::IFieldCodeTokenInfoProvider, public Aspose::Words::Fields::IMergeFieldSurrogate
152 {
153  typedef FieldRef ThisType;
155  typedef Aspose::Words::Fields::IFieldCodeTokenInfoProvider BaseType1;
156  typedef Aspose::Words::Fields::IMergeFieldSurrogate BaseType2;
157 
158  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
159  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
160 
162 
163 private:
164 
165  class FieldRefListLabelBuildBehaviour : public Aspose::Words::Lists::IListLabelBuildBehaviour
166  {
167  typedef FieldRefListLabelBuildBehaviour ThisType;
168  typedef Aspose::Words::Lists::IListLabelBuildBehaviour BaseType;
169 
170  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
171  RTTI_INFO_DECL();
172 
173  public:
174 
176  void NotifyListNumberAppended(int32_t listLabelLength) override;
177  bool ShouldAppendNotListNumberChar(char16_t c) override;
178  int32_t FinilazeListLabelLength(int32_t listLabelLength) override;
179 
180  private:
181 
182  FieldRefListLabelBuildBehaviour();
183 
184  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(FieldRefListLabelBuildBehaviour, CODEPORTING_ARGS());
185  static bool IsDelimiterChar(char16_t c);
186 
187  };
188 
189 public:
190 
193 
196 
199 
312  ASPOSE_WORDS_SHARED_API System::String get_BookmarkName();
313 
315  ASPOSE_WORDS_SHARED_API void set_BookmarkName(System::String value);
316 
404  ASPOSE_WORDS_SHARED_API System::String get_NumberSeparator();
405 
407  ASPOSE_WORDS_SHARED_API void set_NumberSeparator(System::String value);
408 
497  ASPOSE_WORDS_SHARED_API bool get_IncludeNoteOrComment();
498 
500  ASPOSE_WORDS_SHARED_API void set_IncludeNoteOrComment(bool value);
501 
589  ASPOSE_WORDS_SHARED_API bool get_InsertHyperlink();
590 
592  ASPOSE_WORDS_SHARED_API void set_InsertHyperlink(bool value);
593 
681  ASPOSE_WORDS_SHARED_API bool get_InsertParagraphNumber();
682 
684  ASPOSE_WORDS_SHARED_API void set_InsertParagraphNumber(bool value);
685 
773  ASPOSE_WORDS_SHARED_API bool get_InsertRelativePosition();
774 
776  ASPOSE_WORDS_SHARED_API void set_InsertRelativePosition(bool value);
777 
865  ASPOSE_WORDS_SHARED_API bool get_InsertParagraphNumberInRelativeContext();
866 
868  ASPOSE_WORDS_SHARED_API void set_InsertParagraphNumberInRelativeContext(bool value);
869 
957  ASPOSE_WORDS_SHARED_API bool get_SuppressNonDelimiters();
958 
960  ASPOSE_WORDS_SHARED_API void set_SuppressNonDelimiters(bool value);
961 
1049  ASPOSE_WORDS_SHARED_API bool get_InsertParagraphNumberInFullContext();
1050 
1052  ASPOSE_WORDS_SHARED_API void set_InsertParagraphNumberInFullContext(bool value);
1053 
1054  ASPOSE_WORDS_SHARED_API Aspose::Words::Fields::FieldSwitchType GetSwitchType(System::String switchName) override;
1055  ASPOSE_WORDS_SHARED_API System::String GetMergeFieldName() override;
1056  ASPOSE_WORDS_SHARED_API bool CanWorkAsMergeField() override;
1057  ASPOSE_WORDS_SHARED_API bool IsMergeValueRequired() override;
1058 
1059 protected:
1060 
1061  ASPOSE_WORDS_SHARED_API Aspose::Words::Fields::FieldUpdateStage GetUpdateStage() override;
1062  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Fields::FieldUpdateAction> UpdateCore() override;
1063  static System::String GetLabelStringInRelativeContext(System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, System::SharedPtr<Aspose::Words::Paragraph> relativeParagraph, bool suppressNonDelimiters, System::String numberSeparator);
1064  static System::String GetLabelStringInParagraphNumberContext(System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, bool suppressNonDelimiters);
1065  static System::String GetTrimmedLabelStringInParagraphNumberContext(System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph);
1066  static System::String GetLabelStringInFullContext(System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, bool suppressNonDelimiters, System::String numberSeparator);
1067 
1068  virtual ASPOSE_WORDS_SHARED_API ~FieldRef();
1069 
1070 private:
1071 
1072  bool get_InsertParagraphNumberInAnyContext();
1073 
1074  static const int32_t BookmarkNameArgumentIndex;
1075 
1076  static const System::String& NumberSeparatorSwitch();
1077  static const System::String& IncludeNoteOrCommentSwitch();
1078  static const System::String& InsertHyperlinkSwitch();
1079  static const System::String& InsertParagraphNumberSwitch();
1080  static const System::String& InsertRelativePositionSwitch();
1081  static const System::String& InsertParagraphNumberInRelativeContextSwitch();
1082  static const System::String& SuppressNonDelimitersSwitch();
1083  static const System::String& InsertParagraphNumberInFullContextSwitch();
1084  static System::String GetLabelStringInRelativeContext(System::SharedPtr<Aspose::Words::Bookmark> bookmark, System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, System::SharedPtr<Aspose::Words::Paragraph> relativeParagraph, bool suppressNonDelimiters, System::String numberSeparator);
1086  static System::String GetLabelStringInParagraphNumberContext(System::SharedPtr<Aspose::Words::Bookmark> bookmark, System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, bool suppressNonDelimiters);
1087  static System::String GetLabelStringInFullContext(System::SharedPtr<Aspose::Words::Bookmark> bookmark, System::SharedPtr<Aspose::Words::Paragraph> sourceParagraph, bool suppressNonDelimiters, System::String numberSeparator);
1088  static System::SharedPtr<Aspose::Words::Lists::IListLabelBuildBehaviour> GetListLabelBuildBehaviour(bool suppressNonDelimiters);
1090  static System::String TrimTrailingDot(System::String source);
1092  static System::String GetListLabel(System::SharedPtr<Aspose::Words::Bookmark> bookmark, System::SharedPtr<Aspose::Words::Paragraph> paragraph, bool suppressNonDelimiters);
1095  static System::SharedPtr<Aspose::Words::Lists::ListNumberState> GetParagraphListNumberStateFromListNumField(System::SharedPtr<Aspose::Words::Paragraph> paragraph);
1101 
1102 };
1103 
1104 }
1105 }
1106 }