/* 
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __DBSDROOTONLYKCMODULE_H
#define __DBSDROOTONLYKCMODULE_H

#include <dbsdkcmodule.h>
#include <kcmodule.h>

class QLayout;
class NotRoot;
class	DBSDModule;

/** 
 * @brief A KCModule wrapper for DBSDModules that require root permissions.
 *
 * This class displays a message that the current module requires
 * root permissions to run if the given DBSDModule pointer in the
 * constructor equals NULL, otherwise it shows the module.
 * 
 * A button is provided for the user to launch the module using
 * KDE-su to gain root permissions.
 * 
 * @attention This implementation seems unnecessary because the KDE control
 *            center has own functionality to launch modules with root
 *            permissions, but for some reason modules are never
 *            deleted this way and therefore destruction code is never called.
 *
 *            Additionally, the "keep password" function of KDE-su is
 *            not used by KControl, which can be utilized the way
 *            DBSDRootOnlyKCModule handles loading of root-only modules.
 */
 
class  DBSDRootOnlyKCModule : public DBSDKCModule {
	Q_OBJECT

public:
	DBSDRootOnlyKCModule(DBSDModule * = NULL, QWidget * = NULL,  const char * = NULL,  const QStringList & = QStringList());
	virtual ~DBSDRootOnlyKCModule();

protected slots:
	virtual void launchRootModule();

protected:
	virtual QString  kcmoduleName() = 0;

	NotRoot		*notRoot;
};

#endif /* __DBSDROOTONLYKCMODULE_H */
