chore: 更新 manifest.coin 版本至 1.2.0
This commit is contained in:
305
Better-EN5/Services/Conversion/SmfTypes.cs
Normal file
305
Better-EN5/Services/Conversion/SmfTypes.cs
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace BetterEN5.Services.Conversion
|
||||||
|
{
|
||||||
|
public enum SmfShapeType
|
||||||
|
{
|
||||||
|
Rectangle, Ellipse, Triangle, Diamond, Parallelogram,
|
||||||
|
Trapezoid, Pentagon, Hexagon, Octagon, Star,
|
||||||
|
ArrowLeft, ArrowRight, ArrowUp, ArrowDown,
|
||||||
|
Line, LineArrow, LineDoubleArrow,
|
||||||
|
RoundedRectangle, Cloud, Heart, Cross,
|
||||||
|
RightTriangle, RegularPentagon, Chevron, Pie,
|
||||||
|
BlockArc, NoShape
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfStrokeDashStyle
|
||||||
|
{
|
||||||
|
Solid, Dash, Dot, DashDot, DashDotDot, LongDash, LongDashDot
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfVerticalAlignment
|
||||||
|
{
|
||||||
|
Top, Middle, Bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfHorizontalAlignment
|
||||||
|
{
|
||||||
|
Left, Center, Right, Justify
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfTextDirection
|
||||||
|
{
|
||||||
|
Horizontal, Vertical, Rotated270, Rotated90
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfFillType
|
||||||
|
{
|
||||||
|
None, Solid, Gradient, Pattern, SlideBackground
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfGradientType
|
||||||
|
{
|
||||||
|
Linear, Radial, Rectangular, Path
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmfTableBorderStyle
|
||||||
|
{
|
||||||
|
None, Solid, Dashed, Dotted
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfBounds
|
||||||
|
{
|
||||||
|
public double X { get; set; }
|
||||||
|
public double Y { get; set; }
|
||||||
|
public double Width { get; set; }
|
||||||
|
public double Height { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfColor
|
||||||
|
{
|
||||||
|
public string Value { get; set; } = "000000";
|
||||||
|
public double Alpha { get; set; } = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfFill
|
||||||
|
{
|
||||||
|
public SmfFillType Type { get; set; } = SmfFillType.None;
|
||||||
|
public SmfColor? SolidColor { get; set; }
|
||||||
|
public SmfGradientFill? Gradient { get; set; }
|
||||||
|
public string? ImageRef { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfGradientFill
|
||||||
|
{
|
||||||
|
public SmfGradientType Type { get; set; } = SmfGradientType.Linear;
|
||||||
|
public double Angle { get; set; }
|
||||||
|
public List<SmfGradientStop> Stops { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfGradientStop
|
||||||
|
{
|
||||||
|
public double Position { get; set; }
|
||||||
|
public SmfColor Color { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfStroke
|
||||||
|
{
|
||||||
|
public SmfColor? Color { get; set; }
|
||||||
|
public double Width { get; set; } = 1;
|
||||||
|
public SmfStrokeDashStyle DashStyle { get; set; } = SmfStrokeDashStyle.Solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfFormatting
|
||||||
|
{
|
||||||
|
public double? Size { get; set; }
|
||||||
|
public bool? Bold { get; set; }
|
||||||
|
public bool? Italic { get; set; }
|
||||||
|
public bool? Underline { get; set; }
|
||||||
|
public bool? Strikethrough { get; set; }
|
||||||
|
public SmfColor? Color { get; set; }
|
||||||
|
public string? Font { get; set; }
|
||||||
|
public string? LinkTarget { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfRun
|
||||||
|
{
|
||||||
|
public string Text { get; set; } = string.Empty;
|
||||||
|
public SmfFormatting? Formatting { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfParagraph
|
||||||
|
{
|
||||||
|
public List<SmfRun> Runs { get; set; } = new();
|
||||||
|
public SmfHorizontalAlignment? Alignment { get; set; }
|
||||||
|
public double? SpaceBefore { get; set; }
|
||||||
|
public double? SpaceAfter { get; set; }
|
||||||
|
public double? LineSpacing { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfRichText
|
||||||
|
{
|
||||||
|
public List<SmfParagraph> Paragraphs { get; set; } = new();
|
||||||
|
public double LeftMargin { get; set; } = 91440;
|
||||||
|
public double RightMargin { get; set; } = 91440;
|
||||||
|
public double TopMargin { get; set; } = 91440;
|
||||||
|
public double BottomMargin { get; set; } = 91440;
|
||||||
|
public SmfVerticalAlignment VerticalAlignment { get; set; } = SmfVerticalAlignment.Top;
|
||||||
|
public SmfTextDirection TextDirection { get; set; } = SmfTextDirection.Horizontal;
|
||||||
|
public bool WordWrap { get; set; } = true;
|
||||||
|
public bool AutoFit { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class SmfElement
|
||||||
|
{
|
||||||
|
public string Id { get; set; } = string.Empty;
|
||||||
|
public SmfBounds Bounds { get; set; } = new();
|
||||||
|
public double Rotation { get; set; }
|
||||||
|
public bool Locked { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public bool Hidden { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTextElement : SmfElement
|
||||||
|
{
|
||||||
|
public SmfRichText RichText { get; set; } = new();
|
||||||
|
public SmfFill? BackgroundFill { get; set; }
|
||||||
|
public SmfStroke? Outline { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfImageElement : SmfElement
|
||||||
|
{
|
||||||
|
public string Source { get; set; } = string.Empty;
|
||||||
|
public string ContentType { get; set; } = "image/png";
|
||||||
|
public byte[]? Data { get; set; }
|
||||||
|
public SmfCropInfo? Crop { get; set; }
|
||||||
|
public string? Hyperlink { get; set; }
|
||||||
|
public double? Brightness { get; set; }
|
||||||
|
public double? Contrast { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfCropInfo
|
||||||
|
{
|
||||||
|
public double Left { get; set; }
|
||||||
|
public double Right { get; set; }
|
||||||
|
public double Top { get; set; }
|
||||||
|
public double Bottom { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfShapeElement : SmfElement
|
||||||
|
{
|
||||||
|
public SmfShapeType ShapeType { get; set; } = SmfShapeType.Rectangle;
|
||||||
|
public SmfFill Fill { get; set; } = new();
|
||||||
|
public SmfStroke? Stroke { get; set; }
|
||||||
|
public SmfRichText? TextContent { get; set; }
|
||||||
|
public bool FlipHorizontal { get; set; }
|
||||||
|
public bool FlipVertical { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTableElement : SmfElement
|
||||||
|
{
|
||||||
|
public List<double> ColumnWidths { get; set; } = new();
|
||||||
|
public List<SmfTableRow> Rows { get; set; } = new();
|
||||||
|
public SmfTableStyle TableStyle { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTableRow
|
||||||
|
{
|
||||||
|
public double Height { get; set; }
|
||||||
|
public List<SmfTableCell> Cells { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTableCell
|
||||||
|
{
|
||||||
|
public SmfRichText? Content { get; set; }
|
||||||
|
public SmfFill? Background { get; set; }
|
||||||
|
public SmfTableBorder TopBorder { get; set; } = new();
|
||||||
|
public SmfTableBorder BottomBorder { get; set; } = new();
|
||||||
|
public SmfTableBorder LeftBorder { get; set; } = new();
|
||||||
|
public SmfTableBorder RightBorder { get; set; } = new();
|
||||||
|
public int RowSpan { get; set; } = 1;
|
||||||
|
public int ColSpan { get; set; } = 1;
|
||||||
|
public bool MergeHorizontal { get; set; }
|
||||||
|
public bool MergeVertical { get; set; }
|
||||||
|
public double LeftMargin { get; set; } = 45720;
|
||||||
|
public double RightMargin { get; set; } = 45720;
|
||||||
|
public double TopMargin { get; set; } = 0;
|
||||||
|
public double BottomMargin { get; set; } = 0;
|
||||||
|
public SmfVerticalAlignment VerticalAlign { get; set; } = SmfVerticalAlignment.Top;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTableBorder
|
||||||
|
{
|
||||||
|
public SmfTableBorderStyle Style { get; set; } = SmfTableBorderStyle.None;
|
||||||
|
public string Color { get; set; } = "000000";
|
||||||
|
public double Width { get; set; } = 6350;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfTableStyle
|
||||||
|
{
|
||||||
|
public bool BandRows { get; set; }
|
||||||
|
public bool BandColumns { get; set; }
|
||||||
|
public SmfColor? FirstRowColor { get; set; }
|
||||||
|
public SmfColor? LastRowColor { get; set; }
|
||||||
|
public SmfColor? FirstColumnColor { get; set; }
|
||||||
|
public SmfColor? LastColumnColor { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfInkPoint
|
||||||
|
{
|
||||||
|
public double X { get; set; }
|
||||||
|
public double Y { get; set; }
|
||||||
|
public double Pressure { get; set; } = 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfInkStroke
|
||||||
|
{
|
||||||
|
public List<SmfInkPoint> Points { get; set; } = new();
|
||||||
|
public SmfColor Color { get; set; } = new() { Value = "000000" };
|
||||||
|
public double Width { get; set; } = 2;
|
||||||
|
public bool IsHighlighter { get; set; }
|
||||||
|
public double Transparency { get; set; }
|
||||||
|
public string? PenType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfInkElement : SmfElement
|
||||||
|
{
|
||||||
|
public List<SmfInkStroke> Strokes { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfGroupElement : SmfElement
|
||||||
|
{
|
||||||
|
public List<string> ChildIds { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfMediaElement : SmfElement
|
||||||
|
{
|
||||||
|
public string Source { get; set; } = string.Empty;
|
||||||
|
public string ContentType { get; set; } = "video/mp4";
|
||||||
|
public byte[]? Data { get; set; }
|
||||||
|
public bool AutoPlay { get; set; }
|
||||||
|
public bool Loop { get; set; }
|
||||||
|
public double? StartTime { get; set; }
|
||||||
|
public double? EndTime { get; set; }
|
||||||
|
public string? PosterImageRef { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfBackground
|
||||||
|
{
|
||||||
|
public SmfFillType Type { get; set; } = SmfFillType.Solid;
|
||||||
|
public SmfColor? SolidColor { get; set; }
|
||||||
|
public SmfGradientFill? Gradient { get; set; }
|
||||||
|
public string? ImageRef { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfSlide
|
||||||
|
{
|
||||||
|
public string Id { get; set; } = string.Empty;
|
||||||
|
public SmfBackground Background { get; set; } = new();
|
||||||
|
public List<SmfElement> Elements { get; set; } = new();
|
||||||
|
public string? Notes { get; set; }
|
||||||
|
public string? LayoutName { get; set; }
|
||||||
|
public double? TransitionDuration { get; set; }
|
||||||
|
public string? TransitionType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfProperties
|
||||||
|
{
|
||||||
|
public string Title { get; set; } = string.Empty;
|
||||||
|
public string? Author { get; set; }
|
||||||
|
public DateTime? Created { get; set; }
|
||||||
|
public string? Application { get; set; }
|
||||||
|
public double SlideWidth { get; set; } = 12192000;
|
||||||
|
public double SlideHeight { get; set; } = 6858000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SmfDocument
|
||||||
|
{
|
||||||
|
public SmfProperties Properties { get; set; } = new();
|
||||||
|
public List<SmfSlide> Slides { get; set; } = new();
|
||||||
|
public Dictionary<string, byte[]> MediaFiles { get; set; } = new();
|
||||||
|
public Dictionary<string, string> MediaContentTypes { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,5 +24,5 @@ Preinstalled
|
|||||||
False
|
False
|
||||||
>
|
>
|
||||||
Version
|
Version
|
||||||
1.1.2
|
1.2.0
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user