File: solid-hardware.h

package info (click to toggle)
solid 5.78.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,100 kB
  • sloc: cpp: 21,549; xml: 464; lex: 111; yacc: 83; sh: 14; makefile: 5
file content (45 lines) | stat: -rw-r--r-- 1,209 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*  This file is part of the KDE project
    SPDX-FileCopyrightText: 2006 Kevin Ottens <ervin@kde.org>
    SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>

    SPDX-License-Identifier: LGPL-2.0-only
*/

#ifndef SOLID_HARDWARE_H
#define SOLID_HARDWARE_H

#include <QCoreApplication>
#include <QEventLoop>

#include <solid/storageaccess.h>

class QCommandLineParser;
class SolidHardware : public QCoreApplication
{
    Q_OBJECT
public:
    SolidHardware(int &argc, char **argv) : QCoreApplication(argc, argv), m_error(0) {}

    bool hwList(bool interfaces, bool system);
    bool hwCapabilities(const QString &udi);
    bool hwProperties(const QString &udi);
    bool hwQuery(const QString &parentUdi, const QString &query);
    bool listen();

    enum VolumeCallType { Mount, Unmount, Eject };
    bool hwVolumeCall(VolumeCallType type, const QString &udi);

private:
    QEventLoop m_loop;
    int m_error;
    QString m_errorString;

private Q_SLOTS:
    void slotStorageResult(Solid::ErrorType error, const QVariant &errorData);
    void deviceAdded(const QString &udi);
    void deviceRemoved(const QString &udi);
};

Q_DECLARE_METATYPE(QList<int>)

#endif // SOLID_HARDWARE_H