class AsposeWordsCloud::ListLevel
DTO container with a document list level.
Attributes
Gets or sets the justification of the actual number of the list item. The list label is justified relative to the Aspose.Words.Lists.ListLevel.NumberPosition property.
Gets or sets character formatting used for the list label.
Gets or sets a value indicating whether the level turns all inherited numbers to Arabic, false if it preserves their number style.
Gets or sets the link to the document.
Gets or sets the paragraph style that is linked to this list level. This property is null when the list level is not linked to a paragraph style. This property can be set to null.
Gets or sets the number format for the list level. Among normal text characters, the string can contain placeholder characters \x0000 to \x0008 representing the numbers from the corresponding list levels. For example, the string “\x0000.\x0001)” will generate a list label that looks something like “1.5)”. The number “1” is the current number from the 1st list level, the number “5” is the current number from the 2nd list level. Null is not allowed, but an empty string meaning no number is valid.
Gets or sets the position (in points) of the number or bullet for the list level. Aspose.Words.Lists.ListLevel.NumberPosition corresponds to LeftIndent plus FirstLineIndent of the paragraph. Aspose.Words.Lists.ListLevel.TextPosition Aspose.Words.Lists.ListLevel.TabPosition.
Gets or sets the number style for this list level.
Gets or sets the list level, that must appear before the specified list level restarts numbering. The value of -1 means the numbering will continue.
Gets or sets the starting number for this list level. Default value is 1.
Gets or sets the tab position (in points) for the list level. Has effect only when Aspose.Words.Lists.ListLevel.TrailingCharacter is a tab. Aspose.Words.Lists.ListLevel.NumberPosition Aspose.Words.Lists.ListLevel.TextPosition.
Gets or sets the position (in points) for the second line of wrapping text for the list level. Aspose.Words.Lists.ListLevel.TextPosition corresponds to LeftIndent of the paragraph. Aspose.Words.Lists.ListLevel.NumberPosition Aspose.Words.Lists.ListLevel.TabPosition.
Gets or sets the character inserted after the number for the list level.
Public Class Methods
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 105 def self.attribute_map { :'link' => :'Link', :'start_at' => :'StartAt', :'number_style' => :'NumberStyle', :'number_format' => :'NumberFormat', :'alignment' => :'Alignment', :'is_legal' => :'IsLegal', :'restart_after_level' => :'RestartAfterLevel', :'trailing_character' => :'TrailingCharacter', :'font' => :'Font', :'tab_position' => :'TabPosition', :'number_position' => :'NumberPosition', :'text_position' => :'TextPosition', :'linked_style' => :'LinkedStyle' } end
Attribute mapping from ruby-style variable name to JSON key.
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 144 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.key?(:'Link') self.link = attributes[:'Link'] end if attributes.key?(:'StartAt') self.start_at = attributes[:'StartAt'] end if attributes.key?(:'NumberStyle') self.number_style = attributes[:'NumberStyle'] end if attributes.key?(:'NumberFormat') self.number_format = attributes[:'NumberFormat'] end if attributes.key?(:'Alignment') self.alignment = attributes[:'Alignment'] end if attributes.key?(:'IsLegal') self.is_legal = attributes[:'IsLegal'] end if attributes.key?(:'RestartAfterLevel') self.restart_after_level = attributes[:'RestartAfterLevel'] end if attributes.key?(:'TrailingCharacter') self.trailing_character = attributes[:'TrailingCharacter'] end if attributes.key?(:'Font') self.font = attributes[:'Font'] end if attributes.key?(:'TabPosition') self.tab_position = attributes[:'TabPosition'] end if attributes.key?(:'NumberPosition') self.number_position = attributes[:'NumberPosition'] end if attributes.key?(:'TextPosition') self.text_position = attributes[:'TextPosition'] end if attributes.key?(:'LinkedStyle') self.linked_style = attributes[:'LinkedStyle'] end end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 124 def self.swagger_types { :'link' => :'WordsApiLink', :'start_at' => :'Integer', :'number_style' => :'String', :'number_format' => :'String', :'alignment' => :'String', :'is_legal' => :'BOOLEAN', :'restart_after_level' => :'Integer', :'trailing_character' => :'String', :'font' => :'Font', :'tab_position' => :'Float', :'number_position' => :'Float', :'text_position' => :'Float', :'linked_style' => :'Style' } end
Attribute type mapping.
Public Instance Methods
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 261 def ==(other) return true if self.equal?(other) self.class == other.class && link == other.link && start_at == other.start_at && number_style == other.number_style && number_format == other.number_format && alignment == other.alignment && is_legal == other.is_legal && restart_after_level == other.restart_after_level && trailing_character == other.trailing_character && font == other.font && tab_position == other.tab_position && number_position == other.number_position && text_position == other.text_position && linked_style == other.linked_style end
Checks equality by comparing each attribute. @param [Object] Object to be compared
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 316 def _deserialize(type, value) case type.to_sym when :DateTime Time.at(/\d/.match(value)[0].to_f).to_datetime when :Date Time.at(/\d/.match(value)[0].to_f).to_date when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model if value[:'$type'] type = value[:'$type'][0..-4] end temp_model = AsposeWordsCloud.const_get(type).new temp_model.build_from_hash(value) end end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 387 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 232 def alignment=(alignment) validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"]) if alignment.to_i == 0 unless validator.valid?(alignment) raise ArgumentError, "invalid value for 'alignment', must be one of #{validator.allowable_values}." end @alignment = alignment else @alignment = validator.allowable_values[alignment.to_i] end end
Custom attribute writer method checking allowed values (enum). @param [Object] alignment Object to be assigned
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 294 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 401 def collectFilesContent(resultFilesContent) end
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 281 def eql?(other) self == other end
@see the ‘==` method @param [Object] Object to be compared
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 287 def hash [link, start_at, number_style, number_format, alignment, is_legal, restart_after_level, trailing_character, font, tab_position, number_position, text_position, linked_style].hash end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 218 def number_style=(number_style) validator = EnumAttributeValidator.new('String', ["Arabic", "UppercaseRoman", "LowercaseRoman", "UppercaseLetter", "LowercaseLetter", "Ordinal", "Number", "OrdinalText", "Hex", "ChicagoManual", "Kanji", "KanjiDigit", "AiueoHalfWidth", "IrohaHalfWidth", "ArabicFullWidth", "ArabicHalfWidth", "KanjiTraditional", "KanjiTraditional2", "NumberInCircle", "DecimalFullWidth", "Aiueo", "Iroha", "LeadingZero", "Bullet", "Ganada", "Chosung", "GB1", "GB2", "GB3", "GB4", "Zodiac1", "Zodiac2", "Zodiac3", "TradChinNum1", "TradChinNum2", "TradChinNum3", "TradChinNum4", "SimpChinNum1", "SimpChinNum2", "SimpChinNum3", "SimpChinNum4", "HanjaRead", "HanjaReadDigit", "Hangul", "Hanja", "Hebrew1", "Arabic1", "Hebrew2", "Arabic2", "HindiLetter1", "HindiLetter2", "HindiArabic", "HindiCardinalText", "ThaiLetter", "ThaiArabic", "ThaiCardinalText", "VietCardinalText", "NumberInDash", "LowercaseRussian", "UppercaseRussian", "None", "Custom"]) if number_style.to_i == 0 unless validator.valid?(number_style) raise ArgumentError, "invalid value for 'number_style', must be one of #{validator.allowable_values}." end @number_style = number_style else @number_style = validator.allowable_values[number_style.to_i] end end
Custom attribute writer method checking allowed values (enum). @param [Object] number_style
Object to be assigned
Source
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 373 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 361 def to_s to_hash.to_s end
Returns the string representation of the object @return [String] String presentation of the object
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 246 def trailing_character=(trailing_character) validator = EnumAttributeValidator.new('String', ["Tab", "Space", "Nothing"]) if trailing_character.to_i == 0 unless validator.valid?(trailing_character) raise ArgumentError, "invalid value for 'trailing_character', must be one of #{validator.allowable_values}." end @trailing_character = trailing_character else @trailing_character = validator.allowable_values[trailing_character.to_i] end end
Custom attribute writer method checking allowed values (enum). @param [Object] trailing_character
Object to be assigned
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 205 def valid? number_style_validator = EnumAttributeValidator.new('String', ["Arabic", "UppercaseRoman", "LowercaseRoman", "UppercaseLetter", "LowercaseLetter", "Ordinal", "Number", "OrdinalText", "Hex", "ChicagoManual", "Kanji", "KanjiDigit", "AiueoHalfWidth", "IrohaHalfWidth", "ArabicFullWidth", "ArabicHalfWidth", "KanjiTraditional", "KanjiTraditional2", "NumberInCircle", "DecimalFullWidth", "Aiueo", "Iroha", "LeadingZero", "Bullet", "Ganada", "Chosung", "GB1", "GB2", "GB3", "GB4", "Zodiac1", "Zodiac2", "Zodiac3", "TradChinNum1", "TradChinNum2", "TradChinNum3", "TradChinNum4", "SimpChinNum1", "SimpChinNum2", "SimpChinNum3", "SimpChinNum4", "HanjaRead", "HanjaReadDigit", "Hangul", "Hanja", "Hebrew1", "Arabic1", "Hebrew2", "Arabic2", "HindiLetter1", "HindiLetter2", "HindiArabic", "HindiCardinalText", "ThaiLetter", "ThaiArabic", "ThaiCardinalText", "VietCardinalText", "NumberInDash", "LowercaseRussian", "UppercaseRussian", "None", "Custom"]) return false unless number_style_validator.valid?(@number_style) alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"]) return false unless alignment_validator.valid?(@alignment) trailing_character_validator = EnumAttributeValidator.new('String', ["Tab", "Space", "Nothing"]) return false unless trailing_character_validator.valid?(@trailing_character) return true end
Check to see if the all the properties in the model are valid @return true if the model is valid
Source
# File lib/aspose_words_cloud/models/list_level.rb, line 404 def validate() raise ArgumentError, 'Property start_at in ListLevel is required.' if self.start_at.nil? raise ArgumentError, 'Property number_style in ListLevel is required.' if self.number_style.nil? raise ArgumentError, 'Property alignment in ListLevel is required.' if self.alignment.nil? raise ArgumentError, 'Property is_legal in ListLevel is required.' if self.is_legal.nil? raise ArgumentError, 'Property restart_after_level in ListLevel is required.' if self.restart_after_level.nil? raise ArgumentError, 'Property trailing_character in ListLevel is required.' if self.trailing_character.nil? raise ArgumentError, 'Property tab_position in ListLevel is required.' if self.tab_position.nil? raise ArgumentError, 'Property number_position in ListLevel is required.' if self.number_position.nil? raise ArgumentError, 'Property text_position in ListLevel is required.' if self.text_position.nil? unless self.link.nil? self.link.validate end unless self.font.nil? self.font.validate end unless self.linked_style.nil? self.linked_style.validate end end