VirtualBox

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

Last change on this file since 30670 was 28800, checked in by vboxsync, 14 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: USBControllerImpl.h 28800 2010-04-27 08:22:32Z 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.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 ____H_USBCONTROLLERIMPL
21#define ____H_USBCONTROLLERIMPL
22
23#include "VirtualBoxBase.h"
24
25class HostUSBDevice;
26class USBDeviceFilter;
27
28namespace settings
29{
30 struct USBController;
31}
32
33class ATL_NO_VTABLE USBController :
34 public VirtualBoxBase,
35 public VirtualBoxSupportErrorInfoImpl<USBController, IUSBController>,
36 public VirtualBoxSupportTranslation<USBController>,
37 VBOX_SCRIPTABLE_IMPL(IUSBController)
38{
39public:
40 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (USBController)
41
42 DECLARE_NOT_AGGREGATABLE (USBController)
43
44 DECLARE_PROTECT_FINAL_CONSTRUCT()
45
46 BEGIN_COM_MAP(USBController)
47 COM_INTERFACE_ENTRY (ISupportErrorInfo)
48 COM_INTERFACE_ENTRY (IUSBController)
49 COM_INTERFACE_ENTRY2 (IDispatch, IUSBController)
50 END_COM_MAP()
51
52 DECLARE_EMPTY_CTOR_DTOR (USBController)
53
54 HRESULT FinalConstruct();
55 void FinalRelease();
56
57 // public initializer/uninitializer for internal purposes only
58 HRESULT init (Machine *aParent);
59 HRESULT init (Machine *aParent, USBController *aThat);
60 HRESULT initCopy (Machine *aParent, USBController *aThat);
61 void uninit();
62
63 // IUSBController properties
64 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
65 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
66 STDMETHOD(COMGETTER(EnabledEhci)) (BOOL *aEnabled);
67 STDMETHOD(COMSETTER(EnabledEhci)) (BOOL aEnabled);
68 STDMETHOD(COMGETTER(ProxyAvailable)) (BOOL *aEnabled);
69 STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
70 STDMETHOD(COMGETTER(DeviceFilters)) (ComSafeArrayOut (IUSBDeviceFilter *, aDevicesFilters));
71
72 // IUSBController methods
73 STDMETHOD(CreateDeviceFilter) (IN_BSTR aName, IUSBDeviceFilter **aFilter);
74 STDMETHOD(InsertDeviceFilter) (ULONG aPosition, IUSBDeviceFilter *aFilter);
75 STDMETHOD(RemoveDeviceFilter) (ULONG aPosition, IUSBDeviceFilter **aFilter);
76
77 // public methods only for internal purposes
78
79 HRESULT loadSettings(const settings::USBController &data);
80 HRESULT saveSettings(settings::USBController &data);
81
82 void rollback();
83 void commit();
84 void copyFrom (USBController *aThat);
85
86#ifdef VBOX_WITH_USB
87 HRESULT onDeviceFilterChange (USBDeviceFilter *aFilter,
88 BOOL aActiveChanged = FALSE);
89
90 bool hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
91 bool hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
92
93 HRESULT notifyProxy (bool aInsertFilters);
94#endif /* VBOX_WITH_USB */
95
96 // public methods for internal purposes only
97 // (ensure there is a caller and a read lock before calling them!)
98 Machine* getMachine();
99
100 // for VirtualBoxSupportErrorInfoImpl
101 static const wchar_t *getComponentName() { return L"USBController"; }
102
103private:
104
105 void printList();
106
107 struct Data;
108 Data *m;
109};
110
111#endif //!____H_USBCONTROLLERIMPL
112/* 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