Mir
prompt_session_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 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: Nick Dedekind <nick.dedekind@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_PROMPT_SESSION_MANAGER_H_
20 #define MIR_SCENE_PROMPT_SESSION_MANAGER_H_
21 
22 #include <sys/types.h>
23 #include <memory>
24 #include <functional>
25 
26 namespace mir
27 {
28 namespace scene
29 {
30 class Session;
31 class PromptSession;
32 struct PromptSessionCreationParameters;
33 
35 {
36 public:
37  virtual ~PromptSessionManager() = default;
38 
44  virtual std::shared_ptr<PromptSession> start_prompt_session_for(std::shared_ptr<Session> const& session,
45  PromptSessionCreationParameters const& params) const = 0;
46 
51  virtual void stop_prompt_session(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
52 
57  virtual void suspend_prompt_session(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
58 
63  virtual void resume_prompt_session(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
64 
70  virtual void add_prompt_provider(std::shared_ptr<PromptSession> const& prompt_session,
71  std::shared_ptr<Session> const& prompt_provider) const = 0;
72 
77  virtual void remove_session(std::shared_ptr<Session> const& session) const = 0;
78 
83  virtual std::shared_ptr<Session> application_for(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
84 
89  virtual std::shared_ptr<Session> helper_for(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
90 
96  virtual void for_each_provider_in(std::shared_ptr<PromptSession> const& prompt_session,
97  std::function<void(std::shared_ptr<Session> const& prompt_provider)> const& f) const = 0;
98 
99 protected:
100  PromptSessionManager() = default;
103 };
104 
105 }
106 }
107 
108 #endif // MIR_SCENE_PROMPT_SESSION_MANAGER_H_
Definition: as_render_target.h:27
virtual std::shared_ptr< Session > application_for(std::shared_ptr< PromptSession > const &prompt_session) const =0
Retrieve the application session for a prompt session.
virtual ~PromptSessionManager()=default
virtual void add_prompt_provider(std::shared_ptr< PromptSession > const &prompt_session, std::shared_ptr< Session > const &prompt_provider) const =0
Add a prompt provider to an existing prompt session.
virtual void stop_prompt_session(std::shared_ptr< PromptSession > const &prompt_session) const =0
Stop a started prompt session.
virtual void remove_session(std::shared_ptr< Session > const &session) const =0
Remove a session from all associated prompt sessions.
virtual std::shared_ptr< Session > helper_for(std::shared_ptr< PromptSession > const &prompt_session) const =0
Retrieve the helper session for a prompt session.
virtual std::shared_ptr< PromptSession > start_prompt_session_for(std::shared_ptr< Session > const &session, PromptSessionCreationParameters const &params) const =0
Start a new prompt session.
PromptSessionManager & operator=(const PromptSessionManager &)=delete
virtual void resume_prompt_session(std::shared_ptr< PromptSession > const &prompt_session) const =0
Resume a suspended prompt session.
Definition: prompt_session_manager.h:34
virtual void for_each_provider_in(std::shared_ptr< PromptSession > const &prompt_session, std::function< void(std::shared_ptr< Session > const &prompt_provider)> const &f) const =0
Iterate over all the prompt providers associated with a prompt session.
Definition: prompt_session_creation_parameters.h:29
virtual void suspend_prompt_session(std::shared_ptr< PromptSession > const &prompt_session) const =0
Suspend a prompt session.

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed Oct 11 22:26:23 UTC 2017