A few deprecations eradicated involving QCheckBox.
[kdenetwork.git] / filesharing / advanced / kcm_sambaconf / linuxpermissionchecker.h
blob1884c69ef0f6ef63026bfc07c6deeaf0296abda6
1 /***************************************************************************
2 begin : Tue May 17 2003
3 copyright : (C) 2003 by Jan Schäfer
4 email : janschaefer@users.sourceforge.net
5 ***************************************************************************/
7 /******************************************************************************
8 * *
9 * This file is part of KSambaPlugin. *
10 * *
11 * KSambaPlugin is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * KSambaPlugin is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with KSambaPlugin; if not, write to the Free Software *
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
24 * *
25 ******************************************************************************/
26 #ifndef LINUXPERMISSIONCHECKER_H
27 #define LINUXPERMISSIONCHECKER_H
29 #include <qfileinfo.h>
31 class SambaShare;
32 class QWidget;
34 /**
35 * A class to check if the Samba permissions specified in the SambaShare fit
36 * to the un?x permissions of the directory. E.g. a user specifies a SambaShare as writeable
37 * for the public, but the guest account has no write permissions for the directory of the
38 * SambaShare. This will cause a dialog (which can be turned of) to popup and inform the
39 * user about the missing rights and ask him to continue nevertheless or to cancel.
40 * This class works for all un?x systems not only for Linux, but I couldn't call the
41 * class Un?xPermissionChecker ;-)
42 * @author Jan Schaefer
44 class LinuxPermissionChecker{
45 public:
46 LinuxPermissionChecker(SambaShare*,QWidget* parent );
47 ~LinuxPermissionChecker();
49 /**
50 * Checks all possible errors that the user could made
51 * @returns <ul>
52 * <li><code>false</code> if the un?x permissions of the directory doesn't fit
53 * to the specified permissions in the Samba share and the user has pushed
54 * the cancel button of one of the dialogs, that informed her.
55 * <li><code>true</code> if either there haven't been any problems with the un?x
56 * permissions, or there have been problems, but the user pressed always the continue button.
58 bool checkAllPermissions();
60 /**
61 * Checks only the public permissions of the directory. First checks
62 * if the Samba share is specified public and then checks if the guest account
63 * has the appropriate rights.
64 * @return @see #check
66 bool checkPublicPermissions();
68 /**
69 * Checks all permissions of all users specified in
70 * the Samba share
71 * @return @see #check
73 bool checkAllUserPermissions();
75 protected:
78 /**
79 * Checks all permissions of the given un?x user
80 * @return @see #check
82 bool checkUserPermissions(const QString & user);
84 /**
85 * Checks the write permissions of the given un?x user
86 * Does not show a dialog if showMessageBox is false
87 * @return @see #check
89 bool checkUserWritePermissions(const QString & user,bool showMessageBox = true);
91 /**
92 * Checks the read permissions of the given un?x user
93 * Does not show a dialog if showMessageBox is false
94 * @return @see #check
96 bool checkUserReadPermissions(const QString & user,bool showMessageBox = true);
98 QWidget* m_parent;
99 SambaShare* m_sambaShare;
100 QFileInfo m_fi;
103 #endif