1 /***************************************************************************
2 * Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 ***************************************************************************/
19 
20 #ifndef SDDM_SEATMANAGER_H
21 #define SDDM_SEATMANAGER_H
22 
23 #include <QObject>
24 #include <QHash>
25 #include <QDBusObjectPath>
26 
27 namespace SDDM {
28     class Seat;
29     class LogindSeat;
30 
31     class SeatManager : public QObject {
32         Q_OBJECT
33     public:
QObject(parent)34         explicit SeatManager(QObject *parent = 0) : QObject(parent) {}
35 
36         void initialize();
37         void createSeat(const QString &name);
38         void removeSeat(const QString &name);
39         void switchToGreeter(const QString &seat);
40 
41     Q_SIGNALS:
42         void seatCreated(const QString &name);
43         void seatRemoved(const QString &name);
44 
45     private Q_SLOTS:
46         void logindSeatAdded(const QString &name, const QDBusObjectPath &objectPath);
47         void logindSeatRemoved(const QString &name, const QDBusObjectPath &objectPath);
48 
49     private:
50         QHash<QString, Seat *> m_seats; //these will exist only for graphical seats
51         QHash<QString, LogindSeat*> m_systemSeats; //these will exist for all seats
52     };
53 }
54 
55 #endif // SDDM_SEATMANAGER_H
56