openxml-drawingml 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/lib/openxml/drawingml.rb +11 -0
- data/lib/openxml/drawingml/elements.rb +1 -1
- data/lib/openxml/drawingml/elements/adjust_values_list.rb +2 -2
- data/lib/openxml/drawingml/elements/blip.rb +3 -3
- data/lib/openxml/drawingml/elements/blip_fill.rb +1 -2
- data/lib/openxml/drawingml/elements/children_extents.rb +2 -1
- data/lib/openxml/drawingml/elements/children_offset.rb +2 -1
- data/lib/openxml/drawingml/elements/extension.rb +2 -1
- data/lib/openxml/drawingml/elements/extension_list.rb +2 -2
- data/lib/openxml/drawingml/elements/extents.rb +2 -1
- data/lib/openxml/drawingml/elements/fill_rectangle.rb +2 -1
- data/lib/openxml/drawingml/elements/graphic.rb +4 -1
- data/lib/openxml/drawingml/elements/graphic_data.rb +3 -1
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +3 -1
- data/lib/openxml/drawingml/elements/head_end.rb +3 -1
- data/lib/openxml/drawingml/elements/line_break.rb +89 -0
- data/lib/openxml/drawingml/elements/no_autofit.rb +2 -2
- data/lib/openxml/drawingml/elements/no_fill.rb +3 -1
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +1 -2
- data/lib/openxml/drawingml/elements/non_visual_picture_properties.rb +1 -2
- data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +1 -2
- data/lib/openxml/drawingml/elements/offset.rb +1 -1
- data/lib/openxml/drawingml/elements/outline.rb +2 -2
- data/lib/openxml/drawingml/elements/paragraph.rb +78 -0
- data/lib/openxml/drawingml/elements/picture.rb +1 -2
- data/lib/openxml/drawingml/elements/picture_locks.rb +1 -1
- data/lib/openxml/drawingml/elements/picture_shape_properties.rb +1 -2
- data/lib/openxml/drawingml/elements/preset_geometry.rb +2 -2
- data/lib/openxml/drawingml/elements/preset_text_warp.rb +1 -2
- data/lib/openxml/drawingml/elements/round.rb +4 -1
- data/lib/openxml/drawingml/elements/run.rb +85 -0
- data/lib/openxml/drawingml/elements/shape_guide.rb +1 -1
- data/lib/openxml/drawingml/elements/solid_fill.rb +3 -1
- data/lib/openxml/drawingml/elements/source_rectangle.rb +1 -1
- data/lib/openxml/drawingml/elements/srgb_color.rb +2 -1
- data/lib/openxml/drawingml/elements/stretch.rb +2 -2
- data/lib/openxml/drawingml/elements/tail_end.rb +3 -1
- data/lib/openxml/drawingml/elements/text.rb +21 -0
- data/lib/openxml/drawingml/elements/theme_elements.rb +4 -1
- data/lib/openxml/drawingml/elements/transform_effect.rb +1 -2
- data/lib/openxml/drawingml/parts.rb +10 -0
- data/lib/openxml/drawingml/parts/theme.rb +46 -0
- data/lib/openxml/drawingml/properties.rb +24 -0
- data/lib/openxml/drawingml/properties/audio_cd.rb +16 -0
- data/lib/openxml/drawingml/properties/audio_cd_end.rb +13 -0
- data/lib/openxml/drawingml/properties/audio_cd_start.rb +13 -0
- data/lib/openxml/drawingml/properties/audio_cd_time_property.rb +11 -0
- data/lib/openxml/drawingml/properties/audio_file.rb +13 -0
- data/lib/openxml/drawingml/properties/autofit_none.rb +11 -0
- data/lib/openxml/drawingml/properties/autofit_normal.rb +14 -0
- data/lib/openxml/drawingml/properties/autofit_shape.rb +11 -0
- data/lib/openxml/drawingml/properties/background_fill_style_list.rb +14 -0
- data/lib/openxml/drawingml/properties/blip.rb +27 -0
- data/lib/openxml/drawingml/properties/body_properties.rb +81 -0
- data/lib/openxml/drawingml/properties/bullet_color.rb +13 -0
- data/lib/openxml/drawingml/properties/bullet_color_text.rb +11 -0
- data/lib/openxml/drawingml/properties/bullet_font.rb +13 -0
- data/lib/openxml/drawingml/properties/bullet_font_text.rb +11 -0
- data/lib/openxml/drawingml/properties/bullet_size_percent.rb +20 -0
- data/lib/openxml/drawingml/properties/bullet_size_points.rb +20 -0
- data/lib/openxml/drawingml/properties/bullet_size_text.rb +11 -0
- data/lib/openxml/drawingml/properties/bullet_style_auto_numbered.rb +27 -0
- data/lib/openxml/drawingml/properties/bullet_style_blip.rb +12 -0
- data/lib/openxml/drawingml/properties/bullet_style_character.rb +13 -0
- data/lib/openxml/drawingml/properties/bullet_style_none.rb +11 -0
- data/lib/openxml/drawingml/properties/child_extent.rb +13 -0
- data/lib/openxml/drawingml/properties/child_offset.rb +13 -0
- data/lib/openxml/drawingml/properties/color_component_rgb.rb +17 -0
- data/lib/openxml/drawingml/properties/color_container_property.rb +17 -0
- data/lib/openxml/drawingml/properties/color_hex_rgb.rb +20 -0
- data/lib/openxml/drawingml/properties/color_hsl.rb +17 -0
- data/lib/openxml/drawingml/properties/color_mapping.rb +31 -0
- data/lib/openxml/drawingml/properties/color_mapping_override.rb +16 -0
- data/lib/openxml/drawingml/properties/color_mapping_override_map.rb +13 -0
- data/lib/openxml/drawingml/properties/color_mapping_override_master.rb +11 -0
- data/lib/openxml/drawingml/properties/color_preset_color.rb +51 -0
- data/lib/openxml/drawingml/properties/color_property.rb +40 -0
- data/lib/openxml/drawingml/properties/color_scheme.rb +29 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_five.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_four.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_one.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_six.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_three.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_accent_two.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_color.rb +25 -0
- data/lib/openxml/drawingml/properties/color_scheme_dark_one.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_dark_two.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_followed_hyperlink.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_hyperlink.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_light_one.rb +13 -0
- data/lib/openxml/drawingml/properties/color_scheme_light_two.rb +13 -0
- data/lib/openxml/drawingml/properties/color_system_color.rb +30 -0
- data/lib/openxml/drawingml/properties/color_xform_alpha.rb +19 -0
- data/lib/openxml/drawingml/properties/color_xform_alpha_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_alpha_offset.rb +19 -0
- data/lib/openxml/drawingml/properties/color_xform_blue.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_blue_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_blue_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_complement.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_gamma.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_grayscale.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_green.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_green_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_green_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_hue.rb +20 -0
- data/lib/openxml/drawingml/properties/color_xform_hue_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_hue_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_inverse.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_inverse_gamma.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_luminance.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_luminance_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_luminance_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_red.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_red_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_red_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_saturation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_saturation_modulation.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_saturation_offset.rb +11 -0
- data/lib/openxml/drawingml/properties/color_xform_shade.rb +19 -0
- data/lib/openxml/drawingml/properties/color_xform_tint.rb +19 -0
- data/lib/openxml/drawingml/properties/complex_script_font.rb +13 -0
- data/lib/openxml/drawingml/properties/connection.rb +11 -0
- data/lib/openxml/drawingml/properties/connection_end.rb +13 -0
- data/lib/openxml/drawingml/properties/connection_shape_locks.rb +24 -0
- data/lib/openxml/drawingml/properties/connection_start.rb +13 -0
- data/lib/openxml/drawingml/properties/custom_color.rb +13 -0
- data/lib/openxml/drawingml/properties/custom_color_list.rb +14 -0
- data/lib/openxml/drawingml/properties/custom_dash_style.rb +14 -0
- data/lib/openxml/drawingml/properties/custom_geometry.rb +18 -0
- data/lib/openxml/drawingml/properties/dash_stop.rb +14 -0
- data/lib/openxml/drawingml/properties/default_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/default_run_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/default_shape_properties.rb +15 -0
- data/lib/openxml/drawingml/properties/east_asian_font.rb +13 -0
- data/lib/openxml/drawingml/properties/effect_dag.rb +20 -0
- data/lib/openxml/drawingml/properties/effect_list.rb +17 -0
- data/lib/openxml/drawingml/properties/effect_reference.rb +13 -0
- data/lib/openxml/drawingml/properties/effect_style.rb +18 -0
- data/lib/openxml/drawingml/properties/effect_style_list.rb +14 -0
- data/lib/openxml/drawingml/properties/embedded_sound_file.rb +14 -0
- data/lib/openxml/drawingml/properties/extension.rb +14 -0
- data/lib/openxml/drawingml/properties/extension_list.rb +14 -0
- data/lib/openxml/drawingml/properties/extent.rb +29 -0
- data/lib/openxml/drawingml/properties/external_media_file.rb +15 -0
- data/lib/openxml/drawingml/properties/extra_color_scheme.rb +14 -0
- data/lib/openxml/drawingml/properties/extra_color_scheme_list.rb +14 -0
- data/lib/openxml/drawingml/properties/fill_blip.rb +22 -0
- data/lib/openxml/drawingml/properties/fill_gradient.rb +24 -0
- data/lib/openxml/drawingml/properties/fill_group.rb +11 -0
- data/lib/openxml/drawingml/properties/fill_none.rb +11 -0
- data/lib/openxml/drawingml/properties/fill_pattern.rb +23 -0
- data/lib/openxml/drawingml/properties/fill_rectangle.rb +13 -0
- data/lib/openxml/drawingml/properties/fill_reference.rb +13 -0
- data/lib/openxml/drawingml/properties/fill_solid.rb +13 -0
- data/lib/openxml/drawingml/properties/fill_style_list.rb +19 -0
- data/lib/openxml/drawingml/properties/fill_to_rectangle.rb +13 -0
- data/lib/openxml/drawingml/properties/flat_text.rb +39 -0
- data/lib/openxml/drawingml/properties/font_collection_property.rb +16 -0
- data/lib/openxml/drawingml/properties/font_property.rb +29 -0
- data/lib/openxml/drawingml/properties/font_reference.rb +13 -0
- data/lib/openxml/drawingml/properties/font_scheme.rb +18 -0
- data/lib/openxml/drawingml/properties/format_scheme.rb +19 -0
- data/lib/openxml/drawingml/properties/geometry_guide.rb +14 -0
- data/lib/openxml/drawingml/properties/geometry_guide_list.rb +14 -0
- data/lib/openxml/drawingml/properties/gradient_line.rb +14 -0
- data/lib/openxml/drawingml/properties/gradient_path.rb +16 -0
- data/lib/openxml/drawingml/properties/gradient_stop.rb +13 -0
- data/lib/openxml/drawingml/properties/gradient_stop_list.rb +14 -0
- data/lib/openxml/drawingml/properties/graphic.rb +13 -0
- data/lib/openxml/drawingml/properties/graphic_data.rb +14 -0
- data/lib/openxml/drawingml/properties/graphic_frame_locks.rb +20 -0
- data/lib/openxml/drawingml/properties/group_shape_locks.rb +22 -0
- data/lib/openxml/drawingml/properties/group_transform.rb +16 -0
- data/lib/openxml/drawingml/properties/head_end.rb +13 -0
- data/lib/openxml/drawingml/properties/highlight.rb +13 -0
- data/lib/openxml/drawingml/properties/hyperlink_click.rb +13 -0
- data/lib/openxml/drawingml/properties/hyperlink_hover.rb +13 -0
- data/lib/openxml/drawingml/properties/hyperlink_mouse_over.rb +13 -0
- data/lib/openxml/drawingml/properties/hyperlink_property.rb +22 -0
- data/lib/openxml/drawingml/properties/integer_property.rb +12 -0
- data/lib/openxml/drawingml/properties/latin_font.rb +13 -0
- data/lib/openxml/drawingml/properties/level1_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level2_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level3_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level4_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level5_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level6_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level7_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level8_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/level9_paragraph_properties.rb +13 -0
- data/lib/openxml/drawingml/properties/line_default.rb +13 -0
- data/lib/openxml/drawingml/properties/line_end_properties.rb +12 -0
- data/lib/openxml/drawingml/properties/line_join_bevel.rb +11 -0
- data/lib/openxml/drawingml/properties/line_join_miter.rb +31 -0
- data/lib/openxml/drawingml/properties/line_join_round.rb +11 -0
- data/lib/openxml/drawingml/properties/line_property.rb +43 -0
- data/lib/openxml/drawingml/properties/line_spacing.rb +16 -0
- data/lib/openxml/drawingml/properties/line_style_list.rb +14 -0
- data/lib/openxml/drawingml/properties/list_style.rb +24 -0
- data/lib/openxml/drawingml/properties/major_font.rb +13 -0
- data/lib/openxml/drawingml/properties/minor_font.rb +13 -0
- data/lib/openxml/drawingml/properties/object_defaults.rb +17 -0
- data/lib/openxml/drawingml/properties/offset.rb +29 -0
- data/lib/openxml/drawingml/properties/outline.rb +13 -0
- data/lib/openxml/drawingml/properties/outline_reference.rb +13 -0
- data/lib/openxml/drawingml/properties/paragraph_properties.rb +78 -0
- data/lib/openxml/drawingml/properties/path.rb +49 -0
- data/lib/openxml/drawingml/properties/path_list.rb +14 -0
- data/lib/openxml/drawingml/properties/percentage_property.rb +17 -0
- data/lib/openxml/drawingml/properties/picture_locks.rb +25 -0
- data/lib/openxml/drawingml/properties/positive_integer_property.rb +12 -0
- data/lib/openxml/drawingml/properties/positive_percentage_property.rb +17 -0
- data/lib/openxml/drawingml/properties/preset_dash_style.rb +16 -0
- data/lib/openxml/drawingml/properties/preset_geometry.rb +59 -0
- data/lib/openxml/drawingml/properties/preset_text_warp.rb +25 -0
- data/lib/openxml/drawingml/properties/quick_time_file.rb +17 -0
- data/lib/openxml/drawingml/properties/relative_rectangle_property.rb +13 -0
- data/lib/openxml/drawingml/properties/right_to_left.rb +11 -0
- data/lib/openxml/drawingml/properties/run_properties.rb +93 -0
- data/lib/openxml/drawingml/properties/scene_3d.rb +17 -0
- data/lib/openxml/drawingml/properties/shape_adjustment_list.rb +14 -0
- data/lib/openxml/drawingml/properties/shape_default.rb +13 -0
- data/lib/openxml/drawingml/properties/shape_locks.rb +25 -0
- data/lib/openxml/drawingml/properties/shape_properties.rb +46 -0
- data/lib/openxml/drawingml/properties/shape_style.rb +16 -0
- data/lib/openxml/drawingml/properties/simple_boolean_property.rb +16 -0
- data/lib/openxml/drawingml/properties/simple_property_container_property.rb +14 -0
- data/lib/openxml/drawingml/properties/source_rectangle.rb +13 -0
- data/lib/openxml/drawingml/properties/space_after.rb +22 -0
- data/lib/openxml/drawingml/properties/space_before.rb +22 -0
- data/lib/openxml/drawingml/properties/spacing_percent.rb +11 -0
- data/lib/openxml/drawingml/properties/spacing_points.rb +20 -0
- data/lib/openxml/drawingml/properties/stretch.rb +13 -0
- data/lib/openxml/drawingml/properties/style_matrix_reference_property.rb +20 -0
- data/lib/openxml/drawingml/properties/supplemental_font.rb +14 -0
- data/lib/openxml/drawingml/properties/symbol_font.rb +13 -0
- data/lib/openxml/drawingml/properties/tab_list.rb +14 -0
- data/lib/openxml/drawingml/properties/tab_stop.rb +29 -0
- data/lib/openxml/drawingml/properties/tail_end.rb +13 -0
- data/lib/openxml/drawingml/properties/text_body.rb +15 -0
- data/lib/openxml/drawingml/properties/text_default.rb +13 -0
- data/lib/openxml/drawingml/properties/theme_elements.rb +16 -0
- data/lib/openxml/drawingml/properties/tile.rb +35 -0
- data/lib/openxml/drawingml/properties/tile_rectangle.rb +13 -0
- data/lib/openxml/drawingml/properties/transform.rb +19 -0
- data/lib/openxml/drawingml/properties/underline.rb +13 -0
- data/lib/openxml/drawingml/properties/underline_fill.rb +20 -0
- data/lib/openxml/drawingml/properties/underline_fill_text.rb +11 -0
- data/lib/openxml/drawingml/properties/underline_text.rb +11 -0
- data/lib/openxml/drawingml/properties/value_property.rb +12 -0
- data/lib/openxml/drawingml/properties/video_file.rb +13 -0
- data/lib/openxml/drawingml/properties/wav_audio_file.rb +13 -0
- data/lib/openxml/drawingml/version.rb +1 -1
- data/openxml-drawingml.gemspec +3 -3
- metadata +222 -5
- data/lib/openxml/drawingml/element.rb +0 -9
@@ -0,0 +1,14 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class AutofitNormal < OpenXml::Properties::ComplexProperty
|
5
|
+
namespace :a
|
6
|
+
tag :normAutofit
|
7
|
+
|
8
|
+
attribute :font_scale, expects: :percentage
|
9
|
+
attribute :line_space_reduction, displays_as: :lnSpcReduction, expects: :percentage
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "openxml/drawingml/properties/fill_style_list"
|
2
|
+
|
3
|
+
module OpenXml
|
4
|
+
module DrawingML
|
5
|
+
module Properties
|
6
|
+
class BackgroundFillStyleList < FillStyleList
|
7
|
+
namespace :a
|
8
|
+
tag :bgFillStyleLst
|
9
|
+
child_classes :fill_none, :fill_solid, :fill_gradient, :fill_blip, :fill_pattern, :fill_group
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class Blip < OpenXml::Properties::ComplexProperty
|
5
|
+
include HasChildren, ContainsProperties
|
6
|
+
namespace :a
|
7
|
+
tag :blip
|
8
|
+
|
9
|
+
attribute :compression_state, one_of: %i{ email hqprint none print screen }, displays_as: :cstate
|
10
|
+
|
11
|
+
with_namespace :r do
|
12
|
+
attribute :embed, expects: :string
|
13
|
+
attribute :link, expects: :string
|
14
|
+
end
|
15
|
+
|
16
|
+
# TODO: All the various blip child elements as properties
|
17
|
+
|
18
|
+
property :extension_list
|
19
|
+
|
20
|
+
def render?
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class BodyProperties < OpenXml::Properties::ComplexProperty
|
5
|
+
include OpenXml::ContainsProperties
|
6
|
+
namespace :a
|
7
|
+
tag :bodyPr
|
8
|
+
|
9
|
+
VERTICAL_TYPES = %i{
|
10
|
+
eaVert horz mongolianVert vert vert270 wordArtVert wordArtVertRtl
|
11
|
+
}.freeze
|
12
|
+
|
13
|
+
attribute :anchor, one_of: %i{ b ctr dist just t }
|
14
|
+
attribute :anchor_center, displays_as: :anchorCtr, expects: :boolean
|
15
|
+
attribute :bottom_inset, displays_as: :bIns, expects: :coordinate
|
16
|
+
attribute :compatible_line_spacing, displays_as: :compatLnSpc, expects: :boolean
|
17
|
+
attribute :force_antialias, displays_as: :forceAA, expects: :boolean
|
18
|
+
attribute :from_word_art, expects: :boolean
|
19
|
+
attribute :horizontal_overflow, displays_as: :horzOverflow, one_of: %i{ clip overflow }
|
20
|
+
attribute :left_inset, displays_as: :lIns, expects: :coordinate
|
21
|
+
attribute :number_of_columns, displays_as: :numCol, in_range: 1..16
|
22
|
+
attribute :right_inset, displays_as: :rIns, expects: :coordinate
|
23
|
+
attribute :rotation, displays_as: :rot, expects: :integer
|
24
|
+
attribute :columns_right_to_left, displays_as: :rtlCol, expects: :boolean
|
25
|
+
attribute :column_spacing, displays_as: :spcCol, expects: :positive_coordinate
|
26
|
+
attribute :respect_paragraph_spacing, displays_as: :spcFirstLastPara, expects: :boolean
|
27
|
+
attribute :top_inset, displays_as: :tIns, expects: :coordinate
|
28
|
+
attribute :text_stays_upright, displays_as: :upright, expects: :boolean
|
29
|
+
attribute :vertical_text, displays_as: :vert, one_of: VERTICAL_TYPES
|
30
|
+
attribute :vertical_overflow, displays_as: :vertOverflow, one_of: %i{ clip ellipsis overflow }
|
31
|
+
attribute :wrap, one_of: %i{ none square }
|
32
|
+
|
33
|
+
property :preset_text_warp
|
34
|
+
|
35
|
+
property_choice do
|
36
|
+
value_property :no_autofit, as: :autofit_none
|
37
|
+
property :normal_autofit, as: :autofit_normal
|
38
|
+
value_property :shape_autofit, as: :autofit_shape
|
39
|
+
end
|
40
|
+
|
41
|
+
property :scene_3d
|
42
|
+
|
43
|
+
property_choice do
|
44
|
+
# TODO: Fill out the `sp3d` property and its children
|
45
|
+
value_property :exclude_text_from_3d, as: :flat_text
|
46
|
+
end
|
47
|
+
|
48
|
+
property :extension_list
|
49
|
+
|
50
|
+
def render?
|
51
|
+
true
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def coordinate(value)
|
57
|
+
message = "Invalid coordinate: Must be an integer or include units"
|
58
|
+
raise ArgumentError, message unless integer?(value) || universal_measure?(value)
|
59
|
+
end
|
60
|
+
|
61
|
+
def positive_coordinate(value)
|
62
|
+
message = "Invalid positive coordinate: Must be an integer greater than 0 or include units"
|
63
|
+
raise ArgumentError, message unless integer?(value) && value >= 0 || positive_universal_measure?(value)
|
64
|
+
end
|
65
|
+
|
66
|
+
def integer?(value)
|
67
|
+
value.is_a?(Integer)
|
68
|
+
end
|
69
|
+
|
70
|
+
def universal_measure?(value)
|
71
|
+
value.is_a?(String) && value =~ OpenXml::DrawingML::ST_UniversalMeasure
|
72
|
+
end
|
73
|
+
|
74
|
+
def positive_universal_measure?(value)
|
75
|
+
value.is_a?(String) && value =~ OpenXml::DrawingML::ST_PositiveUniversalMeasure
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class BulletSizePercent < ValueProperty
|
5
|
+
namespace :a
|
6
|
+
tag :buSzPct
|
7
|
+
|
8
|
+
def valid?
|
9
|
+
# ST_TextBulletSizePercent - Part 1, section 20.1.10.61
|
10
|
+
/0*((2[5-9])|([3-9][0-9])|([1-3][0-9][0-9])|400)%/ =~ value
|
11
|
+
end
|
12
|
+
|
13
|
+
def invalid_message
|
14
|
+
"Invalid bullet_size_percent: value must be a percentage between 25% and 400%"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class BulletSizePoints < ValueProperty
|
5
|
+
namespace :a
|
6
|
+
tag :buSzPts
|
7
|
+
|
8
|
+
def valid?
|
9
|
+
# Value range taken from OpenXml Spec Part 1, section 20.1.10.67
|
10
|
+
value.is_a?(Integer) && (100..400_000).cover?(value)
|
11
|
+
end
|
12
|
+
|
13
|
+
def invalid_message
|
14
|
+
"Invalid bullet_size_points: value must be a point value between 100 and 400,000"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class BulletStyleAutoNumbered < OpenXml::Properties::ComplexProperty
|
5
|
+
namespace :a
|
6
|
+
tag :buAutoNum
|
7
|
+
|
8
|
+
AUTONUMBER_SCHEMES = %i{
|
9
|
+
alphaLcParenBoth alphaLcParenR alphaLcPeriod alphaUcParenBoth
|
10
|
+
alphaUcParenR alphaUcPeriod arabic1Minus arabic2Minus
|
11
|
+
arabicDbPeriod arabicDbPlain arabicParenBoth arabicParenR
|
12
|
+
arabicPeriod arabicPlain circleNumDbPlain circleNumWdBlackPlain
|
13
|
+
circleNumWdWhitePlain ea1ChsPeriod ea1ChsPlain eaChtPeriod
|
14
|
+
eaChtPlain ea1JpnKorPeriod ea1JpnKorPlain hebrew2Minus
|
15
|
+
hindiAlpha1Period hindiAlphaPeriod hindiNumParenR hindiNumPeriod
|
16
|
+
romanLcParenBoth romanLcParenR romanLcPeriod romanUcParenBoth
|
17
|
+
romanUcParenR romanUcPeriod thaiAlphaParenBoth thaiAlphaParenR
|
18
|
+
thaiAlphaPeriod thaiNumParenBoth thaiNumParenR thaiNumPeriod
|
19
|
+
}.freeze
|
20
|
+
|
21
|
+
attribute :start_at, displays_as: :startAt, expects: :integer, in_range: (1..32_767)
|
22
|
+
attribute :type, one_of: AUTONUMBER_SCHEMES
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "openxml/drawingml/properties/color_property"
|
2
|
+
|
3
|
+
module OpenXml
|
4
|
+
module DrawingML
|
5
|
+
module Properties
|
6
|
+
class ColorComponentRgb < ColorProperty
|
7
|
+
namespace :a
|
8
|
+
tag :scrgbClr
|
9
|
+
|
10
|
+
attribute :blue, displays_as: :b, expects: :percentage
|
11
|
+
attribute :green, displays_as: :g, expects: :percentage
|
12
|
+
attribute :red, displays_as: :r, expects: :percentage
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class ColorContainerProperty < SimplePropertyContainerProperty
|
5
|
+
property_choice do
|
6
|
+
property :component_rgb, as: :color_component_rgb
|
7
|
+
value_property :rgb, as: :color_hex_rgb
|
8
|
+
property :hsl, as: :color_hsl
|
9
|
+
value_property :system_color, as: :color_system_color
|
10
|
+
value_property :scheme_color, as: :color_scheme_color
|
11
|
+
value_property :preset_color, as: :color_preset_color
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "openxml/drawingml/properties/color_property"
|
2
|
+
|
3
|
+
module OpenXml
|
4
|
+
module DrawingML
|
5
|
+
module Properties
|
6
|
+
class ColorHexRgb < ColorProperty
|
7
|
+
namespace :a
|
8
|
+
tag :srgbClr
|
9
|
+
|
10
|
+
attribute :value, displays_as: :val, expects: :hex_color
|
11
|
+
|
12
|
+
def initialize(value)
|
13
|
+
super()
|
14
|
+
self.value = value
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "openxml/drawingml/properties/color_property"
|
2
|
+
|
3
|
+
module OpenXml
|
4
|
+
module DrawingML
|
5
|
+
module Properties
|
6
|
+
class ColorHsl < ColorProperty
|
7
|
+
namespace :a
|
8
|
+
tag :hslClr
|
9
|
+
|
10
|
+
attribute :hue, expects: :integer, in_range: (0..21_600_000)
|
11
|
+
attribute :luminance, displays_as: :lum, expects: :percentage
|
12
|
+
attribute :saturation, displays_as: :sat, expects: :percentage
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Properties
|
4
|
+
class ColorMapping < OpenXml::Properties::ComplexProperty
|
5
|
+
include OpenXml::ContainsProperties
|
6
|
+
namespace :a
|
7
|
+
tag :clrMap
|
8
|
+
|
9
|
+
COLOR_SCHEME_INDEX = %i{
|
10
|
+
dk1 lt1 dk2 lt2 accent1 accent2 accent3 accent4 accent5 accent6 hlink folHlink
|
11
|
+
}.freeze
|
12
|
+
|
13
|
+
attribute :bg1, one_of: COLOR_SCHEME_INDEX
|
14
|
+
attribute :tx1, one_of: COLOR_SCHEME_INDEX
|
15
|
+
attribute :bg2, one_of: COLOR_SCHEME_INDEX
|
16
|
+
attribute :tx2, one_of: COLOR_SCHEME_INDEX
|
17
|
+
attribute :accent1, one_of: COLOR_SCHEME_INDEX
|
18
|
+
attribute :accent2, one_of: COLOR_SCHEME_INDEX
|
19
|
+
attribute :accent3, one_of: COLOR_SCHEME_INDEX
|
20
|
+
attribute :accent4, one_of: COLOR_SCHEME_INDEX
|
21
|
+
attribute :accent5, one_of: COLOR_SCHEME_INDEX
|
22
|
+
attribute :accent6, one_of: COLOR_SCHEME_INDEX
|
23
|
+
attribute :hlink, one_of: COLOR_SCHEME_INDEX
|
24
|
+
attribute :folHlink, one_of: COLOR_SCHEME_INDEX
|
25
|
+
|
26
|
+
property :extension_list
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|