/usr/include/ksambasharedata.h is in kdelibs5-dev 4:4.13.3-0ubuntu0.5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | /*
* Copyright 2010 Rodrigo Belem <rclbelem@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef ksambasharedata_h
#define ksambasharedata_h
#include <QtCore/QExplicitlySharedDataPointer>
#include <kio/kio_export.h>
class QString;
class KSambaShare;
class KSambaSharePrivate;
class KSambaShareDataPrivate;
/**
* This class represents a Samba user share. It is possible to share a directory with one or more
* different names, update the share details or remove.
*
* @author Rodrigo Belem <rclbelem@gmail.com>
* @since 4.7
*/
class KIO_EXPORT KSambaShareData
{
public:
enum GuestPermission {
GuestsNotAllowed,
GuestsAllowed
};
enum UserShareError {
UserShareOk,
UserShareExceedMaxShares,
UserShareNameOk,
UserShareNameInvalid,
UserShareNameInUse,
UserSharePathOk,
UserSharePathInvalid,
UserSharePathNotExists,
UserSharePathNotDirectory,
UserSharePathNotAbsolute,
UserSharePathNotAllowed,
UserShareAclOk,
UserShareAclInvalid,
UserShareAclUserNotValid,
UserShareCommentOk,
UserShareGuestsOk,
UserShareGuestsInvalid,
UserShareGuestsNotAllowed,
UserShareSystemError
};
KSambaShareData();
KSambaShareData(const KSambaShareData &other);
~KSambaShareData();
/**
* @return @c the share name.
*/
QString name() const;
/**
* @return @c the share path.
*/
QString path() const;
/**
* @return @c the share comment.
*/
QString comment() const;
/**
* Returns a @c containing a string describing the permission added to the users, such as
* "[DOMAIN\]username1:X,[DOMAIN\]username2:X,...". X stands for "F" (full control), "R"
* (read-only) and "D" (deny). By dafault the acl is Everyone:R.
*
* @return @c the share acl.
*/
QString acl() const;
/**
* @return @c whether guest access to the share is allowed or not.
*/
KSambaShareData::GuestPermission guestPermission() const;
/**
* Sets the share name. If the share name is changed and valid it will remove the existing
* share and will create a new share.
* The share name cannot use a name of a system user or containing the forbidden characters
* '%, <, >, *, ?, |, /, \, +, =, ;, :, ",,. To check if the name is available or valid use
* the method KSambaShare::isShareNameAvailable().
*
* @param name the name that will be given to the share.
*
* @return @c UserShareNameOk if the name is valid.
* @return @c UserShareNameInvalid if the name contains invalid characters.
* @return @c UserShareNameInUse if the name is already in use by another shared folder or a
* by a system user.
*/
KSambaShareData::UserShareError setName(const QString &name);
/**
* Set the path for the share.
*
* @param path the path that will be given to the share.
*
* @return @c UserSharePathOk if valid.
* @return @c UserSharePathInvalid if the path is in invalid format.
* @return @c UserSharePathNotExists if the path does not exists.
* @return @c UserSharePathNotDirectory if the path points to file instead of a directory.
* @return @c UserSharePathNotAbsolute if the path is not is absolute form.
* @return @c UserSharePathNotAllowed if the path is not owner by the user.
*/
KSambaShareData::UserShareError setPath(const QString &path);
/**
* Sets the comment for the share.
*
* @param comment the comment that will be given to the share.
*
* @return @c UserShareCommentOk always.
*/
KSambaShareData::UserShareError setComment(const QString &comment);
/**
* Sets the acl to the share.
*
* @param acl the acl that will be given to the share.
*
* @return @c UserShareAclOk if the acl is valid.
* @return @c UserShareAclInvalid if the acl has invalid format.
* @return @c UserShareAclUserNotValid if one of the users in the acl is invalid.
*/
KSambaShareData::UserShareError setAcl(const QString &acl);
/**
* Flags if guest is allowed or not to access the share.
*
* @param permission the permission that will be given to the share.
*
* @return @c UserShareGuestsOk if the permission was set.
* @return @c UserShareGuestsNotAllowed if the system does not allow guest access to the
* shares.
*/
KSambaShareData::UserShareError setGuestPermission(const GuestPermission &permission = KSambaShareData::GuestsNotAllowed);
/**
* Share the folder with the information that has been set.
*
* @return @c UserShareOk if the share was added.
*/
KSambaShareData::UserShareError save();
/**
* Unshare the folder held by the object.
*
* @return @c UserShareOk if the share was removed.
*/
KSambaShareData::UserShareError remove();
KSambaShareData &operator=(const KSambaShareData &other);
bool operator==(const KSambaShareData &other) const;
bool operator!=(const KSambaShareData &other) const;
private:
QExplicitlySharedDataPointer<KSambaShareDataPrivate> dd;
friend class KSambaSharePrivate;
};
#endif
|