Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 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
class QueuedInput {
37
public:
38
QueuedInput(const MultiTouchInput& aInput, TouchBlockState& aBlock);
39
QueuedInput(const ScrollWheelInput& aInput, WheelBlockState& aBlock);
40
QueuedInput(const MouseInput& aInput, DragBlockState& aBlock);
41
QueuedInput(const PanGestureInput& aInput, PanGestureBlockState& aBlock);
42
QueuedInput(const KeyboardInput& aInput, KeyboardBlockState& aBlock);
43
44
InputData* Input();
45
InputBlockState* Block();
46
47
private:
48
// A copy of the input event that is provided to the constructor. This must
49
// be non-null, and is owned by this QueuedInput instance (hence the
50
// UniquePtr).
51
UniquePtr<InputData> mInput;
52
// A pointer to the block that the input event is associated with. This must
53
// be non-null.
54
RefPtr<InputBlockState> mBlock;
55
};
56
57
} // namespace layers
58
} // namespace mozilla
59
60
#endif // mozilla_layers_QueuedInput_h