Mir
application_not_responding_detector.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_APPLICATION_NOT_RESPONDING_DETECTOR_H_
20 #define MIR_SCENE_APPLICATION_NOT_RESPONDING_DETECTOR_H_
21 
22 #include <memory>
23 #include <functional>
24 
25 namespace mir
26 {
27 namespace frontend
28 {
29 class Session;
30 }
31 
32 namespace scene
33 {
34 class Session;
35 
37 {
38 public:
40  virtual ~ApplicationNotRespondingDetector() = default;
41 
49  class Observer
50  {
51  public:
52  Observer() = default;
53  virtual ~Observer() = default;
54 
55  virtual void session_unresponsive(Session const* session) = 0;
56  virtual void session_now_responsive(Session const* session) = 0;
57  };
58 
59  virtual void register_session(frontend::Session const* session, std::function<void()> const& pinger) = 0;
60  virtual void unregister_session(frontend::Session const* session) = 0;
61  virtual void pong_received(frontend::Session const* received_for) = 0;
62 
63  virtual void register_observer(std::shared_ptr<Observer> const& observer) = 0;
64  virtual void unregister_observer(std::shared_ptr<Observer> const& observer) = 0;
65 };
66 }
67 }
68 
69 #endif // MIR_SCENE_APPLICATION_NOT_RESPONDING_DETECTOR_H_
Definition: session.h:49
Definition: as_render_target.h:27
Definition: session.h:37
Definition: application_not_responding_detector.h:36
Notification object for application-not-responsive signals.
Definition: application_not_responding_detector.h:49

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed May 10 10:41:27 UTC 2017