1
/***************************************************************************
2
smb4ksudowriterinterface - This class provides an interface to the
3
smb4k_sudowriter utility program that writes entries to the sudoers
7
copyright : (C) 2008 by Alexander Reinholdt
8
email : dustpuppy@users.berlios.de
9
***************************************************************************/
11
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
* This program is distributed in the hope that it will be useful, but *
18
* WITHOUT ANY WARRANTY; without even the implied warranty of *
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20
* General Public License for more details. *
22
* You should have received a copy of the GNU General Public License *
23
* along with this program; if not, write to the *
24
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
26
***************************************************************************/
28
#ifndef SMB4KSUDOWRITERINTERFACE_H
29
#define SMB4KSUDOWRITERINTERFACE_H
39
#include <kdemacros.h>
44
* This class provides an interface to the smb4k_sudowriter utility program
45
* that writes to the sudoers file.
47
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
50
class KDE_EXPORT Smb4KSudoWriterInterface : public QObject
54
friend class Smb4KSudoWriterInterfacePrivate;
58
* Enumeration for the operation that is currently done.
60
enum Operation { AddUser,
65
* This function returns a static pointer to this class.
67
* @returns a static pointer to the Smb4KSudoWriterInterface class.
69
static Smb4KSudoWriterInterface *self();
72
* This function adds the name of the current user to the Smb4K section
73
* in the sudoers file by invoking the smb4k_sudowriter utility program.
74
* If no Smb4K section exists, the utility program will create one.
79
* This function removes the name of the current user from the Smb4K
80
* section in the sudoers file by invoking the smb4k_sudowriter utility
81
* program. If the user is the only entry, the Smb4K section will be
82
* removed from the sudoers file.
88
* This signal is emitted when somthing went wrong with the writing to
91
void failed( Smb4KSudoWriterInterface::Operation operation );
94
* This signal is emitted when the writing to the sudoers file has
95
* finished. It is emitted in case the writing was successful as well
96
* as in case it wasn't.
98
void finished( Smb4KSudoWriterInterface::Operation operation );
102
* This slot is called, when the process exited.
104
* @param exitCode The exit code of the process
106
* @param exitStatus The exit status of the process (@see QProcess::ExitStatus)
108
void slotProcessFinished( int exitCode, QProcess::ExitStatus exitStatus );
111
* This slot is invoked when an error occurred with the process.
113
* @param errorCode The error code returned by the process
115
void slotProcessError( QProcess::ProcessError errorCode );
121
Smb4KSudoWriterInterface();
126
~Smb4KSudoWriterInterface();
131
Operation m_operation;
134
* The KProcess object
141
QProcess::ProcessError m_process_error;