OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_CPP_MOUSE_LOCK_H_ | 5 #ifndef PPAPI_CPP_MOUSE_LOCK_H_ |
6 #define PPAPI_CPP_MOUSE_LOCK_H_ | 6 #define PPAPI_CPP_MOUSE_LOCK_H_ |
7 | 7 |
8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" |
9 #include "ppapi/cpp/instance_handle.h" | 9 #include "ppapi/cpp/instance_handle.h" |
10 | 10 |
11 /// @file | 11 /// @file |
12 /// This file defines the API for locking the target of mouse events to a | 12 /// This file defines the API for locking the target of mouse events to a |
13 /// specific module instance. | 13 /// specific module instance. |
14 | 14 |
15 namespace pp { | 15 namespace pp { |
16 | 16 |
17 class CompletionCallback; | 17 class CompletionCallback; |
| 18 class Instance; |
18 | 19 |
19 /// This class allows you to associate the <code>PPP_MouseLock</code> and | 20 /// This class allows you to associate the <code>PPP_MouseLock</code> and |
20 /// <code>PPB_MouseLock</code> C-based interfaces with an object. It associates | 21 /// <code>PPB_MouseLock</code> C-based interfaces with an object. It associates |
21 /// itself with the given instance, and registers as the global handler for | 22 /// itself with the given instance, and registers as the global handler for |
22 /// handling the <code>PPP_MouseLock</code> interface that the browser calls. | 23 /// handling the <code>PPP_MouseLock</code> interface that the browser calls. |
23 /// | 24 /// |
24 /// You would typically use this class by inheritance on your instance or by | 25 /// You would typically use this class by inheritance on your instance or by |
25 /// composition. | 26 /// composition. |
26 /// | 27 /// |
27 /// <strong>Example (inheritance):</strong> | 28 /// <strong>Example (inheritance):</strong> |
(...skipping 17 matching lines...) Expand all Loading... |
45 /// | 46 /// |
46 /// MyMouseLock mouse_lock_; | 47 /// MyMouseLock mouse_lock_; |
47 /// }; | 48 /// }; |
48 /// </code> | 49 /// </code> |
49 class MouseLock { | 50 class MouseLock { |
50 public: | 51 public: |
51 /// A constructor for creating a <code>MouseLock</code>. | 52 /// A constructor for creating a <code>MouseLock</code>. |
52 /// | 53 /// |
53 /// @param[in] instance The instance with which this resource will be | 54 /// @param[in] instance The instance with which this resource will be |
54 /// associated. | 55 /// associated. |
55 explicit MouseLock(const InstanceHandle& instance); | 56 explicit MouseLock(Instance* instance); |
56 | 57 |
57 /// Destructor. | 58 /// Destructor. |
58 virtual ~MouseLock(); | 59 virtual ~MouseLock(); |
59 | 60 |
60 /// PPP_MouseLock functions exposed as virtual functions for you to override. | 61 /// PPP_MouseLock functions exposed as virtual functions for you to override. |
61 virtual void MouseLockLost() = 0; | 62 virtual void MouseLockLost() = 0; |
62 | 63 |
63 /// LockMouse() requests the mouse to be locked. The browser will permit | 64 /// LockMouse() requests the mouse to be locked. The browser will permit |
64 /// mouse lock only while the tab is in fullscreen mode. | 65 /// mouse lock only while the tab is in fullscreen mode. |
65 /// | 66 /// |
(...skipping 23 matching lines...) Expand all Loading... |
89 /// has lost the mouse lock. | 90 /// has lost the mouse lock. |
90 void UnlockMouse(); | 91 void UnlockMouse(); |
91 | 92 |
92 private: | 93 private: |
93 InstanceHandle associated_instance_; | 94 InstanceHandle associated_instance_; |
94 }; | 95 }; |
95 | 96 |
96 } // namespace pp | 97 } // namespace pp |
97 | 98 |
98 #endif // PPAPI_CPP_MOUSE_LOCK_H_ | 99 #endif // PPAPI_CPP_MOUSE_LOCK_H_ |
OLD | NEW |