Class: AsposeSlidesCloud::TextFrameFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_slides_cloud/models/text_frame_format.rb

Overview

Contains the TextFrame’s formatting properties.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TextFrameFormat

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/aspose_slides_cloud/models/text_frame_format.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.has_key?(:'ThreeDFormat')
    self.three_d_format = attributes[:'ThreeDFormat']
  end

  if attributes.has_key?(:'Transform')
    self.transform = attributes[:'Transform']
  end

  if attributes.has_key?(:'MarginLeft')
    self.margin_left = attributes[:'MarginLeft']
  end

  if attributes.has_key?(:'MarginRight')
    self.margin_right = attributes[:'MarginRight']
  end

  if attributes.has_key?(:'MarginTop')
    self.margin_top = attributes[:'MarginTop']
  end

  if attributes.has_key?(:'MarginBottom')
    self.margin_bottom = attributes[:'MarginBottom']
  end

  if attributes.has_key?(:'WrapText')
    self.wrap_text = attributes[:'WrapText']
  end

  if attributes.has_key?(:'AnchoringType')
    self.anchoring_type = attributes[:'AnchoringType']
  end

  if attributes.has_key?(:'CenterText')
    self.center_text = attributes[:'CenterText']
  end

  if attributes.has_key?(:'TextVerticalType')
    self.text_vertical_type = attributes[:'TextVerticalType']
  end

  if attributes.has_key?(:'AutofitType')
    self.autofit_type = attributes[:'AutofitType']
  end

  if attributes.has_key?(:'ColumnCount')
    self.column_count = attributes[:'ColumnCount']
  end

  if attributes.has_key?(:'ColumnSpacing')
    self.column_spacing = attributes[:'ColumnSpacing']
  end

  if attributes.has_key?(:'KeepTextFlat')
    self.keep_text_flat = attributes[:'KeepTextFlat']
  end

  if attributes.has_key?(:'RotationAngle')
    self.rotation_angle = attributes[:'RotationAngle']
  end

  if attributes.has_key?(:'DefaultParagraphFormat')
    self.default_paragraph_format = attributes[:'DefaultParagraphFormat']
  end
end

Instance Attribute Details

#anchoring_typeObject

Returns or sets vertical anchor text in a TextFrame.



50
51
52
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 50

def anchoring_type
  @anchoring_type
end

#autofit_typeObject

Returns or sets text’s auto-fit mode.



59
60
61
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 59

def autofit_type
  @autofit_type
end

#center_textObject

If True then text should be centered in box horizontally.



53
54
55
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 53

def center_text
  @center_text
end

#column_countObject

Returns or sets number of columns in the text area. This value must be a positive number. Otherwise, the value will be set to zero. Value 0 means undefined value.



62
63
64
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 62

def column_count
  @column_count
end

#column_spacingObject

Returns or sets the space between text columns in the text area (in points). This should only apply when there is more than 1 column present. This value must be a positive number. Otherwise, the value will be set to zero.



65
66
67
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 65

def column_spacing
  @column_spacing
end

#default_paragraph_formatObject

Default portion format.



74
75
76
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 74

def default_paragraph_format
  @default_paragraph_format
end

#keep_text_flatObject

Returns or set keeping text out of 3D scene entirely.



68
69
70
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 68

def keep_text_flat
  @keep_text_flat
end

#margin_bottomObject

Bottom margin.



44
45
46
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 44

def margin_bottom
  @margin_bottom
end

#margin_leftObject

Left margin. Left margin.



35
36
37
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 35

def margin_left
  @margin_left
end

#margin_rightObject

Right margin.



38
39
40
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 38

def margin_right
  @margin_right
end

#margin_topObject

Top margin.



41
42
43
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 41

def margin_top
  @margin_top
end

#rotation_angleObject

Specifies the custom rotation that is being applied to the text within the bounding box.



71
72
73
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 71

def rotation_angle
  @rotation_angle
end

#text_vertical_typeObject

Determines text orientation. The resulted value of visual text rotation summarized from this property and custom angle in property RotationAngle.



56
57
58
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 56

def text_vertical_type
  @text_vertical_type
end

#three_d_formatObject

Represents 3d effect properties for a text.



29
30
31
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 29

def three_d_format
  @three_d_format
end

#transformObject

Gets or sets text wrapping shape.



32
33
34
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 32

def transform
  @transform
end

#wrap_textObject

True if text is wrapped at TextFrame’s margins.



47
48
49
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 47

def wrap_text
  @wrap_text
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 99

def self.attribute_map
  {
    :'three_d_format' => :'ThreeDFormat',
    :'transform' => :'Transform',
    :'margin_left' => :'MarginLeft',
    :'margin_right' => :'MarginRight',
    :'margin_top' => :'MarginTop',
    :'margin_bottom' => :'MarginBottom',
    :'wrap_text' => :'WrapText',
    :'anchoring_type' => :'AnchoringType',
    :'center_text' => :'CenterText',
    :'text_vertical_type' => :'TextVerticalType',
    :'autofit_type' => :'AutofitType',
    :'column_count' => :'ColumnCount',
    :'column_spacing' => :'ColumnSpacing',
    :'keep_text_flat' => :'KeepTextFlat',
    :'rotation_angle' => :'RotationAngle',
    :'default_paragraph_format' => :'DefaultParagraphFormat',
  }
