<?xml version="1.0"?>
<!--
 Copyright (C) 2017 Red Hat, Inc.

 SPDX-License-Identifier: LGPL-2.1-or-later

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library. If not, see <http://www.gnu.org/licenses/>.

 Author: Matthias Clasen <mclasen@redhat.com>
-->

<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
  <!--
      org.freedesktop.portal.Email:
      @short_description: Portal for sending email

      This simple portal lets sandboxed applications request to send an email,
      optionally providing an address, subject, body and attachments.

      This documentation describes version 4 of this interface.
  -->
  <interface name="org.freedesktop.portal.Email">
    <!--
        ComposeEmail:
        @parent_window: Identifier for the application window, see :doc:`window-identifiers`
        @options: Vardict with optional further information
        @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call

        Presents a window that lets the user compose an email.

        Note that the default email client for the host will need to support mailto: URIs
        following `RFC 2368 <https://tools.ietf.org/html/rfc2368>`_, with
        "cc", "bcc", "subject" and "body" query keys each corresponding to the email
        header of the same name, and with each attachment being passed as a ``file://``
        URI as a value in an "attachment" query key.

        For example:

        ::
          
          mailto:foo@bar.com,baz@bar.com?cc=ceo@bar.com&amp;subject=Test%20e-mail%20subject&amp;attachment=file://path/to/full/file.txt


        would send a mail to "foo@bar.com", "baz@bar.com", with a CC:
        to "ceo@bar.com", with the subject "Test e-mail subject"
        and the file pointed by URI ``file://path/to/full/file.txt`` as
        an attachment.

        Supported keys in the @options vardict include:

        * ``handle_token`` (``s``)

          A string that will be used as the last element of the @handle. Must be a valid
          object path element. See the :ref:`org.freedesktop.portal.Request` documentation for
          more information about the @handle.

        * ``address`` (``s``)

          The email address to send to. Must conform to the HTML5 definition of a
          `valid email address <https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address>`_.

        * ``addresses`` (``as``)

          Email addresses to send to. This will be used in addition to address and must
          pass the same validation.

          This option was introduced in version 3 of the interface.

        * ``cc`` (``as``)

          Email addresses to cc.

          This option was introduced in version 3 of the interface.

        * ``bcc`` (``as``)

          Email addresses to bcc.

          This option was introduced in version 3 of the interface.

        * ``subject`` (``s``)

          The subject for the email.

        * ``body`` (``s``)

          The body for the email.

        * ``attachment_fds`` (``ah``)

          File descriptors for files to attach.

        * ``activation_token`` (``s``)

          A token that can be used to activate the chosen application.

          This option was introduced in version 4 of the interface.


        All the keys in the @options vardict are optional.
    -->
    <method name="ComposeEmail">
      <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
      <arg type="s" name="parent_window" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="in"/>
      <arg type="o" name="handle" direction="out"/>
    </method>
    <property name="version" type="u" access="read"/>
  </interface>
</node>
