~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to krunner/lock/lockdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
//
 
8
 
 
9
#ifndef __LOCKDLG_H__
 
10
#define __LOCKDLG_H__
 
11
 
 
12
#include <kgreeterplugin.h>
 
13
 
 
14
#include <KDialog>
 
15
 
 
16
#include <QLabel>
 
17
#include <QTimerEvent>
 
18
#include <QFrame>
 
19
#include <QGridLayout>
 
20
#include <QEvent>
 
21
 
 
22
struct GreeterPluginHandle;
 
23
class LockProcess;
 
24
class QFrame;
 
25
class QGridLayout;
 
26
class QLabel;
 
27
class KPushButton;
 
28
class QSocketNotifier;
 
29
class QTreeWidget;
 
30
 
 
31
//===========================================================================
 
32
//
 
33
// Simple dialog for entering a password.
 
34
// It does not handle password validation.
 
35
//
 
36
class PasswordDlg : public KDialog, public KGreeterPluginHandler
 
37
{
 
38
    Q_OBJECT
 
39
 
 
40
public:
 
41
    PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin, const QString &text = QString());
 
42
    ~PasswordDlg();
 
43
    virtual void setVisible(bool visible);
 
44
 
 
45
    // from KGreetPluginHandler
 
46
    virtual void gplugReturnText( const char *text, int tag );
 
47
    virtual void gplugReturnBinary( const char *data );
 
48
    virtual void gplugSetUser( const QString & );
 
49
    virtual void gplugStart();
 
50
    virtual void gplugChanged();
 
51
    virtual void gplugActivity();
 
52
    virtual void gplugMsgBox( QMessageBox::Icon type, const QString &text );
 
53
    virtual bool gplugHasNode( const QString &id );
 
54
 
 
55
protected:
 
56
    virtual void timerEvent(QTimerEvent *);
 
57
    virtual bool eventFilter(QObject *, QEvent *);
 
58
 
 
59
private Q_SLOTS:
 
60
    void slotSwitchUser();
 
61
    void slotSessionActivated();
 
62
    void slotStartNewSession();
 
63
    void slotOK();
 
64
    void slotActivity();
 
65
    void handleVerify();
 
66
 
 
67
private:
 
68
    void capsLocked();
 
69
    void updateLabel();
 
70
    int Reader (void *buf, int count);
 
71
    bool GRead (void *buf, int count);
 
72
    bool GWrite (const void *buf, int count);
 
73
    bool GSendInt (int val);
 
74
    bool GSendStr (const char *buf);
 
75
    bool GSendArr (int len, const char *buf);
 
76
    bool GRecvInt (int *val);
 
77
    bool GRecvArr (char **buf);
 
78
    void reapVerify();
 
79
    void cantCheck();
 
80
    GreeterPluginHandle *mPlugin;
 
81
    KGreeterPlugin *greet;
 
82
    QFrame      *frame;
 
83
    QGridLayout *frameLayout;
 
84
    QLabel      *mStatusLabel;
 
85
    KPushButton *mNewSessButton, *ok, *cancel;
 
86
    int         mFailedTimerId;
 
87
    int         mTimeoutTimerId;
 
88
    int         mCapsLocked;
 
89
    bool        mUnlockingFailed;
 
90
    int         sPid, sFd;
 
91
    QSocketNotifier *sNot;
 
92
    QTreeWidget *lv;
 
93
};
 
94
 
 
95
#endif
 
96