<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">

<!--
Copyright Contributors to the libdnf project.

This file is part of libdnf: https://github.com/rpm-software-management/libdnf/

Libdnf 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.

Libdnf 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 libdnf.  If not, see <https://www.gnu.org/licenses/>.
-->

<node>
<!-- org.rpm.dnf.v0.Base:
   @short_description: Interface to Base class
-->
<interface name="org.rpm.dnf.v0.Base">
    <!--
        read_all_repos:
        @success: `true` if repositories were successfully loaded, `false` otherwise.

        Explicitly ask for loading repositories metadata.
    -->
    <method name="read_all_repos">
        <arg name="success" type="b" direction="out"/>
    </method>

    <!--
        clean_with_options:
        @cache_type: cache type to clean up. Supported types are "all", "packages", "metadata", "dbcache", and "expire-cache".
        @options: an array of key/value pairs to modify the call behavior
        @success: `true` if the cache was successfully cleaned, `false` otherwise.
        @error_msg: string, contains errors encountered while cleaning the cache.

        Remove or expire cached data.

        Following @options are supported:
            - interactive: boolean, default true
                Set to "true", when the operation is done by a user, thus user interaction like password prompts can be done.

        Unknown options are ignored.
    -->
    <method name="clean_with_options">
        <arg name="cache_type" type="s" direction="in"/>
        <arg name="options" type="a{sv}" direction="in" />
        <arg name="success" type="b" direction="out"/>
        <arg name="error_msg" type="s" direction="out"/>
    </method>

    <!--
        clean:
        @cache_type: cache type to clean up. Supported types are "all", "packages", "metadata", "dbcache", and "expire-cache".
        @success: `true` if the cache was successfully cleaned, `false` otherwise.
        @error_msg: string, contains errors encountered while cleaning the cache.

        Remove or expire cached data.

        This is equivalent to call "clean_with_options()" with empty options.
    -->
    <method name="clean">
        <arg name="cache_type" type="s" direction="in"/>
        <arg name="success" type="b" direction="out"/>
        <arg name="error_msg" type="s" direction="out"/>
    </method>

    <!--
        reset:
        @success: `true` if the session was successfully reset, `false` otherwise.
        @error_msg: string, contains errors encountered while resetting the session

        Completely reset the session.
    -->
    <method name="reset">
        <arg name="success" type="b" direction="out"/>
        <arg name="error_msg" type="s" direction="out"/>
    </method>

    <!--
        download_add_new:
        @session_object_path: object path of the dnf5daemon session
        @download_id: unique id of downloaded object (repo or package)
        @description: the description of the downloaded object
        @total_to_download: total bytes to download

        A new download has started.
    -->
    <signal name="download_add_new">
        <arg name="session_object_path" type="o" />
        <arg name="download_id" type="s" />
        <arg name="description" type="s" />
        <arg name="total_to_download" type="x" />
    </signal>

    <!--
        download_progress:
        @session_object_path: object path of the dnf5daemon session
        @download_id: unique id of downloaded object (repo or package)
        @total_to_download: total bytes to download
        @downloaded: bytes already downloaded

        Progress in downloading.
    -->
    <signal name="download_progress">
        <arg name="session_object_path" type="o" />
        <arg name="download_id" type="s" />
        <arg name="total_to_download" type="x" />
        <arg name="downloaded" type="x" />
    </signal>

    <!--
        download_mirror_failure:
        @session_object_path: object path of the dnf5daemon session
        @download_id: unique id of downloaded object (repo or package)
        @message: an error message
        @url: URL being downloaded
        @metadata: For repository metadata download contains metadata type

        Mirror failure during the download.
    -->
    <signal name="download_mirror_failure">
        <arg name="session_object_path" type="o" />
        <arg name="download_id" type="s" />
        <arg name="message" type="s" />
        <arg name="url" type="s" />
        <arg name="metadata" type="s" />
    </signal>

    <!--
        download_end:
        @session_object_path: object path of the dnf5daemon session
        @download_id: unique id of downloaded object (repo or package)
        @transfer_status: libdnf5::repo::DownloadCallbacks::TransferStatus (0 - successful, 1 - already exists, 2 - error)
        @message: error message in case of failed download

        Downloading has ended.
    -->
    <signal name="download_end">
        <arg name="session_object_path" type="o" />
        <arg name="download_id" type="s" />
        <arg name="transfer_status" type="u" />
        <arg name="message" type="s" />
    </signal>

    <!--
        repo_key_import_request:
        @session_object_path: object path of the dnf5daemon session
        @key_id: OpenPGP key id
        @user_ids: User id
        @key_fingerprint: Fingerprint of the OpenPGP key
        @key_url: URL of the OpenPGP key
        @timestamp: timestamp when the key was created

        Request for repository key import confirmation.
    -->
    <signal name="repo_key_import_request">
        <arg name="session_object_path" type="o" />
        <arg name="key_id" type="s" />
        <arg name="user_ids" type="as" />
        <arg name="key_fingerprint" type="s" />
        <arg name="key_url" type="s" />
        <arg name="timestamp" type="x" />
    </signal>

</interface>

</node>