end

.swagger_typesObject

Attribute type mapping.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 121

def self.swagger_types
  {
    :'three_d_format' => :'ThreeDFormat',
    :'transform' => :'String',
    :'margin_left' => :'Float',
    :'margin_right' => :'Float',
    :'margin_top' => :'Float',
    :'margin_bottom' => :'Float',
    :'wrap_text' => :'String',
    :'anchoring_type' => :'String',
    :'center_text' => :'String',
    :'text_vertical_type' => :'String',
    :'autofit_type' => :'String',
    :'column_count' => :'Integer',
    :'column_spacing' => :'Float',
    :'keep_text_flat' => :'BOOLEAN',
    :'rotation_angle' => :'Float',
    :'default_paragraph_format' => :'ParagraphFormat',
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 302

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      three_d_format == o.three_d_format &&
      transform == o.transform &&
      margin_left == o.margin_left &&
      margin_right == o.margin_right &&
      margin_top == o.margin_top &&
      margin_bottom == o.margin_bottom &&
      wrap_text == o.wrap_text &&
      anchoring_type == o.anchoring_type &&
      center_text == o.center_text &&
      text_vertical_type == o.text_vertical_type &&
      autofit_type == o.autofit_type &&
      column_count == o.column_count &&
      column_spacing == o.column_spacing &&
      keep_text_flat == o.keep_text_flat &&
      rotation_angle == o.rotation_angle &&
      default_paragraph_format == o.default_paragraph_format
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 371

def _deserialize(type, value)
  if value.nil?
    nil
  else
    case type.to_sym
    when :DateTime
      DateTime.parse(value)
    when :Date
      Date.parse(value)
    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
      registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
      if registry_type
        type = registry_type
      end
      temp_model = AsposeSlidesCloud.const_get(type).new
      temp_model.build_from_hash(value)
    end
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 445

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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 338

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    mapKey = self.class.attribute_map[key]
    if !mapKey.nil?
      val = attributes[mapKey]
      if val.nil?
        mapKeyString = mapKey.to_s
        mapKeyString[0] = mapKeyString[0].downcase
        mapKey = mapKeyString.to_sym
        val = attributes[mapKey]
      end
      if !val.nil?
        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 val.is_a?(Array)
            self.send("#{key}=", val.map { |v| _deserialize($1, v) })
          end
        else
          self.send("#{key}=", _deserialize(type, val))
        end
      end
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


325
326
327
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 325

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



331
332
333
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 331

def hash
  [three_d_format, transform, margin_left, margin_right, margin_top, margin_bottom, wrap_text, anchoring_type, center_text, text_vertical_type, autofit_type, column_count, column_spacing, keep_text_flat, rotation_angle, default_paragraph_format].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



217
218
219
220
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 217

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



425
426
427
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 425

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



431
432
433
434
435
436
437
438
439
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 431

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



419
420
421
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 419

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/aspose_slides_cloud/models/text_frame_format.rb', line 224

def valid?
  transform_validator = EnumAttributeValidator.new('String', ['None', 'Plain', 'Stop', 'Triangle', 'TriangleInverted', 'Chevron', 'ChevronInverted', 'RingInside', 'RingOutside', 'ArchUp', 'ArchDown', 'Circle', 'Button', 'ArchUpPour', 'ArchDownPour', 'CirclePour', 'ButtonPour', 'CurveUp', 'CurveDown', 'CanUp', 'CanDown', 'Wave1', 'Wave2', 'DoubleWave1', 'Wave4', 'Inflate', 'Deflate', 'InflateBottom', 'DeflateBottom', 'InflateTop', 'DeflateTop', 'DeflateInflate', 'DeflateInflateDeflate', 'FadeRight', 'FadeLeft', 'FadeUp', 'FadeDown', 'SlantUp', 'SlantDown', 'CascadeUp', 'CascadeDown', 'Custom', 'NotDefined'])
  return false unless transform_validator.valid?(@transform)
  wrap_text_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless wrap_text_validator.valid?(@wrap_text)
  anchoring_type_validator = EnumAttributeValidator.new('String', ['Top', 'Center', 'Bottom', 'Justified', 'Distributed', 'NotDefined'])
  return false unless anchoring_type_validator.valid?(@anchoring_type)
  center_text_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless center_text_validator.valid?(@center_text)
  text_vertical_type_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical', 'Vertical270', 'WordArtVertical', 'EastAsianVertical', 'MongolianVertical', 'WordArtVerticalRightToLeft', 'NotDefined'])
  return false unless text_vertical_type_validator.valid?(@text_vertical_type)
  autofit_type_validator = EnumAttributeValidator.new('String', ['None', 'Normal', 'Shape', 'NotDefined'])
  return false unless autofit_type_validator.valid?(@autofit_type)
  true
end