Clipboard formats



I saw in the IRC scrollback that somebody wanted to know what clipboard formats gnumeric supports.

These are the formats ("TARGETS") other applications may request after Gnumeric has copied a cell region to the clipboard:

application/x-gnumeric
text/html
UTF8_STRING, COMPOUND_TEXT, STRING

I've put the final 3 on the same line because effectively, they all mean plain text.

These are the formats ("TARGETS") other applications may request after Gnumeric has copied a chart, and nothing else, to the clipboard:

application/x-gnumeric
application/x-goffice-graph
image/svg, image/svg+xml
image/png
image/jpeg
image/x-icon
image/bmp, image/x-bmp, image/x-MS-bmp

Syonyms are shown on the same line.

These are the formats ("TARGETS") other applications may request after Gnumeric has copied an image, and nothing else, to the clipboard:

application/x-gnumeric
image/png
image/jpeg
image/x-icon
image/bmp, image/x-bmp, image/x-MS-bmp

plus the mime type of the original image, if it isn't one of the above.

The image formats are those which GTK knows how to export, so if GTK adds a new format, Gnumeric will automatically support it.

These are the clipboard formats which gnumeric knows how to read from the clipboard:

application/x-gnumeric
application/x-goffice-graph
text/html
Biff8, Biff5, Biff4, Biff3, Biff
application/x-openoffice;windows_formatname=\"Star Embed Source (XML)\"
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
UTF8_STRING, COMPOUND_TEXT, STRING

plus image/anything.

Gnumeric will try to parse text/html as a table. The html table does not have to be a complete html document.
The Biff formats are exported by Excel on Windows.
The openoffice formats are for openoffice v 1.0 and 1.1 spreadsheets. We can't make sense of clipboard content from openoffice v2.x yet. One reason is that they use the same format name for OpenDocument as for older openoffice XML. Gnumeric will accept all image formats. If GTK doesn't know how to render it, the bytes will be stored, and a default size assigned.

Here's an example of the application/x-gnumeric format:

<?xml version="1.0" encoding="UTF-8"?>
<gnm:ClipboardRange xmlns:gnm="http://www.gnumeric.org/v10.dtd"; Cols="2"
    Rows="4" BaseCol="3" BaseRow="3">
  <gnm:Styles>
    <gnm:StyleRegion startCol="0" startRow="0" endCol="1" endRow="3">
      <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0"
          Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0"
          Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0"
          Format="General">
        <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0"
            StrikeThrough="0" Script="0">Sans</gnm:Font>
        <gnm:StyleBorder>
          <gnm:Top Style="0"/>
          <gnm:Bottom Style="0"/>
          <gnm:Left Style="0"/>
          <gnm:Right Style="0"/>
          <gnm:Diagonal Style="0"/>
          <gnm:Rev-Diagonal Style="0"/>
        </gnm:StyleBorder>
      </gnm:Style>
    </gnm:StyleRegion>
  </gnm:Styles>
  <gnm:Cells>
    <gnm:Cell Row="3" Col="3" ValueType="40">1</gnm:Cell>
    <gnm:Cell Row="4" Col="3" ValueType="40">2</gnm:Cell>
    <gnm:Cell Row="5" Col="3" ValueType="40">3</gnm:Cell>
    <gnm:Cell Row="6" Col="3" ValueType="40">4</gnm:Cell>
    <gnm:Cell Row="6" Col="4" ValueType="40">3</gnm:Cell>
  </gnm:Cells>
</gnm:ClipboardRange>

ClipboardRange may contain Styles, MergedRegions, Cells and Objects as defined in the XSD schema for Gnumeric XML.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]