VirtualBox

source: vbox/trunk/src/VBox/Main/include/ParallelPortImpl.h@ 4071

Last change on this file since 4071 was 4071, checked in by vboxsync, 18 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1/* $Id: ParallelPortImpl.h 4071 2007-08-07 17:07:59Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation.
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_PARALLELPORTIMPL
19#define ____H_PARALLELPORTIMPL
20
21#include "VirtualBoxBase.h"
22
23#include <VBox/cfgldr.h>
24
25class Machine;
26
27class ATL_NO_VTABLE ParallelPort :
28 public VirtualBoxBaseNEXT,
29 public VirtualBoxSupportErrorInfoImpl <ParallelPort, IParallelPort>,
30 public VirtualBoxSupportTranslation <ParallelPort>,
31 public IParallelPort
32{
33public:
34
35 struct Data
36 {
37 Data()
38 : mSlot (0)
39 , mEnabled(FALSE)
40 , mIRQ (4)
41 , mIOBase (0x378)
42 {}
43
44 bool operator== (const Data &that) const
45 {
46 return this == &that ||
47 (mSlot == that.mSlot &&
48 mEnabled == that.mEnabled &&
49 mIRQ == that.mIRQ &&
50 mIOBase == that.mIOBase);
51 }
52
53 ULONG mSlot;
54 BOOL mEnabled;
55 ULONG mIRQ;
56 ULONG mIOBase;
57 Bstr mDevicePath;
58 };
59
60 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (ParallelPort)
61
62 DECLARE_NOT_AGGREGATABLE(ParallelPort)
63
64 DECLARE_PROTECT_FINAL_CONSTRUCT()
65
66 BEGIN_COM_MAP(ParallelPort)
67 COM_INTERFACE_ENTRY(ISupportErrorInfo)
68 COM_INTERFACE_ENTRY(IParallelPort)
69 END_COM_MAP()
70
71 NS_DECL_ISUPPORTS
72
73 DECLARE_EMPTY_CTOR_DTOR (ParallelPort)
74
75 HRESULT FinalConstruct();
76 void FinalRelease();
77
78 // public initializer/uninitializer for internal purposes only
79 HRESULT init (Machine *aParent, ULONG aSlot);
80 HRESULT init (Machine *aParent, ParallelPort *aThat);
81 HRESULT initCopy (Machine *parent, ParallelPort *aThat);
82 void uninit();
83
84 // IParallelPort properties
85 STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
86 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
87 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
88 STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
89 STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
90 STDMETHOD(COMGETTER(IOBase)) (ULONG *aIOBase);
91 STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
92 STDMETHOD(COMGETTER(DevicePath)) (BSTR *aDevicePath);
93 STDMETHOD(COMSETTER(DevicePath)) (INPTR BSTR aDevicePath);
94
95 // public methods only for internal purposes
96 bool isModified() { AutoLock alock (this); return mData.isBackedUp(); }
97 bool isReallyModified() { AutoLock alock (this); return mData.hasActualChanges(); }
98 bool rollback();
99 void commit();
100 void copyFrom (ParallelPort *aThat);
101
102 // public methods for internal purposes only
103 // (ensure there is a caller and a read lock before calling them!)
104
105 HRESULT loadSettings (CFGNODE aMachine, ULONG aSlot);
106 HRESULT saveSettings (CFGNODE aMachine);
107
108 // for VirtualBoxSupportErrorInfoImpl
109 static const wchar_t *getComponentName() { return L"ParallelPort"; }
110
111private:
112
113 const ComObjPtr <Machine, ComWeakRef> mParent;
114 const ComObjPtr <ParallelPort> mPeer;
115
116 Backupable <Data> mData;
117};
118
119#endif // ____H_FLOPPYDRIVEIMPL
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