2
* Copyright (C) 2014-2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef SESSIONMANAGER_H
18
#define SESSIONMANAGER_H
25
#include <QSharedPointer>
28
#include <mir_toolkit/common.h>
31
#include <miral/application_info.h>
35
#include "sessionmodel.h"
47
class ApplicationManager;
49
class SessionManager : public SessionModel
54
explicit SessionManager(
55
const std::shared_ptr<PromptSessionManager>& promptSessionManager,
56
ApplicationManager* applicationManager,
61
static SessionManager* singleton();
63
SessionInterface *findSession(const mir::scene::Session* session) const;
66
void sessionStarting(SessionInterface* session);
67
void sessionStopping(SessionInterface* session);
70
void onSessionStarting(const miral::ApplicationInfo &appInfo);
71
void onSessionStopping(const miral::ApplicationInfo &appInfo);
73
void onPromptSessionStarting(const PromptSession& promptSession);
74
void onPromptSessionStopping(const PromptSession& promptSession);
75
void onPromptProviderAdded(const qtmir::PromptSession &promptSession, const std::shared_ptr<mir::scene::Session> &);
76
void onPromptProviderRemoved(const qtmir::PromptSession &promptSession, const std::shared_ptr<mir::scene::Session> &);
81
const std::shared_ptr<PromptSessionManager> m_promptSessionManager;
82
ApplicationManager* m_applicationManager;
83
static SessionManager *the_session_manager;
85
QHash<const mir::scene::PromptSession *, SessionInterface *> m_mirPromptToSessionHash;
90
#endif // SESSIONMANAGER_H