Skip to main content

ShapeFill

Struct ShapeFill 

Source
pub struct ShapeFill {
    pub color: String,
    pub transparency: Option<u32>,
}
Expand description

Shape fill/color properties

Fields§

§color: String§transparency: Option<u32>

Implementations§

Source§

impl ShapeFill

Source

pub fn new(color: &str) -> Self

Create new shape fill with color

Examples found in repository?
examples/proper_pptx.rs (line 40)
9fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
10    println!("Generating PPTX files with simplified API...\n");
11
12    // Create output directory
13    fs::create_dir_all("examples/output")?;
14
15    // Example 1: Simple presentation using pptx! macro
16    println!("Creating simple.pptx...");
17    pptx!("My Presentation")
18        .slide("Welcome", &["This is a simple presentation", "Created with ppt-rs"])
19        .save("examples/output/simple_proper.pptx")?;
20    println!("✓ Created: examples/output/simple_proper.pptx");
21
22    // Example 2: Multi-slide presentation with bullet points
23    println!("\nCreating multi_slide.pptx...");
24    pptx!("Multi-Slide Presentation")
25        .title_slide("Introduction")
26        .slide("Agenda", &["Overview", "Details", "Summary", "Q&A"])
27        .slide("Overview", &["Key concepts", "Main features", "Benefits"])
28        .slide("Details", &["Technical specs", "Implementation", "Best practices"])
29        .slide("Summary", &["Key takeaways", "Next steps"])
30        .save("examples/output/multi_slide_proper.pptx")?;
31    println!("✓ Created: examples/output/multi_slide_proper.pptx");
32
33    // Example 3: Report with shapes
34    println!("\nCreating report.pptx...");
35    pptx!("Quarterly Report Q1 2025")
36        .title_slide("Q1 2025 Report")
37        .slide("Highlights", &["Revenue up 15%", "New customers: 500+", "Product launches: 3"])
38        .shapes_slide("Key Metrics", vec![
39            shapes::rect(1.0, 2.0, 2.0, 1.5)
40                .with_fill(ShapeFill::new(colors::CORPORATE_BLUE))
41                .with_text("Revenue"),
42            shapes::rect(4.0, 2.0, 2.0, 1.5)
43                .with_fill(ShapeFill::new(colors::CORPORATE_GREEN))
44                .with_text("Growth"),
45            shapes::rect(7.0, 2.0, 2.0, 1.5)
46                .with_fill(ShapeFill::new(colors::CORPORATE_ORANGE))
47                .with_text("Users"),
48        ])
49        .slide("Next Quarter", &["Goals", "Initiatives", "Timeline"])
50        .save("examples/output/report_proper.pptx")?;
51    println!("✓ Created: examples/output/report_proper.pptx");
52
53    // Example 4: Training with gradient shapes
54    println!("\nCreating training.pptx...");
55    pptx!("Rust Training Course")
56        .title_slide("Learn Rust Programming")
57        .slide("Course Overview", &[
58            "Introduction to Rust",
59            "Ownership and Borrowing",
60            "Structs and Enums",
61            "Error Handling",
62            "Concurrency",
63        ])
64        .slide("Why Rust?", &[
65            "Memory safety without garbage collection",
66            "Zero-cost abstractions",
67            "Fearless concurrency",
68            "Great tooling (cargo, rustfmt, clippy)",
69        ])
70        .shapes_slide("Rust Features", vec![
71            shapes::circle(2.0, 2.5, 1.5)
72                .with_fill(ShapeFill::new(colors::ORANGE))
73                .with_text("Safe"),
74            shapes::circle(5.0, 2.5, 1.5)
75                .with_fill(ShapeFill::new(colors::BLUE))
76                .with_text("Fast"),
77            shapes::circle(8.0, 2.5, 1.5)
78                .with_fill(ShapeFill::new(colors::GREEN))
79                .with_text("Concurrent"),
80        ])
81        .slide("Getting Started", &[
82            "Install rustup",
83            "cargo new my_project",
84            "cargo build && cargo run",
85        ])
86        .save("examples/output/training_proper.pptx")?;
87    println!("✓ Created: examples/output/training_proper.pptx");
88
89    println!("\n✅ All PPTX files generated successfully!");
90    println!("\nGenerated files:");
91
92    // Verify files
93    for file in &[
94        "examples/output/simple_proper.pptx",
95        "examples/output/multi_slide_proper.pptx",
96        "examples/output/report_proper.pptx",
97        "examples/output/training_proper.pptx",
98    ] {
99        let metadata = fs::metadata(file)?;
100        println!("  ✓ {} ({} bytes)", file, metadata.len());
101    }
102
103    Ok(())
104}
More examples
Hide additional examples
examples/templates_demo.rs (line 272)
16fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
17    // 1. Business Proposal Template
18    println!("Creating business proposal...");
19    let proposal = templates::business_proposal(
20        "Q4 Budget Proposal 2025",
21        "Finance Team",
22        ProposalContent {
23            executive_summary: vec![
24                "Requesting $500,000 for digital transformation",
25                "Expected ROI of 300% within 18 months",
26                "Aligns with corporate strategic goals",
27            ],
28            problem: vec![
29                "Legacy systems causing 40% productivity loss",
30                "Customer satisfaction declining due to slow response",
31                "Competitors gaining market share with modern solutions",
32            ],
33            solution: vec![
34                "Implement cloud-native infrastructure",
35                "Deploy AI-powered customer service",
36                "Modernize internal workflows with automation",
37            ],
38            timeline: vec![
39                ("Phase 1: Planning", "Q1 2025"),
40                ("Phase 2: Development", "Q2-Q3 2025"),
41                ("Phase 3: Deployment", "Q4 2025"),
42                ("Phase 4: Optimization", "Q1 2026"),
43            ],
44            budget: vec![
45                ("Infrastructure", "$200,000"),
46                ("Development", "$150,000"),
47                ("Training", "$50,000"),
48                ("Contingency", "$100,000"),
49            ],
50            next_steps: vec![
51                "Executive approval by Jan 15",
52                "Vendor selection by Feb 1",
53                "Team assembly by Feb 15",
54                "Kickoff meeting Mar 1",
55            ],
56        },
57    )?;
58    std::fs::write("examples/output/proposal.pptx", proposal)?;
59    println!("  ✓ Created examples/output/proposal.pptx");
60
61    // 2. Status Report Template
62    println!("Creating status report...");
63    let status = templates::status_report(
64        "Project Alpha - Weekly Status",
65        "Week of December 23, 2025",
66        StatusContent {
67            summary: vec![
68                "Sprint 12 completed on schedule",
69                "All critical features delivered",
70                "On track for Q1 release",
71            ],
72            completed: vec![
73                "User authentication module",
74                "Dashboard redesign",
75                "API performance optimization",
76                "Security audit remediation",
77            ],
78            in_progress: vec![
79                "Mobile responsive layouts",
80                "Export functionality",
81                "Integration testing",
82            ],
83            blocked: vec![
84                "Third-party API access pending approval",
85            ],
86            next_week: vec![
87                "Complete mobile layouts",
88                "Begin UAT testing",
89                "Prepare deployment documentation",
90            ],
91            metrics: vec![
92                ("Velocity", "42 story points"),
93                ("Bug Count", "3 (down from 12)"),
94                ("Test Coverage", "87%"),
95                ("Sprint Burndown", "On track"),
96            ],
97        },
98    )?;
99    std::fs::write("examples/output/status_report.pptx", status)?;
100    println!("  ✓ Created examples/output/status_report.pptx");
101
102    // 3. Training Material Template
103    println!("Creating training material...");
104    let training = templates::training_material(
105        "Introduction to Rust Programming",
106        "DevOps Academy",
107        TrainingContent {
108            objectives: vec![
109                "Understand Rust's ownership model",
110                "Write safe, concurrent code",
111                "Build and test Rust applications",
112                "Integrate Rust with existing systems",
113            ],
114            modules: vec![
115                ("Module 1: Getting Started", vec![
116                    "Installing Rust toolchain",
117                    "Hello World program",
118                    "Cargo basics",
119                    "VS Code setup",
120                ]),
121                ("Module 2: Ownership & Borrowing", vec![
122                    "Stack vs Heap",
123                    "Move semantics",
124                    "References and borrowing",
125                    "Lifetimes basics",
126                ]),
127                ("Module 3: Error Handling", vec![
128                    "Result and Option types",
129                    "Pattern matching",
130                    "The ? operator",
131                    "Custom error types",
132                ]),
133            ],
134            exercises: vec![
135                "Build a CLI calculator",
136                "Implement a linked list",
137                "Create a REST API client",
138                "Write unit tests for all modules",
139            ],
140            summary: vec![
141                "Rust provides memory safety without garbage collection",
142                "Ownership model prevents data races at compile time",
143                "Cargo makes dependency management easy",
144                "Strong type system catches errors early",
145            ],
146        },
147    )?;
148    std::fs::write("examples/output/training.pptx", training)?;
149    println!("  ✓ Created examples/output/training.pptx");
150
151    // 4. Technical Documentation Template
152    println!("Creating technical documentation...");
153    let tech_doc = templates::technical_doc(
154        "ppt-rs Library Architecture",
155        "0.2.0",
156        TechnicalContent {
157            overview: vec![
158                "Rust library for PowerPoint generation",
159                "ECMA-376 Office Open XML compliant",
160                "Zero runtime dependencies on Microsoft Office",
161                "Cross-platform support",
162            ],
163            architecture: vec![
164                "Layered architecture: API → Generator → Parts → OPC",
165                "Trait-based design for extensibility",
166                "Builder pattern for fluent API",
167                "Modular components for maintainability",
168            ],
169            components: vec![
170                ("Generator Module", vec![
171                    "SlideContent - Slide builder",
172                    "Shape - Shape creation",
173                    "Table - Table builder",
174                    "Chart - Chart builder",
175                ]),
176                ("Parts Module", vec![
177                    "SlidePart - Individual slides",
178                    "ImagePart - Embedded images",
179                    "ChartPart - Embedded charts",
180                    "MediaPart - Video/audio",
181                ]),
182                ("CLI Module", vec![
183                    "md2ppt - Markdown conversion",
184                    "validate - PPTX validation",
185                    "create - Quick presentation",
186                ]),
187            ],
188            api_examples: vec![
189                ("create_pptx()", "Create basic presentation"),
190                ("SlideContent::new()", "Build slide content"),
191                ("Shape::new()", "Create shapes"),
192                ("TableBuilder::new()", "Build tables"),
193            ],
194            best_practices: vec![
195                "Use prelude module for simplified API",
196                "Leverage templates for common use cases",
197                "Use layout helpers for consistent positioning",
198                "Test presentations with validation command",
199            ],
200        },
201    )?;
202    std::fs::write("examples/output/tech_doc.pptx", tech_doc)?;
203    println!("  ✓ Created examples/output/tech_doc.pptx");
204
205    // 5. Simple Template
206    println!("Creating simple presentation...");
207    let simple = templates::simple("Quick Presentation", &[
208        ("Welcome", &[
209            "Hello, World!",
210            "This is a simple presentation",
211            "Created with ppt-rs templates",
212        ]),
213        ("Features", &[
214            "Easy to use API",
215            "Multiple templates",
216            "Theme support",
217        ]),
218        ("Conclusion", &[
219            "Try ppt-rs today!",
220            "Visit github.com/yingkitw/ppt-rs",
221        ]),
222    ])?;
223    std::fs::write("examples/output/simple.pptx", simple)?;
224    println!("  ✓ Created examples/output/simple.pptx");
225
226    // 6. Theme showcase using prelude
227    println!("Creating theme showcase...");
228    let theme_pptx = pptx!("Theme Showcase")
229        .slide("Available Themes", &[
230            &format!("Corporate: Primary {} / Accent {}", 
231                themes::CORPORATE.primary, themes::CORPORATE.accent),
232            &format!("Modern: Primary {} / Accent {}",
233                themes::MODERN.primary, themes::MODERN.accent),
234            &format!("Vibrant: Primary {} / Accent {}",
235                themes::VIBRANT.primary, themes::VIBRANT.accent),
236            &format!("Dark: Primary {} / Accent {}",
237                themes::DARK.primary, themes::DARK.accent),
238            &format!("Carbon: Primary {} / Accent {}",
239                themes::CARBON.primary, themes::CARBON.accent),
240        ])
241        .slide("Material Colors", &[
242            &format!("Red: {}", colors::MATERIAL_RED),
243            &format!("Blue: {}", colors::MATERIAL_BLUE),
244            &format!("Green: {}", colors::MATERIAL_GREEN),
245            &format!("Orange: {}", colors::MATERIAL_ORANGE),
246        ])
247        .slide("Carbon Colors", &[
248            &format!("Blue 60: {}", colors::CARBON_BLUE_60),
249            &format!("Green 50: {}", colors::CARBON_GREEN_50),
250            &format!("Gray 100: {}", colors::CARBON_GRAY_100),
251        ])
252        .build()?;
253    std::fs::write("examples/output/themes.pptx", theme_pptx)?;
254    println!("  ✓ Created examples/output/themes.pptx");
255
256    // 7. Layout helpers demo
257    println!("Creating layout demo...");
258    let grid_positions = layouts::grid(2, 3, 1500000, 1000000);
259    let mut grid_shapes = Vec::new();
260    let theme_colors = [
261        themes::CORPORATE.primary,
262        themes::MODERN.primary,
263        themes::VIBRANT.primary,
264        themes::DARK.primary,
265        themes::NATURE.primary,
266        themes::TECH.primary,
267    ];
268    
269    for (i, (x, y)) in grid_positions.iter().enumerate() {
270        grid_shapes.push(
271            shapes::rect_emu(*x, *y, 1400000, 900000)
272                .with_fill(ShapeFill::new(theme_colors[i]))
273                .with_text(&format!("Theme {}", i + 1))
274        );
275    }
276
277    let layout_pptx = pptx!("Layout Helpers Demo")
278        .shapes_slide("Grid Layout (2x3)", grid_shapes)
279        .slide("Layout Features", &[
280            "layouts::grid() - Create grid positions",
281            "layouts::center() - Center shapes on slide",
282            "layouts::stack_horizontal() - Horizontal stacking",
283            "layouts::distribute_horizontal() - Even distribution",
284        ])
285        .build()?;
286    std::fs::write("examples/output/layouts.pptx", layout_pptx)?;
287    println!("  ✓ Created examples/output/layouts.pptx");
288
289    println!("\n✅ All template demos created successfully!");
290    println!("   Check examples/output/ for the generated files.");
291    
292    Ok(())
293}
examples/shapes_demo.rs (line 133)
13fn main() {
14    println!("╔════════════════════════════════════════════════════════════╗");
15    println!("║         PPTX Shapes Demo                                   ║");
16    println!("╚════════════════════════════════════════════════════════════╝\n");
17
18    // =========================================================================
19    // Basic Shapes
20    // =========================================================================
21    println!("📐 Basic Shapes:");
22    
23    let basic_shapes = [
24        ShapeType::Rectangle,
25        ShapeType::RoundedRectangle,
26        ShapeType::Ellipse,
27        ShapeType::Triangle,
28        ShapeType::Diamond,
29        ShapeType::Pentagon,
30        ShapeType::Hexagon,
31        ShapeType::Octagon,
32    ];
33    
34    for shape_type in &basic_shapes {
35        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
36    }
37
38    // =========================================================================
39    // Arrow Shapes
40    // =========================================================================
41    println!("\n➡️  Arrow Shapes:");
42    
43    let arrow_shapes = [
44        ShapeType::RightArrow,
45        ShapeType::LeftArrow,
46        ShapeType::UpArrow,
47        ShapeType::DownArrow,
48        ShapeType::LeftRightArrow,
49        ShapeType::UpDownArrow,
50    ];
51    
52    for shape_type in &arrow_shapes {
53        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
54    }
55
56    // =========================================================================
57    // Star and Banner Shapes
58    // =========================================================================
59    println!("\n⭐ Stars and Banners:");
60    
61    let star_shapes = [
62        ShapeType::Star4,
63        ShapeType::Star5,
64        ShapeType::Star6,
65        ShapeType::Star8,
66        ShapeType::Ribbon,
67        ShapeType::Wave,
68    ];
69    
70    for shape_type in &star_shapes {
71        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
72    }
73
74    // =========================================================================
75    // Callout Shapes
76    // =========================================================================
77    println!("\n💬 Callout Shapes:");
78    
79    let callout_shapes = [
80        ShapeType::WedgeRectCallout,
81        ShapeType::WedgeEllipseCallout,
82        ShapeType::CloudCallout,
83    ];
84    
85    for shape_type in &callout_shapes {
86        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
87    }
88
89    // =========================================================================
90    // Flow Chart Shapes
91    // =========================================================================
92    println!("\n📊 Flow Chart Shapes:");
93    
94    let flowchart_shapes = [
95        ShapeType::FlowChartProcess,
96        ShapeType::FlowChartDecision,
97        ShapeType::FlowChartTerminator,
98        ShapeType::FlowChartDocument,
99    ];
100    
101    for shape_type in &flowchart_shapes {
102        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
103    }
104
105    // =========================================================================
106    // Other Shapes
107    // =========================================================================
108    println!("\n🎨 Other Shapes:");
109    
110    let other_shapes = [
111        ShapeType::Heart,
112        ShapeType::Lightning,
113        ShapeType::Sun,
114        ShapeType::Moon,
115        ShapeType::Cloud,
116    ];
117    
118    for shape_type in &other_shapes {
119        println!("   {} → {}", shape_type.display_name(), shape_type.preset_name());
120    }
121
122    // =========================================================================
123    // Shape with Fill
124    // =========================================================================
125    println!("\n🎨 Shape with Fill:");
126    
127    let filled_shape = Shape::new(
128        ShapeType::Rectangle,
129        inches_to_emu(1.0),
130        inches_to_emu(1.0),
131        inches_to_emu(3.0),
132        inches_to_emu(2.0),
133    ).with_fill(ShapeFill::new("4472C4")); // Blue fill
134    
135    let xml = generate_shape_xml(&filled_shape, 1);
136    println!("   Generated XML ({} chars)", xml.len());
137    println!("   Contains fill: {}", xml.contains("solidFill"));
138
139    // =========================================================================
140    // Shape with Line
141    // =========================================================================
142    println!("\n📏 Shape with Line:");
143    
144    let outlined_shape = Shape::new(
145        ShapeType::Ellipse,
146        inches_to_emu(1.0),
147        inches_to_emu(1.0),
148        inches_to_emu(2.0),
149        inches_to_emu(2.0),
150    ).with_line(ShapeLine::new("FF0000", 25400)); // Red outline, 2pt
151    
152    let xml = generate_shape_xml(&outlined_shape, 2);
153    println!("   Generated XML ({} chars)", xml.len());
154    println!("   Contains line: {}", xml.contains("a:ln"));
155
156    // =========================================================================
157    // Shape with Text
158    // =========================================================================
159    println!("\n📝 Shape with Text:");
160    
161    let text_shape = Shape::new(
162        ShapeType::RoundedRectangle,
163        cm_to_emu(5.0),
164        cm_to_emu(3.0),
165        cm_to_emu(8.0),
166        cm_to_emu(4.0),
167    )
168    .with_fill(ShapeFill::new("70AD47")) // Green fill
169    .with_text("Click Here!");
170    
171    let xml = generate_shape_xml(&text_shape, 3);
172    println!("   Generated XML ({} chars)", xml.len());
173    println!("   Contains text: {}", xml.contains("Click Here!"));
174
175    // =========================================================================
176    // Multiple Shapes
177    // =========================================================================
178    println!("\n📦 Multiple Shapes:");
179    
180    let shapes = vec![
181        Shape::new(ShapeType::Rectangle, 0, 0, 1000000, 500000)
182            .with_fill(ShapeFill::new("FF0000")),
183        Shape::new(ShapeType::Ellipse, 1200000, 0, 500000, 500000)
184            .with_fill(ShapeFill::new("00FF00")),
185        Shape::new(ShapeType::Triangle, 1900000, 0, 500000, 500000)
186            .with_fill(ShapeFill::new("0000FF")),
187    ];
188    
189    let xml = generate_shapes_xml(&shapes, 10);
190    println!("   Generated {} shapes", shapes.len());
191    println!("   Total XML: {} chars", xml.len());
192
193    // =========================================================================
194    // Connector (Arrow Line)
195    // =========================================================================
196    println!("\n🔗 Connector:");
197    
198    let connector_xml = generate_connector_xml(
199        0, 0,
200        inches_to_emu(3.0), inches_to_emu(2.0),
201        100,
202        "000000",
203        12700, // 1pt line
204    );
205    println!("   Generated connector XML ({} chars)", connector_xml.len());
206    println!("   Has arrow head: {}", connector_xml.contains("triangle"));
207
208    // =========================================================================
209    // Flexible Dimension API (NEW)
210    // =========================================================================
211    println!("\n📏 Flexible Dimension API (NEW):");
212
213    // 1. Shape using ratio-based positioning (% of slide)
214    let ratio_shape = Shape::from_dimensions(
215        ShapeType::Rectangle,
216        Dimension::Ratio(0.1), Dimension::Ratio(0.2),   // 10% from left, 20% from top
217        Dimension::Ratio(0.8), Dimension::Ratio(0.6),   // 80% wide, 60% tall
218    ).with_fill(ShapeFill::new("4472C4")).with_text("Ratio-based");
219
220    let xml = generate_shape_xml(&ratio_shape, 20);
221    println!("   Ratio-based shape: {}x{} EMU at ({}, {})",
222        ratio_shape.width, ratio_shape.height, ratio_shape.x, ratio_shape.y);
223    println!("   Generated XML ({} chars)", xml.len());
224
225    // 2. Mixed units: inches for position, ratio for size
226    let mixed_shape = Shape::from_dimensions(
227        ShapeType::RoundedRectangle,
228        Dimension::Inches(1.0), Dimension::Cm(3.0),     // 1 inch from left, 3cm from top
229        Dimension::Ratio(0.5), Dimension::Inches(1.5),  // 50% slide width, 1.5 inches tall
230    ).with_fill(ShapeFill::new("70AD47")).with_text("Mixed units");
231
232    println!("   Mixed-unit shape: {}x{} EMU at ({}, {})",
233        mixed_shape.width, mixed_shape.height, mixed_shape.x, mixed_shape.y);
234
235    // 3. Fluent .at() and .with_dimensions() chaining
236    let fluent_shape = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
237        .at(Dimension::percent(50.0), Dimension::percent(50.0))  // center of slide
238        .with_dimensions(Dimension::Inches(2.0), Dimension::Inches(2.0))
239        .with_fill(ShapeFill::new("C0504D"))
240        .with_text("Centered");
241
242    println!("   Fluent chained shape: {}x{} EMU at ({}, {})",
243        fluent_shape.width, fluent_shape.height, fluent_shape.x, fluent_shape.y);
244
245    // 4. Percent helper (syntactic sugar for Ratio)
246    let percent_shape = Shape::from_dimensions(
247        ShapeType::Diamond,
248        Dimension::percent(40.0), Dimension::percent(30.0),
249        Dimension::percent(20.0), Dimension::percent(40.0),
250    ).with_fill(ShapeFill::new("8064A2"));
251
252    println!("   Percent-based shape: {}x{} EMU at ({}, {})",
253        percent_shape.width, percent_shape.height, percent_shape.x, percent_shape.y);
254
255    // 5. Points (useful for font-relative sizing)
256    let pt_shape = Shape::from_dimensions(
257        ShapeType::Rectangle,
258        Dimension::Pt(72.0), Dimension::Pt(72.0),   // 1 inch = 72pt
259        Dimension::Pt(360.0), Dimension::Pt(144.0), // 5 inches x 2 inches
260    ).with_fill(ShapeFill::new("F79646")).with_text("Points");
261
262    println!("   Point-based shape: {}x{} EMU at ({}, {})",
263        pt_shape.width, pt_shape.height, pt_shape.x, pt_shape.y);
264
265    // 6. All Dimension types side by side (same 1-inch result)
266    println!("\n   Unit equivalence (all = 1 inch = 914400 EMU):");
267    let units = [
268        ("Emu(914400)", Dimension::Emu(914400)),
269        ("Inches(1.0)", Dimension::Inches(1.0)),
270        ("Cm(2.54)",    Dimension::Cm(2.54)),
271        ("Pt(72.0)",    Dimension::Pt(72.0)),
272        ("Ratio(0.1)",  Dimension::Ratio(0.1)),  // 10% of slide width (10 inches)
273    ];
274    for (label, dim) in &units {
275        println!("     {:<16} → {} EMU", label, dim.to_emu_x());
276    }
277
278    // =========================================================================
279    // Summary
280    // =========================================================================
281    println!("\n╔════════════════════════════════════════════════════════════╗");
282    println!("║                    Demo Complete                           ║");
283    println!("╠════════════════════════════════════════════════════════════╣");
284    println!("║  Shape Types Available: 40+                                ║");
285    println!("║  Features:                                                 ║");
286    println!("║  ✓ Basic shapes (rect, ellipse, triangle, etc.)            ║");
287    println!("║  ✓ Arrow shapes (8 directions)                             ║");
288    println!("║  ✓ Stars and banners                                       ║");
289    println!("║  ✓ Callouts                                                ║");
290    println!("║  ✓ Flow chart shapes                                       ║");
291    println!("║  ✓ Fill colors with transparency                           ║");
292    println!("║  ✓ Line/border styling                                     ║");
293    println!("║  ✓ Text inside shapes                                      ║");
294    println!("║  ✓ Connectors with arrow heads                             ║");
295    println!("║  ✓ NEW: Flexible Dimension API (EMU/inches/cm/pt/ratio)    ║");
296    println!("║  ✓ NEW: Fluent .at() and .with_dimensions() chaining       ║");
297    println!("║  ✓ NEW: Percent-based positioning                          ║");
298    println!("╚════════════════════════════════════════════════════════════╝");
299}
examples/dimension_demo.rs (line 48)
21fn main() -> Result<(), Box<dyn std::error::Error>> {
22    println!("╔══════════════════════════════════════════════════════════════╗");
23    println!("║       Dimension API Demo — Flexible Positioning & Sizing     ║");
24    println!("╚══════════════════════════════════════════════════════════════╝\n");
25
26    let mut slides = Vec::new();
27
28    // =========================================================================
29    // SLIDE 1: Title
30    // =========================================================================
31    slides.push(
32        SlideContent::new("Dimension API — Flexible Positioning & Sizing")
33            .layout(SlideLayout::CenteredTitle)
34            .title_size(44)
35            .title_bold(true)
36            .title_color("1F497D")
37    );
38
39    // =========================================================================
40    // SLIDE 2: All Unit Types Side-by-Side
41    // =========================================================================
42    println!("📏 Slide 2: All Unit Types");
43
44    // Each shape is 1 inch wide, positioned using a different unit type
45    let emu_shape = Shape::from_dimensions(ShapeType::Rectangle,
46        Dimension::Emu(457200), Dimension::Inches(1.5),
47        Dimension::Emu(1371600), Dimension::Inches(0.8),
48    ).with_fill(ShapeFill::new("1565C0")).with_text("EMU");
49
50    let inch_shape = Shape::from_dimensions(ShapeType::Rectangle,
51        Dimension::Inches(2.0), Dimension::Inches(1.5),
52        Dimension::Inches(1.5), Dimension::Inches(0.8),
53    ).with_fill(ShapeFill::new("2E7D32")).with_text("Inches");
54
55    let cm_shape = Shape::from_dimensions(ShapeType::Rectangle,
56        Dimension::Cm(9.0), Dimension::Inches(1.5),
57        Dimension::Cm(3.81), Dimension::Inches(0.8),
58    ).with_fill(ShapeFill::new("C62828")).with_text("Cm");
59
60    let pt_shape = Shape::from_dimensions(ShapeType::Rectangle,
61        Dimension::Pt(324.0), Dimension::Inches(1.5),
62        Dimension::Pt(108.0), Dimension::Inches(0.8),
63    ).with_fill(ShapeFill::new("7B1FA2")).with_text("Pt");
64
65    let ratio_shape = Shape::from_dimensions(ShapeType::Rectangle,
66        Dimension::Ratio(0.52), Dimension::Inches(1.5),
67        Dimension::Ratio(0.15), Dimension::Inches(0.8),
68    ).with_fill(ShapeFill::new("EF6C00")).with_text("Ratio");
69
70    let pct_shape = Shape::from_dimensions(ShapeType::Rectangle,
71        Dimension::percent(69.0), Dimension::Inches(1.5),
72        Dimension::percent(15.0), Dimension::Inches(0.8),
73    ).with_fill(ShapeFill::new("00838F")).with_text("Percent");
74
75    // Labels row
76    let label = Shape::from_dimensions(ShapeType::Rectangle,
77        Dimension::Inches(0.5), Dimension::Inches(0.8),
78        Dimension::Inches(9.0), Dimension::Inches(0.5),
79    ).with_text("Each shape below uses a different unit type for X position:");
80
81    slides.push(
82        SlideContent::new("All Dimension Unit Types")
83            .layout(SlideLayout::TitleOnly)
84            .title_color("1F497D").title_bold(true)
85            .add_shape(label)
86            .add_shape(emu_shape)
87            .add_shape(inch_shape)
88            .add_shape(cm_shape)
89            .add_shape(pt_shape)
90            .add_shape(ratio_shape)
91            .add_shape(pct_shape)
92    );
93
94    // =========================================================================
95    // SLIDE 3: Ratio-Based Grid Layout
96    // =========================================================================
97    println!("📐 Slide 3: Ratio-Based Grid (auto-adapts to slide size)");
98
99    let margin = 0.03;  // 3% margin
100    let gap = 0.02;     // 2% gap
101    let cell_w = (1.0 - 2.0 * margin - 2.0 * gap) / 3.0;
102    let cell_h = (0.7 - 2.0 * gap) / 3.0;  // 70% of slide height for grid
103    let y_start = 0.22; // below title
104
105    let colors = [
106        "1565C0", "2E7D32", "C62828",
107        "7B1FA2", "EF6C00", "00838F",
108        "AD1457", "4E342E", "37474F",
109    ];
110    let labels = [
111        "Top-Left", "Top-Center", "Top-Right",
112        "Mid-Left", "Mid-Center", "Mid-Right",
113        "Bot-Left", "Bot-Center", "Bot-Right",
114    ];
115
116    let mut grid_slide = SlideContent::new("Ratio-Based 3x3 Grid Layout")
117        .layout(SlideLayout::TitleOnly)
118        .title_color("1F497D").title_bold(true);
119
120    for row in 0..3 {
121        for col in 0..3 {
122            let idx = row * 3 + col;
123            let x = margin + col as f64 * (cell_w + gap);
124            let y = y_start + row as f64 * (cell_h + gap);
125            let shape = Shape::from_dimensions(ShapeType::RoundedRectangle,
126                Dimension::Ratio(x), Dimension::Ratio(y),
127                Dimension::Ratio(cell_w), Dimension::Ratio(cell_h),
128            ).with_fill(ShapeFill::new(colors[idx])).with_text(labels[idx]);
129            grid_slide = grid_slide.add_shape(shape);
130        }
131    }
132
133    slides.push(grid_slide);
134
135    // =========================================================================
136    // SLIDE 4: Mixed-Unit Positioning
137    // =========================================================================
138    println!("🔀 Slide 4: Mixed-Unit Positioning");
139
140    // Title area: inches for position, ratio for width
141    let title_box = Shape::from_dimensions(ShapeType::RoundedRectangle,
142        Dimension::Inches(0.5), Dimension::Inches(1.5),
143        Dimension::Ratio(0.9), Dimension::Cm(2.0),
144    ).with_fill(ShapeFill::new("1F497D")).with_text("Inches X + Ratio Width + Cm Height");
145
146    // Content area: cm for position, pt for size
147    let content_box = Shape::from_dimensions(ShapeType::Rectangle,
148        Dimension::Cm(2.0), Dimension::Cm(6.0),
149        Dimension::Pt(432.0), Dimension::Pt(108.0),  // 6in x 1.5in
150    ).with_fill(ShapeFill::new("2E7D32")).with_text("Cm position + Pt size");
151
152    // Footer area: percent for everything
153    let footer_box = Shape::from_dimensions(ShapeType::Rectangle,
154        Dimension::percent(5.0), Dimension::percent(75.0),
155        Dimension::percent(90.0), Dimension::percent(10.0),
156    ).with_fill(ShapeFill::new("C62828")).with_text("100% percent-based");
157
158    // Sidebar: EMU for position, inches for size
159    let sidebar = Shape::from_dimensions(ShapeType::Rectangle,
160        Dimension::Emu(8000000), Dimension::Inches(1.5),
161        Dimension::Inches(1.0), Dimension::Ratio(0.6),
162    ).with_fill(ShapeFill::new("7B1FA2")).with_text("EMU + Inches + Ratio");
163
164    slides.push(
165        SlideContent::new("Mixed-Unit Positioning")
166            .layout(SlideLayout::TitleOnly)
167            .title_color("1F497D").title_bold(true)
168            .add_shape(title_box)
169            .add_shape(content_box)
170            .add_shape(footer_box)
171            .add_shape(sidebar)
172    );
173
174    // =========================================================================
175    // SLIDE 5: Fluent .at() and .with_dimensions() Chaining
176    // =========================================================================
177    println!("🔗 Slide 5: Fluent Chaining API");
178
179    // Build shapes step by step with chaining
180    let shape1 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
181        .at(Dimension::percent(10.0), Dimension::percent(25.0))
182        .with_dimensions(Dimension::Inches(2.5), Dimension::Inches(2.5))
183        .with_fill(ShapeFill::new("1565C0"))
184        .with_text(".at() + .with_dimensions()");
185
186    let shape2 = Shape::new(ShapeType::RoundedRectangle, 0, 0, 0, 0)
187        .at(Dimension::Inches(4.0), Dimension::Cm(5.0))
188        .with_dimensions(Dimension::Ratio(0.3), Dimension::Inches(2.0))
189        .with_fill(ShapeFill::new("2E7D32"))
190        .with_line(ShapeLine::new("1B5E20", 25400))
191        .with_text("Chained with fill + line");
192
193    let shape3 = Shape::new(ShapeType::Star5, 0, 0, 0, 0)
194        .at(Dimension::percent(70.0), Dimension::percent(55.0))
195        .with_dimensions(Dimension::Inches(2.0), Dimension::Inches(2.0))
196        .with_fill(ShapeFill::new("FFC107"))
197        .with_rotation(15)
198        .with_text("+ rotation");
199
200    slides.push(
201        SlideContent::new("Fluent .at() and .with_dimensions() Chaining")
202            .layout(SlideLayout::TitleOnly)
203            .title_color("1F497D").title_bold(true)
204            .add_shape(shape1)
205            .add_shape(shape2)
206            .add_shape(shape3)
207    );
208
209    // =========================================================================
210    // SLIDE 6: Prelude Shape Builders
211    // =========================================================================
212    println!("🧰 Slide 6: Prelude Shape Builders");
213
214    // shapes::dim() — generic Dimension-based builder
215    let dim_shape = shapes::dim(ShapeType::Diamond,
216        Dimension::percent(5.0), Dimension::percent(25.0),
217        Dimension::percent(25.0), Dimension::percent(35.0),
218    ).with_fill(ShapeFill::new("7B1FA2")).with_text("shapes::dim()");
219
220    // shapes::rect_ratio() — ratio-based rectangle
221    let ratio_rect = shapes::rect_ratio(0.35, 0.25, 0.28, 0.35)
222        .with_fill(ShapeFill::new("EF6C00")).with_text("shapes::rect_ratio()");
223
224    // shapes::text_box_ratio() — ratio-based text box
225    let ratio_text = shapes::text_box_ratio(0.68, 0.25, 0.28, 0.35, "shapes::text_box_ratio()")
226        .with_fill(ShapeFill::new("00838F"));
227
228    // Traditional shapes::rect() still works (inches)
229    let inch_rect = shapes::rect(1.0, 5.0, 3.0, 1.0)
230        .with_fill(ShapeFill::new("A5A5A5")).with_text("shapes::rect() (inches)");
231
232    slides.push(
233        SlideContent::new("Prelude Shape Builders")
234            .layout(SlideLayout::TitleOnly)
235            .title_color("1F497D").title_bold(true)
236            .add_shape(dim_shape)
237            .add_shape(ratio_rect)
238            .add_shape(ratio_text)
239            .add_shape(inch_rect)
240    );
241
242    // =========================================================================
243    // SLIDE 7: FlexPosition & FlexSize Structs
244    // =========================================================================
245    println!("📦 Slide 7: FlexPosition & FlexSize");
246
247    // Demonstrate FlexPosition and FlexSize for reusable layout definitions
248    let header_pos = FlexPosition::new(Dimension::percent(5.0), Dimension::percent(20.0));
249    let header_size = FlexSize::new(Dimension::percent(90.0), Dimension::percent(12.0));
250    let (hx, hy) = header_pos.to_emu();
251    let (hw, hh) = header_size.to_emu();
252    let header = Shape::new(ShapeType::RoundedRectangle, hx, hy, hw, hh)
253        .with_fill(ShapeFill::new("1F497D"))
254        .with_text("FlexPosition + FlexSize → header");
255
256    let body_pos = FlexPosition::new(Dimension::percent(5.0), Dimension::percent(35.0));
257    let body_size = FlexSize::new(Dimension::percent(60.0), Dimension::percent(50.0));
258    let (bx, by) = body_pos.to_emu();
259    let (bw, bh) = body_size.to_emu();
260    let body = Shape::new(ShapeType::Rectangle, bx, by, bw, bh)
261        .with_fill(ShapeFill::new("E8EAF6"))
262        .with_line(ShapeLine::new("3F51B5", 12700))
263        .with_text("Body area (60% x 50%)");
264
265    let sidebar_pos = FlexPosition::new(Dimension::percent(68.0), Dimension::percent(35.0));
266    let sidebar_size = FlexSize::new(Dimension::percent(27.0), Dimension::percent(50.0));
267    let (sx, sy) = sidebar_pos.to_emu();
268    let (sw, sh) = sidebar_size.to_emu();
269    let sidebar_shape = Shape::new(ShapeType::Rectangle, sx, sy, sw, sh)
270        .with_fill(ShapeFill::new("FFF3E0"))
271        .with_line(ShapeLine::new("EF6C00", 12700))
272        .with_text("Sidebar (27% x 50%)");
273
274    slides.push(
275        SlideContent::new("FlexPosition & FlexSize — Reusable Layouts")
276            .layout(SlideLayout::TitleOnly)
277            .title_color("1F497D").title_bold(true)
278            .add_shape(header)
279            .add_shape(body)
280            .add_shape(sidebar_shape)
281    );
282
283    // =========================================================================
284    // SLIDE 8: Real-World Dashboard with Dimension API
285    // =========================================================================
286    println!("📊 Slide 8: Real-World Dashboard");
287
288    // 4 evenly-spaced KPI cards using percent
289    let kpi_colors = ["1565C0", "2E7D32", "EF6C00", "7B1FA2"];
290    let kpi_labels = [
291        "Revenue\n$2.14M\n+15%",
292        "Users\n12,450\n+22%",
293        "NPS\n72\n+8 pts",
294        "Uptime\n99.9%\n+0.1%",
295    ];
296
297    let mut dashboard = SlideContent::new("KPI Dashboard — Dimension API")
298        .layout(SlideLayout::TitleOnly)
299        .title_color("1F497D").title_bold(true);
300
301    for i in 0..4 {
302        let x_pct = 3.0 + i as f64 * 24.5;
303        let card = Shape::from_dimensions(ShapeType::RoundedRectangle,
304            Dimension::percent(x_pct), Dimension::percent(22.0),
305            Dimension::percent(22.0), Dimension::percent(30.0),
306        ).with_fill(ShapeFill::new(kpi_colors[i])).with_text(kpi_labels[i]);
307        dashboard = dashboard.add_shape(card);
308    }
309
310    // Bottom chart placeholder
311    let chart_area = Shape::from_dimensions(ShapeType::Rectangle,
312        Dimension::percent(3.0), Dimension::percent(58.0),
313        Dimension::percent(94.0), Dimension::percent(35.0),
314    ).with_fill(ShapeFill::new("ECEFF1"))
315     .with_line(ShapeLine::new("B0BEC5", 12700))
316     .with_text("Chart Area (94% x 35%)");
317    dashboard = dashboard.add_shape(chart_area);
318
319    slides.push(dashboard);
320
321    // =========================================================================
322    // SLIDE 9: Unit Equivalence Reference
323    // =========================================================================
324    println!("📖 Slide 9: Unit Equivalence Reference");
325
326    slides.push(
327        SlideContent::new("Dimension Unit Reference")
328            .layout(SlideLayout::TitleAndContent)
329            .title_color("1F497D").title_bold(true)
330            .add_bullet(&format!("1 inch = {} EMU = Dimension::Inches(1.0)", 914400))
331            .add_bullet(&format!("1 cm   = {} EMU = Dimension::Cm(1.0)", 360000))
332            .add_bullet(&format!("1 pt   = {} EMU = Dimension::Pt(1.0)", 12700))
333            .add_bullet(&format!("Slide width  = {} EMU = 10 inches", SLIDE_WIDTH_EMU))
334            .add_bullet(&format!("Slide height = {} EMU = 7.5 inches", SLIDE_HEIGHT_EMU))
335            .add_bullet("Ratio(0.1) on X = 10% of slide width = 1 inch")
336            .add_bullet("Ratio(0.5) on Y = 50% of slide height = 3.75 inches")
337            .add_bullet("percent(50.0) = Ratio(0.5)")
338            .content_size(22)
339    );
340
341    // =========================================================================
342    // Generate PPTX
343    // =========================================================================
344    fs::create_dir_all("examples/output")?;
345    let num_slides = slides.len();
346    let pptx_data = create_pptx_with_content("Dimension API Demo", slides)?;
347    fs::write("examples/output/dimension_demo.pptx", &pptx_data)?;
348
349    println!("\n╔══════════════════════════════════════════════════════════════╗");
350    println!("║                 Dimension API Demo Complete                   ║");
351    println!("╠══════════════════════════════════════════════════════════════╣");
352    println!("║  Output: examples/output/dimension_demo.pptx                 ║");
353    println!("║  Slides: {}                                                   ║", num_slides);
354    println!("║  Size:   {} KB                                               ║", pptx_data.len() / 1024);
355    println!("╠══════════════════════════════════════════════════════════════╣");
356    println!("║  Showcased:                                                  ║");
357    println!("║    ✓ All 6 unit types: EMU, Inches, Cm, Pt, Ratio, Percent   ║");
358    println!("║    ✓ Shape::from_dimensions() constructor                    ║");
359    println!("║    ✓ Fluent .at() and .with_dimensions() chaining            ║");
360    println!("║    ✓ Mixed-unit positioning                                  ║");
361    println!("║    ✓ Prelude helpers: dim(), rect_ratio(), text_box_ratio()  ║");
362    println!("║    ✓ FlexPosition & FlexSize structs                         ║");
363    println!("║    ✓ Ratio-based grid layout (auto-adapts)                   ║");
364    println!("║    ✓ Real-world KPI dashboard                                ║");
365    println!("╚══════════════════════════════════════════════════════════════╝");
366
367    Ok(())
368}
examples/comprehensive_demo.rs (line 238)
69fn main() -> Result<(), Box<dyn std::error::Error>> {
70    println!("╔══════════════════════════════════════════════════════════════╗");
71    println!("║       PPTX-RS Element Showcase - Complete Coverage           ║");
72    println!("╚══════════════════════════════════════════════════════════════╝\n");
73
74    let mut slides = Vec::new();
75
76    // =========================================================================
77    // SLIDE 1: CenteredTitle Layout + Title Formatting
78    // =========================================================================
79    println!("📐 Slide 1: CenteredTitle Layout + Title Formatting");
80    slides.push(
81        SlideContent::new("PPTX-RS Element Showcase")
82            .layout(SlideLayout::CenteredTitle)
83            .title_size(54)
84            .title_bold(true)
85            .title_color("1F497D")
86    );
87
88    // =========================================================================
89    // SLIDE 2: TitleOnly Layout
90    // =========================================================================
91    println!("📐 Slide 2: TitleOnly Layout");
92    slides.push(
93        SlideContent::new("Section: Slide Layouts")
94            .layout(SlideLayout::TitleOnly)
95            .title_size(48)
96            .title_bold(true)
97            .title_color("C0504D")
98    );
99
100    // =========================================================================
101    // SLIDE 3: TitleAndContent Layout + All Text Formatting
102    // =========================================================================
103    println!("📝 Slide 3: TitleAndContent + Text Formatting");
104    slides.push(
105        SlideContent::new("Text Formatting Options")
106            .layout(SlideLayout::TitleAndContent)
107            .title_color("1F497D")
108            .title_bold(true)
109            .title_italic(true)
110            .title_underline(true)
111            .title_size(44)
112            .add_bullet("Normal text (default)")
113            .add_bullet("Bold content text")
114            .add_bullet("Italic content text")
115            .add_bullet("Underlined content")
116            .add_bullet("Custom font size (28pt)")
117            .add_bullet("Custom color (#4F81BD)")
118            .content_bold(true)
119            .content_italic(true)
120            .content_underline(true)
121            .content_size(28)
122            .content_color("4F81BD")
123    );
124
125    // =========================================================================
126    // SLIDE 4: TitleAndBigContent Layout
127    // =========================================================================
128    println!("📐 Slide 4: TitleAndBigContent Layout");
129    slides.push(
130        SlideContent::new("Key Highlights")
131            .layout(SlideLayout::TitleAndBigContent)
132            .title_color("1F497D")
133            .add_bullet("Large content area for emphasis")
134            .add_bullet("Perfect for key messages")
135            .add_bullet("Smaller title, bigger content")
136            .content_bold(true)
137            .content_size(32)
138    );
139
140    // =========================================================================
141    // SLIDE 5: TwoColumn Layout
142    // =========================================================================
143    println!("📐 Slide 5: TwoColumn Layout");
144    slides.push(
145        SlideContent::new("Two Column Comparison")
146            .layout(SlideLayout::TwoColumn)
147            .title_color("1F497D")
148            .add_bullet("Left Column Item 1")
149            .add_bullet("Left Column Item 2")
150            .add_bullet("Left Column Item 3")
151            .add_bullet("Right Column Item 1")
152            .add_bullet("Right Column Item 2")
153            .add_bullet("Right Column Item 3")
154            .content_size(24)
155    );
156
157    // =========================================================================
158    // SLIDE 6: Blank Layout
159    // =========================================================================
160    println!("📐 Slide 6: Blank Layout");
161    slides.push(
162        SlideContent::new("")
163            .layout(SlideLayout::Blank)
164    );
165
166    // =========================================================================
167    // SLIDE 7: Table with All Cell Styling Options
168    // =========================================================================
169    println!("📊 Slide 7: Table with Cell Styling");
170    let styled_table = TableBuilder::new(vec![1500000, 1500000, 1500000])
171        .add_row(TableRow::new(vec![
172            TableCell::new("Header 1").bold().background_color("1F497D"),
173            TableCell::new("Header 2").bold().background_color("4F81BD"),
174            TableCell::new("Header 3").bold().background_color("8064A2"),
175        ]))
176        .add_row(TableRow::new(vec![
177            TableCell::new("Bold Cell").bold(),
178            TableCell::new("Normal Cell"),
179            TableCell::new("Colored").background_color("9BBB59"),
180        ]))
181        .add_row(TableRow::new(vec![
182            TableCell::new("Red BG").background_color("C0504D"),
183            TableCell::new("Green BG").background_color("9BBB59"),
184            TableCell::new("Blue BG").background_color("4F81BD"),
185        ]))
186        .add_row(TableRow::new(vec![
187            TableCell::new("Row 3 Col 1"),
188            TableCell::new("Row 3 Col 2"),
189            TableCell::new("Row 3 Col 3").bold().background_color("F79646"),
190        ]))
191        .position(500000, 1800000)
192        .build();
193    
194    slides.push(
195        SlideContent::new("Table with Cell Styling")
196            .table(styled_table)
197            .title_color("1F497D")
198    );
199
200    // =========================================================================
201    // SLIDE 8: Charts (Bar, Line, Pie)
202    // =========================================================================
203    println!("📈 Slide 8: Chart Types");
204    
205    // Create chart data structures (for demonstration)
206    let _bar_chart = ChartBuilder::new("Sales by Region", ChartType::Bar)
207        .categories(vec!["North", "South", "East", "West"])
208        .add_series(ChartSeries::new("2023", vec![100.0, 80.0, 120.0, 90.0]))
209        .add_series(ChartSeries::new("2024", vec![120.0, 95.0, 140.0, 110.0]))
210        .build();
211    
212    let _line_chart = ChartBuilder::new("Monthly Trend", ChartType::Line)
213        .categories(vec!["Jan", "Feb", "Mar", "Apr", "May", "Jun"])
214        .add_series(ChartSeries::new("Revenue", vec![10.0, 12.0, 15.0, 14.0, 18.0, 22.0]))
215        .build();
216    
217    let _pie_chart = ChartBuilder::new("Market Share", ChartType::Pie)
218        .categories(vec!["Product A", "Product B", "Product C", "Others"])
219        .add_series(ChartSeries::new("Share", vec![40.0, 30.0, 20.0, 10.0]))
220        .build();
221    
222    slides.push(
223        SlideContent::new("Chart Types: Bar, Line, Pie")
224            .with_chart()
225            .title_color("1F497D")
226            .add_bullet("Bar Chart: Compare categories")
227            .add_bullet("Line Chart: Show trends over time")
228            .add_bullet("Pie Chart: Show proportions")
229            .content_size(24)
230    );
231
232    // =========================================================================
233    // SLIDE 9: Shapes with Different Fills
234    // =========================================================================
235    println!("🔷 Slide 9: Shapes with Fills");
236    
237    let rect = Shape::new(ShapeType::Rectangle, 500000, 1600000, 2000000, 1000000)
238        .with_fill(ShapeFill::new("4F81BD"))
239        .with_text("Rectangle");
240    
241    let ellipse = Shape::new(ShapeType::Ellipse, 3000000, 1600000, 2000000, 1000000)
242        .with_fill(ShapeFill::new("9BBB59"))
243        .with_text("Ellipse");
244    
245    let rounded = Shape::new(ShapeType::RoundedRectangle, 5500000, 1600000, 2000000, 1000000)
246        .with_fill(ShapeFill::new("C0504D"))
247        .with_text("Rounded");
248    
249    let triangle = Shape::new(ShapeType::Triangle, 1500000, 3000000, 1500000, 1200000)
250        .with_fill(ShapeFill::new("8064A2"))
251        .with_text("Triangle");
252    
253    let diamond = Shape::new(ShapeType::Diamond, 4000000, 3000000, 1500000, 1200000)
254        .with_fill(ShapeFill::new("F79646"))
255        .with_text("Diamond");
256    
257    slides.push(
258        SlideContent::new("Shape Types with Color Fills")
259            .add_shape(rect)
260            .add_shape(ellipse)
261            .add_shape(rounded)
262            .add_shape(triangle)
263            .add_shape(diamond)
264            .title_color("1F497D")
265    );
266
267    // =========================================================================
268    // SLIDE 10: Gradient Fills (NEW)
269    // =========================================================================
270    println!("🌈 Slide 10: Gradient Fills");
271    
272    // Horizontal gradient
273    let gradient_h = Shape::new(ShapeType::Rectangle, 500000, 1600000, 2500000, 1200000)
274        .with_gradient(GradientFill::linear("1565C0", "42A5F5", GradientDirection::Horizontal))
275        .with_text("Horizontal");
276    
277    // Vertical gradient
278    let gradient_v = Shape::new(ShapeType::Rectangle, 3200000, 1600000, 2500000, 1200000)
279        .with_gradient(GradientFill::linear("2E7D32", "81C784", GradientDirection::Vertical))
280        .with_text("Vertical");
281    
282    // Diagonal gradient
283    let gradient_d = Shape::new(ShapeType::RoundedRectangle, 5900000, 1600000, 2500000, 1200000)
284        .with_gradient(GradientFill::linear("C62828", "EF9A9A", GradientDirection::DiagonalDown))
285        .with_text("Diagonal");
286    
287    // Three-color gradient
288    let gradient_3 = Shape::new(ShapeType::Ellipse, 1800000, 3200000, 2500000, 1200000)
289        .with_gradient(GradientFill::three_color("FF6F00", "FFC107", "FFEB3B", GradientDirection::Horizontal))
290        .with_text("3-Color");
291    
292    // Custom angle gradient
293    let gradient_angle = Shape::new(ShapeType::RoundedRectangle, 4800000, 3200000, 2500000, 1200000)
294        .with_gradient(GradientFill::linear("7B1FA2", "E1BEE7", GradientDirection::Angle(135)))
295        .with_text("135° Angle");
296    
297    slides.push(
298        SlideContent::new("Gradient Fills - Multiple Directions")
299            .add_shape(gradient_h)
300            .add_shape(gradient_v)
301            .add_shape(gradient_d)
302            .add_shape(gradient_3)
303            .add_shape(gradient_angle)
304            .title_color("1F497D")
305    );
306
307    // =========================================================================
308    // SLIDE 11: Transparency (NEW)
309    // =========================================================================
310    println!("👻 Slide 11: Transparency Effects");
311    
312    // Base shape (fully opaque)
313    let base = Shape::new(ShapeType::Rectangle, 1000000, 1800000, 3000000, 2000000)
314        .with_fill(ShapeFill::new("1565C0"))
315        .with_text("Base (100%)");
316    
317    // 25% transparent overlay
318    let trans_25 = Shape::new(ShapeType::Rectangle, 2000000, 2200000, 2500000, 1500000)
319        .with_fill(ShapeFill::new("F44336").with_transparency(25))
320        .with_line(ShapeLine::new("B71C1C", 25400))
321        .with_text("25% Transparent");
322    
323    // 50% transparent overlay
324    let trans_50 = Shape::new(ShapeType::Ellipse, 4500000, 1800000, 2500000, 2000000)
325        .with_fill(ShapeFill::new("4CAF50").with_transparency(50))
326        .with_line(ShapeLine::new("1B5E20", 25400))
327        .with_text("50% Transparent");
328    
329    // 75% transparent overlay
330    let trans_75 = Shape::new(ShapeType::RoundedRectangle, 5500000, 2500000, 2500000, 1500000)
331        .with_fill(ShapeFill::new("FF9800").with_transparency(75))
332        .with_line(ShapeLine::new("E65100", 25400))
333        .with_text("75% Transparent");
334    
335    slides.push(
336        SlideContent::new("Transparency Effects - Overlapping Shapes")
337            .add_shape(base)
338            .add_shape(trans_25)
339            .add_shape(trans_50)
340            .add_shape(trans_75)
341            .title_color("1F497D")
342    );
343
344    // =========================================================================
345    // SLIDE 12: Styled Connectors (NEW)
346    // =========================================================================
347    println!("🔗 Slide 12: Styled Connectors");
348    
349    // Create shapes to connect
350    let box1 = Shape::new(ShapeType::RoundedRectangle, 500000, 1800000, 1800000, 800000)
351        .with_id(100)
352        .with_fill(ShapeFill::new("1565C0"))
353        .with_text("Start");
354    
355    let box2 = Shape::new(ShapeType::RoundedRectangle, 3500000, 1800000, 1800000, 800000)
356        .with_id(101)
357        .with_fill(ShapeFill::new("2E7D32"))
358        .with_text("Process");
359    
360    let box3 = Shape::new(ShapeType::RoundedRectangle, 6500000, 1800000, 1800000, 800000)
361        .with_id(102)
362        .with_fill(ShapeFill::new("C62828"))
363        .with_text("End");
364    
365    // Straight connector with arrow
366    let conn1 = Connector::straight(2300000, 2200000, 3500000, 2200000)
367        .with_line(ConnectorLine::new("1565C0", 25400))
368        .with_end_arrow(ArrowType::Triangle)
369        .with_arrow_size(ArrowSize::Large);
370    
371    // Elbow connector with stealth arrow
372    let conn2 = Connector::elbow(5300000, 2200000, 6500000, 2200000)
373        .with_line(ConnectorLine::new("2E7D32", 38100).with_dash(LineDash::Dash))
374        .with_end_arrow(ArrowType::Stealth)
375        .with_arrow_size(ArrowSize::Medium);
376    
377    // Curved connector examples
378    let box4 = Shape::new(ShapeType::Ellipse, 1000000, 3200000, 1500000, 800000)
379        .with_id(103)
380        .with_fill(ShapeFill::new("7B1FA2"))
381        .with_text("A");
382    
383    let box5 = Shape::new(ShapeType::Ellipse, 4000000, 3200000, 1500000, 800000)
384        .with_id(104)
385        .with_fill(ShapeFill::new("00838F"))
386        .with_text("B");
387    
388    let box6 = Shape::new(ShapeType::Ellipse, 7000000, 3200000, 1500000, 800000)
389        .with_id(105)
390        .with_fill(ShapeFill::new("EF6C00"))
391        .with_text("C");
392    
393    // Curved connector with diamond arrow
394    let conn3 = Connector::curved(2500000, 3600000, 4000000, 3600000)
395        .with_line(ConnectorLine::new("7B1FA2", 19050).with_dash(LineDash::DashDot))
396        .with_arrows(ArrowType::Oval, ArrowType::Diamond);
397    
398    // Dotted connector
399    let conn4 = Connector::straight(5500000, 3600000, 7000000, 3600000)
400        .with_line(ConnectorLine::new("00838F", 12700).with_dash(LineDash::Dot))
401        .with_end_arrow(ArrowType::Open);
402    
403    slides.push(
404        SlideContent::new("Styled Connectors - Types, Arrows, Dashes")
405            .add_shape(box1)
406            .add_shape(box2)
407            .add_shape(box3)
408            .add_shape(box4)
409            .add_shape(box5)
410            .add_shape(box6)
411            .add_connector(conn1)
412            .add_connector(conn2)
413            .add_connector(conn3)
414            .add_connector(conn4)
415            .title_color("1F497D")
416    );
417
418    // =========================================================================
419    // SLIDE 13: Images
420    // =========================================================================
421    println!("🖼️  Slide 13: Image Placeholders");
422    
423    let img1 = Image::new("logo.png", 2500000, 1800000, "png")
424        .position(500000, 1600000);
425    let img2 = Image::new("photo.jpg", 2500000, 1800000, "jpg")
426        .position(3500000, 1600000);
427    let img3 = Image::new("diagram.png", 2000000, 1800000, "png")
428        .position(6500000, 1600000);
429    
430    slides.push(
431        SlideContent::new("Image Placeholders")
432            .add_image(img1)
433            .add_image(img2)
434            .add_image(img3)
435            .title_color("1F497D")
436    );
437
438    // =========================================================================
439    // SLIDE 11: Advanced Table with Borders & Alignment (NEW)
440    // =========================================================================
441    println!("📊 Slide 11: Advanced Table (borders, alignment, merged cells)");
442    
443    // Build advanced table using generator's TableBuilder with alignment
444    let advanced_table = TableBuilder::new(vec![2000000, 2000000, 2000000, 2000000])
445        .add_row(TableRow::new(vec![
446            TableCell::new("Q1 2024 Financial Report").bold().background_color("1F4E79").text_color("FFFFFF").align_center().font_size(14),
447            TableCell::new("").background_color("1F4E79"),
448            TableCell::new("").background_color("1F4E79"),
449            TableCell::new("").background_color("1F4E79"),
450        ]))
451        .add_row(TableRow::new(vec![
452            TableCell::new("Category").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
453            TableCell::new("Revenue").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
454            TableCell::new("Expenses").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
455            TableCell::new("Profit").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
456        ]))
457        .add_row(TableRow::new(vec![
458            TableCell::new("Product Sales").text_color("000000").align_left(),
459            TableCell::new("$1,250,000").text_color("2E7D32").align_right(),
460            TableCell::new("$450,000").text_color("C62828").align_right(),
461            TableCell::new("$800,000").bold().text_color("2E7D32").align_right(),
462        ]))
463        .add_row(TableRow::new(vec![
464            TableCell::new("Services").text_color("000000").align_left(),
465            TableCell::new("$890,000").text_color("2E7D32").align_right(),
466            TableCell::new("$320,000").text_color("C62828").align_right(),
467            TableCell::new("$570,000").bold().text_color("2E7D32").align_right(),
468        ]))
469        .add_row(TableRow::new(vec![
470            TableCell::new("Total").bold().background_color("E7E6E6").text_color("000000").align_left(),
471            TableCell::new("$2,140,000").bold().background_color("E7E6E6").text_color("000000").align_right(),
472            TableCell::new("$770,000").bold().background_color("E7E6E6").text_color("000000").align_right(),
473            TableCell::new("$1,370,000").bold().background_color("C6EFCE").text_color("006100").align_right(),
474        ]))
475        .position(300000, 1600000)
476        .build();
477    
478    slides.push(
479        SlideContent::new("Financial Report - Advanced Table")
480            .table(advanced_table)
481            .title_color("1F4E79")
482            .title_bold(true)
483    );
484
485    // =========================================================================
486    // SLIDE 12: Comparison Matrix Table (NEW)
487    // =========================================================================
488    println!("📊 Slide 12: Comparison Matrix Table");
489    
490    let comparison_table = TableBuilder::new(vec![2000000, 1500000, 1500000, 1500000])
491        .add_row(TableRow::new(vec![
492            TableCell::new("Feature").bold().background_color("4472C4").text_color("FFFFFF"),
493            TableCell::new("Basic").bold().background_color("4472C4").text_color("FFFFFF"),
494            TableCell::new("Pro").bold().background_color("4472C4").text_color("FFFFFF"),
495            TableCell::new("Enterprise").bold().background_color("4472C4").text_color("FFFFFF"),
496        ]))
497        .add_row(TableRow::new(vec![
498            TableCell::new("Storage").text_color("000000"),
499            TableCell::new("5 GB").text_color("000000"),
500            TableCell::new("50 GB").text_color("000000"),
501            TableCell::new("Unlimited").bold().text_color("2E7D32"),
502        ]))
503        .add_row(TableRow::new(vec![
504            TableCell::new("Users").text_color("000000"),
505            TableCell::new("1").text_color("000000"),
506            TableCell::new("10").text_color("000000"),
507            TableCell::new("Unlimited").bold().text_color("2E7D32"),
508        ]))
509        .add_row(TableRow::new(vec![
510            TableCell::new("Support").text_color("000000"),
511            TableCell::new("Email").text_color("000000"),
512            TableCell::new("24/7 Chat").text_color("000000"),
513            TableCell::new("Dedicated").bold().text_color("2E7D32"),
514        ]))
515        .add_row(TableRow::new(vec![
516            TableCell::new("API Access").text_color("000000"),
517            TableCell::new("No").text_color("C62828"),
518            TableCell::new("Yes").text_color("2E7D32"),
519            TableCell::new("Yes + Priority").bold().text_color("2E7D32"),
520        ]))
521        .add_row(TableRow::new(vec![
522            TableCell::new("Price/month").bold().background_color("F2F2F2").text_color("000000"),
523            TableCell::new("$9").bold().background_color("F2F2F2").text_color("000000"),
524            TableCell::new("$29").bold().background_color("F2F2F2").text_color("000000"),
525            TableCell::new("$99").bold().background_color("F2F2F2").text_color("000000"),
526        ]))
527        .position(500000, 1600000)
528        .build();
529    
530    slides.push(
531        SlideContent::new("Pricing Comparison Matrix")
532            .table(comparison_table)
533            .title_color("4472C4")
534            .title_bold(true)
535    );
536
537    // =========================================================================
538    // SLIDE 13: Process Flow with Shapes (NEW - SmartArt-like)
539    // =========================================================================
540    println!("🔷 Slide 13: Process Flow (SmartArt-style)");
541    
542    // Create process flow using shapes
543    let step1 = Shape::new(ShapeType::RoundedRectangle, 300000, 2000000, 1400000, 800000)
544        .with_fill(ShapeFill::new("4472C4"))
545        .with_text("1. Research");
546    let arrow1 = Shape::new(ShapeType::RightArrow, 1800000, 2200000, 400000, 400000)
547        .with_fill(ShapeFill::new("A5A5A5"));
548    let step2 = Shape::new(ShapeType::RoundedRectangle, 2300000, 2000000, 1400000, 800000)
549        .with_fill(ShapeFill::new("ED7D31"))
550        .with_text("2. Design");
551    let arrow2 = Shape::new(ShapeType::RightArrow, 3800000, 2200000, 400000, 400000)
552        .with_fill(ShapeFill::new("A5A5A5"));
553    let step3 = Shape::new(ShapeType::RoundedRectangle, 4300000, 2000000, 1400000, 800000)
554        .with_fill(ShapeFill::new("70AD47"))
555        .with_text("3. Develop");
556    let arrow3 = Shape::new(ShapeType::RightArrow, 5800000, 2200000, 400000, 400000)
557        .with_fill(ShapeFill::new("A5A5A5"));
558    let step4 = Shape::new(ShapeType::RoundedRectangle, 6300000, 2000000, 1400000, 800000)
559        .with_fill(ShapeFill::new("5B9BD5"))
560        .with_text("4. Deploy");
561    
562    slides.push(
563        SlideContent::new("Development Process Flow")
564            .add_shape(step1)
565            .add_shape(arrow1)
566            .add_shape(step2)
567            .add_shape(arrow2)
568            .add_shape(step3)
569            .add_shape(arrow3)
570            .add_shape(step4)
571            .title_color("1F497D")
572            .title_bold(true)
573    );
574
575    // =========================================================================
576    // SLIDE 14: Organization Chart with Shapes (NEW)
577    // =========================================================================
578    println!("🔷 Slide 14: Organization Chart");
579    
580    // CEO at top
581    let ceo = Shape::new(ShapeType::RoundedRectangle, 3500000, 1400000, 2000000, 600000)
582        .with_fill(ShapeFill::new("1F4E79"))
583        .with_text("CEO");
584    
585    // Vertical line from CEO
586    let line1 = Shape::new(ShapeType::Rectangle, 4450000, 2000000, 100000, 400000)
587        .with_fill(ShapeFill::new("A5A5A5"));
588    
589    // Horizontal connector
590    let hline = Shape::new(ShapeType::Rectangle, 1950000, 2400000, 5100000, 50000)
591        .with_fill(ShapeFill::new("A5A5A5"));
592    
593    // CTO, CFO, COO
594    let cto = Shape::new(ShapeType::RoundedRectangle, 1000000, 2600000, 1800000, 500000)
595        .with_fill(ShapeFill::new("2E75B6"))
596        .with_text("CTO");
597    let cfo = Shape::new(ShapeType::RoundedRectangle, 3600000, 2600000, 1800000, 500000)
598        .with_fill(ShapeFill::new("2E75B6"))
599        .with_text("CFO");
600    let coo = Shape::new(ShapeType::RoundedRectangle, 6200000, 2600000, 1800000, 500000)
601        .with_fill(ShapeFill::new("2E75B6"))
602        .with_text("COO");
603    
604    // Vertical lines to departments
605    let vline1 = Shape::new(ShapeType::Rectangle, 1850000, 2450000, 50000, 150000)
606        .with_fill(ShapeFill::new("A5A5A5"));
607    let vline2 = Shape::new(ShapeType::Rectangle, 4450000, 2450000, 50000, 150000)
608        .with_fill(ShapeFill::new("A5A5A5"));
609    let vline3 = Shape::new(ShapeType::Rectangle, 7050000, 2450000, 50000, 150000)
610        .with_fill(ShapeFill::new("A5A5A5"));
611    
612    // Teams under CTO
613    let eng = Shape::new(ShapeType::Rectangle, 500000, 3300000, 1200000, 400000)
614        .with_fill(ShapeFill::new("BDD7EE"))
615        .with_text("Engineering");
616    let product = Shape::new(ShapeType::Rectangle, 1800000, 3300000, 1200000, 400000)
617        .with_fill(ShapeFill::new("BDD7EE"))
618        .with_text("Product");
619    
620    slides.push(
621        SlideContent::new("Organization Structure")
622            .add_shape(ceo)
623            .add_shape(line1)
624            .add_shape(hline)
625            .add_shape(cto)
626            .add_shape(cfo)
627            .add_shape(coo)
628            .add_shape(vline1)
629            .add_shape(vline2)
630            .add_shape(vline3)
631            .add_shape(eng)
632            .add_shape(product)
633            .title_color("1F4E79")
634            .title_bold(true)
635    );
636
637    // =========================================================================
638    // SLIDE 15: PDCA Cycle Diagram (NEW)
639    // =========================================================================
640    println!("🔷 Slide 15: PDCA Cycle Diagram");
641    
642    // Four quadrants for PDCA
643    let plan = Shape::new(ShapeType::RoundedRectangle, 1500000, 1600000, 2500000, 1500000)
644        .with_fill(ShapeFill::new("4472C4"))
645        .with_text("PLAN\n\nDefine goals\nand strategy");
646    let do_box = Shape::new(ShapeType::RoundedRectangle, 4500000, 1600000, 2500000, 1500000)
647        .with_fill(ShapeFill::new("ED7D31"))
648        .with_text("DO\n\nImplement\nthe plan");
649    let check = Shape::new(ShapeType::RoundedRectangle, 4500000, 3300000, 2500000, 1500000)
650        .with_fill(ShapeFill::new("70AD47"))
651        .with_text("CHECK\n\nMeasure\nresults");
652    let act = Shape::new(ShapeType::RoundedRectangle, 1500000, 3300000, 2500000, 1500000)
653        .with_fill(ShapeFill::new("FFC000"))
654        .with_text("ACT\n\nAdjust and\nimprove");
655    
656    // Arrows between quadrants
657    let arr1 = Shape::new(ShapeType::RightArrow, 4100000, 2100000, 300000, 300000)
658        .with_fill(ShapeFill::new("A5A5A5"));
659    let arr2 = Shape::new(ShapeType::DownArrow, 5600000, 3200000, 300000, 200000)
660        .with_fill(ShapeFill::new("A5A5A5"));
661    let arr3 = Shape::new(ShapeType::LeftArrow, 4100000, 3800000, 300000, 300000)
662        .with_fill(ShapeFill::new("A5A5A5"));
663    let arr4 = Shape::new(ShapeType::UpArrow, 2600000, 3200000, 300000, 200000)
664        .with_fill(ShapeFill::new("A5A5A5"));
665    
666    slides.push(
667        SlideContent::new("PDCA Continuous Improvement Cycle")
668            .add_shape(plan)
669            .add_shape(do_box)
670            .add_shape(check)
671            .add_shape(act)
672            .add_shape(arr1)
673            .add_shape(arr2)
674            .add_shape(arr3)
675            .add_shape(arr4)
676            .title_color("1F497D")
677            .title_bold(true)
678    );
679
680    // =========================================================================
681    // SLIDE 16: Pyramid Diagram (Maslow's Hierarchy) (NEW)
682    // =========================================================================
683    println!("🔷 Slide 16: Pyramid Diagram");
684    
685    // Build pyramid from bottom to top
686    let level5 = Shape::new(ShapeType::Trapezoid, 500000, 4000000, 8000000, 600000)
687        .with_fill(ShapeFill::new("C00000"))
688        .with_text("Physiological Needs - Food, Water, Shelter");
689    let level4 = Shape::new(ShapeType::Trapezoid, 1000000, 3400000, 7000000, 600000)
690        .with_fill(ShapeFill::new("ED7D31"))
691        .with_text("Safety Needs - Security, Stability");
692    let level3 = Shape::new(ShapeType::Trapezoid, 1500000, 2800000, 6000000, 600000)
693        .with_fill(ShapeFill::new("FFC000"))
694        .with_text("Love & Belonging - Relationships");
695    let level2 = Shape::new(ShapeType::Trapezoid, 2000000, 2200000, 5000000, 600000)
696        .with_fill(ShapeFill::new("70AD47"))
697        .with_text("Esteem - Achievement, Respect");
698    let level1 = Shape::new(ShapeType::Triangle, 2500000, 1500000, 4000000, 700000)
699        .with_fill(ShapeFill::new("4472C4"))
700        .with_text("Self-Actualization");
701    
702    slides.push(
703        SlideContent::new("Maslow's Hierarchy of Needs")
704            .add_shape(level5)
705            .add_shape(level4)
706            .add_shape(level3)
707            .add_shape(level2)
708            .add_shape(level1)
709            .title_color("1F497D")
710            .title_bold(true)
711    );
712
713    // =========================================================================
714    // SLIDE 17: Venn Diagram (NEW)
715    // =========================================================================
716    println!("🔷 Slide 17: Venn Diagram");
717    
718    // Three overlapping circles
719    let circle1 = Shape::new(ShapeType::Ellipse, 1500000, 1800000, 3000000, 3000000)
720        .with_fill(ShapeFill::new("4472C4"))
721        .with_text("Skills");
722    let circle2 = Shape::new(ShapeType::Ellipse, 3500000, 1800000, 3000000, 3000000)
723        .with_fill(ShapeFill::new("ED7D31"))
724        .with_text("Passion");
725    let circle3 = Shape::new(ShapeType::Ellipse, 2500000, 3200000, 3000000, 3000000)
726        .with_fill(ShapeFill::new("70AD47"))
727        .with_text("Market Need");
728    
729    // Center label
730    let center = Shape::new(ShapeType::Ellipse, 3200000, 2800000, 1600000, 800000)
731        .with_fill(ShapeFill::new("FFFFFF"))
732        .with_text("IKIGAI");
733    
734    slides.push(
735        SlideContent::new("Finding Your Ikigai - Venn Diagram")
736            .add_shape(circle1)
737            .add_shape(circle2)
738            .add_shape(circle3)
739            .add_shape(center)
740            .title_color("1F497D")
741            .title_bold(true)
742    );
743
744    // =========================================================================
745    // SLIDE 18: Timeline/Roadmap (NEW)
746    // =========================================================================
747    println!("📊 Slide 18: Project Timeline");
748    
749    let timeline_table = TableBuilder::new(vec![1500000, 1500000, 1500000, 1500000, 1500000])
750        .add_row(TableRow::new(vec![
751            TableCell::new("Q1 2024").bold().background_color("4472C4").text_color("FFFFFF"),
752            TableCell::new("Q2 2024").bold().background_color("4472C4").text_color("FFFFFF"),
753            TableCell::new("Q3 2024").bold().background_color("4472C4").text_color("FFFFFF"),
754            TableCell::new("Q4 2024").bold().background_color("4472C4").text_color("FFFFFF"),
755            TableCell::new("Q1 2025").bold().background_color("4472C4").text_color("FFFFFF"),
756        ]))
757        .add_row(TableRow::new(vec![
758            TableCell::new("Research\n& Planning").background_color("BDD7EE").text_color("1F497D"),
759            TableCell::new("Design\nPhase").background_color("BDD7EE").text_color("1F497D"),
760            TableCell::new("Development\nSprint 1-3").background_color("C6EFCE").text_color("006100"),
761            TableCell::new("Testing\n& QA").background_color("FCE4D6").text_color("C65911"),
762            TableCell::new("Launch\n& Support").background_color("E2EFDA").text_color("375623"),
763        ]))
764        .add_row(TableRow::new(vec![
765            TableCell::new("✓ Complete").bold().text_color("2E7D32"),
766            TableCell::new("✓ Complete").bold().text_color("2E7D32"),
767            TableCell::new("In Progress").text_color("ED7D31"),
768            TableCell::new("Planned").text_color("7F7F7F"),
769            TableCell::new("Planned").text_color("7F7F7F"),
770        ]))
771        .position(300000, 2000000)
772        .build();
773    
774    slides.push(
775        SlideContent::new("Project Roadmap 2024-2025")
776            .table(timeline_table)
777            .title_color("1F497D")
778            .title_bold(true)
779    );
780
781    // =========================================================================
782    // SLIDE 19: Dashboard Summary (NEW - using Dimension API)
783    // =========================================================================
784    println!("🔷 Slide 19: Dashboard with KPIs (Dimension API)");
785    
786    // KPI boxes using ratio-based positioning — automatically adapts to any slide size
787    let kpi1 = Shape::from_dimensions(ShapeType::RoundedRectangle,
788        Dimension::percent(3.0), Dimension::percent(23.0),
789        Dimension::percent(22.0), Dimension::percent(18.0),
790    ).with_fill(ShapeFill::new("4472C4")).with_text("Revenue\n\n$2.14M\n+15% YoY");
791
792    let kpi2 = Shape::from_dimensions(ShapeType::RoundedRectangle,
793        Dimension::percent(27.0), Dimension::percent(23.0),
794        Dimension::percent(22.0), Dimension::percent(18.0),
795    ).with_fill(ShapeFill::new("70AD47")).with_text("Customers\n\n12,450\n+22% YoY");
796
797    let kpi3 = Shape::from_dimensions(ShapeType::RoundedRectangle,
798        Dimension::percent(51.0), Dimension::percent(23.0),
799        Dimension::percent(22.0), Dimension::percent(18.0),
800    ).with_fill(ShapeFill::new("ED7D31")).with_text("NPS Score\n\n72\n+8 pts");
801
802    let kpi4 = Shape::from_dimensions(ShapeType::RoundedRectangle,
803        Dimension::percent(75.0), Dimension::percent(23.0),
804        Dimension::percent(22.0), Dimension::percent(18.0),
805    ).with_fill(ShapeFill::new("5B9BD5")).with_text("Retention\n\n94%\n+3% YoY");
806    
807    // Status indicators using mixed units: percent for X, inches for size
808    let status1 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
809        .at(Dimension::percent(14.0), Dimension::percent(42.0))
810        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
811        .with_fill(ShapeFill::new("70AD47"));
812    let status2 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
813        .at(Dimension::percent(38.0), Dimension::percent(42.0))
814        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
815        .with_fill(ShapeFill::new("70AD47"));
816    let status3 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
817        .at(Dimension::percent(62.0), Dimension::percent(42.0))
818        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
819        .with_fill(ShapeFill::new("FFC000"));
820    let status4 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
821        .at(Dimension::percent(86.0), Dimension::percent(42.0))
822        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
823        .with_fill(ShapeFill::new("70AD47"));
824    
825    slides.push(
826        SlideContent::new("Executive Dashboard - Q1 2024")
827            .add_shape(kpi1)
828            .add_shape(kpi2)
829            .add_shape(kpi3)
830            .add_shape(kpi4)
831            .add_shape(status1)
832            .add_shape(status2)
833            .add_shape(status3)
834            .add_shape(status4)
835            .title_color("1F497D")
836            .title_bold(true)
837    );
838
839    // =========================================================================
840    // SLIDE 20: Summary Slide (NEW)
841    // =========================================================================
842    println!("📝 Slide 20: Summary with Speaker Notes");
843    
844    slides.push(
845        SlideContent::new("Summary & Next Steps")
846            .layout(SlideLayout::TitleAndContent)
847            .title_color("1F497D")
848            .title_bold(true)
849            .add_bullet("Completed: Research, Design, Initial Development")
850            .add_bullet("In Progress: Sprint 3 Development")
851            .add_bullet("Next: QA Testing Phase (Q4 2024)")
852            .add_bullet("Launch Target: Q1 2025")
853            .add_bullet("Key Risks: Resource constraints, Timeline pressure")
854            .content_size(24)
855            .notes("Speaker Notes:\n\n1. Emphasize the progress made\n2. Highlight key achievements\n3. Address any concerns about timeline\n4. Open for Q&A")
856    );
857
858    // =========================================================================
859    // SLIDE 21: Bullet Styles (NEW v0.2.1)
860    // =========================================================================
861    println!("🔢 Slide 21: Bullet Styles (NEW)");
862    
863    // Numbered list
864    slides.push(
865        SlideContent::new("Bullet Styles - Numbered List")
866            .layout(SlideLayout::TitleAndContent)
867            .title_color("1F497D")
868            .title_bold(true)
869            .with_bullet_style(BulletStyle::Number)
870            .add_bullet("First numbered item")
871            .add_bullet("Second numbered item")
872            .add_bullet("Third numbered item")
873            .add_bullet("Fourth numbered item")
874            .content_size(28)
875    );
876
877    // =========================================================================
878    // SLIDE 22: Lettered Lists (NEW v0.2.1)
879    // =========================================================================
880    println!("🔤 Slide 22: Lettered Lists (NEW)");
881    
882    slides.push(
883        SlideContent::new("Bullet Styles - Lettered Lists")
884            .layout(SlideLayout::TitleAndContent)
885            .title_color("1F497D")
886            .title_bold(true)
887            .add_lettered("Option A - First choice")
888            .add_lettered("Option B - Second choice")
889            .add_lettered("Option C - Third choice")
890            .add_lettered("Option D - Fourth choice")
891            .content_size(28)
892    );
893
894    // =========================================================================
895    // SLIDE 23: Roman Numerals (NEW v0.2.1)
896    // =========================================================================
897    println!("🏛️ Slide 23: Roman Numerals (NEW)");
898    
899    slides.push(
900        SlideContent::new("Bullet Styles - Roman Numerals")
901            .layout(SlideLayout::TitleAndContent)
902            .title_color("1F497D")
903            .title_bold(true)
904            .with_bullet_style(BulletStyle::RomanUpper)
905            .add_bullet("Chapter I - Introduction")
906            .add_bullet("Chapter II - Background")
907            .add_bullet("Chapter III - Methodology")
908            .add_bullet("Chapter IV - Results")
909            .add_bullet("Chapter V - Conclusion")
910            .content_size(28)
911    );
912
913    // =========================================================================
914    // SLIDE 24: Custom Bullets (NEW v0.2.1)
915    // =========================================================================
916    println!("⭐ Slide 24: Custom Bullets (NEW)");
917    
918    slides.push(
919        SlideContent::new("Bullet Styles - Custom Characters")
920            .layout(SlideLayout::TitleAndContent)
921            .title_color("1F497D")
922            .title_bold(true)
923            .add_styled_bullet("Star bullet point", BulletStyle::Custom('★'))
924            .add_styled_bullet("Arrow bullet point", BulletStyle::Custom('→'))
925            .add_styled_bullet("Check bullet point", BulletStyle::Custom('✓'))
926            .add_styled_bullet("Diamond bullet point", BulletStyle::Custom('◆'))
927            .add_styled_bullet("Heart bullet point", BulletStyle::Custom('♥'))
928            .content_size(28)
929    );
930
931    // =========================================================================
932    // SLIDE 25: Sub-bullets / Hierarchy (NEW v0.2.1)
933    // =========================================================================
934    println!("📊 Slide 25: Sub-bullets Hierarchy (NEW)");
935    
936    slides.push(
937        SlideContent::new("Bullet Styles - Hierarchical Lists")
938            .layout(SlideLayout::TitleAndContent)
939            .title_color("1F497D")
940            .title_bold(true)
941            .add_bullet("Main Topic 1")
942            .add_sub_bullet("Supporting detail A")
943            .add_sub_bullet("Supporting detail B")
944            .add_bullet("Main Topic 2")
945            .add_sub_bullet("Supporting detail C")
946            .add_sub_bullet("Supporting detail D")
947            .add_bullet("Main Topic 3")
948            .content_size(24)
949    );
950
951    // =========================================================================
952    // SLIDE 26: Text Enhancements (NEW v0.2.1)
953    // =========================================================================
954    println!("✏️ Slide 26: Text Enhancements (NEW)");
955    
956    // Use BulletPoint with formatting
957    let strikethrough_bullet = BulletPoint::new("Strikethrough: This text is crossed out").strikethrough();
958    let highlight_bullet = BulletPoint::new("Highlight: Yellow background for emphasis").highlight("FFFF00");
959    let subscript_bullet = BulletPoint::new("Subscript: H₂O - for chemical formulas").subscript();
960    let superscript_bullet = BulletPoint::new("Superscript: x² - for math expressions").superscript();
961    let bold_colored = BulletPoint::new("Combined: Bold + Red color").bold().color("FF0000");
962    
963    let mut text_enhancements_slide = SlideContent::new("Text Enhancements - New Formatting")
964        .layout(SlideLayout::TitleAndContent)
965        .title_color("1F497D")
966        .title_bold(true)
967        .content_size(24);
968    text_enhancements_slide.bullets.push(strikethrough_bullet);
969    text_enhancements_slide.bullets.push(highlight_bullet);
970    text_enhancements_slide.bullets.push(subscript_bullet);
971    text_enhancements_slide.bullets.push(superscript_bullet);
972    text_enhancements_slide.bullets.push(bold_colored);
973    
974    slides.push(text_enhancements_slide);
975
976    // =========================================================================
977    // SLIDE 27: Font Size Presets (NEW v0.2.1)
978    // =========================================================================
979    println!("🔤 Slide 27: Font Size Presets (NEW)");
980    
981    // Demonstrate different font sizes per bullet
982    let large_bullet = BulletPoint::new(&format!("LARGE: {}pt - Extra large text", font_sizes::LARGE)).font_size(font_sizes::LARGE);
983    let heading_bullet = BulletPoint::new(&format!("HEADING: {}pt - Section headers", font_sizes::HEADING)).font_size(font_sizes::HEADING);
984    let body_bullet = BulletPoint::new(&format!("BODY: {}pt - Regular content", font_sizes::BODY)).font_size(font_sizes::BODY);
985    let small_bullet = BulletPoint::new(&format!("SMALL: {}pt - Smaller text", font_sizes::SMALL)).font_size(font_sizes::SMALL);
986    let caption_bullet = BulletPoint::new(&format!("CAPTION: {}pt - Captions and notes", font_sizes::CAPTION)).font_size(font_sizes::CAPTION);
987    
988    let mut font_size_slide = SlideContent::new("Font Size Presets - Each line different size")
989        .layout(SlideLayout::TitleAndContent)
990        .title_color("1F497D")
991        .title_bold(true)
992        .title_size(font_sizes::TITLE);
993    font_size_slide.bullets.push(large_bullet);
994    font_size_slide.bullets.push(heading_bullet);
995    font_size_slide.bullets.push(body_bullet);
996    font_size_slide.bullets.push(small_bullet);
997    font_size_slide.bullets.push(caption_bullet);
998    
999    slides.push(font_size_slide);
1000
1001    // =========================================================================
1002    // SLIDE 28: Theme Colors (NEW v0.2.1)
1003    // =========================================================================
1004    println!("🎨 Slide 28: Theme Colors (NEW)");
1005    
1006    // Create shapes with theme colors
1007    let corporate_shape = Shape::new(ShapeType::Rectangle, 500000, 1600000, 1800000, 800000)
1008        .with_fill(ShapeFill::new(themes::CORPORATE.primary))
1009        .with_text("Corporate");
1010    
1011    let modern_shape = Shape::new(ShapeType::Rectangle, 2500000, 1600000, 1800000, 800000)
1012        .with_fill(ShapeFill::new(themes::MODERN.primary))
1013        .with_text("Modern");
1014    
1015    let vibrant_shape = Shape::new(ShapeType::Rectangle, 4500000, 1600000, 1800000, 800000)
1016        .with_fill(ShapeFill::new(themes::VIBRANT.primary))
1017        .with_text("Vibrant");
1018    
1019    let dark_shape = Shape::new(ShapeType::Rectangle, 6500000, 1600000, 1800000, 800000)
1020        .with_fill(ShapeFill::new(themes::DARK.primary))
1021        .with_text("Dark");
1022    
1023    let nature_shape = Shape::new(ShapeType::Rectangle, 500000, 2700000, 1800000, 800000)
1024        .with_fill(ShapeFill::new(themes::NATURE.primary))
1025        .with_text("Nature");
1026    
1027    let tech_shape = Shape::new(ShapeType::Rectangle, 2500000, 2700000, 1800000, 800000)
1028        .with_fill(ShapeFill::new(themes::TECH.primary))
1029        .with_text("Tech");
1030    
1031    let carbon_shape = Shape::new(ShapeType::Rectangle, 4500000, 2700000, 1800000, 800000)
1032        .with_fill(ShapeFill::new(themes::CARBON.primary))
1033        .with_text("Carbon");
1034    
1035    slides.push(
1036        SlideContent::new("Theme Color Palettes")
1037            .layout(SlideLayout::TitleAndContent)
1038            .title_color("1F497D")
1039            .title_bold(true)
1040            .add_shape(corporate_shape)
1041            .add_shape(modern_shape)
1042            .add_shape(vibrant_shape)
1043            .add_shape(dark_shape)
1044            .add_shape(nature_shape)
1045            .add_shape(tech_shape)
1046            .add_shape(carbon_shape)
1047    );
1048
1049    // =========================================================================
1050    // SLIDE 29: Material & Carbon Design Colors (NEW v0.2.1)
1051    // =========================================================================
1052    println!("🌈 Slide 29: Material & Carbon Colors (NEW)");
1053    
1054    // Material Design colors
1055    let material_red = Shape::new(ShapeType::Rectangle, 500000, 1600000, 1200000, 600000)
1056        .with_fill(ShapeFill::new(colors::MATERIAL_RED))
1057        .with_text("M-Red");
1058    
1059    let material_blue = Shape::new(ShapeType::Rectangle, 1900000, 1600000, 1200000, 600000)
1060        .with_fill(ShapeFill::new(colors::MATERIAL_BLUE))
1061        .with_text("M-Blue");
1062    
1063    let material_green = Shape::new(ShapeType::Rectangle, 3300000, 1600000, 1200000, 600000)
1064        .with_fill(ShapeFill::new(colors::MATERIAL_GREEN))
1065        .with_text("M-Green");
1066    
1067    let material_orange = Shape::new(ShapeType::Rectangle, 4700000, 1600000, 1200000, 600000)
1068        .with_fill(ShapeFill::new(colors::MATERIAL_ORANGE))
1069        .with_text("M-Orange");
1070    
1071    let material_purple = Shape::new(ShapeType::Rectangle, 6100000, 1600000, 1200000, 600000)
1072        .with_fill(ShapeFill::new(colors::MATERIAL_PURPLE))
1073        .with_text("M-Purple");
1074    
1075    // Carbon Design colors
1076    let carbon_blue = Shape::new(ShapeType::Rectangle, 500000, 2500000, 1200000, 600000)
1077        .with_fill(ShapeFill::new(colors::CARBON_BLUE_60))
1078        .with_text("C-Blue");
1079    
1080    let carbon_green = Shape::new(ShapeType::Rectangle, 1900000, 2500000, 1200000, 600000)
1081        .with_fill(ShapeFill::new(colors::CARBON_GREEN_50))
1082        .with_text("C-Green");
1083    
1084    let carbon_red = Shape::new(ShapeType::Rectangle, 3300000, 2500000, 1200000, 600000)
1085        .with_fill(ShapeFill::new(colors::CARBON_RED_60))
1086        .with_text("C-Red");
1087    
1088    let carbon_purple = Shape::new(ShapeType::Rectangle, 4700000, 2500000, 1200000, 600000)
1089        .with_fill(ShapeFill::new(colors::CARBON_PURPLE_60))
1090        .with_text("C-Purple");
1091    
1092    let carbon_gray = Shape::new(ShapeType::Rectangle, 6100000, 2500000, 1200000, 600000)
1093        .with_fill(ShapeFill::new(colors::CARBON_GRAY_100))
1094        .with_text("C-Gray");
1095    
1096    slides.push(
1097        SlideContent::new("Material & Carbon Design Colors")
1098            .layout(SlideLayout::TitleAndContent)
1099            .title_color("1F497D")
1100            .title_bold(true)
1101            .add_shape(material_red)
1102            .add_shape(material_blue)
1103            .add_shape(material_green)
1104            .add_shape(material_orange)
1105            .add_shape(material_purple)
1106            .add_shape(carbon_blue)
1107            .add_shape(carbon_green)
1108            .add_shape(carbon_red)
1109            .add_shape(carbon_purple)
1110            .add_shape(carbon_gray)
1111    );
1112
1113    // =========================================================================
1114    // SLIDE 30: Image from Base64 (NEW v0.2.1)
1115    // =========================================================================
1116    println!("🖼️ Slide 30: Image from Base64 (NEW)");
1117    
1118    // 1x1 red PNG pixel in base64
1119    let _red_pixel_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==";
1120    
1121    // Create image from base64 (demonstrating the API)
1122    let _base64_image = ImageBuilder::from_base64(_red_pixel_base64, 914400, 914400, "PNG")
1123        .position(4000000, 2500000)
1124        .build();
1125    
1126    slides.push(
1127        SlideContent::new("Image Loading - New Methods")
1128            .layout(SlideLayout::TitleAndContent)
1129            .title_color("1F497D")
1130            .title_bold(true)
1131            .add_bullet("Image::new(path) - Load from file path")
1132            .add_bullet("Image::from_base64(data) - Load from base64 string")
1133            .add_bullet("Image::from_bytes(data) - Load from raw bytes")
1134            .add_bullet("ImageBuilder for fluent API configuration")
1135            .add_bullet("Built-in base64 decoder (no external deps)")
1136            .content_size(24)
1137    );
1138
1139    // =========================================================================
1140    // SLIDE 31: Feature Summary (NEW v0.2.1)
1141    // =========================================================================
1142    println!("📋 Slide 31: v0.2.1 Feature Summary (NEW)");
1143    
1144    slides.push(
1145        SlideContent::new("New Features in v0.2.1")
1146            .layout(SlideLayout::TitleAndContent)
1147            .title_color("1F497D")
1148            .title_bold(true)
1149            .add_numbered("BulletStyle: Number, Letter, Roman, Custom")
1150            .add_numbered("TextFormat: Strikethrough, Highlight")
1151            .add_numbered("TextFormat: Subscript, Superscript")
1152            .add_numbered("Font size presets in prelude")
1153            .add_numbered("Image::from_base64 and from_bytes")
1154            .add_numbered("Theme color palettes (7 themes)")
1155            .add_numbered("Material & Carbon Design colors")
1156            .content_size(24)
1157    );
1158
1159    // =========================================================================
1160    // SLIDE 32: Slide Show Settings - Comparison Table (REAL: embedded in presProps.xml)
1161    // =========================================================================
1162    println!("🎬 Slide 34: Slide Show Settings (Visual)");
1163
1164    let show_speaker = SlideShowSettings::new().pen_color(PenColor::red());
1165    let show_kiosk = SlideShowSettings::kiosk();
1166    let _show_range = SlideShowSettings::new()
1167        .show_type(ShowType::Browsed)
1168        .slide_range(SlideRange::Range { start: 1, end: 10 })
1169        .without_animation(true);
1170    let _speaker_xml = show_speaker.to_xml();
1171    let _kiosk_xml = show_kiosk.to_xml();
1172
1173    let show_table = TableBuilder::new(vec![2000000, 2000000, 2000000, 2000000])
1174        .add_row(TableRow::new(vec![
1175            TableCell::new("Setting").bold().background_color("1F4E79").text_color("FFFFFF"),
1176            TableCell::new("Speaker").bold().background_color("4472C4").text_color("FFFFFF"),
1177            TableCell::new("Kiosk").bold().background_color("ED7D31").text_color("FFFFFF"),
1178            TableCell::new("Browsed").bold().background_color("70AD47").text_color("FFFFFF"),
1179        ]))
1180        .add_row(TableRow::new(vec![
1181            TableCell::new("Loop").bold().background_color("D6E4F0"),
1182            TableCell::new("No"), TableCell::new("Yes").bold().text_color("2E7D32"),
1183            TableCell::new("No"),
1184        ]))
1185        .add_row(TableRow::new(vec![
1186            TableCell::new("Narration").bold().background_color("D6E4F0"),
1187            TableCell::new("Yes"), TableCell::new("No").text_color("C62828"),
1188            TableCell::new("Yes"),
1189        ]))
1190        .add_row(TableRow::new(vec![
1191            TableCell::new("Animation").bold().background_color("D6E4F0"),
1192            TableCell::new("Yes"), TableCell::new("Yes"),
1193            TableCell::new("No").text_color("C62828"),
1194        ]))
1195        .add_row(TableRow::new(vec![
1196            TableCell::new("Timings").bold().background_color("D6E4F0"),
1197            TableCell::new("Yes"), TableCell::new("Auto"),
1198            TableCell::new("Yes"),
1199        ]))
1200        .add_row(TableRow::new(vec![
1201            TableCell::new("Slide Range").bold().background_color("D6E4F0"),
1202            TableCell::new("All"), TableCell::new("All"),
1203            TableCell::new("1-10"),
1204        ]))
1205        .add_row(TableRow::new(vec![
1206            TableCell::new("Pen Color").bold().background_color("D6E4F0"),
1207            TableCell::new("Red").text_color("FF0000"),
1208            TableCell::new("Red").text_color("FF0000"),
1209            TableCell::new("Red").text_color("FF0000"),
1210        ]))
1211        .position(300000, 1600000)
1212        .build();
1213
1214    // Mode icons
1215    let icon_speaker = Shape::new(ShapeType::RoundedRectangle, 300000, 4200000, 2500000, 600000)
1216        .with_fill(ShapeFill::new("4472C4"))
1217        .with_text("Speaker: Full control");
1218    let icon_kiosk = Shape::new(ShapeType::RoundedRectangle, 3100000, 4200000, 2500000, 600000)
1219        .with_fill(ShapeFill::new("ED7D31"))
1220        .with_text("Kiosk: Auto-loop");
1221    let icon_browsed = Shape::new(ShapeType::RoundedRectangle, 5900000, 4200000, 2500000, 600000)
1222        .with_fill(ShapeFill::new("70AD47"))
1223        .with_text("Browsed: Scrollbar");
1224
1225    slides.push(
1226        SlideContent::new("Slide Show Settings - Mode Comparison")
1227            .table(show_table)
1228            .add_shape(icon_speaker)
1229            .add_shape(icon_kiosk)
1230            .add_shape(icon_browsed)
1231            .title_color("1F497D")
1232            .title_bold(true)
1233    );
1234
1235    // =========================================================================
1236    // SLIDE 35: Print Settings - Visual Handout Grid
1237    // =========================================================================
1238    println!("🖨️  Slide 35: Print Settings & Handouts (Visual)");
1239
1240    let print = PrintSettings::new()
1241        .print_what(PrintWhat::Handouts)
1242        .color_mode(PrintColorMode::Grayscale)
1243        .handout_layout(GenHandoutLayout::SlidesPerPage6)
1244        .frame_slides(true)
1245        .header("Q1 2025 Strategy Review")
1246        .footer("Confidential - Internal Use Only")
1247        .print_date(true)
1248        .print_page_numbers(true);
1249    let _prnpr_xml = print.to_prnpr_xml();
1250    let _handout_xml = print.to_handout_master_xml();
1251
1252    // Visual: 6-slide handout grid (2 cols x 3 rows)
1253    let hdr = Shape::new(ShapeType::Rectangle, 300000, 1500000, 4200000, 300000)
1254        .with_fill(ShapeFill::new("E7E6E6"))
1255        .with_text("Q1 2025 Strategy Review");
1256    // Row 1
1257    let s1 = Shape::new(ShapeType::Rectangle, 400000, 2000000, 1800000, 1100000)
1258        .with_line(ShapeLine::new("999999", 12700))
1259        .with_text("Slide 1");
1260    let s2 = Shape::new(ShapeType::Rectangle, 2500000, 2000000, 1800000, 1100000)
1261        .with_line(ShapeLine::new("999999", 12700))
1262        .with_text("Slide 2");
1263    // Row 2
1264    let s3 = Shape::new(ShapeType::Rectangle, 400000, 3200000, 1800000, 1100000)
1265        .with_line(ShapeLine::new("999999", 12700))
1266        .with_text("Slide 3");
1267    let s4 = Shape::new(ShapeType::Rectangle, 2500000, 3200000, 1800000, 1100000)
1268        .with_line(ShapeLine::new("999999", 12700))
1269        .with_text("Slide 4");
1270    // Row 3
1271    let s5 = Shape::new(ShapeType::Rectangle, 400000, 4400000, 1800000, 1100000)
1272        .with_line(ShapeLine::new("999999", 12700))
1273        .with_text("Slide 5");
1274    let s6 = Shape::new(ShapeType::Rectangle, 2500000, 4400000, 1800000, 1100000)
1275        .with_line(ShapeLine::new("999999", 12700))
1276        .with_text("Slide 6");
1277    let ftr = Shape::new(ShapeType::Rectangle, 300000, 5600000, 4200000, 300000)
1278        .with_fill(ShapeFill::new("E7E6E6"))
1279        .with_text("Confidential - Internal Use Only");
1280
1281    // Settings summary table on the right
1282    let print_table = TableBuilder::new(vec![1800000, 2000000])
1283        .add_row(TableRow::new(vec![
1284            TableCell::new("Print Settings").bold().background_color("1F4E79").text_color("FFFFFF"),
1285            TableCell::new("").background_color("1F4E79"),
1286        ]))
1287        .add_row(TableRow::new(vec![
1288            TableCell::new("Print What").bold().background_color("D6E4F0"),
1289            TableCell::new("Handouts"),
1290        ]))
1291        .add_row(TableRow::new(vec![
1292            TableCell::new("Color Mode").bold().background_color("D6E4F0"),
1293            TableCell::new("Grayscale"),
1294        ]))
1295        .add_row(TableRow::new(vec![
1296            TableCell::new("Layout").bold().background_color("D6E4F0"),
1297            TableCell::new("6 slides/page"),
1298        ]))
1299        .add_row(TableRow::new(vec![
1300            TableCell::new("Frame Slides").bold().background_color("D6E4F0"),
1301            TableCell::new("Yes"),
1302        ]))
1303        .add_row(TableRow::new(vec![
1304            TableCell::new("Date").bold().background_color("D6E4F0"),
1305            TableCell::new("Yes"),
1306        ]))
1307        .add_row(TableRow::new(vec![
1308            TableCell::new("Page Numbers").bold().background_color("D6E4F0"),
1309            TableCell::new("Yes"),
1310        ]))
1311        .position(5000000, 1800000)
1312        .build();
1313
1314    slides.push(
1315        SlideContent::new("Print Handout - 6 Slides Per Page")
1316            .table(print_table)
1317            .add_shape(hdr)
1318            .add_shape(s1).add_shape(s2)
1319            .add_shape(s3).add_shape(s4)
1320            .add_shape(s5).add_shape(s6)
1321            .add_shape(ftr)
1322            .title_color("1F497D")
1323            .title_bold(true)
1324    );
1325
1326    // =========================================================================
1327    // SLIDE 36: Advanced Table Merging - Actual Merged Table
1328    // =========================================================================
1329    println!("📊 Slide 36: Advanced Table Merging (Visual)");
1330
1331    // Use TableMergeMap to compute states, then build a visual table
1332    let mut merge_map = TableMergeMap::new(5, 4);
1333    merge_map.merge_cells(0, 0, 1, 4).unwrap(); // Title row spans all 4 cols
1334    merge_map.merge_cells(1, 0, 2, 1).unwrap(); // "Products" spans 2 rows
1335    merge_map.merge_cells(3, 0, 2, 1).unwrap(); // "Services" spans 2 rows
1336
1337    // Show merge state labels
1338    let state_00 = merge_map.cell_state(0, 0); // Anchor gridSpan=4
1339    let state_01 = merge_map.cell_state(0, 1); // HMerge
1340    let state_10 = merge_map.cell_state(1, 0); // Anchor rowSpan=2
1341    let state_20 = merge_map.cell_state(2, 0); // VMerge
1342    println!("   ├── (0,0): {}", state_00.to_xml_attrs().trim());
1343    println!("   ├── (0,1): {}", state_01.to_xml_attrs().trim());
1344    println!("   ├── (1,0): {}", state_10.to_xml_attrs().trim());
1345    println!("   └── (2,0): {}", state_20.to_xml_attrs().trim());
1346
1347    // Build the table with REAL merge attributes (gridSpan, rowSpan, hMerge, vMerge)
1348    let merge_table = TableBuilder::new(vec![1500000, 2000000, 2000000, 2000000])
1349        .add_row(TableRow::new(vec![
1350            TableCell::new("Q1 2025 Revenue Report").bold().background_color("1F4E79").text_color("FFFFFF").grid_span(4),
1351            TableCell::new("").background_color("1F4E79").h_merge(),
1352            TableCell::new("").background_color("1F4E79").h_merge(),
1353            TableCell::new("").background_color("1F4E79").h_merge(),
1354        ]))
1355        .add_row(TableRow::new(vec![
1356            TableCell::new("Products").bold().background_color("BDD7EE").text_color("1F497D").row_span(2),
1357            TableCell::new("Hardware").background_color("E2EFDA"),
1358            TableCell::new("$450,000").text_color("2E7D32").align_right(),
1359            TableCell::new("+12%").bold().text_color("2E7D32").align_right(),
1360        ]))
1361        .add_row(TableRow::new(vec![
1362            TableCell::new("").background_color("BDD7EE").v_merge(),
1363            TableCell::new("Software").background_color("E2EFDA"),
1364            TableCell::new("$680,000").text_color("2E7D32").align_right(),
1365            TableCell::new("+25%").bold().text_color("2E7D32").align_right(),
1366        ]))
1367        .add_row(TableRow::new(vec![
1368            TableCell::new("Services").bold().background_color("FCE4D6").text_color("C65911").row_span(2),
1369            TableCell::new("Consulting").background_color("FFF2CC"),
1370            TableCell::new("$320,000").text_color("2E7D32").align_right(),
1371            TableCell::new("+8%").bold().text_color("2E7D32").align_right(),
1372        ]))
1373        .add_row(TableRow::new(vec![
1374            TableCell::new("").background_color("FCE4D6").v_merge(),
1375            TableCell::new("Support").background_color("FFF2CC"),
1376            TableCell::new("$190,000").text_color("2E7D32").align_right(),
1377            TableCell::new("+5%").bold().text_color("2E7D32").align_right(),
1378        ]))
1379        .position(300000, 1600000)
1380        .build();
1381
1382    // Legend shapes
1383    let legend_anchor = Shape::new(ShapeType::RoundedRectangle, 300000, 4400000, 2000000, 400000)
1384        .with_fill(ShapeFill::new("4472C4"))
1385        .with_text("Anchor (gridSpan/rowSpan)");
1386    let legend_hmerge = Shape::new(ShapeType::RoundedRectangle, 2500000, 4400000, 2000000, 400000)
1387        .with_fill(ShapeFill::new("ED7D31"))
1388        .with_text("hMerge (col covered)");
1389    let legend_vmerge = Shape::new(ShapeType::RoundedRectangle, 4700000, 4400000, 2000000, 400000)
1390        .with_fill(ShapeFill::new("70AD47"))
1391        .with_text("vMerge (row covered)");
1392    let legend_normal = Shape::new(ShapeType::RoundedRectangle, 6900000, 4400000, 2000000, 400000)
1393        .with_fill(ShapeFill::new("A5A5A5"))
1394        .with_text("Normal (no merge)");
1395
1396    slides.push(
1397        SlideContent::new("Advanced Table Merging - Merged Cells")
1398            .table(merge_table)
1399            .add_shape(legend_anchor)
1400            .add_shape(legend_hmerge)
1401            .add_shape(legend_vmerge)
1402            .add_shape(legend_normal)
1403            .title_color("1F497D")
1404            .title_bold(true)
1405    );
1406
1407    // =========================================================================
1408    // Build PresentationSettings with all advanced features
1409    // =========================================================================
1410    println!("\n⚙️  Building Presentation Settings...");
1411
1412    // Slide show settings (embedded in presProps.xml as <p:showPr>)
1413    let show_settings = SlideShowSettings::new()
1414        .show_type(ShowType::Speaker)
1415        .pen_color(PenColor::red())
1416        .use_timings(true);
1417    println!("   ├── Slide Show: Speaker mode, red pen, timings enabled");
1418    println!("   │   └── XML: {} bytes", show_settings.to_xml().len());
1419
1420    // Print settings (embedded in presProps.xml as <p:prnPr>)
1421    let print_settings = PrintSettings::new()
1422        .print_what(PrintWhat::Handouts)
1423        .color_mode(PrintColorMode::Grayscale)
1424        .handout_layout(GenHandoutLayout::SlidesPerPage6)
1425        .frame_slides(true)
1426        .header("Q1 2025 Strategy Review")
1427        .footer("Confidential - Internal Use Only")
1428        .print_date(true)
1429        .print_page_numbers(true);
1430    println!("   └── Print: Handouts, 6/page, grayscale, framed");
1431    println!("       └── XML: {} bytes", print_settings.to_prnpr_xml().len());
1432
1433    let pres_settings = PresentationSettings::new()
1434        .slide_show(show_settings)
1435        .print(print_settings);
1436    println!("   All settings configured → presProps.xml");
1437
1438    // =========================================================================
1439    // Generate PPTX with real integrated features
1440    // =========================================================================
1441    println!("\n📦 Generating PPTX with integrated features...");
1442    let pptx_data = create_pptx_with_settings(
1443        "PPTX-RS Element Showcase",
1444        slides.clone(),
1445        Some(pres_settings),
1446    )?;
1447    fs::write("comprehensive_demo.pptx", &pptx_data)?;
1448    println!("   ✓ Created comprehensive_demo.pptx ({} slides, {} bytes)", 
1449             slides.len(), pptx_data.len());
1450
1451    // =========================================================================
1452    // Package Analysis - Demonstrate Reading
1453    // =========================================================================
1454    println!("\n📖 Package Analysis (Read Capability):");
1455    
1456    let package = Package::open("comprehensive_demo.pptx")?;
1457    let paths = package.part_paths();
1458    
1459    let slide_count = paths.iter()
1460        .filter(|p| p.starts_with("ppt/slides/slide") && p.ends_with(".xml"))
1461        .count();
1462    
1463    println!("   ├── Total parts: {}", package.part_count());
1464    println!("   ├── Slides: {}", slide_count);
1465    println!("   └── Package opened and analyzed successfully");
1466
1467    // =========================================================================
1468    // NEW: Parts API Demonstration
1469    // =========================================================================
1470    println!("\n🧩 Parts API Demonstration:");
1471    
1472    // SlideLayoutPart - 11 layout types
1473    println!("   ┌── SlideLayoutPart (11 layout types):");
1474    let layouts = [
1475        LayoutType::Title,
1476        LayoutType::TitleAndContent,
1477        LayoutType::SectionHeader,
1478        LayoutType::TwoContent,
1479        LayoutType::Comparison,
1480        LayoutType::TitleOnly,
1481        LayoutType::Blank,
1482        LayoutType::ContentWithCaption,
1483        LayoutType::PictureWithCaption,
1484        LayoutType::TitleAndVerticalText,
1485        LayoutType::VerticalTitleAndText,
1486    ];
1487    for (i, layout_type) in layouts.iter().enumerate() {
1488        let layout = SlideLayoutPart::new(i + 1, *layout_type);
1489        if i < 3 {
1490            println!("   │   ├── {}: {} ({})", i + 1, layout_type.name(), layout.path());
1491        }
1492    }
1493    println!("   │   └── ... and {} more layout types", layouts.len() - 3);
1494    
1495    // SlideMasterPart
1496    println!("   ├── SlideMasterPart:");
1497    let mut master = SlideMasterPart::new(1);
1498    master.set_name("Custom Master");
1499    master.add_layout_rel_id("rId2");
1500    master.add_layout_rel_id("rId3");
1501    println!("   │   ├── Name: {}", master.name());
1502    println!("   │   ├── Path: {}", master.path());
1503    println!("   │   └── Layouts: {} linked", master.layout_rel_ids().len());
1504    
1505    // ThemePart - Colors and Fonts
1506    println!("   ├── ThemePart (colors & fonts):");
1507    let mut theme = ThemePart::new(1);
1508    theme.set_name("Corporate Theme");
1509    theme.set_major_font("Arial");
1510    theme.set_minor_font("Calibri");
1511    theme.set_color("accent1", "FF5733");
1512    theme.set_color("accent2", "33FF57");
1513    let theme_xml = theme.to_xml()?;
1514    println!("   │   ├── Name: {}", theme.name());
1515    println!("   │   ├── Major Font: Arial");
1516    println!("   │   ├── Minor Font: Calibri");
1517    println!("   │   └── XML size: {} bytes", theme_xml.len());
1518    
1519    // NotesSlidePart - Speaker notes
1520    println!("   ├── NotesSlidePart (speaker notes):");
1521    let notes = NotesSlidePart::with_text(1, "Remember to:\n- Introduce yourself\n- Explain the agenda\n- Ask for questions");
1522    let notes_xml = notes.to_xml()?;
1523    println!("   │   ├── Path: {}", notes.path());
1524    println!("   │   ├── Text: \"{}...\"", &notes.notes_text()[..20.min(notes.notes_text().len())]);
1525    println!("   │   └── XML size: {} bytes", notes_xml.len());
1526    
1527    // AppPropertiesPart - Application metadata
1528    println!("   ├── AppPropertiesPart (metadata):");
1529    let mut app_props = AppPropertiesPart::new();
1530    app_props.set_company("Acme Corporation");
1531    app_props.set_slides(slides.len() as u32);
1532    let app_xml = app_props.to_xml()?;
1533    println!("   │   ├── Company: Acme Corporation");
1534    println!("   │   ├── Slides: {}", slides.len());
1535    println!("   │   └── XML size: {} bytes", app_xml.len());
1536    
1537    // MediaPart - Video/Audio formats
1538    println!("   ├── MediaPart (10 media formats):");
1539    println!("   │   ├── Video: mp4, webm, avi, wmv, mov");
1540    println!("   │   ├── Audio: mp3, wav, wma, m4a, ogg");
1541    let sample_media = MediaPart::new(1, MediaFormat::Mp4, vec![0; 100]);
1542    println!("   │   └── Sample: {} ({})", sample_media.path(), sample_media.format().mime_type());
1543    
1544    // TablePart - Table with formatting
1545    println!("   ├── TablePart (cell formatting):");
1546    let table_part = TablePart::new()
1547        .add_row(TableRowPart::new(vec![
1548            TableCellPart::new("Header 1").bold().background("4472C4"),
1549            TableCellPart::new("Header 2").bold().background("4472C4"),
1550        ]))
1551        .add_row(TableRowPart::new(vec![
1552            TableCellPart::new("Data 1").color("333333"),
1553            TableCellPart::new("Data 2").italic(),
1554        ]))
1555        .position(EMU_PER_INCH, EMU_PER_INCH * 2)
1556        .size(EMU_PER_INCH * 6, EMU_PER_INCH * 2);
1557    let table_xml = table_part.to_slide_xml(10);
1558    println!("   │   ├── Rows: {}", table_part.rows.len());
1559    println!("   │   ├── Features: bold, italic, colors, backgrounds");
1560    println!("   │   └── XML size: {} bytes", table_xml.len());
1561    
1562    // ContentTypesPart
1563    println!("   └── ContentTypesPart:");
1564    let mut content_types = ContentTypesPart::new();
1565    content_types.add_presentation();
1566    content_types.add_slide(1);
1567    content_types.add_slide_layout(1);
1568    content_types.add_slide_master(1);
1569    content_types.add_theme(1);
1570    content_types.add_core_properties();
1571    content_types.add_app_properties();
1572    let ct_xml = content_types.to_xml()?;
1573    println!("       ├── Path: {}", content_types.path());
1574    println!("       └── XML size: {} bytes", ct_xml.len());
1575
1576    // =========================================================================
1577    // NEW: Elements API Demonstration
1578    // =========================================================================
1579    println!("\n🎨 Elements API Demonstration:");
1580    
1581    // Color types
1582    println!("   ┌── Color Types:");
1583    let rgb = RgbColor::new(255, 87, 51);
1584    let rgb_hex = RgbColor::from_hex("#4472C4").unwrap();
1585    let scheme = SchemeColor::Accent1;
1586    let color = Color::rgb(100, 149, 237);
1587    println!("   │   ├── RgbColor::new(255, 87, 51) → {}", rgb.to_hex());
1588    println!("   │   ├── RgbColor::from_hex(\"#4472C4\") → {}", rgb_hex.to_hex());
1589    println!("   │   ├── SchemeColor::Accent1 → {}", scheme.as_str());
1590    println!("   │   └── Color::rgb(100, 149, 237) → XML: {}", color.to_xml().chars().take(30).collect::<String>());
1591    
1592    // Position and Size
1593    println!("   ├── Position & Size (EMU units):");
1594    let pos = Position::from_inches(1.0, 2.0);
1595    let size = Size::from_inches(4.0, 3.0);
1596    println!("   │   ├── Position::from_inches(1.0, 2.0) → x={}, y={}", pos.x, pos.y);
1597    println!("   │   ├── Size::from_inches(4.0, 3.0) → w={}, h={}", size.width, size.height);
1598    println!("   │   └── EMU_PER_INCH = {}", EMU_PER_INCH);
1599    
1600    // Transform
1601    println!("   └── Transform (position + size + rotation):");
1602    let transform = Transform::from_inches(1.0, 1.5, 3.0, 2.0).with_rotation(45.0);
1603    let transform_xml = transform.to_xml();
1604    println!("       ├── Transform::from_inches(1.0, 1.5, 3.0, 2.0)");
1605    println!("       ├── .with_rotation(45.0)");
1606    println!("       └── XML: {}...", &transform_xml[..50.min(transform_xml.len())]);
1607
1608    // =========================================================================
1609    // NEW: Advanced Features Demonstration
1610    // =========================================================================
1611    println!("\n🚀 Advanced Features Demonstration:");
1612
1613    // -------------------------------------------------------------------------
1614    // Complex Table Examples
1615    // -------------------------------------------------------------------------
1616    println!("   ┌── Complex Table Examples:");
1617    
1618    // Example 1: Financial Report Table
1619    println!("   │   ┌── Financial Report Table (5x4 with formatting):");
1620    let financial_table = TablePart::new()
1621        .add_row(TableRowPart::new(vec![
1622            TableCellPart::new("Q1 2024 Financial Summary")
1623                .col_span(4)
1624                .bold()
1625                .center()
1626                .background("1F4E79")
1627                .color("FFFFFF")
1628                .font_size(14)
1629                .font("Arial Black"),
1630        ]))
1631        .add_row(TableRowPart::new(vec![
1632            TableCellPart::new("Category").bold().center().background("2E75B6").color("FFFFFF"),
1633            TableCellPart::new("Revenue").bold().center().background("2E75B6").color("FFFFFF"),
1634            TableCellPart::new("Expenses").bold().center().background("2E75B6").color("FFFFFF"),
1635            TableCellPart::new("Profit").bold().center().background("2E75B6").color("FFFFFF"),
1636        ]))
1637        .add_row(TableRowPart::new(vec![
1638            TableCellPart::new("Product Sales").align(HorizontalAlign::Left),
1639            TableCellPart::new("$1,250,000").align(HorizontalAlign::Right).color("2E7D32"),
1640            TableCellPart::new("$450,000").align(HorizontalAlign::Right).color("C62828"),
1641            TableCellPart::new("$800,000").align(HorizontalAlign::Right).bold().color("2E7D32"),
1642        ]))
1643        .add_row(TableRowPart::new(vec![
1644            TableCellPart::new("Services").align(HorizontalAlign::Left),
1645            TableCellPart::new("$890,000").align(HorizontalAlign::Right).color("2E7D32"),
1646            TableCellPart::new("$320,000").align(HorizontalAlign::Right).color("C62828"),
1647            TableCellPart::new("$570,000").align(HorizontalAlign::Right).bold().color("2E7D32"),
1648        ]))
1649        .add_row(TableRowPart::new(vec![
1650            TableCellPart::new("Total").bold().background("E7E6E6"),
1651            TableCellPart::new("$2,140,000").bold().align(HorizontalAlign::Right).background("E7E6E6"),
1652            TableCellPart::new("$770,000").bold().align(HorizontalAlign::Right).background("E7E6E6"),
1653            TableCellPart::new("$1,370,000").bold().align(HorizontalAlign::Right).background("C6EFCE").color("006100"),
1654        ]))
1655        .position(EMU_PER_INCH / 2, EMU_PER_INCH * 2)
1656        .size(EMU_PER_INCH * 8, EMU_PER_INCH * 3);
1657    let fin_xml = financial_table.to_slide_xml(100);
1658    println!("   │   │   ├── Merged header spanning 4 columns");
1659    println!("   │   │   ├── Color-coded values (green=positive, red=negative)");
1660    println!("   │   │   ├── Custom fonts and sizes");
1661    println!("   │   │   └── XML: {} bytes", fin_xml.len());
1662
1663    // Example 2: Comparison Matrix
1664    println!("   │   ├── Comparison Matrix (features vs products):");
1665    let _matrix_table = TablePart::new()
1666        .add_row(TableRowPart::new(vec![
1667            TableCellPart::new("Feature").bold().center().background("4472C4").color("FFFFFF"),
1668            TableCellPart::new("Basic").bold().center().background("4472C4").color("FFFFFF"),
1669            TableCellPart::new("Pro").bold().center().background("4472C4").color("FFFFFF"),
1670            TableCellPart::new("Enterprise").bold().center().background("4472C4").color("FFFFFF"),
1671        ]))
1672        .add_row(TableRowPart::new(vec![
1673            TableCellPart::new("Storage").align(HorizontalAlign::Left),
1674            TableCellPart::new("5 GB").center(),
1675            TableCellPart::new("50 GB").center(),
1676            TableCellPart::new("Unlimited").center().bold().color("2E7D32"),
1677        ]))
1678        .add_row(TableRowPart::new(vec![
1679            TableCellPart::new("Users").align(HorizontalAlign::Left),
1680            TableCellPart::new("1").center(),
1681            TableCellPart::new("10").center(),
1682            TableCellPart::new("Unlimited").center().bold().color("2E7D32"),
1683        ]))
1684        .add_row(TableRowPart::new(vec![
1685            TableCellPart::new("Support").align(HorizontalAlign::Left),
1686            TableCellPart::new("Email").center(),
1687            TableCellPart::new("24/7 Chat").center(),
1688            TableCellPart::new("Dedicated").center().bold().color("2E7D32"),
1689        ]))
1690        .add_row(TableRowPart::new(vec![
1691            TableCellPart::new("Price/mo").bold().background("F2F2F2"),
1692            TableCellPart::new("$9").center().bold().background("F2F2F2"),
1693            TableCellPart::new("$29").center().bold().background("F2F2F2"),
1694            TableCellPart::new("$99").center().bold().background("F2F2F2"),
1695        ]));
1696    println!("   │   │   └── 5x4 matrix with alternating styles");
1697
1698    // Example 3: Schedule/Timeline Table
1699    println!("   │   └── Schedule Table (with row spans):");
1700    let _schedule_table = TablePart::new()
1701        .add_row(TableRowPart::new(vec![
1702            TableCellPart::new("Time").bold().center().background("70AD47").color("FFFFFF"),
1703            TableCellPart::new("Monday").bold().center().background("70AD47").color("FFFFFF"),
1704            TableCellPart::new("Tuesday").bold().center().background("70AD47").color("FFFFFF"),
1705        ]))
1706        .add_row(TableRowPart::new(vec![
1707            TableCellPart::new("9:00 AM").center().background("E2EFDA"),
1708            TableCellPart::new("Team Standup").center().row_span(2).valign(VerticalAlign::Middle).background("BDD7EE"),
1709            TableCellPart::new("Code Review").center(),
1710        ]))
1711        .add_row(TableRowPart::new(vec![
1712            TableCellPart::new("10:00 AM").center().background("E2EFDA"),
1713            TableCellPart::merged(),
1714            TableCellPart::new("Sprint Planning").center().background("FCE4D6"),
1715        ]));
1716    println!("   │       └── Row spans for multi-hour events");
1717
1718    // -------------------------------------------------------------------------
1719    // Complex Animation Sequences
1720    // -------------------------------------------------------------------------
1721    println!("   ├── Complex Animation Sequences:");
1722    
1723    // Sequence 1: Title entrance with staggered content
1724    println!("   │   ┌── Staggered Entrance Sequence:");
1725    let title_anim = Animation::new(2, AnimationEffect::Fade)
1726        .trigger(AnimationTrigger::OnClick)
1727        .duration(500);
1728    let content1 = Animation::new(3, AnimationEffect::FlyIn)
1729        .trigger(AnimationTrigger::AfterPrevious)
1730        .direction(AnimationDirection::Left)
1731        .duration(400)
1732        .delay(200);
1733    let content2 = Animation::new(4, AnimationEffect::FlyIn)
1734        .trigger(AnimationTrigger::AfterPrevious)
1735        .direction(AnimationDirection::Left)
1736        .duration(400)
1737        .delay(100);
1738    let content3 = Animation::new(5, AnimationEffect::FlyIn)
1739        .trigger(AnimationTrigger::AfterPrevious)
1740        .direction(AnimationDirection::Left)
1741        .duration(400)
1742        .delay(100);
1743    let staggered = SlideAnimations::new()
1744        .add(title_anim)
1745        .add(content1)
1746        .add(content2)
1747        .add(content3)
1748        .transition(SlideTransition::new(TransitionEffect::Push).direction(AnimationDirection::Left).duration(750));
1749    let staggered_xml = staggered.to_timing_xml()?;
1750    println!("   │   │   ├── Title: Fade on click");
1751    println!("   │   │   ├── Content 1-3: FlyIn with 100ms stagger");
1752    println!("   │   │   ├── Transition: Push from left (750ms)");
1753    println!("   │   │   └── XML: {} bytes", staggered_xml.len());
1754
1755    // Sequence 2: Emphasis and exit
1756    println!("   │   ├── Emphasis + Exit Sequence:");
1757    let emphasis = Animation::new(6, AnimationEffect::Pulse)
1758        .trigger(AnimationTrigger::OnClick)
1759        .duration(1000)
1760        .repeat(3);
1761    let exit = Animation::new(6, AnimationEffect::FadeOut)
1762        .trigger(AnimationTrigger::AfterPrevious)
1763        .duration(500);
1764    let _emphasis_seq = SlideAnimations::new()
1765        .add(emphasis)
1766        .add(exit);
1767    println!("   │   │   ├── Pulse 3x on click, then fade out");
1768    println!("   │   │   └── Same shape, sequential effects");
1769
1770    // Sequence 3: Motion path
1771    println!("   │   └── Motion Path Animation:");
1772    let _motion = Animation::new(7, AnimationEffect::Lines)
1773        .trigger(AnimationTrigger::OnClick)
1774        .duration(2000);
1775    println!("   │       └── Custom path: Lines, Arcs, Turns, Loops");
1776
1777    // -------------------------------------------------------------------------
1778    // SmartArt Combinations
1779    // -------------------------------------------------------------------------
1780    println!("   ├── SmartArt Layout Examples:");
1781    
1782    // Process flow
1783    println!("   │   ┌── Process Flow (5 steps):");
1784    let process = SmartArtPart::new(1, SmartArtLayout::BasicProcess)
1785        .add_items(vec!["Research", "Design", "Develop", "Test", "Deploy"])
1786        .position(EMU_PER_INCH / 2, EMU_PER_INCH * 2)
1787        .size(EMU_PER_INCH * 8, EMU_PER_INCH * 2);
1788    println!("   │   │   └── {} nodes in horizontal flow", process.nodes().len());
1789
1790    // Organization chart
1791    println!("   │   ├── Organization Chart:");
1792    let org = SmartArtPart::new(2, SmartArtLayout::OrgChart)
1793        .add_items(vec!["CEO", "CTO", "CFO", "VP Engineering", "VP Sales"]);
1794    println!("   │   │   └── Hierarchical structure with {} positions", org.nodes().len());
1795
1796    // Cycle diagram
1797    println!("   │   ├── Cycle Diagram:");
1798    let cycle = SmartArtPart::new(3, SmartArtLayout::BasicCycle)
1799        .add_items(vec!["Plan", "Do", "Check", "Act"]);
1800    println!("   │   │   └── PDCA cycle with {} phases", cycle.nodes().len());
1801
1802    // Venn diagram
1803    println!("   │   ├── Venn Diagram:");
1804    let _venn = SmartArtPart::new(4, SmartArtLayout::BasicVenn)
1805        .add_items(vec!["Skills", "Passion", "Market Need"]);
1806    println!("   │   │   └── 3-circle Venn for Ikigai concept");
1807
1808    // Pyramid
1809    println!("   │   └── Pyramid:");
1810    let pyramid = SmartArtPart::new(5, SmartArtLayout::BasicPyramid)
1811        .add_items(vec!["Self-Actualization", "Esteem", "Love/Belonging", "Safety", "Physiological"]);
1812    println!("   │       └── Maslow's hierarchy with {} levels", pyramid.nodes().len());
1813
1814    // -------------------------------------------------------------------------
1815    // 3D Model Configurations
1816    // -------------------------------------------------------------------------
1817    println!("   ├── 3D Model Configurations:");
1818    
1819    // Product showcase
1820    println!("   │   ┌── Product Showcase:");
1821    let _product_3d = Model3DPart::new(1, Model3DFormat::Glb, vec![0; 100])
1822        .camera(CameraPreset::IsometricTopUp)
1823        .rotation(0.0, 45.0, 0.0)
1824        .zoom(1.2)
1825        .position(EMU_PER_INCH * 2, EMU_PER_INCH * 2)
1826        .size(EMU_PER_INCH * 4, EMU_PER_INCH * 4);
1827    println!("   │   │   ├── Camera: Isometric top-up view");
1828    println!("   │   │   ├── Rotation: 45° Y-axis for best angle");
1829    println!("   │   │   └── Zoom: 1.2x for detail");
1830
1831    // Architectural model
1832    println!("   │   ├── Architectural Model:");
1833    let _arch_3d = Model3DPart::new(2, Model3DFormat::Gltf, vec![0; 100])
1834        .camera(CameraPreset::Front)
1835        .rotation(15.0, -30.0, 0.0)
1836        .ambient_light("FFFFCC");
1837    println!("   │   │   ├── Camera: Front view with tilt");
1838    println!("   │   │   └── Ambient: Warm lighting (FFFFCC)");
1839
1840    // Technical diagram
1841    println!("   │   └── Technical Diagram:");
1842    let _tech_3d = Model3DPart::new(3, Model3DFormat::Obj, vec![0; 100])
1843        .camera(CameraPreset::IsometricOffAxis1Top)
1844        .rotation(0.0, 0.0, 0.0);
1845    println!("   │       └── Camera: Off-axis isometric for exploded view");
1846
1847    // -------------------------------------------------------------------------
1848    // Theme + Master + Layout Combination
1849    // -------------------------------------------------------------------------
1850    println!("   ├── Theme + Master + Layout Integration:");
1851    
1852    // Corporate theme
1853    let mut corp_theme = ThemePart::new(1);
1854    corp_theme.set_name("Corporate Blue");
1855    corp_theme.set_major_font("Segoe UI");
1856    corp_theme.set_minor_font("Segoe UI Light");
1857    corp_theme.set_color("dk1", "000000");
1858    corp_theme.set_color("lt1", "FFFFFF");
1859    corp_theme.set_color("dk2", "1F497D");
1860    corp_theme.set_color("lt2", "EEECE1");
1861    corp_theme.set_color("accent1", "4472C4");
1862    corp_theme.set_color("accent2", "ED7D31");
1863    corp_theme.set_color("accent3", "A5A5A5");
1864    corp_theme.set_color("accent4", "FFC000");
1865    corp_theme.set_color("accent5", "5B9BD5");
1866    corp_theme.set_color("accent6", "70AD47");
1867    let theme_xml = corp_theme.to_xml()?;
1868    println!("   │   ├── Theme: Corporate Blue");
1869    println!("   │   │   ├── Fonts: Segoe UI / Segoe UI Light");
1870    println!("   │   │   ├── 12 color slots defined");
1871    println!("   │   │   └── XML: {} bytes", theme_xml.len());
1872
1873    // Master with multiple layouts
1874    let mut corp_master = SlideMasterPart::new(1);
1875    corp_master.set_name("Corporate Master");
1876    corp_master.add_layout_rel_id("rId2"); // Title
1877    corp_master.add_layout_rel_id("rId3"); // Title + Content
1878    corp_master.add_layout_rel_id("rId4"); // Section Header
1879    corp_master.add_layout_rel_id("rId5"); // Two Content
1880    corp_master.add_layout_rel_id("rId6"); // Comparison
1881    corp_master.add_layout_rel_id("rId7"); // Title Only
1882    corp_master.add_layout_rel_id("rId8"); // Blank
1883    println!("   │   └── Master: {} with {} layouts linked", corp_master.name(), corp_master.layout_rel_ids().len());
1884
1885    // -------------------------------------------------------------------------
1886    // VBA + Custom XML Integration
1887    // -------------------------------------------------------------------------
1888    println!("   ├── VBA + Custom XML Integration:");
1889    
1890    // VBA with multiple modules
1891    let _vba_project = VbaProjectPart::new()
1892        .add_module(VbaModule::new("AutoRun", r#"
1893Sub Auto_Open()
1894    MsgBox "Welcome to the presentation!"
1895End Sub
1896
1897Sub NavigateToSlide(slideNum As Integer)
1898    SlideShowWindows(1).View.GotoSlide slideNum
1899End Sub
1900"#))
1901        .add_module(VbaModule::new("DataHelpers", r#"
1902Function GetCustomData(key As String) As String
1903    ' Read from Custom XML part
1904    GetCustomData = ActivePresentation.CustomXMLParts(1).SelectSingleNode("//" & key).Text
1905End Function
1906"#))
1907        .add_module(VbaModule::class("SlideController", r#"
1908Private currentSlide As Integer
1909
1910Public Sub NextSlide()
1911    currentSlide = currentSlide + 1
1912    NavigateToSlide currentSlide
1913End Sub
1914"#));
1915    println!("   │   ├── VBA Project:");
1916    println!("   │   │   ├── AutoRun: Auto_Open, NavigateToSlide");
1917    println!("   │   │   ├── DataHelpers: GetCustomData (reads Custom XML)");
1918    println!("   │   │   └── SlideController: Class for navigation");
1919
1920    // Custom XML with structured data
1921    let app_config = CustomXmlPart::new(1, "presentationConfig")
1922        .namespace("http://company.com/pptx/config")
1923        .property("version", "2.1.0")
1924        .property("author", "Demo User")
1925        .property("department", "Engineering")
1926        .property("confidentiality", "Internal")
1927        .property("lastModified", "2024-01-15T10:30:00Z");
1928    let config_xml = app_config.to_xml()?;
1929    println!("   │   └── Custom XML:");
1930    println!("   │       ├── Namespace: http://company.com/pptx/config");
1931    println!("   │       ├── Properties: version, author, department, etc.");
1932    println!("   │       └── XML: {} bytes", config_xml.len());
1933
1934    // -------------------------------------------------------------------------
1935    // Embedded Fonts with Variants
1936    // -------------------------------------------------------------------------
1937    println!("   ├── Embedded Font Collection:");
1938    let mut font_collection = EmbeddedFontCollection::new();
1939    font_collection.add("Corporate Sans", vec![0; 1000]);
1940    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::Bold);
1941    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::Italic);
1942    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::BoldItalic);
1943    font_collection.add("Code Mono", vec![0; 800]);
1944    let fonts_xml = font_collection.to_xml();
1945    println!("   │   ├── Corporate Sans: Regular, Bold, Italic, BoldItalic");
1946    println!("   │   ├── Code Mono: Regular");
1947    println!("   │   ├── Total: {} font files", font_collection.len());
1948    println!("   │   └── XML: {} bytes", fonts_xml.len());
1949
1950    // -------------------------------------------------------------------------
1951    // Handout with Full Configuration
1952    // -------------------------------------------------------------------------
1953    println!("   └── Handout Master Configuration:");
1954    let handout = HandoutMasterPart::new()
1955        .layout(HandoutLayout::SlidesPerPage6)
1956        .header("Q1 2024 Strategy Review")
1957        .footer("Confidential - Internal Use Only");
1958    let handout_xml = handout.to_xml()?;
1959    println!("       ├── Layout: 6 slides per page");
1960    println!("       ├── Header: Q1 2024 Strategy Review");
1961    println!("       ├── Footer: Confidential - Internal Use Only");
1962    println!("       └── XML: {} bytes", handout_xml.len());
1963
1964    // =========================================================================
1965    // Summary
1966    // =========================================================================
1967    println!("\n╔══════════════════════════════════════════════════════════════╗");
1968    println!("║                    Element Coverage Summary                   ║");
1969    println!("╠══════════════════════════════════════════════════════════════╣");
1970    println!("║  LAYOUTS (6 types):                                          ║");
1971    println!("║    ✓ CenteredTitle    ✓ TitleOnly      ✓ TitleAndContent     ║");
1972    println!("║    ✓ TitleAndBigContent  ✓ TwoColumn   ✓ Blank               ║");
1973    println!("╠══════════════════════════════════════════════════════════════╣");
1974    println!("║  TEXT FORMATTING:                                            ║");
1975    println!("║    ✓ Bold            ✓ Italic         ✓ Underline            ║");
1976    println!("║    ✓ Font Size       ✓ Font Color     ✓ Title/Content styles ║");
1977    println!("╠══════════════════════════════════════════════════════════════╣");
1978    println!("║  TABLES:                                                     ║");
1979    println!("║    ✓ Multiple rows/columns  ✓ Bold cells  ✓ Background colors║");
1980    println!("║    ✓ Header styling         ✓ Position control               ║");
1981    println!("╠══════════════════════════════════════════════════════════════╣");
1982    println!("║  CHARTS:                                                     ║");
1983    println!("║    ✓ Bar Chart       ✓ Line Chart     ✓ Pie Chart            ║");
1984    println!("║    ✓ Multiple series ✓ Categories                            ║");
1985    println!("╠══════════════════════════════════════════════════════════════╣");
1986    println!("║  SHAPES:                                                     ║");
1987    println!("║    ✓ Rectangle       ✓ Ellipse        ✓ RoundedRectangle     ║");
1988    println!("║    ✓ Triangle        ✓ Diamond        ✓ Color fills          ║");
1989    println!("║    ✓ Gradient fills  ✓ Transparency   ✓ Text in shapes       ║");
1990    println!("╠══════════════════════════════════════════════════════════════╣");
1991    println!("║  CONNECTORS (NEW):                                           ║");
1992    println!("║    ✓ Straight        ✓ Elbow          ✓ Curved               ║");
1993    println!("║    ✓ Arrow types     ✓ Dash styles    ✓ Line colors/widths   ║");
1994    println!("╠══════════════════════════════════════════════════════════════╣");
1995    println!("║  IMAGES:                                                     ║");
1996    println!("║    ✓ Image placeholders  ✓ Position   ✓ Dimensions           ║");
1997    println!("╠══════════════════════════════════════════════════════════════╣");
1998    println!("║  PACKAGE:                                                    ║");
1999    println!("║    ✓ Create PPTX     ✓ Read PPTX      ✓ Analyze contents     ║");
2000    println!("╠══════════════════════════════════════════════════════════════╣");
2001    println!("║  PARTS API (NEW):                                            ║");
2002    println!("║    ✓ SlideLayoutPart (11 types)  ✓ SlideMasterPart           ║");
2003    println!("║    ✓ ThemePart (colors/fonts)    ✓ NotesSlidePart            ║");
2004    println!("║    ✓ AppPropertiesPart           ✓ MediaPart (10 formats)    ║");
2005    println!("║    ✓ TablePart (cell formatting) ✓ ContentTypesPart          ║");
2006    println!("╠══════════════════════════════════════════════════════════════╣");
2007    println!("║  ELEMENTS API:                                               ║");
2008    println!("║    ✓ RgbColor        ✓ SchemeColor    ✓ Color enum           ║");
2009    println!("║    ✓ Position        ✓ Size           ✓ Transform            ║");
2010    println!("║    ✓ EMU conversions (inches, cm, mm, pt)                    ║");
2011    println!("╠══════════════════════════════════════════════════════════════╣");
2012    println!("║  ADVANCED FEATURES (NEW):                                    ║");
2013    println!("║    ✓ Animation (50+ effects)  ✓ Transitions (27 types)       ║");
2014    println!("║    ✓ SmartArt (25 layouts)    ✓ 3D Models (GLB/GLTF/OBJ)     ║");
2015    println!("║    ✓ VBA Macros (.pptm)       ✓ Embedded Fonts               ║");
2016    println!("║    ✓ Custom XML               ✓ Handout Master               ║");
2017    println!("║    ✓ Table borders/alignment  ✓ Merged cells                 ║");
2018    println!("╠══════════════════════════════════════════════════════════════╣");
2019    println!("║  DIMENSION API (NEW):                                        ║");
2020    println!("║    ✓ EMU / Inches / Cm / Pt / Ratio / Percent units          ║");
2021    println!("║    ✓ from_dimensions() constructor                           ║");
2022    println!("║    ✓ Fluent .at() and .with_dimensions() chaining            ║");
2023    println!("║    ✓ Mixed-unit positioning (e.g. inches + percent)          ║");
2024    println!("╠══════════════════════════════════════════════════════════════╣");
2025    println!("║  Output: comprehensive_demo.pptx ({} slides, {} KB)         ║", 
2026             slides.len(), pptx_data.len() / 1024);
2027    println!("╚══════════════════════════════════════════════════════════════╝");
2028
2029    Ok(())
2030}
Source

pub fn with_transparency(self, percent: u32) -> Self

Set transparency (0-100 percent)

Examples found in repository?
examples/comprehensive_demo.rs (line 319)
69fn main() -> Result<(), Box<dyn std::error::Error>> {
70    println!("╔══════════════════════════════════════════════════════════════╗");
71    println!("║       PPTX-RS Element Showcase - Complete Coverage           ║");
72    println!("╚══════════════════════════════════════════════════════════════╝\n");
73
74    let mut slides = Vec::new();
75
76    // =========================================================================
77    // SLIDE 1: CenteredTitle Layout + Title Formatting
78    // =========================================================================
79    println!("📐 Slide 1: CenteredTitle Layout + Title Formatting");
80    slides.push(
81        SlideContent::new("PPTX-RS Element Showcase")
82            .layout(SlideLayout::CenteredTitle)
83            .title_size(54)
84            .title_bold(true)
85            .title_color("1F497D")
86    );
87
88    // =========================================================================
89    // SLIDE 2: TitleOnly Layout
90    // =========================================================================
91    println!("📐 Slide 2: TitleOnly Layout");
92    slides.push(
93        SlideContent::new("Section: Slide Layouts")
94            .layout(SlideLayout::TitleOnly)
95            .title_size(48)
96            .title_bold(true)
97            .title_color("C0504D")
98    );
99
100    // =========================================================================
101    // SLIDE 3: TitleAndContent Layout + All Text Formatting
102    // =========================================================================
103    println!("📝 Slide 3: TitleAndContent + Text Formatting");
104    slides.push(
105        SlideContent::new("Text Formatting Options")
106            .layout(SlideLayout::TitleAndContent)
107            .title_color("1F497D")
108            .title_bold(true)
109            .title_italic(true)
110            .title_underline(true)
111            .title_size(44)
112            .add_bullet("Normal text (default)")
113            .add_bullet("Bold content text")
114            .add_bullet("Italic content text")
115            .add_bullet("Underlined content")
116            .add_bullet("Custom font size (28pt)")
117            .add_bullet("Custom color (#4F81BD)")
118            .content_bold(true)
119            .content_italic(true)
120            .content_underline(true)
121            .content_size(28)
122            .content_color("4F81BD")
123    );
124
125    // =========================================================================
126    // SLIDE 4: TitleAndBigContent Layout
127    // =========================================================================
128    println!("📐 Slide 4: TitleAndBigContent Layout");
129    slides.push(
130        SlideContent::new("Key Highlights")
131            .layout(SlideLayout::TitleAndBigContent)
132            .title_color("1F497D")
133            .add_bullet("Large content area for emphasis")
134            .add_bullet("Perfect for key messages")
135            .add_bullet("Smaller title, bigger content")
136            .content_bold(true)
137            .content_size(32)
138    );
139
140    // =========================================================================
141    // SLIDE 5: TwoColumn Layout
142    // =========================================================================
143    println!("📐 Slide 5: TwoColumn Layout");
144    slides.push(
145        SlideContent::new("Two Column Comparison")
146            .layout(SlideLayout::TwoColumn)
147            .title_color("1F497D")
148            .add_bullet("Left Column Item 1")
149            .add_bullet("Left Column Item 2")
150            .add_bullet("Left Column Item 3")
151            .add_bullet("Right Column Item 1")
152            .add_bullet("Right Column Item 2")
153            .add_bullet("Right Column Item 3")
154            .content_size(24)
155    );
156
157    // =========================================================================
158    // SLIDE 6: Blank Layout
159    // =========================================================================
160    println!("📐 Slide 6: Blank Layout");
161    slides.push(
162        SlideContent::new("")
163            .layout(SlideLayout::Blank)
164    );
165
166    // =========================================================================
167    // SLIDE 7: Table with All Cell Styling Options
168    // =========================================================================
169    println!("📊 Slide 7: Table with Cell Styling");
170    let styled_table = TableBuilder::new(vec![1500000, 1500000, 1500000])
171        .add_row(TableRow::new(vec![
172            TableCell::new("Header 1").bold().background_color("1F497D"),
173            TableCell::new("Header 2").bold().background_color("4F81BD"),
174            TableCell::new("Header 3").bold().background_color("8064A2"),
175        ]))
176        .add_row(TableRow::new(vec![
177            TableCell::new("Bold Cell").bold(),
178            TableCell::new("Normal Cell"),
179            TableCell::new("Colored").background_color("9BBB59"),
180        ]))
181        .add_row(TableRow::new(vec![
182            TableCell::new("Red BG").background_color("C0504D"),
183            TableCell::new("Green BG").background_color("9BBB59"),
184            TableCell::new("Blue BG").background_color("4F81BD"),
185        ]))
186        .add_row(TableRow::new(vec![
187            TableCell::new("Row 3 Col 1"),
188            TableCell::new("Row 3 Col 2"),
189            TableCell::new("Row 3 Col 3").bold().background_color("F79646"),
190        ]))
191        .position(500000, 1800000)
192        .build();
193    
194    slides.push(
195        SlideContent::new("Table with Cell Styling")
196            .table(styled_table)
197            .title_color("1F497D")
198    );
199
200    // =========================================================================
201    // SLIDE 8: Charts (Bar, Line, Pie)
202    // =========================================================================
203    println!("📈 Slide 8: Chart Types");
204    
205    // Create chart data structures (for demonstration)
206    let _bar_chart = ChartBuilder::new("Sales by Region", ChartType::Bar)
207        .categories(vec!["North", "South", "East", "West"])
208        .add_series(ChartSeries::new("2023", vec![100.0, 80.0, 120.0, 90.0]))
209        .add_series(ChartSeries::new("2024", vec![120.0, 95.0, 140.0, 110.0]))
210        .build();
211    
212    let _line_chart = ChartBuilder::new("Monthly Trend", ChartType::Line)
213        .categories(vec!["Jan", "Feb", "Mar", "Apr", "May", "Jun"])
214        .add_series(ChartSeries::new("Revenue", vec![10.0, 12.0, 15.0, 14.0, 18.0, 22.0]))
215        .build();
216    
217    let _pie_chart = ChartBuilder::new("Market Share", ChartType::Pie)
218        .categories(vec!["Product A", "Product B", "Product C", "Others"])
219        .add_series(ChartSeries::new("Share", vec![40.0, 30.0, 20.0, 10.0]))
220        .build();
221    
222    slides.push(
223        SlideContent::new("Chart Types: Bar, Line, Pie")
224            .with_chart()
225            .title_color("1F497D")
226            .add_bullet("Bar Chart: Compare categories")
227            .add_bullet("Line Chart: Show trends over time")
228            .add_bullet("Pie Chart: Show proportions")
229            .content_size(24)
230    );
231
232    // =========================================================================
233    // SLIDE 9: Shapes with Different Fills
234    // =========================================================================
235    println!("🔷 Slide 9: Shapes with Fills");
236    
237    let rect = Shape::new(ShapeType::Rectangle, 500000, 1600000, 2000000, 1000000)
238        .with_fill(ShapeFill::new("4F81BD"))
239        .with_text("Rectangle");
240    
241    let ellipse = Shape::new(ShapeType::Ellipse, 3000000, 1600000, 2000000, 1000000)
242        .with_fill(ShapeFill::new("9BBB59"))
243        .with_text("Ellipse");
244    
245    let rounded = Shape::new(ShapeType::RoundedRectangle, 5500000, 1600000, 2000000, 1000000)
246        .with_fill(ShapeFill::new("C0504D"))
247        .with_text("Rounded");
248    
249    let triangle = Shape::new(ShapeType::Triangle, 1500000, 3000000, 1500000, 1200000)
250        .with_fill(ShapeFill::new("8064A2"))
251        .with_text("Triangle");
252    
253    let diamond = Shape::new(ShapeType::Diamond, 4000000, 3000000, 1500000, 1200000)
254        .with_fill(ShapeFill::new("F79646"))
255        .with_text("Diamond");
256    
257    slides.push(
258        SlideContent::new("Shape Types with Color Fills")
259            .add_shape(rect)
260            .add_shape(ellipse)
261            .add_shape(rounded)
262            .add_shape(triangle)
263            .add_shape(diamond)
264            .title_color("1F497D")
265    );
266
267    // =========================================================================
268    // SLIDE 10: Gradient Fills (NEW)
269    // =========================================================================
270    println!("🌈 Slide 10: Gradient Fills");
271    
272    // Horizontal gradient
273    let gradient_h = Shape::new(ShapeType::Rectangle, 500000, 1600000, 2500000, 1200000)
274        .with_gradient(GradientFill::linear("1565C0", "42A5F5", GradientDirection::Horizontal))
275        .with_text("Horizontal");
276    
277    // Vertical gradient
278    let gradient_v = Shape::new(ShapeType::Rectangle, 3200000, 1600000, 2500000, 1200000)
279        .with_gradient(GradientFill::linear("2E7D32", "81C784", GradientDirection::Vertical))
280        .with_text("Vertical");
281    
282    // Diagonal gradient
283    let gradient_d = Shape::new(ShapeType::RoundedRectangle, 5900000, 1600000, 2500000, 1200000)
284        .with_gradient(GradientFill::linear("C62828", "EF9A9A", GradientDirection::DiagonalDown))
285        .with_text("Diagonal");
286    
287    // Three-color gradient
288    let gradient_3 = Shape::new(ShapeType::Ellipse, 1800000, 3200000, 2500000, 1200000)
289        .with_gradient(GradientFill::three_color("FF6F00", "FFC107", "FFEB3B", GradientDirection::Horizontal))
290        .with_text("3-Color");
291    
292    // Custom angle gradient
293    let gradient_angle = Shape::new(ShapeType::RoundedRectangle, 4800000, 3200000, 2500000, 1200000)
294        .with_gradient(GradientFill::linear("7B1FA2", "E1BEE7", GradientDirection::Angle(135)))
295        .with_text("135° Angle");
296    
297    slides.push(
298        SlideContent::new("Gradient Fills - Multiple Directions")
299            .add_shape(gradient_h)
300            .add_shape(gradient_v)
301            .add_shape(gradient_d)
302            .add_shape(gradient_3)
303            .add_shape(gradient_angle)
304            .title_color("1F497D")
305    );
306
307    // =========================================================================
308    // SLIDE 11: Transparency (NEW)
309    // =========================================================================
310    println!("👻 Slide 11: Transparency Effects");
311    
312    // Base shape (fully opaque)
313    let base = Shape::new(ShapeType::Rectangle, 1000000, 1800000, 3000000, 2000000)
314        .with_fill(ShapeFill::new("1565C0"))
315        .with_text("Base (100%)");
316    
317    // 25% transparent overlay
318    let trans_25 = Shape::new(ShapeType::Rectangle, 2000000, 2200000, 2500000, 1500000)
319        .with_fill(ShapeFill::new("F44336").with_transparency(25))
320        .with_line(ShapeLine::new("B71C1C", 25400))
321        .with_text("25% Transparent");
322    
323    // 50% transparent overlay
324    let trans_50 = Shape::new(ShapeType::Ellipse, 4500000, 1800000, 2500000, 2000000)
325        .with_fill(ShapeFill::new("4CAF50").with_transparency(50))
326        .with_line(ShapeLine::new("1B5E20", 25400))
327        .with_text("50% Transparent");
328    
329    // 75% transparent overlay
330    let trans_75 = Shape::new(ShapeType::RoundedRectangle, 5500000, 2500000, 2500000, 1500000)
331        .with_fill(ShapeFill::new("FF9800").with_transparency(75))
332        .with_line(ShapeLine::new("E65100", 25400))
333        .with_text("75% Transparent");
334    
335    slides.push(
336        SlideContent::new("Transparency Effects - Overlapping Shapes")
337            .add_shape(base)
338            .add_shape(trans_25)
339            .add_shape(trans_50)
340            .add_shape(trans_75)
341            .title_color("1F497D")
342    );
343
344    // =========================================================================
345    // SLIDE 12: Styled Connectors (NEW)
346    // =========================================================================
347    println!("🔗 Slide 12: Styled Connectors");
348    
349    // Create shapes to connect
350    let box1 = Shape::new(ShapeType::RoundedRectangle, 500000, 1800000, 1800000, 800000)
351        .with_id(100)
352        .with_fill(ShapeFill::new("1565C0"))
353        .with_text("Start");
354    
355    let box2 = Shape::new(ShapeType::RoundedRectangle, 3500000, 1800000, 1800000, 800000)
356        .with_id(101)
357        .with_fill(ShapeFill::new("2E7D32"))
358        .with_text("Process");
359    
360    let box3 = Shape::new(ShapeType::RoundedRectangle, 6500000, 1800000, 1800000, 800000)
361        .with_id(102)
362        .with_fill(ShapeFill::new("C62828"))
363        .with_text("End");
364    
365    // Straight connector with arrow
366    let conn1 = Connector::straight(2300000, 2200000, 3500000, 2200000)
367        .with_line(ConnectorLine::new("1565C0", 25400))
368        .with_end_arrow(ArrowType::Triangle)
369        .with_arrow_size(ArrowSize::Large);
370    
371    // Elbow connector with stealth arrow
372    let conn2 = Connector::elbow(5300000, 2200000, 6500000, 2200000)
373        .with_line(ConnectorLine::new("2E7D32", 38100).with_dash(LineDash::Dash))
374        .with_end_arrow(ArrowType::Stealth)
375        .with_arrow_size(ArrowSize::Medium);
376    
377    // Curved connector examples
378    let box4 = Shape::new(ShapeType::Ellipse, 1000000, 3200000, 1500000, 800000)
379        .with_id(103)
380        .with_fill(ShapeFill::new("7B1FA2"))
381        .with_text("A");
382    
383    let box5 = Shape::new(ShapeType::Ellipse, 4000000, 3200000, 1500000, 800000)
384        .with_id(104)
385        .with_fill(ShapeFill::new("00838F"))
386        .with_text("B");
387    
388    let box6 = Shape::new(ShapeType::Ellipse, 7000000, 3200000, 1500000, 800000)
389        .with_id(105)
390        .with_fill(ShapeFill::new("EF6C00"))
391        .with_text("C");
392    
393    // Curved connector with diamond arrow
394    let conn3 = Connector::curved(2500000, 3600000, 4000000, 3600000)
395        .with_line(ConnectorLine::new("7B1FA2", 19050).with_dash(LineDash::DashDot))
396        .with_arrows(ArrowType::Oval, ArrowType::Diamond);
397    
398    // Dotted connector
399    let conn4 = Connector::straight(5500000, 3600000, 7000000, 3600000)
400        .with_line(ConnectorLine::new("00838F", 12700).with_dash(LineDash::Dot))
401        .with_end_arrow(ArrowType::Open);
402    
403    slides.push(
404        SlideContent::new("Styled Connectors - Types, Arrows, Dashes")
405            .add_shape(box1)
406            .add_shape(box2)
407            .add_shape(box3)
408            .add_shape(box4)
409            .add_shape(box5)
410            .add_shape(box6)
411            .add_connector(conn1)
412            .add_connector(conn2)
413            .add_connector(conn3)
414            .add_connector(conn4)
415            .title_color("1F497D")
416    );
417
418    // =========================================================================
419    // SLIDE 13: Images
420    // =========================================================================
421    println!("🖼️  Slide 13: Image Placeholders");
422    
423    let img1 = Image::new("logo.png", 2500000, 1800000, "png")
424        .position(500000, 1600000);
425    let img2 = Image::new("photo.jpg", 2500000, 1800000, "jpg")
426        .position(3500000, 1600000);
427    let img3 = Image::new("diagram.png", 2000000, 1800000, "png")
428        .position(6500000, 1600000);
429    
430    slides.push(
431        SlideContent::new("Image Placeholders")
432            .add_image(img1)
433            .add_image(img2)
434            .add_image(img3)
435            .title_color("1F497D")
436    );
437
438    // =========================================================================
439    // SLIDE 11: Advanced Table with Borders & Alignment (NEW)
440    // =========================================================================
441    println!("📊 Slide 11: Advanced Table (borders, alignment, merged cells)");
442    
443    // Build advanced table using generator's TableBuilder with alignment
444    let advanced_table = TableBuilder::new(vec![2000000, 2000000, 2000000, 2000000])
445        .add_row(TableRow::new(vec![
446            TableCell::new("Q1 2024 Financial Report").bold().background_color("1F4E79").text_color("FFFFFF").align_center().font_size(14),
447            TableCell::new("").background_color("1F4E79"),
448            TableCell::new("").background_color("1F4E79"),
449            TableCell::new("").background_color("1F4E79"),
450        ]))
451        .add_row(TableRow::new(vec![
452            TableCell::new("Category").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
453            TableCell::new("Revenue").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
454            TableCell::new("Expenses").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
455            TableCell::new("Profit").bold().background_color("2E75B6").text_color("FFFFFF").align_center(),
456        ]))
457        .add_row(TableRow::new(vec![
458            TableCell::new("Product Sales").text_color("000000").align_left(),
459            TableCell::new("$1,250,000").text_color("2E7D32").align_right(),
460            TableCell::new("$450,000").text_color("C62828").align_right(),
461            TableCell::new("$800,000").bold().text_color("2E7D32").align_right(),
462        ]))
463        .add_row(TableRow::new(vec![
464            TableCell::new("Services").text_color("000000").align_left(),
465            TableCell::new("$890,000").text_color("2E7D32").align_right(),
466            TableCell::new("$320,000").text_color("C62828").align_right(),
467            TableCell::new("$570,000").bold().text_color("2E7D32").align_right(),
468        ]))
469        .add_row(TableRow::new(vec![
470            TableCell::new("Total").bold().background_color("E7E6E6").text_color("000000").align_left(),
471            TableCell::new("$2,140,000").bold().background_color("E7E6E6").text_color("000000").align_right(),
472            TableCell::new("$770,000").bold().background_color("E7E6E6").text_color("000000").align_right(),
473            TableCell::new("$1,370,000").bold().background_color("C6EFCE").text_color("006100").align_right(),
474        ]))
475        .position(300000, 1600000)
476        .build();
477    
478    slides.push(
479        SlideContent::new("Financial Report - Advanced Table")
480            .table(advanced_table)
481            .title_color("1F4E79")
482            .title_bold(true)
483    );
484
485    // =========================================================================
486    // SLIDE 12: Comparison Matrix Table (NEW)
487    // =========================================================================
488    println!("📊 Slide 12: Comparison Matrix Table");
489    
490    let comparison_table = TableBuilder::new(vec![2000000, 1500000, 1500000, 1500000])
491        .add_row(TableRow::new(vec![
492            TableCell::new("Feature").bold().background_color("4472C4").text_color("FFFFFF"),
493            TableCell::new("Basic").bold().background_color("4472C4").text_color("FFFFFF"),
494            TableCell::new("Pro").bold().background_color("4472C4").text_color("FFFFFF"),
495            TableCell::new("Enterprise").bold().background_color("4472C4").text_color("FFFFFF"),
496        ]))
497        .add_row(TableRow::new(vec![
498            TableCell::new("Storage").text_color("000000"),
499            TableCell::new("5 GB").text_color("000000"),
500            TableCell::new("50 GB").text_color("000000"),
501            TableCell::new("Unlimited").bold().text_color("2E7D32"),
502        ]))
503        .add_row(TableRow::new(vec![
504            TableCell::new("Users").text_color("000000"),
505            TableCell::new("1").text_color("000000"),
506            TableCell::new("10").text_color("000000"),
507            TableCell::new("Unlimited").bold().text_color("2E7D32"),
508        ]))
509        .add_row(TableRow::new(vec![
510            TableCell::new("Support").text_color("000000"),
511            TableCell::new("Email").text_color("000000"),
512            TableCell::new("24/7 Chat").text_color("000000"),
513            TableCell::new("Dedicated").bold().text_color("2E7D32"),
514        ]))
515        .add_row(TableRow::new(vec![
516            TableCell::new("API Access").text_color("000000"),
517            TableCell::new("No").text_color("C62828"),
518            TableCell::new("Yes").text_color("2E7D32"),
519            TableCell::new("Yes + Priority").bold().text_color("2E7D32"),
520        ]))
521        .add_row(TableRow::new(vec![
522            TableCell::new("Price/month").bold().background_color("F2F2F2").text_color("000000"),
523            TableCell::new("$9").bold().background_color("F2F2F2").text_color("000000"),
524            TableCell::new("$29").bold().background_color("F2F2F2").text_color("000000"),
525            TableCell::new("$99").bold().background_color("F2F2F2").text_color("000000"),
526        ]))
527        .position(500000, 1600000)
528        .build();
529    
530    slides.push(
531        SlideContent::new("Pricing Comparison Matrix")
532            .table(comparison_table)
533            .title_color("4472C4")
534            .title_bold(true)
535    );
536
537    // =========================================================================
538    // SLIDE 13: Process Flow with Shapes (NEW - SmartArt-like)
539    // =========================================================================
540    println!("🔷 Slide 13: Process Flow (SmartArt-style)");
541    
542    // Create process flow using shapes
543    let step1 = Shape::new(ShapeType::RoundedRectangle, 300000, 2000000, 1400000, 800000)
544        .with_fill(ShapeFill::new("4472C4"))
545        .with_text("1. Research");
546    let arrow1 = Shape::new(ShapeType::RightArrow, 1800000, 2200000, 400000, 400000)
547        .with_fill(ShapeFill::new("A5A5A5"));
548    let step2 = Shape::new(ShapeType::RoundedRectangle, 2300000, 2000000, 1400000, 800000)
549        .with_fill(ShapeFill::new("ED7D31"))
550        .with_text("2. Design");
551    let arrow2 = Shape::new(ShapeType::RightArrow, 3800000, 2200000, 400000, 400000)
552        .with_fill(ShapeFill::new("A5A5A5"));
553    let step3 = Shape::new(ShapeType::RoundedRectangle, 4300000, 2000000, 1400000, 800000)
554        .with_fill(ShapeFill::new("70AD47"))
555        .with_text("3. Develop");
556    let arrow3 = Shape::new(ShapeType::RightArrow, 5800000, 2200000, 400000, 400000)
557        .with_fill(ShapeFill::new("A5A5A5"));
558    let step4 = Shape::new(ShapeType::RoundedRectangle, 6300000, 2000000, 1400000, 800000)
559        .with_fill(ShapeFill::new("5B9BD5"))
560        .with_text("4. Deploy");
561    
562    slides.push(
563        SlideContent::new("Development Process Flow")
564            .add_shape(step1)
565            .add_shape(arrow1)
566            .add_shape(step2)
567            .add_shape(arrow2)
568            .add_shape(step3)
569            .add_shape(arrow3)
570            .add_shape(step4)
571            .title_color("1F497D")
572            .title_bold(true)
573    );
574
575    // =========================================================================
576    // SLIDE 14: Organization Chart with Shapes (NEW)
577    // =========================================================================
578    println!("🔷 Slide 14: Organization Chart");
579    
580    // CEO at top
581    let ceo = Shape::new(ShapeType::RoundedRectangle, 3500000, 1400000, 2000000, 600000)
582        .with_fill(ShapeFill::new("1F4E79"))
583        .with_text("CEO");
584    
585    // Vertical line from CEO
586    let line1 = Shape::new(ShapeType::Rectangle, 4450000, 2000000, 100000, 400000)
587        .with_fill(ShapeFill::new("A5A5A5"));
588    
589    // Horizontal connector
590    let hline = Shape::new(ShapeType::Rectangle, 1950000, 2400000, 5100000, 50000)
591        .with_fill(ShapeFill::new("A5A5A5"));
592    
593    // CTO, CFO, COO
594    let cto = Shape::new(ShapeType::RoundedRectangle, 1000000, 2600000, 1800000, 500000)
595        .with_fill(ShapeFill::new("2E75B6"))
596        .with_text("CTO");
597    let cfo = Shape::new(ShapeType::RoundedRectangle, 3600000, 2600000, 1800000, 500000)
598        .with_fill(ShapeFill::new("2E75B6"))
599        .with_text("CFO");
600    let coo = Shape::new(ShapeType::RoundedRectangle, 6200000, 2600000, 1800000, 500000)
601        .with_fill(ShapeFill::new("2E75B6"))
602        .with_text("COO");
603    
604    // Vertical lines to departments
605    let vline1 = Shape::new(ShapeType::Rectangle, 1850000, 2450000, 50000, 150000)
606        .with_fill(ShapeFill::new("A5A5A5"));
607    let vline2 = Shape::new(ShapeType::Rectangle, 4450000, 2450000, 50000, 150000)
608        .with_fill(ShapeFill::new("A5A5A5"));
609    let vline3 = Shape::new(ShapeType::Rectangle, 7050000, 2450000, 50000, 150000)
610        .with_fill(ShapeFill::new("A5A5A5"));
611    
612    // Teams under CTO
613    let eng = Shape::new(ShapeType::Rectangle, 500000, 3300000, 1200000, 400000)
614        .with_fill(ShapeFill::new("BDD7EE"))
615        .with_text("Engineering");
616    let product = Shape::new(ShapeType::Rectangle, 1800000, 3300000, 1200000, 400000)
617        .with_fill(ShapeFill::new("BDD7EE"))
618        .with_text("Product");
619    
620    slides.push(
621        SlideContent::new("Organization Structure")
622            .add_shape(ceo)
623            .add_shape(line1)
624            .add_shape(hline)
625            .add_shape(cto)
626            .add_shape(cfo)
627            .add_shape(coo)
628            .add_shape(vline1)
629            .add_shape(vline2)
630            .add_shape(vline3)
631            .add_shape(eng)
632            .add_shape(product)
633            .title_color("1F4E79")
634            .title_bold(true)
635    );
636
637    // =========================================================================
638    // SLIDE 15: PDCA Cycle Diagram (NEW)
639    // =========================================================================
640    println!("🔷 Slide 15: PDCA Cycle Diagram");
641    
642    // Four quadrants for PDCA
643    let plan = Shape::new(ShapeType::RoundedRectangle, 1500000, 1600000, 2500000, 1500000)
644        .with_fill(ShapeFill::new("4472C4"))
645        .with_text("PLAN\n\nDefine goals\nand strategy");
646    let do_box = Shape::new(ShapeType::RoundedRectangle, 4500000, 1600000, 2500000, 1500000)
647        .with_fill(ShapeFill::new("ED7D31"))
648        .with_text("DO\n\nImplement\nthe plan");
649    let check = Shape::new(ShapeType::RoundedRectangle, 4500000, 3300000, 2500000, 1500000)
650        .with_fill(ShapeFill::new("70AD47"))
651        .with_text("CHECK\n\nMeasure\nresults");
652    let act = Shape::new(ShapeType::RoundedRectangle, 1500000, 3300000, 2500000, 1500000)
653        .with_fill(ShapeFill::new("FFC000"))
654        .with_text("ACT\n\nAdjust and\nimprove");
655    
656    // Arrows between quadrants
657    let arr1 = Shape::new(ShapeType::RightArrow, 4100000, 2100000, 300000, 300000)
658        .with_fill(ShapeFill::new("A5A5A5"));
659    let arr2 = Shape::new(ShapeType::DownArrow, 5600000, 3200000, 300000, 200000)
660        .with_fill(ShapeFill::new("A5A5A5"));
661    let arr3 = Shape::new(ShapeType::LeftArrow, 4100000, 3800000, 300000, 300000)
662        .with_fill(ShapeFill::new("A5A5A5"));
663    let arr4 = Shape::new(ShapeType::UpArrow, 2600000, 3200000, 300000, 200000)
664        .with_fill(ShapeFill::new("A5A5A5"));
665    
666    slides.push(
667        SlideContent::new("PDCA Continuous Improvement Cycle")
668            .add_shape(plan)
669            .add_shape(do_box)
670            .add_shape(check)
671            .add_shape(act)
672            .add_shape(arr1)
673            .add_shape(arr2)
674            .add_shape(arr3)
675            .add_shape(arr4)
676            .title_color("1F497D")
677            .title_bold(true)
678    );
679
680    // =========================================================================
681    // SLIDE 16: Pyramid Diagram (Maslow's Hierarchy) (NEW)
682    // =========================================================================
683    println!("🔷 Slide 16: Pyramid Diagram");
684    
685    // Build pyramid from bottom to top
686    let level5 = Shape::new(ShapeType::Trapezoid, 500000, 4000000, 8000000, 600000)
687        .with_fill(ShapeFill::new("C00000"))
688        .with_text("Physiological Needs - Food, Water, Shelter");
689    let level4 = Shape::new(ShapeType::Trapezoid, 1000000, 3400000, 7000000, 600000)
690        .with_fill(ShapeFill::new("ED7D31"))
691        .with_text("Safety Needs - Security, Stability");
692    let level3 = Shape::new(ShapeType::Trapezoid, 1500000, 2800000, 6000000, 600000)
693        .with_fill(ShapeFill::new("FFC000"))
694        .with_text("Love & Belonging - Relationships");
695    let level2 = Shape::new(ShapeType::Trapezoid, 2000000, 2200000, 5000000, 600000)
696        .with_fill(ShapeFill::new("70AD47"))
697        .with_text("Esteem - Achievement, Respect");
698    let level1 = Shape::new(ShapeType::Triangle, 2500000, 1500000, 4000000, 700000)
699        .with_fill(ShapeFill::new("4472C4"))
700        .with_text("Self-Actualization");
701    
702    slides.push(
703        SlideContent::new("Maslow's Hierarchy of Needs")
704            .add_shape(level5)
705            .add_shape(level4)
706            .add_shape(level3)
707            .add_shape(level2)
708            .add_shape(level1)
709            .title_color("1F497D")
710            .title_bold(true)
711    );
712
713    // =========================================================================
714    // SLIDE 17: Venn Diagram (NEW)
715    // =========================================================================
716    println!("🔷 Slide 17: Venn Diagram");
717    
718    // Three overlapping circles
719    let circle1 = Shape::new(ShapeType::Ellipse, 1500000, 1800000, 3000000, 3000000)
720        .with_fill(ShapeFill::new("4472C4"))
721        .with_text("Skills");
722    let circle2 = Shape::new(ShapeType::Ellipse, 3500000, 1800000, 3000000, 3000000)
723        .with_fill(ShapeFill::new("ED7D31"))
724        .with_text("Passion");
725    let circle3 = Shape::new(ShapeType::Ellipse, 2500000, 3200000, 3000000, 3000000)
726        .with_fill(ShapeFill::new("70AD47"))
727        .with_text("Market Need");
728    
729    // Center label
730    let center = Shape::new(ShapeType::Ellipse, 3200000, 2800000, 1600000, 800000)
731        .with_fill(ShapeFill::new("FFFFFF"))
732        .with_text("IKIGAI");
733    
734    slides.push(
735        SlideContent::new("Finding Your Ikigai - Venn Diagram")
736            .add_shape(circle1)
737            .add_shape(circle2)
738            .add_shape(circle3)
739            .add_shape(center)
740            .title_color("1F497D")
741            .title_bold(true)
742    );
743
744    // =========================================================================
745    // SLIDE 18: Timeline/Roadmap (NEW)
746    // =========================================================================
747    println!("📊 Slide 18: Project Timeline");
748    
749    let timeline_table = TableBuilder::new(vec![1500000, 1500000, 1500000, 1500000, 1500000])
750        .add_row(TableRow::new(vec![
751            TableCell::new("Q1 2024").bold().background_color("4472C4").text_color("FFFFFF"),
752            TableCell::new("Q2 2024").bold().background_color("4472C4").text_color("FFFFFF"),
753            TableCell::new("Q3 2024").bold().background_color("4472C4").text_color("FFFFFF"),
754            TableCell::new("Q4 2024").bold().background_color("4472C4").text_color("FFFFFF"),
755            TableCell::new("Q1 2025").bold().background_color("4472C4").text_color("FFFFFF"),
756        ]))
757        .add_row(TableRow::new(vec![
758            TableCell::new("Research\n& Planning").background_color("BDD7EE").text_color("1F497D"),
759            TableCell::new("Design\nPhase").background_color("BDD7EE").text_color("1F497D"),
760            TableCell::new("Development\nSprint 1-3").background_color("C6EFCE").text_color("006100"),
761            TableCell::new("Testing\n& QA").background_color("FCE4D6").text_color("C65911"),
762            TableCell::new("Launch\n& Support").background_color("E2EFDA").text_color("375623"),
763        ]))
764        .add_row(TableRow::new(vec![
765            TableCell::new("✓ Complete").bold().text_color("2E7D32"),
766            TableCell::new("✓ Complete").bold().text_color("2E7D32"),
767            TableCell::new("In Progress").text_color("ED7D31"),
768            TableCell::new("Planned").text_color("7F7F7F"),
769            TableCell::new("Planned").text_color("7F7F7F"),
770        ]))
771        .position(300000, 2000000)
772        .build();
773    
774    slides.push(
775        SlideContent::new("Project Roadmap 2024-2025")
776            .table(timeline_table)
777            .title_color("1F497D")
778            .title_bold(true)
779    );
780
781    // =========================================================================
782    // SLIDE 19: Dashboard Summary (NEW - using Dimension API)
783    // =========================================================================
784    println!("🔷 Slide 19: Dashboard with KPIs (Dimension API)");
785    
786    // KPI boxes using ratio-based positioning — automatically adapts to any slide size
787    let kpi1 = Shape::from_dimensions(ShapeType::RoundedRectangle,
788        Dimension::percent(3.0), Dimension::percent(23.0),
789        Dimension::percent(22.0), Dimension::percent(18.0),
790    ).with_fill(ShapeFill::new("4472C4")).with_text("Revenue\n\n$2.14M\n+15% YoY");
791
792    let kpi2 = Shape::from_dimensions(ShapeType::RoundedRectangle,
793        Dimension::percent(27.0), Dimension::percent(23.0),
794        Dimension::percent(22.0), Dimension::percent(18.0),
795    ).with_fill(ShapeFill::new("70AD47")).with_text("Customers\n\n12,450\n+22% YoY");
796
797    let kpi3 = Shape::from_dimensions(ShapeType::RoundedRectangle,
798        Dimension::percent(51.0), Dimension::percent(23.0),
799        Dimension::percent(22.0), Dimension::percent(18.0),
800    ).with_fill(ShapeFill::new("ED7D31")).with_text("NPS Score\n\n72\n+8 pts");
801
802    let kpi4 = Shape::from_dimensions(ShapeType::RoundedRectangle,
803        Dimension::percent(75.0), Dimension::percent(23.0),
804        Dimension::percent(22.0), Dimension::percent(18.0),
805    ).with_fill(ShapeFill::new("5B9BD5")).with_text("Retention\n\n94%\n+3% YoY");
806    
807    // Status indicators using mixed units: percent for X, inches for size
808    let status1 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
809        .at(Dimension::percent(14.0), Dimension::percent(42.0))
810        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
811        .with_fill(ShapeFill::new("70AD47"));
812    let status2 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
813        .at(Dimension::percent(38.0), Dimension::percent(42.0))
814        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
815        .with_fill(ShapeFill::new("70AD47"));
816    let status3 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
817        .at(Dimension::percent(62.0), Dimension::percent(42.0))
818        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
819        .with_fill(ShapeFill::new("FFC000"));
820    let status4 = Shape::new(ShapeType::Ellipse, 0, 0, 0, 0)
821        .at(Dimension::percent(86.0), Dimension::percent(42.0))
822        .with_dimensions(Dimension::Inches(0.3), Dimension::Inches(0.3))
823        .with_fill(ShapeFill::new("70AD47"));
824    
825    slides.push(
826        SlideContent::new("Executive Dashboard - Q1 2024")
827            .add_shape(kpi1)
828            .add_shape(kpi2)
829            .add_shape(kpi3)
830            .add_shape(kpi4)
831            .add_shape(status1)
832            .add_shape(status2)
833            .add_shape(status3)
834            .add_shape(status4)
835            .title_color("1F497D")
836            .title_bold(true)
837    );
838
839    // =========================================================================
840    // SLIDE 20: Summary Slide (NEW)
841    // =========================================================================
842    println!("📝 Slide 20: Summary with Speaker Notes");
843    
844    slides.push(
845        SlideContent::new("Summary & Next Steps")
846            .layout(SlideLayout::TitleAndContent)
847            .title_color("1F497D")
848            .title_bold(true)
849            .add_bullet("Completed: Research, Design, Initial Development")
850            .add_bullet("In Progress: Sprint 3 Development")
851            .add_bullet("Next: QA Testing Phase (Q4 2024)")
852            .add_bullet("Launch Target: Q1 2025")
853            .add_bullet("Key Risks: Resource constraints, Timeline pressure")
854            .content_size(24)
855            .notes("Speaker Notes:\n\n1. Emphasize the progress made\n2. Highlight key achievements\n3. Address any concerns about timeline\n4. Open for Q&A")
856    );
857
858    // =========================================================================
859    // SLIDE 21: Bullet Styles (NEW v0.2.1)
860    // =========================================================================
861    println!("🔢 Slide 21: Bullet Styles (NEW)");
862    
863    // Numbered list
864    slides.push(
865        SlideContent::new("Bullet Styles - Numbered List")
866            .layout(SlideLayout::TitleAndContent)
867            .title_color("1F497D")
868            .title_bold(true)
869            .with_bullet_style(BulletStyle::Number)
870            .add_bullet("First numbered item")
871            .add_bullet("Second numbered item")
872            .add_bullet("Third numbered item")
873            .add_bullet("Fourth numbered item")
874            .content_size(28)
875    );
876
877    // =========================================================================
878    // SLIDE 22: Lettered Lists (NEW v0.2.1)
879    // =========================================================================
880    println!("🔤 Slide 22: Lettered Lists (NEW)");
881    
882    slides.push(
883        SlideContent::new("Bullet Styles - Lettered Lists")
884            .layout(SlideLayout::TitleAndContent)
885            .title_color("1F497D")
886            .title_bold(true)
887            .add_lettered("Option A - First choice")
888            .add_lettered("Option B - Second choice")
889            .add_lettered("Option C - Third choice")
890            .add_lettered("Option D - Fourth choice")
891            .content_size(28)
892    );
893
894    // =========================================================================
895    // SLIDE 23: Roman Numerals (NEW v0.2.1)
896    // =========================================================================
897    println!("🏛️ Slide 23: Roman Numerals (NEW)");
898    
899    slides.push(
900        SlideContent::new("Bullet Styles - Roman Numerals")
901            .layout(SlideLayout::TitleAndContent)
902            .title_color("1F497D")
903            .title_bold(true)
904            .with_bullet_style(BulletStyle::RomanUpper)
905            .add_bullet("Chapter I - Introduction")
906            .add_bullet("Chapter II - Background")
907            .add_bullet("Chapter III - Methodology")
908            .add_bullet("Chapter IV - Results")
909            .add_bullet("Chapter V - Conclusion")
910            .content_size(28)
911    );
912
913    // =========================================================================
914    // SLIDE 24: Custom Bullets (NEW v0.2.1)
915    // =========================================================================
916    println!("⭐ Slide 24: Custom Bullets (NEW)");
917    
918    slides.push(
919        SlideContent::new("Bullet Styles - Custom Characters")
920            .layout(SlideLayout::TitleAndContent)
921            .title_color("1F497D")
922            .title_bold(true)
923            .add_styled_bullet("Star bullet point", BulletStyle::Custom('★'))
924            .add_styled_bullet("Arrow bullet point", BulletStyle::Custom('→'))
925            .add_styled_bullet("Check bullet point", BulletStyle::Custom('✓'))
926            .add_styled_bullet("Diamond bullet point", BulletStyle::Custom('◆'))
927            .add_styled_bullet("Heart bullet point", BulletStyle::Custom('♥'))
928            .content_size(28)
929    );
930
931    // =========================================================================
932    // SLIDE 25: Sub-bullets / Hierarchy (NEW v0.2.1)
933    // =========================================================================
934    println!("📊 Slide 25: Sub-bullets Hierarchy (NEW)");
935    
936    slides.push(
937        SlideContent::new("Bullet Styles - Hierarchical Lists")
938            .layout(SlideLayout::TitleAndContent)
939            .title_color("1F497D")
940            .title_bold(true)
941            .add_bullet("Main Topic 1")
942            .add_sub_bullet("Supporting detail A")
943            .add_sub_bullet("Supporting detail B")
944            .add_bullet("Main Topic 2")
945            .add_sub_bullet("Supporting detail C")
946            .add_sub_bullet("Supporting detail D")
947            .add_bullet("Main Topic 3")
948            .content_size(24)
949    );
950
951    // =========================================================================
952    // SLIDE 26: Text Enhancements (NEW v0.2.1)
953    // =========================================================================
954    println!("✏️ Slide 26: Text Enhancements (NEW)");
955    
956    // Use BulletPoint with formatting
957    let strikethrough_bullet = BulletPoint::new("Strikethrough: This text is crossed out").strikethrough();
958    let highlight_bullet = BulletPoint::new("Highlight: Yellow background for emphasis").highlight("FFFF00");
959    let subscript_bullet = BulletPoint::new("Subscript: H₂O - for chemical formulas").subscript();
960    let superscript_bullet = BulletPoint::new("Superscript: x² - for math expressions").superscript();
961    let bold_colored = BulletPoint::new("Combined: Bold + Red color").bold().color("FF0000");
962    
963    let mut text_enhancements_slide = SlideContent::new("Text Enhancements - New Formatting")
964        .layout(SlideLayout::TitleAndContent)
965        .title_color("1F497D")
966        .title_bold(true)
967        .content_size(24);
968    text_enhancements_slide.bullets.push(strikethrough_bullet);
969    text_enhancements_slide.bullets.push(highlight_bullet);
970    text_enhancements_slide.bullets.push(subscript_bullet);
971    text_enhancements_slide.bullets.push(superscript_bullet);
972    text_enhancements_slide.bullets.push(bold_colored);
973    
974    slides.push(text_enhancements_slide);
975
976    // =========================================================================
977    // SLIDE 27: Font Size Presets (NEW v0.2.1)
978    // =========================================================================
979    println!("🔤 Slide 27: Font Size Presets (NEW)");
980    
981    // Demonstrate different font sizes per bullet
982    let large_bullet = BulletPoint::new(&format!("LARGE: {}pt - Extra large text", font_sizes::LARGE)).font_size(font_sizes::LARGE);
983    let heading_bullet = BulletPoint::new(&format!("HEADING: {}pt - Section headers", font_sizes::HEADING)).font_size(font_sizes::HEADING);
984    let body_bullet = BulletPoint::new(&format!("BODY: {}pt - Regular content", font_sizes::BODY)).font_size(font_sizes::BODY);
985    let small_bullet = BulletPoint::new(&format!("SMALL: {}pt - Smaller text", font_sizes::SMALL)).font_size(font_sizes::SMALL);
986    let caption_bullet = BulletPoint::new(&format!("CAPTION: {}pt - Captions and notes", font_sizes::CAPTION)).font_size(font_sizes::CAPTION);
987    
988    let mut font_size_slide = SlideContent::new("Font Size Presets - Each line different size")
989        .layout(SlideLayout::TitleAndContent)
990        .title_color("1F497D")
991        .title_bold(true)
992        .title_size(font_sizes::TITLE);
993    font_size_slide.bullets.push(large_bullet);
994    font_size_slide.bullets.push(heading_bullet);
995    font_size_slide.bullets.push(body_bullet);
996    font_size_slide.bullets.push(small_bullet);
997    font_size_slide.bullets.push(caption_bullet);
998    
999    slides.push(font_size_slide);
1000
1001    // =========================================================================
1002    // SLIDE 28: Theme Colors (NEW v0.2.1)
1003    // =========================================================================
1004    println!("🎨 Slide 28: Theme Colors (NEW)");
1005    
1006    // Create shapes with theme colors
1007    let corporate_shape = Shape::new(ShapeType::Rectangle, 500000, 1600000, 1800000, 800000)
1008        .with_fill(ShapeFill::new(themes::CORPORATE.primary))
1009        .with_text("Corporate");
1010    
1011    let modern_shape = Shape::new(ShapeType::Rectangle, 2500000, 1600000, 1800000, 800000)
1012        .with_fill(ShapeFill::new(themes::MODERN.primary))
1013        .with_text("Modern");
1014    
1015    let vibrant_shape = Shape::new(ShapeType::Rectangle, 4500000, 1600000, 1800000, 800000)
1016        .with_fill(ShapeFill::new(themes::VIBRANT.primary))
1017        .with_text("Vibrant");
1018    
1019    let dark_shape = Shape::new(ShapeType::Rectangle, 6500000, 1600000, 1800000, 800000)
1020        .with_fill(ShapeFill::new(themes::DARK.primary))
1021        .with_text("Dark");
1022    
1023    let nature_shape = Shape::new(ShapeType::Rectangle, 500000, 2700000, 1800000, 800000)
1024        .with_fill(ShapeFill::new(themes::NATURE.primary))
1025        .with_text("Nature");
1026    
1027    let tech_shape = Shape::new(ShapeType::Rectangle, 2500000, 2700000, 1800000, 800000)
1028        .with_fill(ShapeFill::new(themes::TECH.primary))
1029        .with_text("Tech");
1030    
1031    let carbon_shape = Shape::new(ShapeType::Rectangle, 4500000, 2700000, 1800000, 800000)
1032        .with_fill(ShapeFill::new(themes::CARBON.primary))
1033        .with_text("Carbon");
1034    
1035    slides.push(
1036        SlideContent::new("Theme Color Palettes")
1037            .layout(SlideLayout::TitleAndContent)
1038            .title_color("1F497D")
1039            .title_bold(true)
1040            .add_shape(corporate_shape)
1041            .add_shape(modern_shape)
1042            .add_shape(vibrant_shape)
1043            .add_shape(dark_shape)
1044            .add_shape(nature_shape)
1045            .add_shape(tech_shape)
1046            .add_shape(carbon_shape)
1047    );
1048
1049    // =========================================================================
1050    // SLIDE 29: Material & Carbon Design Colors (NEW v0.2.1)
1051    // =========================================================================
1052    println!("🌈 Slide 29: Material & Carbon Colors (NEW)");
1053    
1054    // Material Design colors
1055    let material_red = Shape::new(ShapeType::Rectangle, 500000, 1600000, 1200000, 600000)
1056        .with_fill(ShapeFill::new(colors::MATERIAL_RED))
1057        .with_text("M-Red");
1058    
1059    let material_blue = Shape::new(ShapeType::Rectangle, 1900000, 1600000, 1200000, 600000)
1060        .with_fill(ShapeFill::new(colors::MATERIAL_BLUE))
1061        .with_text("M-Blue");
1062    
1063    let material_green = Shape::new(ShapeType::Rectangle, 3300000, 1600000, 1200000, 600000)
1064        .with_fill(ShapeFill::new(colors::MATERIAL_GREEN))
1065        .with_text("M-Green");
1066    
1067    let material_orange = Shape::new(ShapeType::Rectangle, 4700000, 1600000, 1200000, 600000)
1068        .with_fill(ShapeFill::new(colors::MATERIAL_ORANGE))
1069        .with_text("M-Orange");
1070    
1071    let material_purple = Shape::new(ShapeType::Rectangle, 6100000, 1600000, 1200000, 600000)
1072        .with_fill(ShapeFill::new(colors::MATERIAL_PURPLE))
1073        .with_text("M-Purple");
1074    
1075    // Carbon Design colors
1076    let carbon_blue = Shape::new(ShapeType::Rectangle, 500000, 2500000, 1200000, 600000)
1077        .with_fill(ShapeFill::new(colors::CARBON_BLUE_60))
1078        .with_text("C-Blue");
1079    
1080    let carbon_green = Shape::new(ShapeType::Rectangle, 1900000, 2500000, 1200000, 600000)
1081        .with_fill(ShapeFill::new(colors::CARBON_GREEN_50))
1082        .with_text("C-Green");
1083    
1084    let carbon_red = Shape::new(ShapeType::Rectangle, 3300000, 2500000, 1200000, 600000)
1085        .with_fill(ShapeFill::new(colors::CARBON_RED_60))
1086        .with_text("C-Red");
1087    
1088    let carbon_purple = Shape::new(ShapeType::Rectangle, 4700000, 2500000, 1200000, 600000)
1089        .with_fill(ShapeFill::new(colors::CARBON_PURPLE_60))
1090        .with_text("C-Purple");
1091    
1092    let carbon_gray = Shape::new(ShapeType::Rectangle, 6100000, 2500000, 1200000, 600000)
1093        .with_fill(ShapeFill::new(colors::CARBON_GRAY_100))
1094        .with_text("C-Gray");
1095    
1096    slides.push(
1097        SlideContent::new("Material & Carbon Design Colors")
1098            .layout(SlideLayout::TitleAndContent)
1099            .title_color("1F497D")
1100            .title_bold(true)
1101            .add_shape(material_red)
1102            .add_shape(material_blue)
1103            .add_shape(material_green)
1104            .add_shape(material_orange)
1105            .add_shape(material_purple)
1106            .add_shape(carbon_blue)
1107            .add_shape(carbon_green)
1108            .add_shape(carbon_red)
1109            .add_shape(carbon_purple)
1110            .add_shape(carbon_gray)
1111    );
1112
1113    // =========================================================================
1114    // SLIDE 30: Image from Base64 (NEW v0.2.1)
1115    // =========================================================================
1116    println!("🖼️ Slide 30: Image from Base64 (NEW)");
1117    
1118    // 1x1 red PNG pixel in base64
1119    let _red_pixel_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==";
1120    
1121    // Create image from base64 (demonstrating the API)
1122    let _base64_image = ImageBuilder::from_base64(_red_pixel_base64, 914400, 914400, "PNG")
1123        .position(4000000, 2500000)
1124        .build();
1125    
1126    slides.push(
1127        SlideContent::new("Image Loading - New Methods")
1128            .layout(SlideLayout::TitleAndContent)
1129            .title_color("1F497D")
1130            .title_bold(true)
1131            .add_bullet("Image::new(path) - Load from file path")
1132            .add_bullet("Image::from_base64(data) - Load from base64 string")
1133            .add_bullet("Image::from_bytes(data) - Load from raw bytes")
1134            .add_bullet("ImageBuilder for fluent API configuration")
1135            .add_bullet("Built-in base64 decoder (no external deps)")
1136            .content_size(24)
1137    );
1138
1139    // =========================================================================
1140    // SLIDE 31: Feature Summary (NEW v0.2.1)
1141    // =========================================================================
1142    println!("📋 Slide 31: v0.2.1 Feature Summary (NEW)");
1143    
1144    slides.push(
1145        SlideContent::new("New Features in v0.2.1")
1146            .layout(SlideLayout::TitleAndContent)
1147            .title_color("1F497D")
1148            .title_bold(true)
1149            .add_numbered("BulletStyle: Number, Letter, Roman, Custom")
1150            .add_numbered("TextFormat: Strikethrough, Highlight")
1151            .add_numbered("TextFormat: Subscript, Superscript")
1152            .add_numbered("Font size presets in prelude")
1153            .add_numbered("Image::from_base64 and from_bytes")
1154            .add_numbered("Theme color palettes (7 themes)")
1155            .add_numbered("Material & Carbon Design colors")
1156            .content_size(24)
1157    );
1158
1159    // =========================================================================
1160    // SLIDE 32: Slide Show Settings - Comparison Table (REAL: embedded in presProps.xml)
1161    // =========================================================================
1162    println!("🎬 Slide 34: Slide Show Settings (Visual)");
1163
1164    let show_speaker = SlideShowSettings::new().pen_color(PenColor::red());
1165    let show_kiosk = SlideShowSettings::kiosk();
1166    let _show_range = SlideShowSettings::new()
1167        .show_type(ShowType::Browsed)
1168        .slide_range(SlideRange::Range { start: 1, end: 10 })
1169        .without_animation(true);
1170    let _speaker_xml = show_speaker.to_xml();
1171    let _kiosk_xml = show_kiosk.to_xml();
1172
1173    let show_table = TableBuilder::new(vec![2000000, 2000000, 2000000, 2000000])
1174        .add_row(TableRow::new(vec![
1175            TableCell::new("Setting").bold().background_color("1F4E79").text_color("FFFFFF"),
1176            TableCell::new("Speaker").bold().background_color("4472C4").text_color("FFFFFF"),
1177            TableCell::new("Kiosk").bold().background_color("ED7D31").text_color("FFFFFF"),
1178            TableCell::new("Browsed").bold().background_color("70AD47").text_color("FFFFFF"),
1179        ]))
1180        .add_row(TableRow::new(vec![
1181            TableCell::new("Loop").bold().background_color("D6E4F0"),
1182            TableCell::new("No"), TableCell::new("Yes").bold().text_color("2E7D32"),
1183            TableCell::new("No"),
1184        ]))
1185        .add_row(TableRow::new(vec![
1186            TableCell::new("Narration").bold().background_color("D6E4F0"),
1187            TableCell::new("Yes"), TableCell::new("No").text_color("C62828"),
1188            TableCell::new("Yes"),
1189        ]))
1190        .add_row(TableRow::new(vec![
1191            TableCell::new("Animation").bold().background_color("D6E4F0"),
1192            TableCell::new("Yes"), TableCell::new("Yes"),
1193            TableCell::new("No").text_color("C62828"),
1194        ]))
1195        .add_row(TableRow::new(vec![
1196            TableCell::new("Timings").bold().background_color("D6E4F0"),
1197            TableCell::new("Yes"), TableCell::new("Auto"),
1198            TableCell::new("Yes"),
1199        ]))
1200        .add_row(TableRow::new(vec![
1201            TableCell::new("Slide Range").bold().background_color("D6E4F0"),
1202            TableCell::new("All"), TableCell::new("All"),
1203            TableCell::new("1-10"),
1204        ]))
1205        .add_row(TableRow::new(vec![
1206            TableCell::new("Pen Color").bold().background_color("D6E4F0"),
1207            TableCell::new("Red").text_color("FF0000"),
1208            TableCell::new("Red").text_color("FF0000"),
1209            TableCell::new("Red").text_color("FF0000"),
1210        ]))
1211        .position(300000, 1600000)
1212        .build();
1213
1214    // Mode icons
1215    let icon_speaker = Shape::new(ShapeType::RoundedRectangle, 300000, 4200000, 2500000, 600000)
1216        .with_fill(ShapeFill::new("4472C4"))
1217        .with_text("Speaker: Full control");
1218    let icon_kiosk = Shape::new(ShapeType::RoundedRectangle, 3100000, 4200000, 2500000, 600000)
1219        .with_fill(ShapeFill::new("ED7D31"))
1220        .with_text("Kiosk: Auto-loop");
1221    let icon_browsed = Shape::new(ShapeType::RoundedRectangle, 5900000, 4200000, 2500000, 600000)
1222        .with_fill(ShapeFill::new("70AD47"))
1223        .with_text("Browsed: Scrollbar");
1224
1225    slides.push(
1226        SlideContent::new("Slide Show Settings - Mode Comparison")
1227            .table(show_table)
1228            .add_shape(icon_speaker)
1229            .add_shape(icon_kiosk)
1230            .add_shape(icon_browsed)
1231            .title_color("1F497D")
1232            .title_bold(true)
1233    );
1234
1235    // =========================================================================
1236    // SLIDE 35: Print Settings - Visual Handout Grid
1237    // =========================================================================
1238    println!("🖨️  Slide 35: Print Settings & Handouts (Visual)");
1239
1240    let print = PrintSettings::new()
1241        .print_what(PrintWhat::Handouts)
1242        .color_mode(PrintColorMode::Grayscale)
1243        .handout_layout(GenHandoutLayout::SlidesPerPage6)
1244        .frame_slides(true)
1245        .header("Q1 2025 Strategy Review")
1246        .footer("Confidential - Internal Use Only")
1247        .print_date(true)
1248        .print_page_numbers(true);
1249    let _prnpr_xml = print.to_prnpr_xml();
1250    let _handout_xml = print.to_handout_master_xml();
1251
1252    // Visual: 6-slide handout grid (2 cols x 3 rows)
1253    let hdr = Shape::new(ShapeType::Rectangle, 300000, 1500000, 4200000, 300000)
1254        .with_fill(ShapeFill::new("E7E6E6"))
1255        .with_text("Q1 2025 Strategy Review");
1256    // Row 1
1257    let s1 = Shape::new(ShapeType::Rectangle, 400000, 2000000, 1800000, 1100000)
1258        .with_line(ShapeLine::new("999999", 12700))
1259        .with_text("Slide 1");
1260    let s2 = Shape::new(ShapeType::Rectangle, 2500000, 2000000, 1800000, 1100000)
1261        .with_line(ShapeLine::new("999999", 12700))
1262        .with_text("Slide 2");
1263    // Row 2
1264    let s3 = Shape::new(ShapeType::Rectangle, 400000, 3200000, 1800000, 1100000)
1265        .with_line(ShapeLine::new("999999", 12700))
1266        .with_text("Slide 3");
1267    let s4 = Shape::new(ShapeType::Rectangle, 2500000, 3200000, 1800000, 1100000)
1268        .with_line(ShapeLine::new("999999", 12700))
1269        .with_text("Slide 4");
1270    // Row 3
1271    let s5 = Shape::new(ShapeType::Rectangle, 400000, 4400000, 1800000, 1100000)
1272        .with_line(ShapeLine::new("999999", 12700))
1273        .with_text("Slide 5");
1274    let s6 = Shape::new(ShapeType::Rectangle, 2500000, 4400000, 1800000, 1100000)
1275        .with_line(ShapeLine::new("999999", 12700))
1276        .with_text("Slide 6");
1277    let ftr = Shape::new(ShapeType::Rectangle, 300000, 5600000, 4200000, 300000)
1278        .with_fill(ShapeFill::new("E7E6E6"))
1279        .with_text("Confidential - Internal Use Only");
1280
1281    // Settings summary table on the right
1282    let print_table = TableBuilder::new(vec![1800000, 2000000])
1283        .add_row(TableRow::new(vec![
1284            TableCell::new("Print Settings").bold().background_color("1F4E79").text_color("FFFFFF"),
1285            TableCell::new("").background_color("1F4E79"),
1286        ]))
1287        .add_row(TableRow::new(vec![
1288            TableCell::new("Print What").bold().background_color("D6E4F0"),
1289            TableCell::new("Handouts"),
1290        ]))
1291        .add_row(TableRow::new(vec![
1292            TableCell::new("Color Mode").bold().background_color("D6E4F0"),
1293            TableCell::new("Grayscale"),
1294        ]))
1295        .add_row(TableRow::new(vec![
1296            TableCell::new("Layout").bold().background_color("D6E4F0"),
1297            TableCell::new("6 slides/page"),
1298        ]))
1299        .add_row(TableRow::new(vec![
1300            TableCell::new("Frame Slides").bold().background_color("D6E4F0"),
1301            TableCell::new("Yes"),
1302        ]))
1303        .add_row(TableRow::new(vec![
1304            TableCell::new("Date").bold().background_color("D6E4F0"),
1305            TableCell::new("Yes"),
1306        ]))
1307        .add_row(TableRow::new(vec![
1308            TableCell::new("Page Numbers").bold().background_color("D6E4F0"),
1309            TableCell::new("Yes"),
1310        ]))
1311        .position(5000000, 1800000)
1312        .build();
1313
1314    slides.push(
1315        SlideContent::new("Print Handout - 6 Slides Per Page")
1316            .table(print_table)
1317            .add_shape(hdr)
1318            .add_shape(s1).add_shape(s2)
1319            .add_shape(s3).add_shape(s4)
1320            .add_shape(s5).add_shape(s6)
1321            .add_shape(ftr)
1322            .title_color("1F497D")
1323            .title_bold(true)
1324    );
1325
1326    // =========================================================================
1327    // SLIDE 36: Advanced Table Merging - Actual Merged Table
1328    // =========================================================================
1329    println!("📊 Slide 36: Advanced Table Merging (Visual)");
1330
1331    // Use TableMergeMap to compute states, then build a visual table
1332    let mut merge_map = TableMergeMap::new(5, 4);
1333    merge_map.merge_cells(0, 0, 1, 4).unwrap(); // Title row spans all 4 cols
1334    merge_map.merge_cells(1, 0, 2, 1).unwrap(); // "Products" spans 2 rows
1335    merge_map.merge_cells(3, 0, 2, 1).unwrap(); // "Services" spans 2 rows
1336
1337    // Show merge state labels
1338    let state_00 = merge_map.cell_state(0, 0); // Anchor gridSpan=4
1339    let state_01 = merge_map.cell_state(0, 1); // HMerge
1340    let state_10 = merge_map.cell_state(1, 0); // Anchor rowSpan=2
1341    let state_20 = merge_map.cell_state(2, 0); // VMerge
1342    println!("   ├── (0,0): {}", state_00.to_xml_attrs().trim());
1343    println!("   ├── (0,1): {}", state_01.to_xml_attrs().trim());
1344    println!("   ├── (1,0): {}", state_10.to_xml_attrs().trim());
1345    println!("   └── (2,0): {}", state_20.to_xml_attrs().trim());
1346
1347    // Build the table with REAL merge attributes (gridSpan, rowSpan, hMerge, vMerge)
1348    let merge_table = TableBuilder::new(vec![1500000, 2000000, 2000000, 2000000])
1349        .add_row(TableRow::new(vec![
1350            TableCell::new("Q1 2025 Revenue Report").bold().background_color("1F4E79").text_color("FFFFFF").grid_span(4),
1351            TableCell::new("").background_color("1F4E79").h_merge(),
1352            TableCell::new("").background_color("1F4E79").h_merge(),
1353            TableCell::new("").background_color("1F4E79").h_merge(),
1354        ]))
1355        .add_row(TableRow::new(vec![
1356            TableCell::new("Products").bold().background_color("BDD7EE").text_color("1F497D").row_span(2),
1357            TableCell::new("Hardware").background_color("E2EFDA"),
1358            TableCell::new("$450,000").text_color("2E7D32").align_right(),
1359            TableCell::new("+12%").bold().text_color("2E7D32").align_right(),
1360        ]))
1361        .add_row(TableRow::new(vec![
1362            TableCell::new("").background_color("BDD7EE").v_merge(),
1363            TableCell::new("Software").background_color("E2EFDA"),
1364            TableCell::new("$680,000").text_color("2E7D32").align_right(),
1365            TableCell::new("+25%").bold().text_color("2E7D32").align_right(),
1366        ]))
1367        .add_row(TableRow::new(vec![
1368            TableCell::new("Services").bold().background_color("FCE4D6").text_color("C65911").row_span(2),
1369            TableCell::new("Consulting").background_color("FFF2CC"),
1370            TableCell::new("$320,000").text_color("2E7D32").align_right(),
1371            TableCell::new("+8%").bold().text_color("2E7D32").align_right(),
1372        ]))
1373        .add_row(TableRow::new(vec![
1374            TableCell::new("").background_color("FCE4D6").v_merge(),
1375            TableCell::new("Support").background_color("FFF2CC"),
1376            TableCell::new("$190,000").text_color("2E7D32").align_right(),
1377            TableCell::new("+5%").bold().text_color("2E7D32").align_right(),
1378        ]))
1379        .position(300000, 1600000)
1380        .build();
1381
1382    // Legend shapes
1383    let legend_anchor = Shape::new(ShapeType::RoundedRectangle, 300000, 4400000, 2000000, 400000)
1384        .with_fill(ShapeFill::new("4472C4"))
1385        .with_text("Anchor (gridSpan/rowSpan)");
1386    let legend_hmerge = Shape::new(ShapeType::RoundedRectangle, 2500000, 4400000, 2000000, 400000)
1387        .with_fill(ShapeFill::new("ED7D31"))
1388        .with_text("hMerge (col covered)");
1389    let legend_vmerge = Shape::new(ShapeType::RoundedRectangle, 4700000, 4400000, 2000000, 400000)
1390        .with_fill(ShapeFill::new("70AD47"))
1391        .with_text("vMerge (row covered)");
1392    let legend_normal = Shape::new(ShapeType::RoundedRectangle, 6900000, 4400000, 2000000, 400000)
1393        .with_fill(ShapeFill::new("A5A5A5"))
1394        .with_text("Normal (no merge)");
1395
1396    slides.push(
1397        SlideContent::new("Advanced Table Merging - Merged Cells")
1398            .table(merge_table)
1399            .add_shape(legend_anchor)
1400            .add_shape(legend_hmerge)
1401            .add_shape(legend_vmerge)
1402            .add_shape(legend_normal)
1403            .title_color("1F497D")
1404            .title_bold(true)
1405    );
1406
1407    // =========================================================================
1408    // Build PresentationSettings with all advanced features
1409    // =========================================================================
1410    println!("\n⚙️  Building Presentation Settings...");
1411
1412    // Slide show settings (embedded in presProps.xml as <p:showPr>)
1413    let show_settings = SlideShowSettings::new()
1414        .show_type(ShowType::Speaker)
1415        .pen_color(PenColor::red())
1416        .use_timings(true);
1417    println!("   ├── Slide Show: Speaker mode, red pen, timings enabled");
1418    println!("   │   └── XML: {} bytes", show_settings.to_xml().len());
1419
1420    // Print settings (embedded in presProps.xml as <p:prnPr>)
1421    let print_settings = PrintSettings::new()
1422        .print_what(PrintWhat::Handouts)
1423        .color_mode(PrintColorMode::Grayscale)
1424        .handout_layout(GenHandoutLayout::SlidesPerPage6)
1425        .frame_slides(true)
1426        .header("Q1 2025 Strategy Review")
1427        .footer("Confidential - Internal Use Only")
1428        .print_date(true)
1429        .print_page_numbers(true);
1430    println!("   └── Print: Handouts, 6/page, grayscale, framed");
1431    println!("       └── XML: {} bytes", print_settings.to_prnpr_xml().len());
1432
1433    let pres_settings = PresentationSettings::new()
1434        .slide_show(show_settings)
1435        .print(print_settings);
1436    println!("   All settings configured → presProps.xml");
1437
1438    // =========================================================================
1439    // Generate PPTX with real integrated features
1440    // =========================================================================
1441    println!("\n📦 Generating PPTX with integrated features...");
1442    let pptx_data = create_pptx_with_settings(
1443        "PPTX-RS Element Showcase",
1444        slides.clone(),
1445        Some(pres_settings),
1446    )?;
1447    fs::write("comprehensive_demo.pptx", &pptx_data)?;
1448    println!("   ✓ Created comprehensive_demo.pptx ({} slides, {} bytes)", 
1449             slides.len(), pptx_data.len());
1450
1451    // =========================================================================
1452    // Package Analysis - Demonstrate Reading
1453    // =========================================================================
1454    println!("\n📖 Package Analysis (Read Capability):");
1455    
1456    let package = Package::open("comprehensive_demo.pptx")?;
1457    let paths = package.part_paths();
1458    
1459    let slide_count = paths.iter()
1460        .filter(|p| p.starts_with("ppt/slides/slide") && p.ends_with(".xml"))
1461        .count();
1462    
1463    println!("   ├── Total parts: {}", package.part_count());
1464    println!("   ├── Slides: {}", slide_count);
1465    println!("   └── Package opened and analyzed successfully");
1466
1467    // =========================================================================
1468    // NEW: Parts API Demonstration
1469    // =========================================================================
1470    println!("\n🧩 Parts API Demonstration:");
1471    
1472    // SlideLayoutPart - 11 layout types
1473    println!("   ┌── SlideLayoutPart (11 layout types):");
1474    let layouts = [
1475        LayoutType::Title,
1476        LayoutType::TitleAndContent,
1477        LayoutType::SectionHeader,
1478        LayoutType::TwoContent,
1479        LayoutType::Comparison,
1480        LayoutType::TitleOnly,
1481        LayoutType::Blank,
1482        LayoutType::ContentWithCaption,
1483        LayoutType::PictureWithCaption,
1484        LayoutType::TitleAndVerticalText,
1485        LayoutType::VerticalTitleAndText,
1486    ];
1487    for (i, layout_type) in layouts.iter().enumerate() {
1488        let layout = SlideLayoutPart::new(i + 1, *layout_type);
1489        if i < 3 {
1490            println!("   │   ├── {}: {} ({})", i + 1, layout_type.name(), layout.path());
1491        }
1492    }
1493    println!("   │   └── ... and {} more layout types", layouts.len() - 3);
1494    
1495    // SlideMasterPart
1496    println!("   ├── SlideMasterPart:");
1497    let mut master = SlideMasterPart::new(1);
1498    master.set_name("Custom Master");
1499    master.add_layout_rel_id("rId2");
1500    master.add_layout_rel_id("rId3");
1501    println!("   │   ├── Name: {}", master.name());
1502    println!("   │   ├── Path: {}", master.path());
1503    println!("   │   └── Layouts: {} linked", master.layout_rel_ids().len());
1504    
1505    // ThemePart - Colors and Fonts
1506    println!("   ├── ThemePart (colors & fonts):");
1507    let mut theme = ThemePart::new(1);
1508    theme.set_name("Corporate Theme");
1509    theme.set_major_font("Arial");
1510    theme.set_minor_font("Calibri");
1511    theme.set_color("accent1", "FF5733");
1512    theme.set_color("accent2", "33FF57");
1513    let theme_xml = theme.to_xml()?;
1514    println!("   │   ├── Name: {}", theme.name());
1515    println!("   │   ├── Major Font: Arial");
1516    println!("   │   ├── Minor Font: Calibri");
1517    println!("   │   └── XML size: {} bytes", theme_xml.len());
1518    
1519    // NotesSlidePart - Speaker notes
1520    println!("   ├── NotesSlidePart (speaker notes):");
1521    let notes = NotesSlidePart::with_text(1, "Remember to:\n- Introduce yourself\n- Explain the agenda\n- Ask for questions");
1522    let notes_xml = notes.to_xml()?;
1523    println!("   │   ├── Path: {}", notes.path());
1524    println!("   │   ├── Text: \"{}...\"", &notes.notes_text()[..20.min(notes.notes_text().len())]);
1525    println!("   │   └── XML size: {} bytes", notes_xml.len());
1526    
1527    // AppPropertiesPart - Application metadata
1528    println!("   ├── AppPropertiesPart (metadata):");
1529    let mut app_props = AppPropertiesPart::new();
1530    app_props.set_company("Acme Corporation");
1531    app_props.set_slides(slides.len() as u32);
1532    let app_xml = app_props.to_xml()?;
1533    println!("   │   ├── Company: Acme Corporation");
1534    println!("   │   ├── Slides: {}", slides.len());
1535    println!("   │   └── XML size: {} bytes", app_xml.len());
1536    
1537    // MediaPart - Video/Audio formats
1538    println!("   ├── MediaPart (10 media formats):");
1539    println!("   │   ├── Video: mp4, webm, avi, wmv, mov");
1540    println!("   │   ├── Audio: mp3, wav, wma, m4a, ogg");
1541    let sample_media = MediaPart::new(1, MediaFormat::Mp4, vec![0; 100]);
1542    println!("   │   └── Sample: {} ({})", sample_media.path(), sample_media.format().mime_type());
1543    
1544    // TablePart - Table with formatting
1545    println!("   ├── TablePart (cell formatting):");
1546    let table_part = TablePart::new()
1547        .add_row(TableRowPart::new(vec![
1548            TableCellPart::new("Header 1").bold().background("4472C4"),
1549            TableCellPart::new("Header 2").bold().background("4472C4"),
1550        ]))
1551        .add_row(TableRowPart::new(vec![
1552            TableCellPart::new("Data 1").color("333333"),
1553            TableCellPart::new("Data 2").italic(),
1554        ]))
1555        .position(EMU_PER_INCH, EMU_PER_INCH * 2)
1556        .size(EMU_PER_INCH * 6, EMU_PER_INCH * 2);
1557    let table_xml = table_part.to_slide_xml(10);
1558    println!("   │   ├── Rows: {}", table_part.rows.len());
1559    println!("   │   ├── Features: bold, italic, colors, backgrounds");
1560    println!("   │   └── XML size: {} bytes", table_xml.len());
1561    
1562    // ContentTypesPart
1563    println!("   └── ContentTypesPart:");
1564    let mut content_types = ContentTypesPart::new();
1565    content_types.add_presentation();
1566    content_types.add_slide(1);
1567    content_types.add_slide_layout(1);
1568    content_types.add_slide_master(1);
1569    content_types.add_theme(1);
1570    content_types.add_core_properties();
1571    content_types.add_app_properties();
1572    let ct_xml = content_types.to_xml()?;
1573    println!("       ├── Path: {}", content_types.path());
1574    println!("       └── XML size: {} bytes", ct_xml.len());
1575
1576    // =========================================================================
1577    // NEW: Elements API Demonstration
1578    // =========================================================================
1579    println!("\n🎨 Elements API Demonstration:");
1580    
1581    // Color types
1582    println!("   ┌── Color Types:");
1583    let rgb = RgbColor::new(255, 87, 51);
1584    let rgb_hex = RgbColor::from_hex("#4472C4").unwrap();
1585    let scheme = SchemeColor::Accent1;
1586    let color = Color::rgb(100, 149, 237);
1587    println!("   │   ├── RgbColor::new(255, 87, 51) → {}", rgb.to_hex());
1588    println!("   │   ├── RgbColor::from_hex(\"#4472C4\") → {}", rgb_hex.to_hex());
1589    println!("   │   ├── SchemeColor::Accent1 → {}", scheme.as_str());
1590    println!("   │   └── Color::rgb(100, 149, 237) → XML: {}", color.to_xml().chars().take(30).collect::<String>());
1591    
1592    // Position and Size
1593    println!("   ├── Position & Size (EMU units):");
1594    let pos = Position::from_inches(1.0, 2.0);
1595    let size = Size::from_inches(4.0, 3.0);
1596    println!("   │   ├── Position::from_inches(1.0, 2.0) → x={}, y={}", pos.x, pos.y);
1597    println!("   │   ├── Size::from_inches(4.0, 3.0) → w={}, h={}", size.width, size.height);
1598    println!("   │   └── EMU_PER_INCH = {}", EMU_PER_INCH);
1599    
1600    // Transform
1601    println!("   └── Transform (position + size + rotation):");
1602    let transform = Transform::from_inches(1.0, 1.5, 3.0, 2.0).with_rotation(45.0);
1603    let transform_xml = transform.to_xml();
1604    println!("       ├── Transform::from_inches(1.0, 1.5, 3.0, 2.0)");
1605    println!("       ├── .with_rotation(45.0)");
1606    println!("       └── XML: {}...", &transform_xml[..50.min(transform_xml.len())]);
1607
1608    // =========================================================================
1609    // NEW: Advanced Features Demonstration
1610    // =========================================================================
1611    println!("\n🚀 Advanced Features Demonstration:");
1612
1613    // -------------------------------------------------------------------------
1614    // Complex Table Examples
1615    // -------------------------------------------------------------------------
1616    println!("   ┌── Complex Table Examples:");
1617    
1618    // Example 1: Financial Report Table
1619    println!("   │   ┌── Financial Report Table (5x4 with formatting):");
1620    let financial_table = TablePart::new()
1621        .add_row(TableRowPart::new(vec![
1622            TableCellPart::new("Q1 2024 Financial Summary")
1623                .col_span(4)
1624                .bold()
1625                .center()
1626                .background("1F4E79")
1627                .color("FFFFFF")
1628                .font_size(14)
1629                .font("Arial Black"),
1630        ]))
1631        .add_row(TableRowPart::new(vec![
1632            TableCellPart::new("Category").bold().center().background("2E75B6").color("FFFFFF"),
1633            TableCellPart::new("Revenue").bold().center().background("2E75B6").color("FFFFFF"),
1634            TableCellPart::new("Expenses").bold().center().background("2E75B6").color("FFFFFF"),
1635            TableCellPart::new("Profit").bold().center().background("2E75B6").color("FFFFFF"),
1636        ]))
1637        .add_row(TableRowPart::new(vec![
1638            TableCellPart::new("Product Sales").align(HorizontalAlign::Left),
1639            TableCellPart::new("$1,250,000").align(HorizontalAlign::Right).color("2E7D32"),
1640            TableCellPart::new("$450,000").align(HorizontalAlign::Right).color("C62828"),
1641            TableCellPart::new("$800,000").align(HorizontalAlign::Right).bold().color("2E7D32"),
1642        ]))
1643        .add_row(TableRowPart::new(vec![
1644            TableCellPart::new("Services").align(HorizontalAlign::Left),
1645            TableCellPart::new("$890,000").align(HorizontalAlign::Right).color("2E7D32"),
1646            TableCellPart::new("$320,000").align(HorizontalAlign::Right).color("C62828"),
1647            TableCellPart::new("$570,000").align(HorizontalAlign::Right).bold().color("2E7D32"),
1648        ]))
1649        .add_row(TableRowPart::new(vec![
1650            TableCellPart::new("Total").bold().background("E7E6E6"),
1651            TableCellPart::new("$2,140,000").bold().align(HorizontalAlign::Right).background("E7E6E6"),
1652            TableCellPart::new("$770,000").bold().align(HorizontalAlign::Right).background("E7E6E6"),
1653            TableCellPart::new("$1,370,000").bold().align(HorizontalAlign::Right).background("C6EFCE").color("006100"),
1654        ]))
1655        .position(EMU_PER_INCH / 2, EMU_PER_INCH * 2)
1656        .size(EMU_PER_INCH * 8, EMU_PER_INCH * 3);
1657    let fin_xml = financial_table.to_slide_xml(100);
1658    println!("   │   │   ├── Merged header spanning 4 columns");
1659    println!("   │   │   ├── Color-coded values (green=positive, red=negative)");
1660    println!("   │   │   ├── Custom fonts and sizes");
1661    println!("   │   │   └── XML: {} bytes", fin_xml.len());
1662
1663    // Example 2: Comparison Matrix
1664    println!("   │   ├── Comparison Matrix (features vs products):");
1665    let _matrix_table = TablePart::new()
1666        .add_row(TableRowPart::new(vec![
1667            TableCellPart::new("Feature").bold().center().background("4472C4").color("FFFFFF"),
1668            TableCellPart::new("Basic").bold().center().background("4472C4").color("FFFFFF"),
1669            TableCellPart::new("Pro").bold().center().background("4472C4").color("FFFFFF"),
1670            TableCellPart::new("Enterprise").bold().center().background("4472C4").color("FFFFFF"),
1671        ]))
1672        .add_row(TableRowPart::new(vec![
1673            TableCellPart::new("Storage").align(HorizontalAlign::Left),
1674            TableCellPart::new("5 GB").center(),
1675            TableCellPart::new("50 GB").center(),
1676            TableCellPart::new("Unlimited").center().bold().color("2E7D32"),
1677        ]))
1678        .add_row(TableRowPart::new(vec![
1679            TableCellPart::new("Users").align(HorizontalAlign::Left),
1680            TableCellPart::new("1").center(),
1681            TableCellPart::new("10").center(),
1682            TableCellPart::new("Unlimited").center().bold().color("2E7D32"),
1683        ]))
1684        .add_row(TableRowPart::new(vec![
1685            TableCellPart::new("Support").align(HorizontalAlign::Left),
1686            TableCellPart::new("Email").center(),
1687            TableCellPart::new("24/7 Chat").center(),
1688            TableCellPart::new("Dedicated").center().bold().color("2E7D32"),
1689        ]))
1690        .add_row(TableRowPart::new(vec![
1691            TableCellPart::new("Price/mo").bold().background("F2F2F2"),
1692            TableCellPart::new("$9").center().bold().background("F2F2F2"),
1693            TableCellPart::new("$29").center().bold().background("F2F2F2"),
1694            TableCellPart::new("$99").center().bold().background("F2F2F2"),
1695        ]));
1696    println!("   │   │   └── 5x4 matrix with alternating styles");
1697
1698    // Example 3: Schedule/Timeline Table
1699    println!("   │   └── Schedule Table (with row spans):");
1700    let _schedule_table = TablePart::new()
1701        .add_row(TableRowPart::new(vec![
1702            TableCellPart::new("Time").bold().center().background("70AD47").color("FFFFFF"),
1703            TableCellPart::new("Monday").bold().center().background("70AD47").color("FFFFFF"),
1704            TableCellPart::new("Tuesday").bold().center().background("70AD47").color("FFFFFF"),
1705        ]))
1706        .add_row(TableRowPart::new(vec![
1707            TableCellPart::new("9:00 AM").center().background("E2EFDA"),
1708            TableCellPart::new("Team Standup").center().row_span(2).valign(VerticalAlign::Middle).background("BDD7EE"),
1709            TableCellPart::new("Code Review").center(),
1710        ]))
1711        .add_row(TableRowPart::new(vec![
1712            TableCellPart::new("10:00 AM").center().background("E2EFDA"),
1713            TableCellPart::merged(),
1714            TableCellPart::new("Sprint Planning").center().background("FCE4D6"),
1715        ]));
1716    println!("   │       └── Row spans for multi-hour events");
1717
1718    // -------------------------------------------------------------------------
1719    // Complex Animation Sequences
1720    // -------------------------------------------------------------------------
1721    println!("   ├── Complex Animation Sequences:");
1722    
1723    // Sequence 1: Title entrance with staggered content
1724    println!("   │   ┌── Staggered Entrance Sequence:");
1725    let title_anim = Animation::new(2, AnimationEffect::Fade)
1726        .trigger(AnimationTrigger::OnClick)
1727        .duration(500);
1728    let content1 = Animation::new(3, AnimationEffect::FlyIn)
1729        .trigger(AnimationTrigger::AfterPrevious)
1730        .direction(AnimationDirection::Left)
1731        .duration(400)
1732        .delay(200);
1733    let content2 = Animation::new(4, AnimationEffect::FlyIn)
1734        .trigger(AnimationTrigger::AfterPrevious)
1735        .direction(AnimationDirection::Left)
1736        .duration(400)
1737        .delay(100);
1738    let content3 = Animation::new(5, AnimationEffect::FlyIn)
1739        .trigger(AnimationTrigger::AfterPrevious)
1740        .direction(AnimationDirection::Left)
1741        .duration(400)
1742        .delay(100);
1743    let staggered = SlideAnimations::new()
1744        .add(title_anim)
1745        .add(content1)
1746        .add(content2)
1747        .add(content3)
1748        .transition(SlideTransition::new(TransitionEffect::Push).direction(AnimationDirection::Left).duration(750));
1749    let staggered_xml = staggered.to_timing_xml()?;
1750    println!("   │   │   ├── Title: Fade on click");
1751    println!("   │   │   ├── Content 1-3: FlyIn with 100ms stagger");
1752    println!("   │   │   ├── Transition: Push from left (750ms)");
1753    println!("   │   │   └── XML: {} bytes", staggered_xml.len());
1754
1755    // Sequence 2: Emphasis and exit
1756    println!("   │   ├── Emphasis + Exit Sequence:");
1757    let emphasis = Animation::new(6, AnimationEffect::Pulse)
1758        .trigger(AnimationTrigger::OnClick)
1759        .duration(1000)
1760        .repeat(3);
1761    let exit = Animation::new(6, AnimationEffect::FadeOut)
1762        .trigger(AnimationTrigger::AfterPrevious)
1763        .duration(500);
1764    let _emphasis_seq = SlideAnimations::new()
1765        .add(emphasis)
1766        .add(exit);
1767    println!("   │   │   ├── Pulse 3x on click, then fade out");
1768    println!("   │   │   └── Same shape, sequential effects");
1769
1770    // Sequence 3: Motion path
1771    println!("   │   └── Motion Path Animation:");
1772    let _motion = Animation::new(7, AnimationEffect::Lines)
1773        .trigger(AnimationTrigger::OnClick)
1774        .duration(2000);
1775    println!("   │       └── Custom path: Lines, Arcs, Turns, Loops");
1776
1777    // -------------------------------------------------------------------------
1778    // SmartArt Combinations
1779    // -------------------------------------------------------------------------
1780    println!("   ├── SmartArt Layout Examples:");
1781    
1782    // Process flow
1783    println!("   │   ┌── Process Flow (5 steps):");
1784    let process = SmartArtPart::new(1, SmartArtLayout::BasicProcess)
1785        .add_items(vec!["Research", "Design", "Develop", "Test", "Deploy"])
1786        .position(EMU_PER_INCH / 2, EMU_PER_INCH * 2)
1787        .size(EMU_PER_INCH * 8, EMU_PER_INCH * 2);
1788    println!("   │   │   └── {} nodes in horizontal flow", process.nodes().len());
1789
1790    // Organization chart
1791    println!("   │   ├── Organization Chart:");
1792    let org = SmartArtPart::new(2, SmartArtLayout::OrgChart)
1793        .add_items(vec!["CEO", "CTO", "CFO", "VP Engineering", "VP Sales"]);
1794    println!("   │   │   └── Hierarchical structure with {} positions", org.nodes().len());
1795
1796    // Cycle diagram
1797    println!("   │   ├── Cycle Diagram:");
1798    let cycle = SmartArtPart::new(3, SmartArtLayout::BasicCycle)
1799        .add_items(vec!["Plan", "Do", "Check", "Act"]);
1800    println!("   │   │   └── PDCA cycle with {} phases", cycle.nodes().len());
1801
1802    // Venn diagram
1803    println!("   │   ├── Venn Diagram:");
1804    let _venn = SmartArtPart::new(4, SmartArtLayout::BasicVenn)
1805        .add_items(vec!["Skills", "Passion", "Market Need"]);
1806    println!("   │   │   └── 3-circle Venn for Ikigai concept");
1807
1808    // Pyramid
1809    println!("   │   └── Pyramid:");
1810    let pyramid = SmartArtPart::new(5, SmartArtLayout::BasicPyramid)
1811        .add_items(vec!["Self-Actualization", "Esteem", "Love/Belonging", "Safety", "Physiological"]);
1812    println!("   │       └── Maslow's hierarchy with {} levels", pyramid.nodes().len());
1813
1814    // -------------------------------------------------------------------------
1815    // 3D Model Configurations
1816    // -------------------------------------------------------------------------
1817    println!("   ├── 3D Model Configurations:");
1818    
1819    // Product showcase
1820    println!("   │   ┌── Product Showcase:");
1821    let _product_3d = Model3DPart::new(1, Model3DFormat::Glb, vec![0; 100])
1822        .camera(CameraPreset::IsometricTopUp)
1823        .rotation(0.0, 45.0, 0.0)
1824        .zoom(1.2)
1825        .position(EMU_PER_INCH * 2, EMU_PER_INCH * 2)
1826        .size(EMU_PER_INCH * 4, EMU_PER_INCH * 4);
1827    println!("   │   │   ├── Camera: Isometric top-up view");
1828    println!("   │   │   ├── Rotation: 45° Y-axis for best angle");
1829    println!("   │   │   └── Zoom: 1.2x for detail");
1830
1831    // Architectural model
1832    println!("   │   ├── Architectural Model:");
1833    let _arch_3d = Model3DPart::new(2, Model3DFormat::Gltf, vec![0; 100])
1834        .camera(CameraPreset::Front)
1835        .rotation(15.0, -30.0, 0.0)
1836        .ambient_light("FFFFCC");
1837    println!("   │   │   ├── Camera: Front view with tilt");
1838    println!("   │   │   └── Ambient: Warm lighting (FFFFCC)");
1839
1840    // Technical diagram
1841    println!("   │   └── Technical Diagram:");
1842    let _tech_3d = Model3DPart::new(3, Model3DFormat::Obj, vec![0; 100])
1843        .camera(CameraPreset::IsometricOffAxis1Top)
1844        .rotation(0.0, 0.0, 0.0);
1845    println!("   │       └── Camera: Off-axis isometric for exploded view");
1846
1847    // -------------------------------------------------------------------------
1848    // Theme + Master + Layout Combination
1849    // -------------------------------------------------------------------------
1850    println!("   ├── Theme + Master + Layout Integration:");
1851    
1852    // Corporate theme
1853    let mut corp_theme = ThemePart::new(1);
1854    corp_theme.set_name("Corporate Blue");
1855    corp_theme.set_major_font("Segoe UI");
1856    corp_theme.set_minor_font("Segoe UI Light");
1857    corp_theme.set_color("dk1", "000000");
1858    corp_theme.set_color("lt1", "FFFFFF");
1859    corp_theme.set_color("dk2", "1F497D");
1860    corp_theme.set_color("lt2", "EEECE1");
1861    corp_theme.set_color("accent1", "4472C4");
1862    corp_theme.set_color("accent2", "ED7D31");
1863    corp_theme.set_color("accent3", "A5A5A5");
1864    corp_theme.set_color("accent4", "FFC000");
1865    corp_theme.set_color("accent5", "5B9BD5");
1866    corp_theme.set_color("accent6", "70AD47");
1867    let theme_xml = corp_theme.to_xml()?;
1868    println!("   │   ├── Theme: Corporate Blue");
1869    println!("   │   │   ├── Fonts: Segoe UI / Segoe UI Light");
1870    println!("   │   │   ├── 12 color slots defined");
1871    println!("   │   │   └── XML: {} bytes", theme_xml.len());
1872
1873    // Master with multiple layouts
1874    let mut corp_master = SlideMasterPart::new(1);
1875    corp_master.set_name("Corporate Master");
1876    corp_master.add_layout_rel_id("rId2"); // Title
1877    corp_master.add_layout_rel_id("rId3"); // Title + Content
1878    corp_master.add_layout_rel_id("rId4"); // Section Header
1879    corp_master.add_layout_rel_id("rId5"); // Two Content
1880    corp_master.add_layout_rel_id("rId6"); // Comparison
1881    corp_master.add_layout_rel_id("rId7"); // Title Only
1882    corp_master.add_layout_rel_id("rId8"); // Blank
1883    println!("   │   └── Master: {} with {} layouts linked", corp_master.name(), corp_master.layout_rel_ids().len());
1884
1885    // -------------------------------------------------------------------------
1886    // VBA + Custom XML Integration
1887    // -------------------------------------------------------------------------
1888    println!("   ├── VBA + Custom XML Integration:");
1889    
1890    // VBA with multiple modules
1891    let _vba_project = VbaProjectPart::new()
1892        .add_module(VbaModule::new("AutoRun", r#"
1893Sub Auto_Open()
1894    MsgBox "Welcome to the presentation!"
1895End Sub
1896
1897Sub NavigateToSlide(slideNum As Integer)
1898    SlideShowWindows(1).View.GotoSlide slideNum
1899End Sub
1900"#))
1901        .add_module(VbaModule::new("DataHelpers", r#"
1902Function GetCustomData(key As String) As String
1903    ' Read from Custom XML part
1904    GetCustomData = ActivePresentation.CustomXMLParts(1).SelectSingleNode("//" & key).Text
1905End Function
1906"#))
1907        .add_module(VbaModule::class("SlideController", r#"
1908Private currentSlide As Integer
1909
1910Public Sub NextSlide()
1911    currentSlide = currentSlide + 1
1912    NavigateToSlide currentSlide
1913End Sub
1914"#));
1915    println!("   │   ├── VBA Project:");
1916    println!("   │   │   ├── AutoRun: Auto_Open, NavigateToSlide");
1917    println!("   │   │   ├── DataHelpers: GetCustomData (reads Custom XML)");
1918    println!("   │   │   └── SlideController: Class for navigation");
1919
1920    // Custom XML with structured data
1921    let app_config = CustomXmlPart::new(1, "presentationConfig")
1922        .namespace("http://company.com/pptx/config")
1923        .property("version", "2.1.0")
1924        .property("author", "Demo User")
1925        .property("department", "Engineering")
1926        .property("confidentiality", "Internal")
1927        .property("lastModified", "2024-01-15T10:30:00Z");
1928    let config_xml = app_config.to_xml()?;
1929    println!("   │   └── Custom XML:");
1930    println!("   │       ├── Namespace: http://company.com/pptx/config");
1931    println!("   │       ├── Properties: version, author, department, etc.");
1932    println!("   │       └── XML: {} bytes", config_xml.len());
1933
1934    // -------------------------------------------------------------------------
1935    // Embedded Fonts with Variants
1936    // -------------------------------------------------------------------------
1937    println!("   ├── Embedded Font Collection:");
1938    let mut font_collection = EmbeddedFontCollection::new();
1939    font_collection.add("Corporate Sans", vec![0; 1000]);
1940    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::Bold);
1941    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::Italic);
1942    font_collection.add_with_type("Corporate Sans", vec![0; 1000], FontEmbedType::BoldItalic);
1943    font_collection.add("Code Mono", vec![0; 800]);
1944    let fonts_xml = font_collection.to_xml();
1945    println!("   │   ├── Corporate Sans: Regular, Bold, Italic, BoldItalic");
1946    println!("   │   ├── Code Mono: Regular");
1947    println!("   │   ├── Total: {} font files", font_collection.len());
1948    println!("   │   └── XML: {} bytes", fonts_xml.len());
1949
1950    // -------------------------------------------------------------------------
1951    // Handout with Full Configuration
1952    // -------------------------------------------------------------------------
1953    println!("   └── Handout Master Configuration:");
1954    let handout = HandoutMasterPart::new()
1955        .layout(HandoutLayout::SlidesPerPage6)
1956        .header("Q1 2024 Strategy Review")
1957        .footer("Confidential - Internal Use Only");
1958    let handout_xml = handout.to_xml()?;
1959    println!("       ├── Layout: 6 slides per page");
1960    println!("       ├── Header: Q1 2024 Strategy Review");
1961    println!("       ├── Footer: Confidential - Internal Use Only");
1962    println!("       └── XML: {} bytes", handout_xml.len());
1963
1964    // =========================================================================
1965    // Summary
1966    // =========================================================================
1967    println!("\n╔══════════════════════════════════════════════════════════════╗");
1968    println!("║                    Element Coverage Summary                   ║");
1969    println!("╠══════════════════════════════════════════════════════════════╣");
1970    println!("║  LAYOUTS (6 types):                                          ║");
1971    println!("║    ✓ CenteredTitle    ✓ TitleOnly      ✓ TitleAndContent     ║");
1972    println!("║    ✓ TitleAndBigContent  ✓ TwoColumn   ✓ Blank               ║");
1973    println!("╠══════════════════════════════════════════════════════════════╣");
1974    println!("║  TEXT FORMATTING:                                            ║");
1975    println!("║    ✓ Bold            ✓ Italic         ✓ Underline            ║");
1976    println!("║    ✓ Font Size       ✓ Font Color     ✓ Title/Content styles ║");
1977    println!("╠══════════════════════════════════════════════════════════════╣");
1978    println!("║  TABLES:                                                     ║");
1979    println!("║    ✓ Multiple rows/columns  ✓ Bold cells  ✓ Background colors║");
1980    println!("║    ✓ Header styling         ✓ Position control               ║");
1981    println!("╠══════════════════════════════════════════════════════════════╣");
1982    println!("║  CHARTS:                                                     ║");
1983    println!("║    ✓ Bar Chart       ✓ Line Chart     ✓ Pie Chart            ║");
1984    println!("║    ✓ Multiple series ✓ Categories                            ║");
1985    println!("╠══════════════════════════════════════════════════════════════╣");
1986    println!("║  SHAPES:                                                     ║");
1987    println!("║    ✓ Rectangle       ✓ Ellipse        ✓ RoundedRectangle     ║");
1988    println!("║    ✓ Triangle        ✓ Diamond        ✓ Color fills          ║");
1989    println!("║    ✓ Gradient fills  ✓ Transparency   ✓ Text in shapes       ║");
1990    println!("╠══════════════════════════════════════════════════════════════╣");
1991    println!("║  CONNECTORS (NEW):                                           ║");
1992    println!("║    ✓ Straight        ✓ Elbow          ✓ Curved               ║");
1993    println!("║    ✓ Arrow types     ✓ Dash styles    ✓ Line colors/widths   ║");
1994    println!("╠══════════════════════════════════════════════════════════════╣");
1995    println!("║  IMAGES:                                                     ║");
1996    println!("║    ✓ Image placeholders  ✓ Position   ✓ Dimensions           ║");
1997    println!("╠══════════════════════════════════════════════════════════════╣");
1998    println!("║  PACKAGE:                                                    ║");
1999    println!("║    ✓ Create PPTX     ✓ Read PPTX      ✓ Analyze contents     ║");
2000    println!("╠══════════════════════════════════════════════════════════════╣");
2001    println!("║  PARTS API (NEW):                                            ║");
2002    println!("║    ✓ SlideLayoutPart (11 types)  ✓ SlideMasterPart           ║");
2003    println!("║    ✓ ThemePart (colors/fonts)    ✓ NotesSlidePart            ║");
2004    println!("║    ✓ AppPropertiesPart           ✓ MediaPart (10 formats)    ║");
2005    println!("║    ✓ TablePart (cell formatting) ✓ ContentTypesPart          ║");
2006    println!("╠══════════════════════════════════════════════════════════════╣");
2007    println!("║  ELEMENTS API:                                               ║");
2008    println!("║    ✓ RgbColor        ✓ SchemeColor    ✓ Color enum           ║");
2009    println!("║    ✓ Position        ✓ Size           ✓ Transform            ║");
2010    println!("║    ✓ EMU conversions (inches, cm, mm, pt)                    ║");
2011    println!("╠══════════════════════════════════════════════════════════════╣");
2012    println!("║  ADVANCED FEATURES (NEW):                                    ║");
2013    println!("║    ✓ Animation (50+ effects)  ✓ Transitions (27 types)       ║");
2014    println!("║    ✓ SmartArt (25 layouts)    ✓ 3D Models (GLB/GLTF/OBJ)     ║");
2015    println!("║    ✓ VBA Macros (.pptm)       ✓ Embedded Fonts               ║");
2016    println!("║    ✓ Custom XML               ✓ Handout Master               ║");
2017    println!("║    ✓ Table borders/alignment  ✓ Merged cells                 ║");
2018    println!("╠══════════════════════════════════════════════════════════════╣");
2019    println!("║  DIMENSION API (NEW):                                        ║");
2020    println!("║    ✓ EMU / Inches / Cm / Pt / Ratio / Percent units          ║");
2021    println!("║    ✓ from_dimensions() constructor                           ║");
2022    println!("║    ✓ Fluent .at() and .with_dimensions() chaining            ║");
2023    println!("║    ✓ Mixed-unit positioning (e.g. inches + percent)          ║");
2024    println!("╠══════════════════════════════════════════════════════════════╣");
2025    println!("║  Output: comprehensive_demo.pptx ({} slides, {} KB)         ║", 
2026             slides.len(), pptx_data.len() / 1024);
2027    println!("╚══════════════════════════════════════════════════════════════╝");
2028
2029    Ok(())
2030}
Source

pub fn transparency(self, percent: u32) -> Self

Set transparency (0-100 percent) - builder style (deprecated, use with_transparency)

Trait Implementations§

Source§

impl Clone for ShapeFill

Source§

fn clone(&self) -> ShapeFill

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShapeFill

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more