1 | /* $Id: ParallelPortImpl.h 26171 2010-02-02 20:37:36Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VirtualBox COM class implementation.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef ____H_PARALLELPORTIMPL
|
---|
24 | #define ____H_PARALLELPORTIMPL
|
---|
25 |
|
---|
26 | #include "VirtualBoxBase.h"
|
---|
27 |
|
---|
28 | namespace settings
|
---|
29 | {
|
---|
30 | struct ParallelPort;
|
---|
31 | }
|
---|
32 |
|
---|
33 | class ATL_NO_VTABLE ParallelPort :
|
---|
34 | public VirtualBoxBase,
|
---|
35 | public VirtualBoxSupportErrorInfoImpl<ParallelPort, IParallelPort>,
|
---|
36 | public VirtualBoxSupportTranslation<ParallelPort>,
|
---|
37 | VBOX_SCRIPTABLE_IMPL(IParallelPort)
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (ParallelPort)
|
---|
41 |
|
---|
42 | DECLARE_NOT_AGGREGATABLE(ParallelPort)
|
---|
43 |
|
---|
44 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
45 |
|
---|
46 | BEGIN_COM_MAP(ParallelPort)
|
---|
47 | COM_INTERFACE_ENTRY (ISupportErrorInfo)
|
---|
48 | COM_INTERFACE_ENTRY (IParallelPort)
|
---|
49 | COM_INTERFACE_ENTRY2 (IDispatch, IParallelPort)
|
---|
50 | END_COM_MAP()
|
---|
51 |
|
---|
52 | ParallelPort() {}
|
---|
53 | ~ParallelPort() {}
|
---|
54 |
|
---|
55 | HRESULT FinalConstruct();
|
---|
56 | void FinalRelease();
|
---|
57 |
|
---|
58 | // public initializer/uninitializer for internal purposes only
|
---|
59 | HRESULT init (Machine *aParent, ULONG aSlot);
|
---|
60 | HRESULT init (Machine *aParent, ParallelPort *aThat);
|
---|
61 | HRESULT initCopy (Machine *parent, ParallelPort *aThat);
|
---|
62 | void uninit();
|
---|
63 |
|
---|
64 | // IParallelPort properties
|
---|
65 | STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
|
---|
66 | STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
|
---|
67 | STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
|
---|
68 | STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
|
---|
69 | STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
|
---|
70 | STDMETHOD(COMGETTER(IOBase)) (ULONG *aIOBase);
|
---|
71 | STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
|
---|
72 | STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
|
---|
73 | STDMETHOD(COMSETTER(Path)) (IN_BSTR aPath);
|
---|
74 |
|
---|
75 | // public methods only for internal purposes
|
---|
76 |
|
---|
77 | HRESULT loadSettings(const settings::ParallelPort &data);
|
---|
78 | HRESULT saveSettings(settings::ParallelPort &data);
|
---|
79 |
|
---|
80 | bool isModified();
|
---|
81 | void rollback();
|
---|
82 | void commit();
|
---|
83 | void copyFrom(ParallelPort *aThat);
|
---|
84 |
|
---|
85 | // public methods for internal purposes only
|
---|
86 | // (ensure there is a caller and a read lock before calling them!)
|
---|
87 |
|
---|
88 | // for VirtualBoxSupportErrorInfoImpl
|
---|
89 | static const wchar_t *getComponentName() { return L"ParallelPort"; }
|
---|
90 |
|
---|
91 | private:
|
---|
92 | HRESULT checkSetPath(const Utf8Str &str);
|
---|
93 |
|
---|
94 | struct Data;
|
---|
95 | Data *m;
|
---|
96 | };
|
---|
97 |
|
---|
98 | #endif // ____H_FLOPPYDRIVEIMPL
|
---|
99 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|