BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / input / usb_hid / TabletProtocolHandler.h
blob55a81bc531f8482cb897f7345f1bb3630f78d412
1 /*
2 * Copyright 2013 Stephan Aßmus <superstippi@gmx.de>
3 * Copyright 2010-2011 Enrique Medina Gremaldos <quiqueiii@gmail.com>
4 * Copyright 2008-2011 Michael Lotz <mmlr@mlotz.ch>
5 * Distributed under the terms of the MIT license.
6 */
7 #ifndef USB_TABLET_PROTOCOL_HANDLER_H
8 #define USB_TABLET_PROTOCOL_HANDLER_H
11 #include <InterfaceDefs.h>
13 #include "ProtocolHandler.h"
16 class HIDCollection;
17 class HIDReportItem;
20 #ifndef B_MAX_MOUSE_BUTTONS
21 # define B_MAX_MOUSE_BUTTONS 8
22 #endif
25 class TabletProtocolHandler : public ProtocolHandler {
26 public:
27 TabletProtocolHandler(HIDReport &report,
28 HIDReportItem &xAxis,
29 HIDReportItem &yAxis);
31 static void AddHandlers(HIDDevice &device,
32 HIDCollection &collection,
33 ProtocolHandler *&handlerList);
35 virtual status_t Control(uint32 *cookie, uint32 op, void *buffer,
36 size_t length);
38 private:
39 status_t _ReadReport(void *buffer, uint32 *cookie);
41 HIDReport & fReport;
43 HIDReportItem & fXAxis;
44 HIDReportItem & fYAxis;
45 HIDReportItem * fWheel;
46 HIDReportItem * fButtons[B_MAX_MOUSE_BUTTONS];
48 HIDReportItem * fPressure;
49 HIDReportItem * fRange;
50 HIDReportItem * fTip;
51 HIDReportItem * fBarrelSwitch;
52 HIDReportItem * fEraser;
53 HIDReportItem * fXTilt;
54 HIDReportItem * fYTilt;
56 uint32 fLastButtons;
57 uint32 fClickCount;
58 bigtime_t fLastClickTime;
59 bigtime_t fClickSpeed;
62 #endif // USB_TABLET_PROTOCOL_HANDLER_H