1 | /* $Id: SerialPortImpl.h 30714 2010-07-07 16:20:03Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
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_SERIALPORTIMPL
|
---|
21 | #define ____H_SERIALPORTIMPL
|
---|
22 |
|
---|
23 | #include "VirtualBoxBase.h"
|
---|
24 |
|
---|
25 | class GuestOSType;
|
---|
26 |
|
---|
27 | namespace settings
|
---|
28 | {
|
---|
29 | struct SerialPort;
|
---|
30 | }
|
---|
31 |
|
---|
32 | class ATL_NO_VTABLE SerialPort :
|
---|
33 | public VirtualBoxBase,
|
---|
34 | public VirtualBoxSupportTranslation<SerialPort>,
|
---|
35 | VBOX_SCRIPTABLE_IMPL(ISerialPort)
|
---|
36 | {
|
---|
37 | public:
|
---|
38 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SerialPort, ISerialPort)
|
---|
39 |
|
---|
40 | DECLARE_NOT_AGGREGATABLE(SerialPort)
|
---|
41 |
|
---|
42 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
43 |
|
---|
44 | BEGIN_COM_MAP(SerialPort)
|
---|
45 | COM_INTERFACE_ENTRY (ISupportErrorInfo)
|
---|
46 | COM_INTERFACE_ENTRY (ISerialPort)
|
---|
47 | COM_INTERFACE_ENTRY2 (IDispatch, ISerialPort)
|
---|
48 | END_COM_MAP()
|
---|
49 |
|
---|
50 | DECLARE_EMPTY_CTOR_DTOR (SerialPort)
|
---|
51 |
|
---|
52 | HRESULT FinalConstruct();
|
---|
53 | void FinalRelease();
|
---|
54 |
|
---|
55 | // public initializer/uninitializer for internal purposes only
|
---|
56 | HRESULT init (Machine *aParent, ULONG aSlot);
|
---|
57 | HRESULT init (Machine *aParent, SerialPort *aThat);
|
---|
58 | HRESULT initCopy (Machine *parent, SerialPort *aThat);
|
---|
59 | void uninit();
|
---|
60 |
|
---|
61 | // ISerialPort properties
|
---|
62 | STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
|
---|
63 | STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
|
---|
64 | STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
|
---|
65 | STDMETHOD(COMGETTER(HostMode)) (PortMode_T *aHostMode);
|
---|
66 | STDMETHOD(COMSETTER(HostMode)) (PortMode_T aHostMode);
|
---|
67 | STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
|
---|
68 | STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
|
---|
69 | STDMETHOD(COMGETTER(IOBase) ) (ULONG *aIOBase);
|
---|
70 | STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
|
---|
71 | STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
|
---|
72 | STDMETHOD(COMSETTER(Path)) (IN_BSTR aPath);
|
---|
73 | STDMETHOD(COMGETTER(Server)) (BOOL *aServer);
|
---|
74 | STDMETHOD(COMSETTER(Server)) (BOOL aServer);
|
---|
75 |
|
---|
76 | // public methods only for internal purposes
|
---|
77 |
|
---|
78 | HRESULT loadSettings(const settings::SerialPort &data);
|
---|
79 | HRESULT saveSettings(settings::SerialPort &data);
|
---|
80 |
|
---|
81 | bool isModified();
|
---|
82 | void rollback();
|
---|
83 | void commit();
|
---|
84 | void copyFrom(SerialPort *aThat);
|
---|
85 |
|
---|
86 | void applyDefaults (GuestOSType *aOsType);
|
---|
87 |
|
---|
88 | // public methods for internal purposes only
|
---|
89 | // (ensure there is a caller and a read lock before calling them!)
|
---|
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: */
|
---|