VirtualBox

source: vbox/trunk/src/VBox/Main/include/USBDeviceFiltersImpl.h@ 67954

Last change on this file since 67954 was 62485, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: USBDeviceFiltersImpl.h 62485 2016-07-22 18:36:43Z vboxsync $ */
2
3/** @file
4 *
5 * VBox USBDeviceFilters COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2013-2016 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_USBDEVICEFILTERSIMPL
21#define ____H_USBDEVICEFILTERSIMPL
22
23#include "USBDeviceFiltersWrap.h"
24
25class HostUSBDevice;
26class USBDeviceFilter;
27
28namespace settings
29{
30 struct USB;
31}
32
33class ATL_NO_VTABLE USBDeviceFilters :
34 public USBDeviceFiltersWrap
35{
36public:
37
38 DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilters)
39
40 HRESULT FinalConstruct();
41 void FinalRelease();
42
43 // public initializer/uninitializer for internal purposes only
44 HRESULT init(Machine *aParent);
45 HRESULT init(Machine *aParent, USBDeviceFilters *aThat);
46 HRESULT initCopy(Machine *aParent, USBDeviceFilters *aThat);
47 void uninit();
48
49 // public methods only for internal purposes
50 HRESULT i_loadSettings(const settings::USB &data);
51 HRESULT i_saveSettings(settings::USB &data);
52
53 void i_rollback();
54 void i_commit();
55 void i_copyFrom(USBDeviceFilters *aThat);
56
57#ifdef VBOX_WITH_USB
58 HRESULT i_onDeviceFilterChange(USBDeviceFilter *aFilter,
59 BOOL aActiveChanged = FALSE);
60 bool i_hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
61 bool i_hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
62 HRESULT i_notifyProxy(bool aInsertFilters);
63#endif /* VBOX_WITH_USB */
64
65 // public methods for internal purposes only
66 // (ensure there is a caller and a read lock before calling them!)
67 Machine* i_getMachine();
68
69private:
70
71 // Wrapped IUSBDeviceFilters attributes
72 HRESULT getDeviceFilters(std::vector<ComPtr<IUSBDeviceFilter> > &aDeviceFilters);
73
74 // wrapped IUSBDeviceFilters methods
75 HRESULT createDeviceFilter(const com::Utf8Str &aName,
76 ComPtr<IUSBDeviceFilter> &aFilter);
77 HRESULT insertDeviceFilter(ULONG aPosition,
78 const ComPtr<IUSBDeviceFilter> &aFilter);
79 HRESULT removeDeviceFilter(ULONG aPosition,
80 ComPtr<IUSBDeviceFilter> &aFilter);
81 struct Data;
82 Data *m;
83};
84
85#endif //!____H_USBDEVICEFILTERSIMPL
86/* 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