~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to krunner/lock/lockprocess.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

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 LOCKPROCESS_H
 
10
#define LOCKPROCESS_H
 
11
 
 
12
#include <kgreeterplugin.h>
 
13
 
 
14
#include <K3Process>
 
15
 
 
16
#include <QWidget>
 
17
#include <QTimer>
 
18
#include <QStack>
 
19
#include <QList>
 
20
#include <QMessageBox>
 
21
#include <QPixmap>
 
22
 
 
23
#include <X11/Xlib.h>
 
24
#include <fixx11h.h>
 
25
 
 
26
class KLibrary;
 
27
 
 
28
struct GreeterPluginHandle {
 
29
    KLibrary *library;
 
30
    kgreeterplugin_info *info;
 
31
};
 
32
 
 
33
//===========================================================================
 
34
//
 
35
// Screen saver handling process.  Handles screensaver window,
 
36
// starting screensaver hacks, and password entry.
 
37
//
 
38
class LockProcess
 
39
    : public QWidget
 
40
{
 
41
    Q_OBJECT
 
42
public:
 
43
    explicit LockProcess(bool child_saver = false, bool useBlankOnly = false);
 
44
    ~LockProcess();
 
45
 
 
46
    bool lock();
 
47
 
 
48
    bool defaultSave();
 
49
 
 
50
    bool dontLock();
 
51
 
 
52
    void setChildren(QList<int> children) { child_sockets = children; }
 
53
    void setParent(int fd) { mParent = fd; }
 
54
 
 
55
    void msgBox( QMessageBox::Icon type, const QString &txt );
 
56
    int execDialog( QDialog* dlg );
 
57
    
 
58
public Q_SLOTS:
 
59
    void quitSaver();
 
60
    void preparePopup();
 
61
    void cleanupPopup();
 
62
 
 
63
protected:
 
64
    virtual bool x11Event(XEvent *);
 
65
    virtual void timerEvent(QTimerEvent *);
 
66
 
 
67
private Q_SLOTS:
 
68
    void hackExited(K3Process *);
 
69
    void signalPipeSignal();
 
70
    bool startLock();
 
71
    void suspend();
 
72
    void checkDPMSActive();
 
73
    void slotDeadTimePassed();
 
74
 
 
75
private:
 
76
    void configure();
 
77
    void readSaver();
 
78
    void createSaverWindow();
 
79
    void hideSaverWindow();
 
80
    void saveVRoot();
 
81
    void setVRoot(Window win, Window rw);
 
82
    void removeVRoot(Window win);
 
83
    bool grabKeyboard();
 
84
    bool grabMouse();
 
85
    bool grabInput();
 
86
    void ungrabInput();
 
87
    void cantLock(const QString &reason);
 
88
    bool startSaver();
 
89
    void stopSaver();
 
90
    bool startHack();
 
91
    void stopHack();
 
92
    void setupSignals();
 
93
    bool checkPass();
 
94
    void stayOnTop();
 
95
    void lockXF86();
 
96
    void unlockXF86();
 
97
    void resume( bool force );
 
98
    static QVariant getConf(void *ctx, const char *key, const QVariant &dflt);
 
99
 
 
100
    bool        mLocked;
 
101
    int         mLockGrace;
 
102
    int         mPriority;
 
103
    bool        mBusy;
 
104
    K3Process    mHackProc;
 
105
    int         mRootWidth;
 
106
    int         mRootHeight;
 
107
    QString     mSaverExec;
 
108
    QString     mSaver;
 
109
    bool        mOpenGLVisual;
 
110
    bool        child_saver;
 
111
    QList<int> child_sockets;
 
112
    int         mParent;
 
113
    bool        mUseBlankOnly;
 
114
    bool        mSuspended;
 
115
    QTimer      mSuspendTimer;
 
116
    bool        mVisibility;
 
117
    bool        mDPMSDepend;
 
118
    QTimer      mCheckDPMS;
 
119
    QStack< QWidget* > mDialogs;
 
120
    bool        mRestoreXF86Lock;
 
121
    bool        mForbidden;
 
122
    QStringList mPlugins, mPluginOptions;
 
123
    QString     mMethod;
 
124
    GreeterPluginHandle greetPlugin;
 
125
    QPixmap     mSavedScreen;
 
126
    int         mAutoLogoutTimerId;
 
127
    int         mAutoLogoutTimeout;
 
128
    bool        mAutoLogout;
 
129
};
 
130
 
 
131
#endif
 
132