Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / components / usb_service / usb_interface.h
blob7ca3197d0be15a37fda707ad9de71f526e523d9c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_USB_SERVICE_USB_INTERFACE_H_
6 #define COMPONENTS_USB_SERVICE_USB_INTERFACE_H_
8 #include "base/memory/ref_counted.h"
9 #include "components/usb_service/usb_service_export.h"
11 namespace usb_service {
13 enum UsbTransferType {
14 USB_TRANSFER_CONTROL = 0,
15 USB_TRANSFER_ISOCHRONOUS,
16 USB_TRANSFER_BULK,
17 USB_TRANSFER_INTERRUPT,
20 enum UsbEndpointDirection {
21 USB_DIRECTION_INBOUND = 0,
22 USB_DIRECTION_OUTBOUND,
25 enum UsbSynchronizationType {
26 USB_SYNCHRONIZATION_NONE = 0,
27 USB_SYNCHRONIZATION_ASYNCHRONOUS,
28 USB_SYNCHRONIZATION_ADAPTIVE,
29 USB_SYNCHRONIZATION_SYNCHRONOUS,
32 enum UsbUsageType {
33 USB_USAGE_DATA = 0,
34 USB_USAGE_FEEDBACK,
35 USB_USAGE_EXPLICIT_FEEDBACK
38 class USB_SERVICE_EXPORT UsbEndpointDescriptor
39 : public base::RefCounted<const UsbEndpointDescriptor> {
40 public:
41 virtual int GetAddress() const = 0;
42 virtual UsbEndpointDirection GetDirection() const = 0;
43 virtual int GetMaximumPacketSize() const = 0;
44 virtual UsbSynchronizationType GetSynchronizationType() const = 0;
45 virtual UsbTransferType GetTransferType() const = 0;
46 virtual UsbUsageType GetUsageType() const = 0;
47 virtual int GetPollingInterval() const = 0;
49 protected:
50 friend class base::RefCounted<const UsbEndpointDescriptor>;
52 UsbEndpointDescriptor() {};
53 virtual ~UsbEndpointDescriptor() {};
55 DISALLOW_COPY_AND_ASSIGN(UsbEndpointDescriptor);
58 class USB_SERVICE_EXPORT UsbInterfaceAltSettingDescriptor
59 : public base::RefCounted<const UsbInterfaceAltSettingDescriptor> {
60 public:
61 virtual size_t GetNumEndpoints() const = 0;
62 virtual scoped_refptr<const UsbEndpointDescriptor> GetEndpoint(
63 size_t index) const = 0;
65 virtual int GetInterfaceNumber() const = 0;
66 virtual int GetAlternateSetting() const = 0;
67 virtual int GetInterfaceClass() const = 0;
68 virtual int GetInterfaceSubclass() const = 0;
69 virtual int GetInterfaceProtocol() const = 0;
71 protected:
72 friend class base::RefCounted<const UsbInterfaceAltSettingDescriptor>;
74 UsbInterfaceAltSettingDescriptor() {};
75 virtual ~UsbInterfaceAltSettingDescriptor() {};
77 DISALLOW_COPY_AND_ASSIGN(UsbInterfaceAltSettingDescriptor);
80 class USB_SERVICE_EXPORT UsbInterfaceDescriptor
81 : public base::RefCounted<const UsbInterfaceDescriptor> {
82 public:
83 virtual size_t GetNumAltSettings() const = 0;
84 virtual scoped_refptr<const UsbInterfaceAltSettingDescriptor> GetAltSetting(
85 size_t index) const = 0;
87 protected:
88 friend class base::RefCounted<const UsbInterfaceDescriptor>;
90 UsbInterfaceDescriptor() {};
91 virtual ~UsbInterfaceDescriptor() {};
93 DISALLOW_COPY_AND_ASSIGN(UsbInterfaceDescriptor);
96 class USB_SERVICE_EXPORT UsbConfigDescriptor
97 : public base::RefCounted<UsbConfigDescriptor> {
98 public:
99 virtual size_t GetNumInterfaces() const = 0;
100 virtual scoped_refptr<const UsbInterfaceDescriptor> GetInterface(
101 size_t index) const = 0;
103 protected:
104 friend class base::RefCounted<UsbConfigDescriptor>;
106 UsbConfigDescriptor() {};
107 virtual ~UsbConfigDescriptor() {};
109 DISALLOW_COPY_AND_ASSIGN(UsbConfigDescriptor);
112 } // namespace usb_service;
114 #endif // COMPONENTS_USB_SERVICE_USB_INTERFACE_H_