VirtualBox

source: vbox/trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h@ 87093

Last change on this file since 87093 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: RemoteUSBDeviceImpl.h 82968 2020-02-04 10:35:17Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox IHostUSBDevice COM interface implementation
6 * for remote (VRDP) USB devices
7 */
8
9/*
10 * Copyright (C) 2006-2020 Oracle Corporation
11 *
12 * This file is part of VirtualBox Open Source Edition (OSE), as
13 * available from http://www.virtualbox.org. This file is free software;
14 * you can redistribute it and/or modify it under the terms of the GNU
15 * General Public License (GPL) as published by the Free Software
16 * Foundation, in version 2 as it comes in the "COPYING" file of the
17 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19 */
20
21#ifndef MAIN_INCLUDED_RemoteUSBDeviceImpl_h
22#define MAIN_INCLUDED_RemoteUSBDeviceImpl_h
23#ifndef RT_WITHOUT_PRAGMA_ONCE
24# pragma once
25#endif
26
27#include "HostUSBDeviceWrap.h"
28
29struct _VRDEUSBDEVICEDESC;
30typedef _VRDEUSBDEVICEDESC VRDEUSBDEVICEDESC;
31
32class ATL_NO_VTABLE RemoteUSBDevice :
33 public HostUSBDeviceWrap
34{
35public:
36
37 DECLARE_EMPTY_CTOR_DTOR(RemoteUSBDevice)
38
39 HRESULT FinalConstruct();
40 void FinalRelease();
41
42 // public initializer/uninitializer for internal purposes only
43 HRESULT init(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt);
44 void uninit();
45
46 // public methods only for internal purposes
47 bool dirty(void) const { return mData.dirty; }
48 void dirty(bool aDirty) { mData.dirty = aDirty; }
49
50 uint16_t devId(void) const { return mData.devId; }
51 uint32_t clientId(void) { return mData.clientId; }
52
53 bool captured(void) const { return mData.state == USBDeviceState_Captured; }
54 void captured(bool aCaptured)
55 {
56 if (aCaptured)
57 {
58 Assert(mData.state == USBDeviceState_Available);
59 mData.state = USBDeviceState_Captured;
60 }
61 else
62 {
63 Assert(mData.state == USBDeviceState_Captured);
64 mData.state = USBDeviceState_Available;
65 }
66 }
67
68private:
69
70 // wrapped IUSBDevice properties
71 HRESULT getId(com::Guid &aId);
72 HRESULT getVendorId(USHORT *aVendorId);
73 HRESULT getProductId(USHORT *aProductId);
74 HRESULT getRevision(USHORT *aRevision);
75 HRESULT getManufacturer(com::Utf8Str &aManufacturer);
76 HRESULT getProduct(com::Utf8Str &aProduct);
77 HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
78 HRESULT getAddress(com::Utf8Str &aAddress);
79 HRESULT getPort(USHORT *aPort);
80 HRESULT getVersion(USHORT *aVersion);
81 HRESULT getPortPath(com::Utf8Str &aAddress);
82 HRESULT getSpeed(USBConnectionSpeed_T *aSpeed);
83 HRESULT getRemote(BOOL *aRemote);
84 HRESULT getBackend(com::Utf8Str &aBackend);
85 HRESULT getDeviceInfo(std::vector<com::Utf8Str> &aInfo);
86
87 // wrapped IHostUSBDevice properties
88 HRESULT getState(USBDeviceState_T *aState);
89
90
91 struct Data
92 {
93 Data() : vendorId(0), productId(0), revision(0), port(0), version(1),
94 speed(USBConnectionSpeed_Null), dirty(FALSE),
95 devId(0), clientId(0) {}
96
97 const Guid id;
98
99 const uint16_t vendorId;
100 const uint16_t productId;
101 const uint16_t revision;
102
103 const Utf8Str manufacturer;
104 const Utf8Str product;
105 const Utf8Str serialNumber;
106
107 const Utf8Str address;
108 const Utf8Str backend;
109
110 const uint16_t port;
111 const Utf8Str portPath;
112 const uint16_t version;
113 const USBConnectionSpeed_T speed;
114
115 USBDeviceState_T state;
116 bool dirty;
117
118 const uint16_t devId;
119 const uint32_t clientId;
120 };
121
122 Data mData;
123};
124
125#endif /* !MAIN_INCLUDED_RemoteUSBDeviceImpl_h */
126/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette