summaryrefslogtreecommitdiffstats
path: root/src/loginform.h
diff options
context:
space:
mode:
authorSimon Rettberg2017-08-11 15:00:33 +0200
committerSimon Rettberg2017-08-11 15:00:33 +0200
commit1a0bb4e833f4a6dbef65f4f4641f9920c13a04fc (patch)
treeb20cba2e068c96973ce6259b73c00e0c2b68c086 /src/loginform.h
parentinitial commit (diff)
downloadslxgreeter-1a0bb4e833f4a6dbef65f4f4641f9920c13a04fc.tar.gz
slxgreeter-1a0bb4e833f4a6dbef65f4f4641f9920c13a04fc.tar.xz
slxgreeter-1a0bb4e833f4a6dbef65f4f4641f9920c13a04fc.zip
Move code to src/, tweak CMakeLists.txt
Diffstat (limited to 'src/loginform.h')
-rw-r--r--src/loginform.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/loginform.h b/src/loginform.h
new file mode 100644
index 0000000..8346a58
--- /dev/null
+++ b/src/loginform.h
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2012-2015 Christian Surlykke
+*
+* This file is part of qt-lightdm-greeter
+* It is distributed under the LGPL 2.1 or later license.
+* Please refer to the LICENSE file for a copy of the license.
+*/
+#ifndef LOGINFORM_H
+#define LOGINFORM_H
+
+#include <QWidget>
+#include <QProcess>
+#include <QDialog>
+#include <QKeyEvent>
+#include <QGraphicsOpacityEffect>
+#include <QMap>
+
+#include <QLightDM/Power>
+#include <QLightDM/Greeter>
+#include <QLightDM/SessionsModel>
+
+
+namespace Ui
+{
+class LoginForm;
+}
+
+class LoginForm : public QWidget
+{
+ Q_OBJECT
+
+friend class DecoratedUsersModel;
+
+public:
+ explicit LoginForm(QWidget *parent = 0);
+ ~LoginForm();
+ virtual void setFocus(Qt::FocusReason reason);
+
+public slots:
+ void userChanged();
+ void leaveDropDownActivated(int index);
+ void respond();
+ void onPrompt(QString prompt, QLightDM::Greeter::PromptType promptType);
+ void authenticationComplete();
+
+protected:
+ virtual void keyPressEvent(QKeyEvent *event);
+
+private:
+ void initialize();
+ void addLeaveEntry(bool canDo, QString iconName, QString text, QString actionName);
+ QString currentSession();
+ void setCurrentSession(QString session);
+
+ Ui::LoginForm *ui;
+
+ QLightDM::Greeter m_Greeter;
+ QLightDM::PowerInterface power;
+ QLightDM::SessionsModel sessionsModel;
+
+ QMap<int, void (QLightDM::PowerInterface::*)()> powerSlots;
+};
+
+#endif // LOGINFORM_H