<!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.Offline:
   @short_description: Interface to offline transactions
-->
<interface name="org.rpm.dnf.v0.Offline">
    <!--
        get_status:
        @pending: boolean, true if there is a pending offline transaction
        @transaction_status: the status of the current offline dnf5 transaction

        Check whether there is an offline transaction configured for the next reboot initiated by dnf5 and return its status.
    -->
    <method name="get_status">
        <arg name="pending" type="b" direction="out" />
        <arg name="transaction_status" type="a{sv}" direction="out" />
    </method>

    <!--
        cancel_with_options:
        @options: an array of key/value pairs to modify the call behavior
        @success: boolean, returns `false` if there was an error during the transaction cancellation, or if the offline transaction was initiated by another tool than dnf5. Returns `true` if the offline transaction was successfully cancelled or if no offline transaction was configured.
        @error_msg: string, contains error encountered while cancelling the transaction

        Cancel the dnf5 offline transaction configured for the next reboot. Offline updates scheduled by another tool are not cancelled.

        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="cancel_with_options">
        <arg name="options" type="a{sv}" direction="in" />
        <arg name="success" type="b" direction="out" />
        <arg name="error_msg" type="s" direction="out" />
    </method>

    <!--
        cancel:
        @success: boolean, returns `false` if there was an error during the transaction cancellation, or if the offline transaction was initiated by another tool than dnf5. Returns `true` if the offline transaction was successfully cancelled or if no offline transaction was configured.
        @error_msg: string, contains error encountered while cancelling the transaction

        Cancel the dnf5 offline transaction configured for the next reboot. Offline updates scheduled by another tool are not cancelled.

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

    <!--
        clean_with_options:
        @options: an array of key/value pairs to modify the call behavior
        @success: boolean, returns `false` if there was an error during the transaction cleanup. Returns `true` if the offline transaction was successfully cleaned or if no offline transaction was configured.
        @error_msg: string, contains error encountered while cleaning the transaction

        Cancel the dnf5 offline transaction configured for the next reboot and remove all stored offline transaction data, including downloaded packages. Offline updates scheduled by another tool are not affected.

        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="success" type="b" direction="out" />
        <arg name="error_msg" type="s" direction="out" />
    </method>

    <!--
        clean:
        @success: boolean, returns `false` if there was an error during the transaction cleanup. Returns `true` if the offline transaction was successfully cleaned or if no offline transaction was configured.
        @error_msg: string, contains error encountered while cleaning the transaction

        Cancel the dnf5 offline transaction configured for the next reboot and remove all stored offline transaction data, including downloaded packages. Offline updates scheduled by another tool are not affected.

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

    <!--
        set_finish_action_with_options:
        @action: string, one of "poweroff", or "reboot". If set to "poweroff", the system will be powered off after applying the offline transaction. Otherwise the system will reboot.
        @options: an array of key/value pairs to modify the call behavior
        @success: boolean, true if the action was successfully set
        @error_msg: string, contains error encountered while setting the action

        Set the action that should be performed after the offline transaction is applied. If the `action` is "poweroff", the system will be powered off, otherwise it will be rebooted (which is default).
        The call might fail in case there is no scheduled offline transaction, or the transaction was not scheduled using libdnf5.

        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="set_finish_action_with_options">
        <arg name="action" 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>

    <!--
        set_finish_action:
        @action: string, one of "poweroff", or "reboot". If set to "poweroff", the system will be powered off after applying the offline transaction. Otherwise the system will reboot.
        @success: boolean, true if the action was successfully set
        @error_msg: string, contains error encountered while setting the action

        Set the action that should be performed after the offline transaction is applied. If the `action` is "poweroff", the system will be powered off, otherwise it will be rebooted (which is default).
        The call might fail in case there is no scheduled offline transaction, or the transaction was not scheduled using libdnf5.


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

</interface>

</node>
