<?xml version='1.0' encoding='UTF-8'?>

<!-- Default MimeType Export Profiles for KLatexFormula
     $Id$
  -->

<!-- version: specifies klf compatibility version, currently "4.0" -->
<export-profile-list version="4.0">

  <!-- List profile definitions here.  A profile is a list of data export types,
       associated to MIME types (x11), Mac OS X identifiers and MS Windows clipboard
       format names.
       
       You may specify several MIME types, mac identifiers and Windows format names for
       each data export type, in which case the data is exposed for all the given names.
       
       Note that QT already translates a certain number of standard types, so there is no
       need to declare the mac identifiers for PNG or PDF, for example.  Experiment a
       little.
    -->
  <profile name="default">
    <description>Default</description>

    <!-- Of course, PNG -->
    <export-type exporter="KLFBackendFormatsExporter" format="PNG">
      <default-qt-formats type="image" />
      <mime-type>image/png</mime-type>
      <win-format>PNG</win-format>
      <!-- for MS office: [old; test if still needed?] -->
      <win-format>PNG+Office Art</win-format>
      <!-- don't provide PNG by default on Mac, as most applications understand PDF but
           seem to prefer png when pasting ....??? but it does make sense here as some
           apps don't understand pdf -->
      <mac-flavor>public.png</mac-flavor>
    </export-type>

    <!-- PDF is always nice -->
    <export-type exporter="KLFBackendFormatsExporter" format="PDF">
      <mime-type>application/pdf</mime-type>
      <win-format>PDF</win-format>
      <win-format>application/pdf</win-format>
      <mac-flavor>com.adobe.pdf</mac-flavor>
    </export-type>

    <!-- SVG is useful, if we have it from ghostscript ... -->
    <export-type exporter="KLFBackendFormatsExporter" format="SVG">
      <mime-type>image/svg+xml</mime-type>
      <win-format>SVG</win-format>
      <win-format>image/svg+xml</win-format>
      <mac-flavor>public.svg-image</mac-flavor>
    </export-type>
    <!-- ... or from the inkscapeformats user script ... -->
    <export-type exporter="UserScript:inkscapeformats" format="svg">
      <mime-type>image/svg+xml</mime-type>
      <win-format>SVG</win-format>
      <win-format>image/svg+xml</win-format>
      <!-- NOTE: Inkscape can be really slow if the X11 server has to be
           started, so don't provide it by default on Mac OS X, especially since
           Qt doesn't support "Lazy" clipboard data setting on Mac OS X -->
      <!-- <mac-flavor>public.svg-image</mac-flavor> -->
    </export-type>
    <!-- ... or from the svg-dvisvgm user script. -->
    <export-type exporter="UserScript:svg-dvisvgm" format="svg">
      <mime-type>image/svg+xml</mime-type>
      <win-format>SVG</win-format>
      <win-format>image/svg+xml</win-format>
      <mac-flavor>public.svg-image</mac-flavor>
    </export-type>

    <!-- AICB: just use the EPS data and advertize it as AICB (for Adobe Indesign)
         Note: to use the "default" export profile with InDesign & AICB, you have to
         go into InDesign's Preferences -> Clipboard Handling -> uncheck "prefer PDF"
      -->
    <export-type exporter="KLFBackendFormatsExporter" format="EPS">
      <win-format>AICB</win-format>
      <mac-flavor>com.adobe.illustrator.aicb</mac-flavor>
    </export-type>

    <!-- Never hurts to include HTML (eg. for Thunderbird, GMail, ...) -->
    <export-type exporter="KLFHtmlDataExporter" format="html-png">
      <default-qt-formats type="html" />
    </export-type>

    <!-- EMF metafile for windows apps -->
    <export-type exporter="UserScript:inkscapeformats" format="emf">
      <mime-type>image/x-emf</mime-type>
      <mime-type>application/emf</mime-type>
      <mime-type>application/x-emf</mime-type>
      <mime-type>image/x-emf</mime-type>
      <win-format>CF_ENHMETAFILE</win-format>
      <!-- mac flavor??  ### not necessary: plus, starting X11 is really slow,
           so don't provide it in the default selection -->
    </export-type>

    <!-- OpenOffice.org format -->
    <export-type exporter="KLFOpenOfficeDrawExporter" format="odg">
      <mime-type>application/x-openoffice-drawing;windows_formatname="Drawing Format"</mime-type>
      <win-format>Drawing Format</win-format>
      <!-- see "KLFOpenOfficeDrawExporter" profile below for notes on dynamic UTIs -->
      <mac-flavor>dyn.ah62d4rv4gu80c6durvy0g2pyrf106p52fz11a3psr7xgq4pdqy00k6xbs7y06335s7y063dts73z83xtsm00c7dsqf00n1b7emche2p1rf1gskcgr73g42pyek</mac-flavor>
    </export-type>

  </profile>

  <profile name="vector_formats">
    <description>Vector Formats</description>

    <!-- PDF -->
    <export-type exporter="KLFBackendFormatsExporter" format="PDF">
      <mime-type>application/pdf</mime-type>
      <win-format>PDF</win-format>
      <win-format>application/pdf</win-format>
      <mac-flavor>com.adobe.pdf</mac-flavor>
    </export-type>

    <!-- EPS / PS -->
    <export-type exporter="KLFBackendFormatsExporter" format="EPS">
      <mime-type>application/eps</mime-type>
      <mime-type>application/postscript</mime-type>
      <mime-type>image/eps</mime-type>
      <win-format>Encapsulated PostScript</win-format>
      <win-format>PostScript</win-format>
      <mac-flavor>com.adobe.postscript</mac-flavor>
      <mac-flavor>com.adobe.encapsulated-postscript</mac-flavor>
    </export-type>

    <!-- SVG is useful, if we have it from ghostscript ... -->
    <export-type exporter="KLFBackendFormatsExporter" format="SVG">
      <mime-type>image/svg+xml</mime-type>
      <win-format>SVG</win-format>
      <mac-flavor>public.svg-image</mac-flavor>
    </export-type>
    <!-- ... or from the user script -->
    <export-type exporter="UserScript:svg-dvisvgm" format="svg">
      <mime-type>image/svg+xml</mime-type>
      <win-format>SVG</win-format>
      <mac-flavor>public.svg-image</mac-flavor>
    </export-type>

  </profile>

  <!-- Simple image. Let Qt do the job -->
  <profile name="simple-image-via-qt">
    <description>Simple Image (via Qt)</description>
    <export-type exporter="KLFBackendFormatsExporter" format="PNG">
      <default-qt-formats type="image" />
    </export-type>
  </profile>

  <!-- An HTML fragment for pasting into gmail or thunderbird, with PNG data -->
  <profile name="html-png-fragment">
    <description>HTML fragment (PNG)</description>
    <!-- HTML fragment for Thunderbird, GMail, ... -->
    <export-type exporter="KLFHtmlDataExporter" format="html-png">
      <default-qt-formats type="html" />
    </export-type>
  </profile>

  <!-- Source code for HTML fragment with PNG data: advertized as plain text -->
  <profile name="html-png-fragment-text">
    <in-submenu>More HTML fragments</in-submenu>
    <description>HTML fragment (PNG), as text</description>
    <export-type exporter="KLFHtmlDataExporter" format="html-png">
      <default-qt-formats type="text" />
    </export-type>
  </profile>

  <!-- An HTML fragment with a hack for displaying SVG, with PNG fallback -->
  <profile name="html-fragment">
    <in-submenu>More HTML fragments</in-submenu>
    <description>HTML fragment (SVG/PNG)</description>
    <export-type exporter="KLFHtmlDataExporter" format="html">
      <default-qt-formats type="html" />
    </export-type>
  </profile>

  <!-- An HTML fragment with vector SVG data -->
  <profile name="html-svg-fragment">
    <in-submenu>More HTML fragments</in-submenu>
    <description>HTML fragment (SVG)</description>
    <export-type exporter="KLFHtmlDataExporter" format="html-svg">
      <default-qt-formats type="html" />
    </export-type>
  </profile>

  <!-- An HTML fragment with reference to a temporary PNG file -->
  <profile name="KLFTempImgRefHtmlExporter-html">
    <in-submenu>More HTML fragments</in-submenu>
    <description>HTML fragment (temp. PNG file)</description>
    <export-type exporter="KLFTempImgRefHtmlExporter" format="html">
      <default-qt-formats type="html" />
    </export-type>
  </profile>



  <!-- Just plain simple PNG -->
  <profile name="png">
    <description>PNG</description>
    <export-type exporter="KLFBackendFormatsExporter" format="PNG">
      <mime-type>image/png</mime-type>
      <win-format>PNG</win-format>
      <mac-flavor>public.png</mac-flavor>
    </export-type>
  </profile>


  <!-- A special format for InDesign - AICB - allows to change color etc. inside InDesign -->
  <profile name="for_adobe_indesign">
    <!--<in-submenu>Specific Applications</in-submenu>-->
    <description>Copy to Adobe InDesign (AICB)</description>
    <!-- AICB: just use the EPS data and advertize it as AICB (for Adobe Indesign) -->
    <export-type exporter="KLFBackendFormatsExporter" format="EPS">
      <win-format>AICB</win-format><!-- What's the correct name ?????? -->
      <mac-flavor>com.adobe.illustrator.aicb</mac-flavor>
    </export-type>
  </profile>



  <!-- Temporary files -->
  <profile name="temp-pdf-file">
    <in-submenu>Temporary File</in-submenu>
    <description>Temp PDF File</description>
    <export-type exporter="KLFTempFileUriExporter" format="PDF">
      <default-qt-formats type="urls" />
    </export-type>
  </profile>
  <profile name="temp-png-file">
    <in-submenu>Temporary File</in-submenu>
    <description>Temp PNG File</description>
    <export-type exporter="KLFTempFileUriExporter" format="PNG">
      <default-qt-formats type="urls" />
    </export-type>
  </profile>
  <profile name="temp-ps-file">
    <in-submenu>Temporary File</in-submenu>
    <description>Temp PS File</description>
    <export-type exporter="KLFTempFileUriExporter" format="PS">
      <default-qt-formats type="urls" />
    </export-type>
  </profile>

  <!-- Specific formats -->
  <profile name="KLFBackendFormatsExporter-pdf">
    <in-submenu>Specific Formats</in-submenu>
    <description>PDF</description>
    <export-type exporter="KLFBackendFormatsExporter" format="PDF">
      <mime-type>application/pdf</mime-type>
      <win-format>PDF</win-format>
      <win-format>application/pdf</win-format>
      <mac-flavor>com.adobe.pdf</mac-flavor>
    </export-type>
  </profile>
  <profile name="KLFBackendFormatsExporter-png">
    <in-submenu>Specific Formats</in-submenu>
    <description>PNG</description>
    <export-type exporter="KLFBackendFormatsExporter" format="PNG">
      <mime-type>image/png</mime-type>
      <win-format>PNG</win-format>
      <mac-flavor>public.png</mac-flavor>
    </export-type>
  </profile>
  <profile name="KLFBackendFormatsExporter-eps">
    <in-submenu>Specific Formats</in-submenu>
    <description>EPS</description>
    <export-type exporter="KLFBackendFormatsExporter" format="EPS">
      <mime-type>application/eps</mime-type>
      <mime-type>application/postscript</mime-type>
      <mime-type>image/eps</mime-type>
      <win-format>Encapsulated PostScript</win-format>
      <win-format>PostScript</win-format>
      <mac-flavor>com.adobe.postscript</mac-flavor>
      <mac-flavor>com.adobe.encapsulated-postscript</mac-flavor>
    </export-type>
  </profile>
  <profile name="KLFTexExporter-tex">
    <in-submenu>Specific Formats</in-submenu>
    <description>LaTeX source</description>
    <export-type exporter="KLFTexExporter" format="tex">
      <default-qt-formats type="text" />
      <mime-type>application/x-latex</mime-type>
      <mime-type>application/x-tex</mime-type>
    </export-type>
  </profile>
  <profile name="KLFOpenOfficeDrawExporter-odg">
    <in-submenu>Specific Formats</in-submenu>
    <description>OpenOffice Draw</description>
    <export-type exporter="KLFOpenOfficeDrawExporter" format="odg">
      <mime-type>application/x-openoffice-drawing;windows_formatname="Drawing Format"</mime-type>
      <win-format>Drawing Format</win-format>

      <!-- Notes: read https://alastairs-place.net/blog/2012/06/06/utis-are-better-than-you-think-and-heres-why/
           to get how these dynamic UTIs are encoded.  In python, decode them as:

           import string
           import base64
           v2 = 'abcdefghkmnpqrstuvwxyz0123456789' # vector used by mac UTIs-base32
           v  = 'abcdefghijklmnopqrstuvwxyz234567' # vector used by python's base64.b32*** and the RFC standard
           transv = string.maketrans(v2, v)
           base64.b32decode(s.translate(transv)+'='*(-len(s)%8), True)
           -->
      <!-- this decodes to '?0=6:4=application/x-openoffice-drawing;windows_formatname\\="Drawing Format"' -->
      <mac-flavor>dyn.ah62d4rv4gu80c6durvy0g2pyrf106p52fz11a3psr7xgq4pdqy00k6xbs7y06335s7y063dts73z83xtsm00c7dsqf00n1b7emche2p1rf1gskcgr73g42pyek</mac-flavor>
    </export-type>
  </profile>

</export-profile-list>


<!-- NOTES

  Ideally we should be able to cover all of the following cases: (I stress, *ideally*.)

  Test:
   - Copy & Paste
   - Drag & Drop

  On MAC OS X:
   - to Apple Pages / Keynote
   - to Adobe Illustrator
   - to Adobe InDesign
   - to MS Office Word / Powerpoint
   - to Thunderbird email composer
   - to LibreOffice/OpenOffice
   - to Gmail in firefox/chrome
   - to GIMP
   - to Inkscape

  On Windows:
   - to Adobe Illustrator
   - to Adobe InDesign
   - to MS Office Word / Powerpoint
   - to LibreOffice/OpenOffice
   - to Thunderbird
   - to gmail in firefox/chrome
   - to GIMP
   - to Inkscape

  On Linux: - to LibreOffice/OpenOffice - to GIMP - to Thunderbird - to Inkscape -->
