From 219aadeb7659ccee887e7d70c1711ee6dd50f35f Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Sun, 23 Apr 2017 00:10:23 +0800 Subject: - Initialize char support, relate issue #31; - Doc for function `GetRows()` updated, relate issue #43; - Fix doc typo in `xmlContentTypes.go`; - Default template updated; - Readme updated; - go test updated --- xmlDrawing.go | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 8 deletions(-) (limited to 'xmlDrawing.go') diff --git a/xmlDrawing.go b/xmlDrawing.go index 4b87d9d..156b2ac 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -2,14 +2,20 @@ package excelize // Source relationship and namespace. const ( - SourceRelationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" - SourceRelationshipImage = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" - SourceRelationshipDrawingML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" - SourceRelationshipHyperLink = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" - SourceRelationshipWorkSheet = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" - NameSpaceDrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main" - NameSpaceSpreadSheetDrawing = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" - NameSpaceXML = "http://www.w3.org/XML/1998/namespace" + SourceRelationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" + SourceRelationshipChart = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" + SourceRelationshipImage = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" + SourceRelationshipDrawingML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" + SourceRelationshipHyperLink = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" + SourceRelationshipWorkSheet = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" + SourceRelationshipChart201506 = "http://schemas.microsoft.com/office/drawing/2015/06/chart" + SourceRelationshipChart20070802 = "http://schemas.microsoft.com/office/drawing/2007/8/2/chart" + SourceRelationshipChart2014 = "http://schemas.microsoft.com/office/drawing/2014/chart" + SourceRelationshipCompatibility = "http://schemas.openxmlformats.org/markup-compatibility/2006" + NameSpaceDrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main" + NameSpaceDrawingMLChart = "http://schemas.openxmlformats.org/drawingml/2006/chart" + NameSpaceSpreadSheetDrawing = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" + NameSpaceXML = "http://www.w3.org/XML/1998/namespace" ) var supportImageTypes = map[string]string{".gif": ".gif", ".jpg": ".jpeg", ".jpeg": ".jpeg", ".png": ".png"} @@ -187,6 +193,59 @@ type xlsxWsDr struct { A string `xml:"xmlns:a,attr"` } +// graphicFrame (Graphic Frame) directly maps the graphicFrame element. +type graphicFrame struct { + GraphicFrame *xlsxGraphicFrame `xml:"xdr:graphicFrame"` +} + +// xlsxGraphicFrame (Graphic Frame) directly maps the xdr:graphicFrame element. +// This element specifies the existence of a graphics frame. This frame contains +// a graphic that was generated by an external source and needs a container in +// which to be displayed on the slide surface. +type xlsxGraphicFrame struct { + Macro string `xml:"macro,attr"` + NvGraphicFramePr xlsxNvGraphicFramePr `xml:"xdr:nvGraphicFramePr"` + Xfrm xlsxXfrm `xml:"xdr:xfrm"` + Graphic *xlsxGraphic `xml:"a:graphic"` +} + +// xlsxNvGraphicFramePr (Non-Visual Properties for a Graphic Frame) directly +// maps the xdr:nvGraphicFramePr element. This element specifies all non-visual +// properties for a graphic frame. This element is a container for the non- +// visual identification properties, shape properties and application properties +// that are to be associated with a graphic frame. This allows for additional +// information that does not affect the appearance of the graphic frame to be +// stored. +type xlsxNvGraphicFramePr struct { + CNvPr *xlsxCNvPr `xml:"xdr:cNvPr"` + ChicNvGraphicFramePr string `xml:"xdr:cNvGraphicFramePr"` +} + +// xlsxGraphic (Graphic Object) directly maps the a:graphic element. This +// element specifies the existence of a single graphic object. Document authors +// should refer to this element when they wish to persist a graphical object of +// some kind. The specification for this graphical object is provided entirely +// by the document author and referenced within the graphicData child element. +type xlsxGraphic struct { + GraphicData *xlsxGraphicData `xml:"a:graphicData"` +} + +// xlsxGraphicData (Graphic Object Data) directly maps the a:graphicData +// element. This element specifies the reference to a graphic object within the +// document. This graphic object is provided entirely by the document authors +// who choose to persist this data within the document. +type xlsxGraphicData struct { + URI string `xml:"uri,attr"` + Chart *xlsxChart `xml:"c:chart,omitempty"` +} + +// xlsxChart (Chart) directly maps the c:chart element. +type xlsxChart struct { + C string `xml:"xmlns:c,attr"` + RID string `xml:"r:id,attr"` + R string `xml:"xmlns:r,attr"` +} + // encodeWsDr directly maps the element xdr:wsDr. type encodeWsDr struct { WsDr xlsxWsDr `xml:"xdr:wsDr"` -- cgit v1.2.1