Warning, /libraries/kirigami-addons/src/components/DownloadAction.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Controls 2.15 as QQC2
0006 
0007 import org.kde.kirigami 2.15 as Kirigami
0008 
0009 /**
0010  * @brief An action for with bindings for managing the download of a piece of media.
0011  *
0012  * The action provides properties to help track progress but is up to the action
0013  * representation to respond to them. The onTriggered() signal should be used to
0014  * perform the download action itself.
0015  *
0016  * The most common use case for this is where a custom URI scheme is used that a
0017  * QML media component can't handle on it's own.
0018  */
0019 Kirigami.Action {
0020     id: root
0021 
0022     /**
0023      * @brief The download progress between 0% and 100%.
0024      */
0025     property real progress: -1
0026 
0027     /**
0028      * @brief Whether the download has started.
0029      */
0030     readonly property bool started: progress > 0.0
0031 
0032     /**
0033      * @brief Whether the download has completed.
0034      */
0035     readonly property bool completed: progress >= 100.0
0036 
0037     text: i18nd("kirigami-addons6", "Download")
0038     icon.name: "download"
0039 }