VirtualBox

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

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

Main: remove SupportErrorInfo template magic

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