Back to index

lightdm  1.3.2
greeter.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 David Edmundson.
00003  * Copyright (C) 2010-2011 Robert Ancell
00004  * Author: David Edmundson <kde@davidedmundson.co.uk>
00005  *
00006  * This library is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU Lesser General Public License as published by the Free
00008  * Software Foundation; either version 3 of the License, or (at your option) any
00009  * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
00010  * license.
00011  */
00012 
00013 #ifndef QLIGHTDM_GREETER_H
00014 #define QLIGHTDM_GREETER_H
00015 
00016 #include <QtCore/QObject>
00017 #include <QtCore/QVariant>
00018 
00019 
00020 namespace QLightDM
00021 {
00022     class GreeterPrivate;
00023 
00024 class Q_DECL_EXPORT Greeter : public QObject
00025 {
00026     Q_OBJECT
00027     
00028     Q_PROPERTY(bool authenticated READ isAuthenticated ); //NOTFIY authenticationComplete
00029     Q_PROPERTY(QString authenticationUser READ authenticationUser );  
00030     Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT);
00031     Q_PROPERTY(QString selectUser READ selectUserHint CONSTANT);
00032     Q_PROPERTY(bool selectGuest READ selectGuestHint CONSTANT);
00033 
00034     Q_PROPERTY(QString hostname READ hostname CONSTANT);
00035     Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT);
00036     Q_PROPERTY(bool locked READ lockHint CONSTANT);
00037     
00038     Q_PROPERTY(QString hostname READ hostname CONSTANT);
00039 
00040 public:
00041     enum PromptType {
00042         PromptTypeQuestion,
00043         PromptTypeSecret
00044     };
00045 
00046     enum MessageType {
00047         MessageTypeInfo,
00048         MessageTypeError
00049     };
00050 
00051     explicit Greeter(QObject* parent=0);
00052     virtual ~Greeter();
00053 
00054     QString getHint(const QString &name) const;   
00055     QString defaultSessionHint() const;
00056     bool hideUsersHint() const;
00057     bool showManualLoginHint() const;
00058     bool lockHint () const;
00059     bool hasGuestAccountHint() const;
00060     QString selectUserHint() const;
00061     bool selectGuestHint() const;
00062     QString autologinUserHint() const;
00063     bool autologinGuestHint() const;
00064     int autologinTimeoutHint() const;
00065 
00066     bool inAuthentication() const;
00067     bool isAuthenticated() const;
00068     QString authenticationUser() const;
00069     QString hostname() const;
00070 
00071 public slots:
00072     bool connectSync();
00073     void authenticate(const QString &username=QString());
00074     void authenticateAsGuest();
00075     void respond(const QString &response);
00076     void cancelAuthentication();
00077     void setLanguage (const QString &language);
00078     bool startSessionSync(const QString &session=QString());
00079 
00080 signals:
00081     void showMessage(QString text, QLightDM::Greeter::MessageType type);
00082     void showPrompt(QString text, QLightDM::Greeter::PromptType type);
00083     void authenticationComplete();
00084     void autologinTimerExpired();
00085 
00086 private:
00087     GreeterPrivate *d_ptr;
00088     Q_DECLARE_PRIVATE(Greeter)
00089 
00090 };
00091 };
00092 
00093 #endif // QLIGHTDM_GREETER_H