1/*
2 SPDX-FileCopyrightText: 2010 Rodrigo Belem <rclbelem@gmail.com>
3 SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef ksambashare_p_h
9#define ksambashare_p_h
10
11#include <QMap>
12
13#include "ksambasharedata.h"
14
15class QString;
16class KSambaShare;
17
18class KSambaSharePrivate
19{
20public:
21 explicit KSambaSharePrivate(KSambaShare *parent);
22 ~KSambaSharePrivate();
23
24 static bool isSambaInstalled();
25 void setUserSharePath();
26
27 static int runProcess(const QString &progName, const QStringList &args, QByteArray &stdOut, QByteArray &stdErr);
28 static QString testparmParamValue(const QString &parameterName);
29
30 QByteArray getNetUserShareInfo();
31 QStringList shareNames() const;
32 QStringList sharedDirs() const;
33 KSambaShareData getShareByName(const QString &shareName) const;
34 QList<KSambaShareData> getSharesByPath(const QString &path) const;
35
36 bool isShareNameValid(const QString &name) const;
37 bool isDirectoryShared(const QString &path) const;
38 bool isShareNameAvailable(const QString &name) const;
39 bool areGuestsAllowed() const;
40 KSambaShareData::UserShareError isPathValid(const QString &path) const;
41 KSambaShareData::UserShareError isAclValid(const QString &acl) const;
42 KSambaShareData::UserShareError guestsAllowed(const KSambaShareData::GuestPermission &guestok) const;
43
44 KSambaShareData::UserShareError add(const KSambaShareData &shareData);
45 KSambaShareData::UserShareError remove(const KSambaShareData &shareName);
46 static QMap<QString, KSambaShareData> parse(const QByteArray &usershareData);
47
48 void slotFileChange(const QString &path);
49
50private:
51 KSambaShare *const q_ptr;
52 Q_DECLARE_PUBLIC(KSambaShare)
53
54 QMap<QString, KSambaShareData> data;
55 QString smbConf;
56 QString userSharePath;
57 bool skipUserShare;
58 QByteArray m_stdErr;
59};
60
61#endif
62

source code of kio/src/core/ksambashare_p.h