jkwang | 38380930 | 2017-03-08 18:10:38 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_EXO_GAMING_SEAT_DELEGATE_H_ |
| 6 | #define COMPONENTS_EXO_GAMING_SEAT_DELEGATE_H_ |
| 7 | |
| 8 | namespace exo { |
| 9 | class Surface; |
| 10 | class GamepadDelegate; |
| 11 | class GamingSeat; |
| 12 | |
| 13 | // It send gamepad_added event and generate the GamepadDelegate. |
| 14 | class GamingSeatDelegate { |
| 15 | public: |
| 16 | // Gives the delegate a chance to clean up when the GamingSeat instance is |
| 17 | // destroyed |
| 18 | virtual void OnGamingSeatDestroying(GamingSeat* gaming_seat) = 0; |
| 19 | |
| 20 | // This should return true if |surface| is a valid target for this gaming |
| 21 | // seat. E.g. the surface is owned by the same client as the gaming seat. |
| 22 | virtual bool CanAcceptGamepadEventsForSurface(Surface* surface) const = 0; |
| 23 | |
| 24 | // When a new gamepad is connected, gaming seat call this to get the |
| 25 | // gamepad delegate. |
| 26 | virtual GamepadDelegate* GamepadAdded() = 0; |
| 27 | |
| 28 | protected: |
| 29 | virtual ~GamingSeatDelegate() {} |
| 30 | }; |
| 31 | |
| 32 | } // namespace exo |
| 33 | |
| 34 | #endif // COMPONENTS_EXO_GAMING_SEAT_DELEGATE_H_ |