00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef KGREETER_H
00027 #define KGREETER_H
00028
00029 #include "kgverify.h"
00030 #include "kgdialog.h"
00031
00032 class KdmClock;
00033 class UserListView;
00034 class KdmThemer;
00035 class KdmItem;
00036
00037 class KListView;
00038 class KSimpleConfig;
00039
00040 class TQLabel;
00041 class TQPushButton;
00042 class TQPopupMenu;
00043 class TQListViewItem;
00044
00045 struct SessType {
00046 TQString name, type;
00047 bool hid;
00048 int prio;
00049
00050 SessType() {}
00051 SessType( const TQString &n, const TQString &t, bool h, int p ) :
00052 name( n ), type( t ), hid( h ), prio( p ) {}
00053 bool operator<( const SessType &st ) {
00054 return hid != st.hid ? hid < st.hid :
00055 prio != st.prio ? prio < st.prio :
00056 name < st.name;
00057 }
00058 };
00059
00060 class KGreeter : public KGDialog, public KGVerifyHandler {
00061 Q_OBJECT
00062 typedef KGDialog inherited;
00063
00064 public:
00065 KGreeter( bool themed = false );
00066 ~KGreeter();
00067
00068 public slots:
00069 void accept();
00070 void reject();
00071 void slotUserClicked( TQListViewItem * );
00072 void slotSessionSelected( int );
00073 void slotUserEntered();
00074
00075 protected:
00076 void readFacesList();
00077 void installUserList();
00078 void insertUser( const TQImage &, const TQString &, struct passwd * );
00079 void insertUsers( int limit = -1);
00080 void putSession( const TQString &, const TQString &, bool, const char * );
00081 void insertSessions();
00082 virtual void pluginSetup();
00083 void setPrevWM( int );
00084
00085 TQString curUser, dName;
00086 KSimpleConfig *stsFile;
00087 UserListView *userView;
00088 TQStringList *userList;
00089 TQPopupMenu *sessMenu;
00090 TQValueVector<SessType> sessionTypes;
00091 TQStringList randomFaces;
00092 TQMap<TQString, TQString> randomFacesMap;
00093 int nNormals, nSpecials;
00094 int curPrev, curSel;
00095 bool prevValid;
00096 bool needLoad;
00097 bool themed;
00098
00099 static int curPlugin;
00100 static PluginList pluginList;
00101
00102 private slots:
00103 void slotLoadPrevWM();
00104
00105 public:
00106 virtual void verifyPluginChanged( int id );
00107 virtual void verifyClear();
00108 virtual void verifyOk();
00109 virtual void verifyFailed();
00110
00111 virtual void verifySetUser( const TQString &user );
00112 };
00113
00114 class KStdGreeter : public KGreeter {
00115 Q_OBJECT
00116 typedef KGreeter inherited;
00117
00118 public:
00119 KStdGreeter();
00120
00121 protected:
00122 virtual void pluginSetup();
00123
00124 private:
00125 KdmClock *clock;
00126 TQLabel *pixLabel;
00127 TQPushButton *goButton;
00128 TQPushButton *menuButton;
00129
00130 public:
00131 virtual void verifyFailed();
00132 virtual void verifyRetry();
00133 };
00134
00135 class KThemedGreeter : public KGreeter {
00136 Q_OBJECT
00137 typedef KGreeter inherited;
00138
00139 public:
00140 KThemedGreeter();
00141 bool isOK() { return themer != 0; }
00142 static TQString timedUser;
00143 static int timedDelay;
00144
00145 public slots:
00146 void slotThemeActivated( const TQString &id );
00147 void slotSessMenu();
00148 void slotActionMenu();
00149 void slotAskAdminPassword();
00150
00151 protected:
00152 virtual void updateStatus( bool fail, bool caps, int timedleft );
00153 virtual void pluginSetup();
00154 virtual void keyPressEvent( TQKeyEvent * );
00155 virtual bool event( TQEvent *e );
00156
00157 private:
00158
00159 KdmThemer *themer;
00160 KdmItem *caps_warning, *xauth_warning, *pam_error, *timed_label,
00161 *console_rect, *userlist_rect,
00162 *session_button, *system_button, *admin_button;
00163
00164 public:
00165 virtual void verifyFailed();
00166 virtual void verifyRetry();
00167 };
00168
00169 #endif