Plasma5Support

ksolidnotify.h
1/*
2 SPDX-FileCopyrightText: 2010 Jacopo De Simoi <wilderkde@gmail.com>
3 SPDX-FileCopyrightText: 2014 Lukáš Tinkl <ltinkl@redhat.com>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include <QHash>
11#include <QObject>
12#include <QString>
13
14#include <Solid/Device>
15#include <solid/solidnamespace.h>
16
17/**
18 * @brief Class which triggers solid notifications
19 *
20 * This is an internal class which listens to solid errors and route them via dbus to an
21 * appropriate visualization (e.g. the plasma device notifier applet); if such visualization is not available
22 * errors are shown via regular notifications
23 *
24 * @author Jacopo De Simoi <wilderkde at gmail.com>
25 */
26
27class KSolidNotify : public QObject
28{
30
31public:
32 explicit KSolidNotify(QObject *parent);
33
35 void notify(Solid::ErrorType solidError, const QString &error, const QString &errorDetails, const QString &udi);
36 void blockingAppsReady(const QStringList &apps);
37 void clearNotification(const QString &udi);
38
39protected Q_SLOTS:
40 void onDeviceAdded(const QString &udi);
41 void onDeviceRemoved(const QString &udi);
42
43private:
44 enum class SolidReplyType {
45 Setup,
46 Teardown,
47 Eject,
48 };
49
50 void onSolidReply(SolidReplyType type, Solid::ErrorType error, const QVariant &errorData, const QString &udi);
51
52 void connectSignals(Solid::Device *device);
53 bool isSafelyRemovable(const QString &udi) const;
54 void queryBlockingApps(const QString &devicePath);
55
57};
Class which triggers solid notifications.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.