VirtualBox

source: vbox/trunk/src/VBox/Main/include/EmulatedUSBImpl.h@ 48631

Last change on this file since 48631 was 48631, checked in by vboxsync, 11 years ago

Main: EmulatedUSB callback, detach device.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/* $Id: EmulatedUSBImpl.h 48631 2013-09-23 10:46:00Z vboxsync $ */
2
3/** @file
4 *
5 * Emulated USB devices manager.
6 */
7
8/*
9 * Copyright (C) 2013 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19
20#ifndef EMULATEDUSB_IMPL_H_
21#define EMULATEDUSB_IMPL_H_
22
23#include "EmulatedUSBWrap.h"
24
25class Console;
26class EUSBWEBCAM;
27
28typedef std::map<Utf8Str, EUSBWEBCAM *> WebcamsMap;
29
30class ATL_NO_VTABLE EmulatedUSB :
31 public EmulatedUSBWrap
32{
33public:
34
35 DECLARE_EMPTY_CTOR_DTOR(EmulatedUSB)
36
37 HRESULT FinalConstruct();
38 void FinalRelease();
39
40 /* Public initializer/uninitializer for internal purposes only. */
41 HRESULT init(ComObjPtr<Console> pConsole);
42 void uninit();
43
44 /* Public method for internal use. */
45 static DECLCALLBACK(int) eusbCallback(void *pv, const char *pszId, uint32_t iEvent,
46 const void *pvData, uint32_t cbData);
47
48private:
49
50 static DECLCALLBACK(int) eusbCallbackEMT(EmulatedUSB *pThis, char *pszId, uint32_t iEvent,
51 void *pvData, uint32_t cbData);
52
53 HRESULT webcamPathFromId(com::Utf8Str *pPath, const char *pszId);
54
55 // wrapped IEmulatedUSB properties
56 virtual HRESULT getWebcams(std::vector<com::Utf8Str> &aWebcams);
57
58 // wrapped IEmulatedUSB methods
59 virtual HRESULT webcamAttach(const com::Utf8Str &aPath,
60 const com::Utf8Str &aSettings);
61 virtual HRESULT webcamDetach(const com::Utf8Str &aPath);
62
63 /* Data. */
64 struct Data
65 {
66 Data()
67 {
68 }
69
70 ComObjPtr<Console> pConsole;
71 WebcamsMap webcams;
72 };
73
74 Data m;
75};
76
77#endif // EMULATEDUSB_IMPL_H_
78
79/* 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