File indexing completed on 2024-06-23 05:28:18

0001 /*
0002 This file is part of LightDM-KDE.
0003 
0004 Copyright 2012 David Edmundson <kde@davidedmundson.co.uk>
0005 
0006 LightDM-KDE is free software: you can redistribute it and/or modify
0007 it under the terms of the GNU General Public License as published by
0008 the Free Software Foundation, either version 3 of the License, or
0009 (at your option) any later version.
0010 
0011 LightDM-KDE is distributed in the hope that it will be useful,
0012 but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 GNU General Public License for more details.
0015 
0016 You should have received a copy of the GNU General Public License
0017 along with LightDM-KDE.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 #ifndef GREETERWRAPPER_H
0021 #define GREETERWRAPPER_H
0022 
0023 #include <QLightDM/Greeter>
0024 
0025 #include <KSharedConfig>
0026 #include <KConfigGroup>
0027 
0028 class GreeterWrapper : public QLightDM::Greeter
0029 {
0030     Q_OBJECT
0031 
0032     Q_PROPERTY(QString lastLoggedInUser READ lastLoggedInUser CONSTANT)
0033     Q_PROPERTY(QString guestLoginName READ guestLoginName CONSTANT)
0034 
0035 public:
0036     explicit GreeterWrapper(QObject *parent = 0);
0037 
0038     QString lastLoggedInUser() const;
0039     QString guestLoginName() const;
0040 
0041 signals:
0042     void aboutToLogin();
0043 
0044 public slots:
0045     bool startSessionSync(const QString &session=QString());
0046 
0047 private:
0048     void saveLastUser(const QString &user);
0049     KConfigGroup m_configGroup;
0050 };
0051 
0052 #endif // GREETERWRAPPER_H