HyphenationOptions.h
1 //////////////////////////////////////////////////////////////////////////
2 // 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.
7 //////////////////////////////////////////////////////////////////////////
8 #pragma once
9 
10 
11 #include <system/shared_ptr.h>
12 #include <system/object.h>
13 #include <cstdint>
14 
15 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
16 
17 namespace Aspose { namespace Words { namespace Settings { class DocPr; } } }
18 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxSettingsReader; } } } } }
19 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxSettingsWriter; } } } } }
20 namespace Aspose { namespace Words { namespace RW { namespace Doc { class DocPrFiler; } } } }
21 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfDocPrReader; } } } } }
22 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlDocPrReader; } } } } }
23 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlDocPrWriter; } } } } }
24 
25 namespace Aspose {
26 
27 namespace Words {
28 
29 namespace Settings {
30 
31 
32 /// <summary>
33 /// Allows to configure document hyphenation options.
34 /// </summary>
35 class HyphenationOptions : public System::Object
36 {
37  typedef HyphenationOptions ThisType;
38  typedef System::Object BaseType;
39 
40  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
41  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
42 
43  friend class Aspose::Words::Settings::DocPr;
44  friend class Aspose::Words::RW::Docx::Reader::DocxSettingsReader;
45  friend class Aspose::Words::RW::Docx::Writer::DocxSettingsWriter;
46  friend class Aspose::Words::RW::Doc::DocPrFiler;
47  friend class Aspose::Words::RW::Rtf::Reader::RtfDocPrReader;
48  friend class Aspose::Words::RW::Wml::Reader::WmlDocPrReader;
49  friend class Aspose::Words::RW::Wml::Writer::WmlDocPrWriter;
50 
51 public:
52 
53  /// <summary>
54  /// Gets or sets value determining whether automatic hyphenation is turned on for the document.
55  /// Default value for this property is <b>false</b>.
56  /// </summary>
58  /// Setter for Aspose::Words::Settings::HyphenationOptions::get_AutoHyphenation
60  /// <summary>
61  /// Gets or sets the maximum number of consecutive lines that can end with hyphens.
62  /// Default value for this property is 0.
63  /// </summary>
64  /// <remarks>
65  /// <p>If value of this property is set to 0, any number of consecutive lines can end with hyphens.</p>
66  /// <p>The property does not have effect when saving to fixed page formats e.g. PDF.</p>
67  /// </remarks>
68  ASPOSE_WORDS_SHARED_API int32_t get_ConsecutiveHyphenLimit() const;
69  /// Setter for Aspose::Words::Settings::HyphenationOptions::get_ConsecutiveHyphenLimit
71  /// <summary>
72  /// Gets or sets the distance in 1/20 of a point from the right margin within which you do not want
73  /// to hyphenate words.
74  /// Default value for this property is 360 (0.25 inch).
75  /// </summary>
76  ///
78  /// Setter for Aspose::Words::Settings::HyphenationOptions::get_HyphenationZone
80  /// <summary>
81  /// Gets or sets value determining whether words written in all capital letters are hyphenated.
82  /// Default value for this property is <b>true</b>.
83  /// </summary>
85  /// Setter for Aspose::Words::Settings::HyphenationOptions::get_HyphenateCaps
87 
89 
90 protected:
91 
92  static const int32_t ConsecutiveHyphenLimitDefault;
93  static const int32_t HyphenationZoneDefault;
94  static const bool HyphenateCapsDefault;
95 
96  System::SharedPtr<Aspose::Words::Settings::HyphenationOptions> Clone();
97  void SetConsecutiveHyphenLimitSafe(int32_t value);
98  void SetHyphenationZoneSafe(int32_t value);
99 
100 private:
101 
102  bool mAutoHyphenation;
103  int32_t mConsecutiveHyphenLimit;
104  int32_t mHyphenationZone;
105  bool mHyphenateCaps;
106 
107  static bool IsValidConsecutiveHyphenLimit(int32_t value);
108  static bool IsValidHyphenationZone(int32_t value);
109 
110 };
111 
112 }
113 }
114 }
Definition: IFontData.h:20
@ InsertLineBreaks
Insert line breaks after every 76th character.
HyphenationOptions()