<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!--
    SPDX-License-Identifier: LGPL-2.0-or-later
    SPDX-FileCopyrightText: 2017, 2018 David Edmundson <davidedmundson@kde.org>
    SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de>
    SPDX-FileCopyrightText: 2020-2021 Alexander Lohnau <alexander.lohnau@gmx.de>
-->

<node>
  <interface name="org.kde.krunner1">
    <!--
        This method gets called when a match session is over.
        It can be used to clear data which should not be kept in memory after a match session.
    -->
    <method name="Teardown"/>

    <!--
        This method can be used to set runner config at runtime. In case the service wildcard is used
        the config is only for one service requested.
        It gets only called when the X-Plasma-Api value is set to DBus2

        Possible values for the response map are:
        MatchRegex (String)
        MinLetterCount (int)
        TriggerWords (StringList)
        Actions (RemoteActions), see X-Plasma-Request-Actions-Once property docs

        See API documentation of the AbstractRunner class for details about these values.
    -->
    <method name="Config">
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap" />
      <arg name="config" type="a{sv}" direction="out">
      </arg>
    </method>

    <!--
        Returns a list of actions supported by this runner.
        For example, a song match returned by a music player runner can be queued, added to the playlist, or played.
        This should be constant
      Structure is:
         - ID
         - Text
         - IconName
    -->
    <method name="Actions">
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="KRunner::Actions" />
      <arg name="matches" type="a(sss)" direction="out">
      </arg>
    </method>

    <!--
        Called with an XDG Activation Token.
        This is called just before Run in order for the DBusRunner to receive the XDG Activation Token
        necessary to pass focus to another window when e.g. launching an application or opening a document.
    -->
    <method name="SetActivationToken">
      <arg name="token" type="s" direction="in"/>
    </method>

    <!--
        Execute an action
    -->
    <method name="Run">
        <!--
        The Unique ID from Match.
        -->
      <arg name="matchId" type="s" direction="in"/>
        <!--
        The action ID to run. For the default action this will be empty.
        -->
      <arg name="actionId" type="s" direction="in"/>
    </method>
    <!--
        Fetch matching results for a given query.

        Note: Multiple Match calls may be made with new queries before a call has returned
        has returned.
    -->
    <method name="Match">
      <arg name="query" type="s" direction="in"/>
      <!--
        Return a list of items that match the
        Structure is:
         - Id
         - Text
         - IconName
         - Type (see KRunner::QueryMatch::Type)
         - Relevance
         - Properties (VariantMap)
            - urls (StringList)
            - category
            - subtext
            - actions (StringList of RemoteAction's IDs). In case you don't want to display any actions set this to an empty list.
              Otherwise all the actions will be shown for compatibility with the previous versions of the D-Bus API.
              When the actions only need to be fetched once you can set the X-Plasma-Request-Actions-Once property of
              the service file to true.
            - icon-data (iiibiiay). Custom icon pixmap. Icon name should be preferred, if available.
              Format is the same as org.freedesktop.Notifications icon-data, in order: width, height, row stride,
              has alpha, bits per sample, number of channels, pixmap data.
            - multiline (boolean). If the text should be displayed as styled multiline text.
      -->
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RemoteMatches"/>
      <arg name="matches" type="a(sssida{sv})" direction="out"/>
    </method>
  </interface>
</node>
