BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / input / usb_hid / MouseProtocolHandler.h
blob81ab7a7cb0091462e0cb712404e44698289dfc0f
1 /*
2 * Copyright 2008-2011 Michael Lotz <mmlr@mlotz.ch>
3 * Distributed under the terms of the MIT license.
4 */
5 #ifndef USB_MOUSE_PROTOCOL_HANDLER_H
6 #define USB_MOUSE_PROTOCOL_HANDLER_H
9 #include <InterfaceDefs.h>
11 #include "ProtocolHandler.h"
14 class HIDCollection;
15 class HIDReportItem;
18 #ifndef B_MAX_MOUSE_BUTTONS
19 # define B_MAX_MOUSE_BUTTONS 8
20 #endif
23 class MouseProtocolHandler : public ProtocolHandler {
24 public:
25 MouseProtocolHandler(HIDReport &report,
26 HIDReportItem &xAxis,
27 HIDReportItem &yAxis);
29 static void AddHandlers(HIDDevice &device,
30 HIDCollection &collection,
31 ProtocolHandler *&handlerList);
33 virtual status_t Control(uint32 *cookie, uint32 op, void *buffer,
34 size_t length);
36 private:
37 status_t _ReadReport(void *buffer, uint32 *cookie);
39 HIDReport & fReport;
41 HIDReportItem & fXAxis;
42 HIDReportItem & fYAxis;
43 HIDReportItem * fWheel;
44 HIDReportItem * fButtons[B_MAX_MOUSE_BUTTONS];
46 uint32 fLastButtons;
47 uint32 fClickCount;
48 bigtime_t fLastClickTime;
49 bigtime_t fClickSpeed;
52 #endif // USB_MOUSE_PROTOCOL_HANDLER_H