1/*
2
3Conversation widget for kdm greeter
4
5Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
6Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
7
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
23*/
24
25
26#ifndef KGREET_WINBIND_H
27#define KGREET_WINBIND_H
28
29#include "kgreeterplugin.h"
30
31#include <QObject>
32#include <QtCore/QTimer>
33
34class KComboBox;
35class KLineEdit;
36class KSimpleConfig;
37class QLabel;
38class KProcess;
39
40class KWinbindGreeter : public QObject, public KGreeterPlugin {
41 Q_OBJECT
42
43 public:
44 KWinbindGreeter(KGreeterPluginHandler *handler,
45 QWidget *parent,
46 const QString &fixedEntitiy,
47 Function func, Context ctx);
48 ~KWinbindGreeter();
49 virtual void loadUsers(const QStringList &users);
50 virtual void presetEntity(const QString &entity, int field);
51 virtual QString getEntity() const;
52 virtual void setUser(const QString &user);
53 virtual void setEnabled(bool on);
54 virtual bool textMessage(const char *message, bool error);
55 virtual void textPrompt(const char *prompt, bool echo, bool nonBlocking);
56 virtual bool binaryPrompt(const char *prompt, bool nonBlocking);
57 virtual void start();
58 virtual void suspend();
59 virtual void resume();
60 virtual void next();
61 virtual void abort();
62 virtual void succeeded();
63 virtual void failed();
64 virtual void revive();
65 virtual void clear();
66
67 public Q_SLOTS:
68 void slotLoginLostFocus();
69 void slotChangedDomain(const QString &dom);
70 void slotChanged();
71 void slotStartDomainList();
72 void slotEndDomainList();
73
74 private:
75 void setActive(bool enable);
76 void setActive2(bool enable);
77 void returnData();
78
79 QLabel *domainLabel, *loginLabel, *passwdLabel, *passwd1Label, *passwd2Label;
80 KComboBox *domainCombo;
81 KLineEdit *loginEdit;
82 KLineEdit *passwdEdit, *passwd1Edit, *passwd2Edit;
83 KSimpleConfig *stsFile;
84 QString fixedDomain, fixedUser, curUser;
85 QStringList allUsers;
86 KProcess* m_domainLister;
87
88 Function func;
89 Context ctx;
90 int exp, pExp, has;
91 bool running, authTok;
92};
93
94#endif /* KGREET_WINBIND_H */
95