Mir
session_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voss <thomas.voss@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_APPLICATION_MANAGER_H_
20 #define MIR_SCENE_APPLICATION_MANAGER_H_
21 
23 
24 #include <memory>
25 #include <vector>
26 
27 namespace mir
28 {
29 namespace scene
30 {
31 class SessionContainer;
32 class SessionEventSink;
33 class SessionListener;
34 class SnapshotStrategy;
35 class SurfaceCoordinator;
36 class PromptSessionManager;
37 
38 
40 {
41 public:
42  explicit SessionManager(std::shared_ptr<SurfaceCoordinator> const& surface_coordinator,
43  std::shared_ptr<SessionContainer> const& app_container,
44  std::shared_ptr<SnapshotStrategy> const& snapshot_strategy,
45  std::shared_ptr<SessionEventSink> const& session_event_sink,
46  std::shared_ptr<SessionListener> const& session_listener);
47  virtual ~SessionManager() noexcept;
48 
49  std::shared_ptr<Session> open_session(
50  pid_t client_pid,
51  std::string const& name,
52  std::shared_ptr<frontend::EventSink> const& sink) override;
53 
54  void close_session(std::shared_ptr<Session> const& session) override;
55 
56  std::shared_ptr<Session> successor_of(std::shared_ptr<Session> const&) const override;
57 
58  void set_focus_to(std::shared_ptr<Session> const& focus) override;
59  void unset_focus() override;
60 
61 protected:
62  SessionManager(const SessionManager&) = delete;
63  SessionManager& operator=(const SessionManager&) = delete;
64 
65 private:
66  std::shared_ptr<SurfaceCoordinator> const surface_coordinator;
67  std::shared_ptr<SessionContainer> const app_container;
68  std::shared_ptr<SnapshotStrategy> const snapshot_strategy;
69  std::shared_ptr<SessionEventSink> const session_event_sink;
70  std::shared_ptr<SessionListener> const session_listener;
71 };
72 
73 }
74 }
75 
76 #endif // MIR_SCENE_APPLICATION_MANAGER_H_
All things Mir.
Definition: buffer_stream.h:37
Definition: session_coordinator.h:41
std::shared_ptr< Session > open_session(pid_t client_pid, std::string const &name, std::shared_ptr< frontend::EventSink > const &sink) override
Definition: session_manager.cpp:76
Definition: session_manager.h:39
std::shared_ptr< Session > successor_of(std::shared_ptr< Session > const &) const override
Definition: session_manager.cpp:118
void set_focus_to(std::shared_ptr< Session > const &focus) override
Definition: session_manager.cpp:92
void unset_focus() override
Definition: session_manager.cpp:98
SessionManager(std::shared_ptr< SurfaceCoordinator > const &surface_coordinator, std::shared_ptr< SessionContainer > const &app_container, std::shared_ptr< SnapshotStrategy > const &snapshot_strategy, std::shared_ptr< SessionEventSink > const &session_event_sink, std::shared_ptr< SessionListener > const &session_listener)
Definition: session_manager.cpp:40
SessionManager & operator=(const SessionManager &)=delete
virtual ~SessionManager() noexcept
Definition: session_manager.cpp:56
void close_session(std::shared_ptr< Session > const &session) override
Definition: session_manager.cpp:104

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015