24. Sdm概要
// 今のところ画像には非対応
type Component =
| Heading of TextStyleGroup list * Level:int * Value:Text
| Paragraph of TextStyleGroup list * Lines: Text list
| List of ListStyleGroup list * Items: Component list
| Table of TableStyleGroup list * TableContents
type Page = { Name: string; Components: Component list }
25. Edm概要
type Cell =
{ Row: int; Column: int
// マージもカンタン
MergedRows: int; MergedColumns: int
Format: FormatInfo
Data: Data }
type Sheet =
{ Name: string
Cells: Cell list
Drawings: Drawing list }
26. Sdm2Edm概要
// 実際はデフォルト実装付きのクラスを継承する方が便利
// Textだけを実装すればいいConvertionRule抽象クラスと、
// 何も実装しなくていいSimpleConvertionRuleクラスが用意されている
type IConvertionRule =
abstract Text:
ComponentRange * TextStyleGroup list * Text -> ConvertedResult
abstract ArroundHeading:
ComponentRange * TextStyleGroup list * int * Cell list ->
ConvertedResult
(* snip *)
abstract Drawing:
groups:TextStyleGroup list -> Drawing list