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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0413c6049180f6a50091d4463825400da1208746
|
4
|
+
data.tar.gz: 6ebc2912bb0d41e02ad652149524f858e62f73a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b4a06a92a6809989cdb4e3fdf867e7db5675a605cbf2299ebbd3c0d82a2548282c3ef072c2181ae598c77ab202e8e3c6b0ad6cb6111c1a10bec35b446f7a057
|
7
|
+
data.tar.gz: ac611aa3706fb37e79d7b7be628c84ca3a3d01ad0d33e3dbf184a347ae644d0c0012e0f3616e9259d750eb6b80e5d15cffc58993c2dbf1ca362e31a39e844ab9
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openxml-drawingml (0.
|
4
|
+
openxml-drawingml (0.2.0)
|
5
5
|
nokogiri
|
6
|
-
openxml-package (~> 0.2
|
6
|
+
openxml-package (~> 0.3.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -13,14 +13,14 @@ GEM
|
|
13
13
|
docile (1.1.5)
|
14
14
|
json (2.1.0)
|
15
15
|
method_source (0.8.2)
|
16
|
-
mini_portile2 (2.
|
17
|
-
nokogiri (1.8.
|
18
|
-
mini_portile2 (~> 2.
|
19
|
-
openxml-package (0.2
|
16
|
+
mini_portile2 (2.3.0)
|
17
|
+
nokogiri (1.8.1)
|
18
|
+
mini_portile2 (~> 2.3.0)
|
19
|
+
openxml-package (0.3.2)
|
20
20
|
nokogiri
|
21
21
|
ox
|
22
22
|
rubyzip (~> 1.2.1)
|
23
|
-
ox (2.
|
23
|
+
ox (2.8.0)
|
24
24
|
pry (0.10.4)
|
25
25
|
coderay (~> 1.1.0)
|
26
26
|
method_source (~> 0.8.1)
|
@@ -62,4 +62,4 @@ DEPENDENCIES
|
|
62
62
|
timecop
|
63
63
|
|
64
64
|
BUNDLED WITH
|
65
|
-
1.
|
65
|
+
1.15.4
|
data/lib/openxml/drawingml.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
module OpenXml
|
2
2
|
module DrawingML
|
3
|
+
# Validation constants
|
4
|
+
ST_FixedPercentage = /^-?((100)|([0-9][0-9]?))(\.[0-9][0-9]?)?%$/ # Part 1 - 22.9.2.3
|
5
|
+
ST_PositiveFixedPercentage = /^((100)|([0-9][0-9]?))(\.[0-9][0-9]?)?%$/ # Part 1 - 22.9.2.10
|
6
|
+
ST_Percentage = /^-?[0-9]+(\.[0-9]+)?%$/ # Part 1 - 22.9.2.9
|
7
|
+
ST_PositivePercentage = /^[0-9]+(\.[0-9]+)?%$/ # Part 1 - 22.9.2.11
|
8
|
+
ST_UniversalMeasure = /^(-?[0-9]+(:?\.[0-9]+)?)(:?mm|cm|in|pt|pc|pi)?$/ # Part 1 - 22.9.2.15
|
9
|
+
ST_PositiveUniversalMeasure = /^[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)?$/ # Part 1 - 22.9.2.12
|
10
|
+
|
3
11
|
end
|
4
12
|
end
|
5
13
|
|
14
|
+
require "openxml/package"
|
15
|
+
require "openxml/drawingml/properties"
|
6
16
|
require "openxml/drawingml/elements"
|
17
|
+
require "openxml/drawingml/parts"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module OpenXml
|
2
2
|
module DrawingML
|
3
3
|
module Elements
|
4
|
-
class Blip < OpenXml::
|
4
|
+
class Blip < OpenXml::Element
|
5
5
|
include HasChildren
|
6
|
-
|
6
|
+
namespace :a
|
7
7
|
tag :blip
|
8
8
|
|
9
|
-
attribute :compression_state, one_of: %i
|
9
|
+
attribute :compression_state, one_of: %i{ email hqprint none print screen }, displays_as: :cstate
|
10
10
|
|
11
11
|
with_namespace :r do
|
12
12
|
attribute :embed, expects: :string
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module OpenXml
|
2
2
|
module DrawingML
|
3
3
|
module Elements
|
4
|
-
class GraphicFrameLocks < OpenXml::
|
4
|
+
class GraphicFrameLocks < OpenXml::Element
|
5
|
+
namespace :a
|
6
|
+
tag :graphicFrameLocks
|
5
7
|
|
6
8
|
attribute :disallow_aspect_ratio_changes, expects: :boolean, displays_as: :noChangeAspect
|
7
9
|
attribute :disallow_drilldown, expects: :boolean, displays_as: :noDrilldown
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module OpenXml
|
2
2
|
module DrawingML
|
3
3
|
module Elements
|
4
|
-
class HeadEnd < OpenXml::
|
4
|
+
class HeadEnd < OpenXml::Element
|
5
|
+
namespace :a
|
6
|
+
tag :headEnd
|
5
7
|
|
6
8
|
attribute :length, expects: :valid_end_size, displays_as: :len
|
7
9
|
attribute :type, expects: :valid_end_type
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class LineBreak < OpenXml::Element
|
5
|
+
include HasProperties
|
6
|
+
namespace :a
|
7
|
+
tag :br
|
8
|
+
properties_tag :rPr
|
9
|
+
|
10
|
+
# Includes the same rPr as run so that if text is added to the position
|
11
|
+
# later, it can apply that formatting to the new text. cf. Part 1 - 21.1.2.2.1
|
12
|
+
|
13
|
+
UNDERLINE_STYLES = %i{
|
14
|
+
dash dashHeavy dashLong dashLongHeavy dbl dotDash dotDashHeavy
|
15
|
+
dotDotDash dotDotDashHeavy dotted dottedHeavy heavy none sng wavy
|
16
|
+
wavyDbl wavyHeavy words
|
17
|
+
}.freeze
|
18
|
+
|
19
|
+
# Validations
|
20
|
+
point = lambda { |value|
|
21
|
+
valid_point = value.is_a?(Integer) && (-400_000..400_000).covers?(value)
|
22
|
+
valid_measure = value =~ /-?[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)/
|
23
|
+
raise ArgumentError unless valid_point || valid_measure
|
24
|
+
}
|
25
|
+
|
26
|
+
properties_attribute :alternative_language, displays_as: :altLang, expects: :string
|
27
|
+
properties_attribute :bold, displays_as: :b, expects: :boolean
|
28
|
+
properties_attribute :baseline, expects: :percentage
|
29
|
+
properties_attribute :bookmark_target, displays_as: :bmk, expects: :string
|
30
|
+
properties_attribute :capitalization, displays_as: :cap, one_of: %i{ all none small }
|
31
|
+
properties_attribute :dirty, expects: :boolean
|
32
|
+
properties_attribute :spelling_error, displays_as: :err, expects: :boolean
|
33
|
+
properties_attribute :italic, displays_as: :i, expects: :boolean
|
34
|
+
properties_attribute :kerning, displays_as: :kern, expects: :integer, in_range: (0..400_000)
|
35
|
+
properties_attribute :kumimoji, expects: :boolean
|
36
|
+
properties_attribute :language, displays_as: :lang, expects: :string
|
37
|
+
properties_attribute :no_proofing, displays_as: :noProof, expects: :boolean
|
38
|
+
properties_attribute :normalize_heights, displays_as: :normalizeH, expects: :boolean
|
39
|
+
properties_attribute :smart_tag_clean, displays_as: :smtClean, expects: :boolean
|
40
|
+
properties_attribute :smart_tag_id, displays_as: :smtId, expects: :positive_integer
|
41
|
+
properties_attribute :spacing, displays_as: :spc, validation: point
|
42
|
+
properties_attribute :strikethrough, displays_as: :strike, one_of: %i{ dblStrike noStrike sngStrike }
|
43
|
+
properties_attribute :font_size, displays_as: :sz, expects: :integer, in_range: (100..400_000)
|
44
|
+
properties_attribute :underline, displays_as: :u, one_of: UNDERLINE_STYLES
|
45
|
+
|
46
|
+
property :outline
|
47
|
+
|
48
|
+
property_choice do
|
49
|
+
value_property :no_fill, as: :fill_none
|
50
|
+
property :solid_fill, as: :fill_solid
|
51
|
+
property :gradient_fill, as: :fill_gradient
|
52
|
+
property :pattern_fill, as: :fill_pattern
|
53
|
+
property :blip_fill, as: :fill_blip
|
54
|
+
value_property :inherit_group_fill, as: :fill_group
|
55
|
+
end
|
56
|
+
|
57
|
+
property_choice do
|
58
|
+
property :effect_list
|
59
|
+
property :effect_dag
|
60
|
+
end
|
61
|
+
|
62
|
+
property :highlight
|
63
|
+
|
64
|
+
property_choice do
|
65
|
+
value_property :underline_inherits, as: :underline_text
|
66
|
+
property :underline
|
67
|
+
end
|
68
|
+
|
69
|
+
property_choice do
|
70
|
+
value_property :underline_fill_inherits, as: :underline_fill_text
|
71
|
+
property :underline_fill
|
72
|
+
end
|
73
|
+
|
74
|
+
value_property :latin_font
|
75
|
+
value_property :east_asian_font
|
76
|
+
value_property :complex_script_font
|
77
|
+
value_property :symbol_font
|
78
|
+
|
79
|
+
property :hyperlink_click
|
80
|
+
property :hyperlink_mouse_over
|
81
|
+
|
82
|
+
value_property :right_to_left
|
83
|
+
|
84
|
+
property :extension_list
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module OpenXml
|
2
2
|
module DrawingML
|
3
3
|
module Elements
|
4
|
-
class Outline < OpenXml::
|
4
|
+
class Outline < OpenXml::Element
|
5
5
|
include HasChildren
|
6
|
-
|
6
|
+
namespace :a
|
7
7
|
tag :ln
|
8
8
|
|
9
9
|
attribute :alignment, expects: :valid_stroke_alignment, displays_as: :algn
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class Paragraph < OpenXml::Element
|
5
|
+
include HasChildren
|
6
|
+
include HasProperties
|
7
|
+
namespace :a
|
8
|
+
tag :p
|
9
|
+
|
10
|
+
# Validations
|
11
|
+
coordinate = lambda do |value|
|
12
|
+
message = "Invalid coordinate: Must either be an integer or include units"
|
13
|
+
is_integer = value.is_a?(Integer)
|
14
|
+
is_measure = value.is_a?(String) && value =~ OpenXml::DrawingML::ST_UniversalMeasure
|
15
|
+
raise ArgumentError, message unless is_integer || is_measure
|
16
|
+
end
|
17
|
+
|
18
|
+
indent_range = lambda do |value|
|
19
|
+
message = "Invalid indentation range: Must be an integer between -51,206,400 and 51,206,400 or include units"
|
20
|
+
is_integer_in_range = value.is_a?(Integer) && (-51_206_400..51_206_400).cover?(value)
|
21
|
+
is_measure = value.is_a?(String) && value =~ OpenXml::DrawingML::ST_UniversalMeasure
|
22
|
+
raise ArgumentError, message unless is_integer_in_range || is_measure
|
23
|
+
end
|
24
|
+
|
25
|
+
text_margin = lambda do |value|
|
26
|
+
message = "Invalid text margin: Must be an integer between 0 and 51,206,400 or include units"
|
27
|
+
is_integer_in_range = value.is_a?(Integer) && (0..51_206_400).cover?(value)
|
28
|
+
is_measure = value.is_a?(String) && value =~ OpenXml::DrawingML::ST_PositiveUniversalMeasure
|
29
|
+
raise ArgumentError, message unless is_integer_in_range || is_measure
|
30
|
+
end
|
31
|
+
|
32
|
+
properties_attribute :alignment, displays_as: :algn, one_of: %i{ ctr dist just justLow l r thaiDist }
|
33
|
+
properties_attribute :default_tab_size, displays_as: :defTabSz, validation: coordinate
|
34
|
+
properties_attribute :east_asian_line_break, displays_as: :eaLnBrk, expects: :boolean
|
35
|
+
properties_attribute :vertical_alignment, displays_as: :fontAlgn, one_of: %i{ auto b base ctr t }
|
36
|
+
properties_attribute :hanging_punctuation, displays_as: :hangingPunct, expects: :boolean
|
37
|
+
properties_attribute :indent, validation: indent_range
|
38
|
+
properties_attribute :latin_line_break, displays_as: :latinLnBrk, expects: :boolean
|
39
|
+
properties_attribute :level, displays_as: :lvl, in_range: 0..8
|
40
|
+
properties_attribute :left_margin, displays_as: :marL, validation: text_margin
|
41
|
+
properties_attribute :right_margin, displays_as: :marR, validation: text_margin
|
42
|
+
properties_attribute :right_to_left, displays_as: :rtl, expects: :boolean
|
43
|
+
|
44
|
+
property :line_spacing
|
45
|
+
property :space_before
|
46
|
+
property :space_after
|
47
|
+
|
48
|
+
property_choice do
|
49
|
+
property :bullet_color
|
50
|
+
value_property :bullet_color_matches_text, as: :bullet_color_text
|
51
|
+
end
|
52
|
+
|
53
|
+
property_choice do
|
54
|
+
value_property :bullet_size_matches_text, as: :bullet_size_text
|
55
|
+
value_property :bullet_size_percent
|
56
|
+
value_property :bullet_size_points
|
57
|
+
end
|
58
|
+
|
59
|
+
property_choice do
|
60
|
+
value_property :bullet_font_matches_text, as: :bullet_font_text
|
61
|
+
value_property :bullet_font
|
62
|
+
end
|
63
|
+
|
64
|
+
property_choice do
|
65
|
+
value_property :disable_bullets, as: :bullet_style_none
|
66
|
+
property :autonumbered_bullets, as: :bullet_style_auto_numbered
|
67
|
+
property :character_bullets, as: :bullet_style_character
|
68
|
+
property :blip_bullets, as: :bullet_style_blip
|
69
|
+
end
|
70
|
+
|
71
|
+
property :tab_list
|
72
|
+
property :default_run_properties
|
73
|
+
property :extension_list
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|