| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2011 Mario Bensi <mbensi@ipsquad.net> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 | */ |
| 6 | |
| 7 | #ifndef SOLID_NETWORKSHARE_H |
| 8 | #define SOLID_NETWORKSHARE_H |
| 9 | |
| 10 | #include <solid/solid_export.h> |
| 11 | |
| 12 | #include <solid/deviceinterface.h> |
| 13 | |
| 14 | #include <QUrl> |
| 15 | |
| 16 | namespace Solid |
| 17 | { |
| 18 | class Device; |
| 19 | class NetworkSharePrivate; |
| 20 | |
| 21 | /*! |
| 22 | * \class Solid::NetworkShare |
| 23 | * \inheaderfile Solid/NetworkShare |
| 24 | * \inmodule Solid |
| 25 | * |
| 26 | * \brief NetworkShare interface. |
| 27 | * |
| 28 | * A NetworkShare interface is used to determine the type of |
| 29 | * network access. |
| 30 | * \since 4.7 |
| 31 | */ |
| 32 | class SOLID_EXPORT NetworkShare : public DeviceInterface |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | /*! |
| 37 | * \property Solid::NetworkShare::type |
| 38 | */ |
| 39 | Q_PROPERTY(ShareType type READ type) |
| 40 | |
| 41 | /*! |
| 42 | * \property Solid::NetworkShare::url |
| 43 | */ |
| 44 | Q_PROPERTY(QUrl url READ url) |
| 45 | |
| 46 | Q_DECLARE_PRIVATE(NetworkShare) |
| 47 | friend class Device; |
| 48 | |
| 49 | private: |
| 50 | /*! |
| 51 | * \internal |
| 52 | * |
| 53 | * Creates a new NetworkShare object. |
| 54 | * You generally won't need this. It's created when necessary using |
| 55 | * Device::as(). |
| 56 | * |
| 57 | * \a backendObject the device interface object provided by the backend |
| 58 | * \sa Solid::Device::as() |
| 59 | */ |
| 60 | SOLID_NO_EXPORT explicit NetworkShare(QObject *backendObject); |
| 61 | |
| 62 | public: |
| 63 | ~NetworkShare() override; |
| 64 | |
| 65 | /*! |
| 66 | * This enum type defines the type of networkShare device can be. |
| 67 | * |
| 68 | * \value Unknown a unsupported network protocol |
| 69 | * \value Nfs nfs protocol |
| 70 | * \value Cifs samba protocol |
| 71 | * \value Smb3 samba protocol (version 3) |
| 72 | */ |
| 73 | enum ShareType { Unknown, Nfs, Cifs, Smb3 }; |
| 74 | Q_ENUM(ShareType) |
| 75 | |
| 76 | /*! |
| 77 | * Get the Solid::DeviceInterface::Type of the NetworkShare device interface. |
| 78 | * |
| 79 | * Returns the NetworkShare device interface type |
| 80 | * \sa Solid::DeviceInterface::Type |
| 81 | */ |
| 82 | static Type deviceInterfaceType() |
| 83 | { |
| 84 | return DeviceInterface::NetworkShare; |
| 85 | } |
| 86 | |
| 87 | /*! |
| 88 | * Retrieves the type of network share |
| 89 | * |
| 90 | * Returns the type of network share |
| 91 | */ |
| 92 | ShareType type() const; |
| 93 | |
| 94 | /*! |
| 95 | * Retrieves the url of network share |
| 96 | * |
| 97 | * Returns the url of network share |
| 98 | */ |
| 99 | QUrl url() const; |
| 100 | }; |
| 101 | } |
| 102 | |
| 103 | #endif |
| 104 | |