Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / krunner / lock / lockdlg.h
blob675a72171d15dfc3400cbd3d21e145bb956cdd7e
1 //===========================================================================
2 //
3 // This file is part of the KDE project
4 //
5 // Copyright 1999 Martin R. Jones <mjones@kde.org>
6 // Copyright 2003 Oswald Buddenhagen <ossi@kde.org>
7 //
9 #ifndef __LOCKDLG_H__
10 #define __LOCKDLG_H__
12 #include <kgreeterplugin.h>
14 #include <KDialog>
16 #include <QLabel>
17 #include <QTimerEvent>
18 #include <QFrame>
19 #include <QGridLayout>
20 #include <QEvent>
22 struct GreeterPluginHandle;
23 class LockProcess;
24 class QFrame;
25 class QGridLayout;
26 class QLabel;
27 class KPushButton;
28 class Q3ListView;
30 //===========================================================================
32 // Simple dialog for entering a password.
33 // It does not handle password validation.
35 class PasswordDlg : public KDialog, public KGreeterPluginHandler
37 Q_OBJECT
39 public:
40 PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin);
41 ~PasswordDlg();
42 virtual void setVisible(bool visible);
44 // from KGreetPluginHandler
45 virtual void gplugReturnText( const char *text, int tag );
46 virtual void gplugReturnBinary( const char *data );
47 virtual void gplugSetUser( const QString & );
48 virtual void gplugStart();
49 virtual void gplugActivity();
50 virtual void gplugMsgBox( QMessageBox::Icon type, const QString &text );
51 virtual bool gplugHasNode( const QString &id );
53 protected:
54 virtual void timerEvent(QTimerEvent *);
55 virtual bool eventFilter(QObject *, QEvent *);
57 private Q_SLOTS:
58 void slotSwitchUser();
59 void slotSessionActivated();
60 void slotStartNewSession();
61 void slotOK();
62 void slotActivity();
64 private:
65 void capsLocked();
66 void updateLabel();
67 int Reader (void *buf, int count);
68 bool GRead (void *buf, int count);
69 bool GWrite (const void *buf, int count);
70 bool GSendInt (int val);
71 bool GSendStr (const char *buf);
72 bool GSendArr (int len, const char *buf);
73 bool GRecvInt (int *val);
74 bool GRecvArr (char **buf);
75 void handleVerify();
76 void reapVerify();
77 void cantCheck();
78 GreeterPluginHandle *mPlugin;
79 KGreeterPlugin *greet;
80 QFrame *frame;
81 QGridLayout *frameLayout;
82 QLabel *mStatusLabel;
83 KPushButton *mNewSessButton, *ok, *cancel;
84 int mFailedTimerId;
85 int mTimeoutTimerId;
86 int mCapsLocked;
87 bool mUnlockingFailed;
88 int sPid, sFd;
89 Q3ListView *lv;
92 #endif