Warning, /plasma/plasma-mobile/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
0003     SPDX-FileCopyrightText: 2019 Aditya Mehra <Aix.m@outlook.com>
0004     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 import QtQuick
0010 import QtQuick.Layouts
0011 
0012 import org.kde.plasma.private.volume 0.1 as VolumeLib
0013 import org.kde.plasma.private.mobileshell.state as MobileShellState
0014 import org.kde.plasma.private.mobileshell as MobileShell
0015 
0016 /**
0017  * This imports the volume OSD and also sets up keyboard/hardware button bindings.
0018  */
0019 QtObject {
0020     id: component
0021 
0022     function showVolumeOverlay() {
0023         osd.showOverlay();
0024     }
0025 
0026     Component.onCompleted: {
0027         MobileShell.AudioInfo.volumeChanged.connect(showVolumeOverlay);
0028     }
0029 
0030     property var apiListener: Connections {
0031         target: MobileShellState.ShellDBusClient
0032 
0033         function onShowVolumeOSDRequested() {
0034             component.showVolumeOverlay();
0035         }
0036     }
0037 
0038     property var osd: VolumeOSD {}
0039 
0040     property var actionCollection: VolumeLib.GlobalActionCollection {
0041         name: "kmix"
0042         displayName: i18n("Audio")
0043 
0044         VolumeLib.GlobalAction {
0045             objectName: "increase_volume"
0046             text: i18n("Increase Volume")
0047             shortcut: Qt.Key_VolumeUp
0048             onTriggered: MobileShell.AudioInfo.increaseVolume()
0049         }
0050 
0051         VolumeLib.GlobalAction {
0052             objectName: "decrease_volume"
0053             text: i18n("Decrease Volume")
0054             shortcut: Qt.Key_VolumeDown
0055             onTriggered: MobileShell.AudioInfo.decreaseVolume()
0056         }
0057 
0058         VolumeLib.GlobalAction {
0059             objectName: "mute"
0060             text: i18n("Mute")
0061             shortcut: Qt.Key_VolumeMute
0062             onTriggered: MobileShell.AudioInfo.muteVolume()
0063         }
0064     }
0065 }