00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __LOCKDLG_H__
00010 #define __LOCKDLG_H__
00011
00012 #include <kgreeterplugin.h>
00013
00014 #include <tqdialog.h>
00015 #include <tqstringlist.h>
00016
00017 #include "lockprocess.h"
00018
00019 struct GreeterPluginHandle;
00020 class LockProcess;
00021 class TQFrame;
00022 class TQGridLayout;
00023 class TQLabel;
00024 class KPushButton;
00025 class TQListView;
00026
00027
00028
00029
00030
00031
00032 class PasswordDlg : public TQDialog, public KGreeterPluginHandler
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin);
00038 ~PasswordDlg();
00039 virtual void show();
00040
00041
00042 virtual void gplugReturnText( const char *text, int tag );
00043 virtual void gplugReturnBinary( const char *data );
00044 virtual void gplugSetUser( const TQString & );
00045 virtual void gplugStart();
00046 virtual void gplugActivity();
00047 virtual void gplugMsgBox( TQMessageBox::Icon type, const TQString &text );
00048
00049 protected:
00050 virtual void timerEvent(TQTimerEvent *);
00051 virtual bool eventFilter(TQObject *, TQEvent *);
00052
00053 private slots:
00054 void slotSwitchUser();
00055 void slotSessionActivated();
00056 void slotStartNewSession();
00057 void slotOK();
00058 void layoutClicked();
00059 void slotActivity();
00060
00061 private:
00062 void setLayoutText( const TQString &txt );
00063 void capsLocked();
00064 void updateLabel();
00065 int Reader (void *buf, int count);
00066 bool GRead (void *buf, int count);
00067 bool GWrite (const void *buf, int count);
00068 bool GSendInt (int val);
00069 bool GSendStr (const char *buf);
00070 bool GSendArr (int len, const char *buf);
00071 bool GRecvInt (int *val);
00072 bool GRecvArr (char **buf);
00073 void handleVerify();
00074 void reapVerify();
00075 void cantCheck();
00076 GreeterPluginHandle *mPlugin;
00077 KGreeterPlugin *greet;
00078 TQFrame *frame;
00079 TQGridLayout *frameLayout;
00080 TQLabel *mStatusLabel;
00081 KPushButton *mNewSessButton, *ok, *cancel;
00082 TQPushButton *mLayoutButton;
00083 int mFailedTimerId;
00084 int mTimeoutTimerId;
00085 int mCapsLocked;
00086 bool mUnlockingFailed;
00087 TQStringList layoutsList;
00088 TQStringList::iterator currLayout;
00089 int sPid, sFd;
00090 TQListView *lv;
00091 };
00092
00093 #endif
00094