Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set sw=2 ts=8 et tw=80 : */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_layers_QueuedInput_h
8 : #define mozilla_layers_QueuedInput_h
9 :
10 : #include "mozilla/RefPtr.h"
11 : #include "mozilla/UniquePtr.h"
12 :
13 : namespace mozilla {
14 :
15 : class InputData;
16 : class MultiTouchInput;
17 : class ScrollWheelInput;
18 : class MouseInput;
19 : class PanGestureInput;
20 : class KeyboardInput;
21 :
22 : namespace layers {
23 :
24 : class InputBlockState;
25 : class TouchBlockState;
26 : class WheelBlockState;
27 : class DragBlockState;
28 : class PanGestureBlockState;
29 : class KeyboardBlockState;
30 :
31 : /**
32 : * This lightweight class holds a pointer to an input event that has not yet
33 : * been completely processed, along with the input block that the input event
34 : * is associated with.
35 : */
36 0 : class QueuedInput
37 : {
38 : public:
39 : QueuedInput(const MultiTouchInput& aInput, TouchBlockState& aBlock);
40 : QueuedInput(const ScrollWheelInput& aInput, WheelBlockState& aBlock);
41 : QueuedInput(const MouseInput& aInput, DragBlockState& aBlock);
42 : QueuedInput(const PanGestureInput& aInput, PanGestureBlockState& aBlock);
43 : QueuedInput(const KeyboardInput& aInput, KeyboardBlockState& aBlock);
44 :
45 : InputData* Input();
46 : InputBlockState* Block();
47 :
48 : private:
49 : // A copy of the input event that is provided to the constructor. This must
50 : // be non-null, and is owned by this QueuedInput instance (hence the
51 : // UniquePtr).
52 : UniquePtr<InputData> mInput;
53 : // A pointer to the block that the input event is associated with. This must
54 : // be non-null.
55 : RefPtr<InputBlockState> mBlock;
56 : };
57 :
58 : } // namespace layers
59 : } // namespace mozilla
60 :
61 : #endif // mozilla_layers_QueuedInput_h
|