/*************************************************************************** tdesudo.cpp - description ------------------- begin : Sam Feb 15 15:42:12 CET 2003 copyright : (C) 2003 by Robert Gruber (C) 2007 by Martin Böhm Anthony Mercatante Canonical Ltd (Jonathan Riddell ) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TDESUDO_H #define TDESUDO_H #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include class KCookie; /* * KdeSudo is the base class of the project * * It inherits KPasswordDialog and overrrides the * slot slotOK() * * @author Robert Gruber * @version 2.4 */ class KdeSudo : public KPasswordDialog { Q_OBJECT public: /* * Default construtor */ KdeSudo(TQWidget* parent=0, const char *name=0, const TQString& icon=TQString(), const TQString& generic=TQString(), bool withIgnoreButton=false); /* * Default destructor */ ~KdeSudo(); enum ResultCodes { AsUser = 10 }; public slots: // Public slots /* * This slot gets exectuted if sudo creates some output */ void receivedOut(KProcess*proc, char*buffer, int buflen); /* * This slot gets exectuted when sudo exits */ void procExited(KProcess *proc); /* * This slot overrides the slot from KPasswordDialog * @see KPasswordDialog */ void slotOk(); void slotUser1(); TQString validArg(TQString arg); private: // Private attributes KProcess * p; bool bError; bool newDcop; bool keepPwd; bool emptyPwd; bool useTerm; bool noExec; bool unCleaned; TQString m_tmpname; TQString iceauthorityFile; TQString dcopServer; TQString kdeSycoca; KCookie* m_pCookie; void blockSigChild(); void unblockSigChild(); }; #endif