add more spacing
[personal-kdebase.git] / workspace / krunner / lock / lockdlg.h
blob27529e6e818283c91004b529ac949fbe69f4b342
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 QTreeWidget;
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, const QString &text = QString());
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 gplugChanged();
50 virtual void gplugActivity();
51 virtual void gplugMsgBox( QMessageBox::Icon type, const QString &text );
52 virtual bool gplugHasNode( const QString &id );
54 protected:
55 virtual void timerEvent(QTimerEvent *);
56 virtual bool eventFilter(QObject *, QEvent *);
58 private Q_SLOTS:
59 void slotSwitchUser();
60 void slotSessionActivated();
61 void slotStartNewSession();
62 void slotOK();
63 void slotActivity();
65 private:
66 void capsLocked();
67 void updateLabel();
68 int Reader (void *buf, int count);
69 bool GRead (void *buf, int count);
70 bool GWrite (const void *buf, int count);
71 bool GSendInt (int val);
72 bool GSendStr (const char *buf);
73 bool GSendArr (int len, const char *buf);
74 bool GRecvInt (int *val);
75 bool GRecvArr (char **buf);
76 void handleVerify();
77 void reapVerify();
78 void cantCheck();
79 GreeterPluginHandle *mPlugin;
80 KGreeterPlugin *greet;
81 QFrame *frame;
82 QGridLayout *frameLayout;
83 QLabel *mStatusLabel;
84 KPushButton *mNewSessButton, *ok, *cancel;
85 int mFailedTimerId;
86 int mTimeoutTimerId;
87 int mCapsLocked;
88 bool mUnlockingFailed;
89 int sPid, sFd;
90 QTreeWidget *lv;
93 #endif