Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
58  virtual void add_prompt_provider(std::shared_ptr<PromptSession> const& prompt_session,
59  std::shared_ptr<Session> const& prompt_provider) const = 0;
60 
65  virtual void remove_session(std::shared_ptr<Session> const& session) const = 0;
66 
71  virtual std::shared_ptr<Session> application_for(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
72 
77  virtual std::shared_ptr<Session> helper_for(std::shared_ptr<PromptSession> const& prompt_session) const = 0;
78 
84  virtual void for_each_provider_in(std::shared_ptr<PromptSession> const& prompt_session,
85  std::function<void(std::shared_ptr<Session> const& prompt_provider)> const& f) const = 0;
86 
87 protected:
88  PromptSessionManager() = default;
91 };
92 
93 }
94 }
95 
96 #endif // MIR_SCENE_PROMPT_SESSION_MANAGER_H_
All things Mir.
Definition: aging_buffer.h:24
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
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

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014