VirtualBox

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

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

Main: less includes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: USBControllerImpl.h 25197 2009-12-04 17:32:03Z vboxsync $ */
2
3/** @file
4 *
5 * VBox USBController COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_USBCONTROLLERIMPL
25#define ____H_USBCONTROLLERIMPL
26
27#include "VirtualBoxBase.h"
28
29class Machine;
30class HostUSBDevice;
31class USBDeviceFilter;
32
33namespace settings
34{
35 struct USBController;
36}
37
38class ATL_NO_VTABLE USBController :
39 public VirtualBoxBase,
40 public VirtualBoxSupportErrorInfoImpl<USBController, IUSBController>,
41 public VirtualBoxSupportTranslation<USBController>,
42 VBOX_SCRIPTABLE_IMPL(IUSBController)
43{
44public:
45 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (USBController)
46
47 DECLARE_NOT_AGGREGATABLE (USBController)
48
49 DECLARE_PROTECT_FINAL_CONSTRUCT()
50
51 BEGIN_COM_MAP(USBController)
52 COM_INTERFACE_ENTRY (ISupportErrorInfo)
53 COM_INTERFACE_ENTRY (IUSBController)
54 COM_INTERFACE_ENTRY2 (IDispatch, IUSBController)
55 END_COM_MAP()
56
57 DECLARE_EMPTY_CTOR_DTOR (USBController)
58
59 HRESULT FinalConstruct();
60 void FinalRelease();
61
62 // public initializer/uninitializer for internal purposes only
63 HRESULT init (Machine *aParent);
64 HRESULT init (Machine *aParent, USBController *aThat);
65 HRESULT initCopy (Machine *aParent, USBController *aThat);
66 void uninit();
67
68 // IUSBController properties
69 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
70 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
71 STDMETHOD(COMGETTER(EnabledEhci)) (BOOL *aEnabled);
72 STDMETHOD(COMSETTER(EnabledEhci)) (BOOL aEnabled);
73 STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
74 STDMETHOD(COMGETTER(DeviceFilters)) (ComSafeArrayOut (IUSBDeviceFilter *, aDevicesFilters));
75
76 // IUSBController methods
77 STDMETHOD(CreateDeviceFilter) (IN_BSTR aName, IUSBDeviceFilter **aFilter);
78 STDMETHOD(InsertDeviceFilter) (ULONG aPosition, IUSBDeviceFilter *aFilter);
79 STDMETHOD(RemoveDeviceFilter) (ULONG aPosition, IUSBDeviceFilter **aFilter);
80
81 // public methods only for internal purposes
82
83 HRESULT loadSettings(const settings::USBController &data);
84 HRESULT saveSettings(settings::USBController &data);
85
86 bool isModified();
87 bool isReallyModified();
88 bool rollback();
89 void commit();
90 void copyFrom (USBController *aThat);
91
92#ifdef VBOX_WITH_USB
93 HRESULT onDeviceFilterChange (USBDeviceFilter *aFilter,
94 BOOL aActiveChanged = FALSE);
95
96 bool hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
97 bool hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
98
99 HRESULT notifyProxy (bool aInsertFilters);
100#endif /* VBOX_WITH_USB */
101
102 // public methods for internal purposes only
103 // (ensure there is a caller and a read lock before calling them!)
104 Machine* getMachine();
105
106 // for VirtualBoxSupportErrorInfoImpl
107 static const wchar_t *getComponentName() { return L"USBController"; }
108
109private:
110
111 void printList();
112
113 struct Data;
114 Data *m;
115};
116
117#endif //!____H_USBCONTROLLERIMPL
118/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use