VirtualBox

source: vbox/trunk/src/VBox/Main/include/USBControllerImpl.h@ 30760

Last change on this file since 30760 was 30760, checked in by vboxsync, 15 years ago

Main: separate internal machine data structs into MachineImplPrivate.h to significantly speed up compilation and for better interface separation; remove obsolete ConsoleEvents.h file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: USBControllerImpl.h 30760 2010-07-09 13:12:04Z vboxsync $ */
2
3/** @file
4 *
5 * VBox USBController COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2006-2007 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.215389.xyz. 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 ____H_USBCONTROLLERIMPL
21#define ____H_USBCONTROLLERIMPL
22
23#include "VirtualBoxBase.h"
24
25class ATL_NO_VTABLE USBController :
26 public VirtualBoxBase,
27 VBOX_SCRIPTABLE_IMPL(IUSBController)
28{
29public:
30 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(USBController, IUSBController)
31
32 DECLARE_NOT_AGGREGATABLE (USBController)
33
34 DECLARE_PROTECT_FINAL_CONSTRUCT()
35
36 BEGIN_COM_MAP(USBController)
37 COM_INTERFACE_ENTRY (ISupportErrorInfo)
38 COM_INTERFACE_ENTRY (IUSBController)
39 COM_INTERFACE_ENTRY2 (IDispatch, IUSBController)
40 END_COM_MAP()
41
42 DECLARE_EMPTY_CTOR_DTOR (USBController)
43
44 HRESULT FinalConstruct();
45 void FinalRelease();
46
47 // public initializer/uninitializer for internal purposes only
48 HRESULT init (Machine *aParent);
49 HRESULT init (Machine *aParent, USBController *aThat);
50 HRESULT initCopy (Machine *aParent, USBController *aThat);
51 void uninit();
52
53 // IUSBController properties
54 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
55 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
56 STDMETHOD(COMGETTER(EnabledEhci)) (BOOL *aEnabled);
57 STDMETHOD(COMSETTER(EnabledEhci)) (BOOL aEnabled);
58 STDMETHOD(COMGETTER(ProxyAvailable)) (BOOL *aEnabled);
59 STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
60 STDMETHOD(COMGETTER(DeviceFilters)) (ComSafeArrayOut (IUSBDeviceFilter *, aDevicesFilters));
61
62 // IUSBController methods
63 STDMETHOD(CreateDeviceFilter) (IN_BSTR aName, IUSBDeviceFilter **aFilter);
64 STDMETHOD(InsertDeviceFilter) (ULONG aPosition, IUSBDeviceFilter *aFilter);
65 STDMETHOD(RemoveDeviceFilter) (ULONG aPosition, IUSBDeviceFilter **aFilter);
66
67 // public methods only for internal purposes
68
69 HRESULT loadSettings(const settings::USBController &data);
70 HRESULT saveSettings(settings::USBController &data);
71
72 void rollback();
73 void commit();
74 void copyFrom (USBController *aThat);
75
76#ifdef VBOX_WITH_USB
77 HRESULT onDeviceFilterChange (USBDeviceFilter *aFilter,
78 BOOL aActiveChanged = FALSE);
79
80 bool hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
81 bool hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
82
83 HRESULT notifyProxy (bool aInsertFilters);
84#endif /* VBOX_WITH_USB */
85
86 // public methods for internal purposes only
87 // (ensure there is a caller and a read lock before calling them!)
88 Machine* getMachine();
89
90private:
91
92 void printList();
93
94 struct Data;
95 Data *m;
96};
97
98#endif //!____H_USBCONTROLLERIMPL
99/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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