1 | /* $Id: SerialPortImpl.h 41214 2012-05-08 17:59:43Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2012 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 | VBOX_SCRIPTABLE_IMPL(ISerialPort)
|
---|
35 | {
|
---|
36 | public:
|
---|
37 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SerialPort, ISerialPort)
|
---|
38 |
|
---|
39 | DECLARE_NOT_AGGREGATABLE(SerialPort)
|
---|
40 |
|
---|
41 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
42 |
|
---|
43 | BEGIN_COM_MAP(SerialPort)
|
---|
44 | VBOX_DEFAULT_INTERFACE_ENTRIES (ISerialPort)
|
---|
45 | END_COM_MAP()
|
---|
46 |
|
---|
47 | DECLARE_EMPTY_CTOR_DTOR (SerialPort)
|
---|
48 |
|
---|
49 | HRESULT FinalConstruct();
|
---|
50 | void FinalRelease();
|
---|
51 |
|
---|
52 | // public initializer/uninitializer for internal purposes only
|
---|
53 | HRESULT init (Machine *aParent, ULONG aSlot);
|
---|
54 | HRESULT init (Machine *aParent, SerialPort *aThat);
|
---|
55 | HRESULT initCopy (Machine *parent, SerialPort *aThat);
|
---|
56 | void uninit();
|
---|
57 |
|
---|
58 | // ISerialPort properties
|
---|
59 | STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
|
---|
60 | STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
|
---|
61 | STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
|
---|
62 | STDMETHOD(COMGETTER(HostMode)) (PortMode_T *aHostMode);
|
---|
63 | STDMETHOD(COMSETTER(HostMode)) (PortMode_T aHostMode);
|
---|
64 | STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
|
---|
65 | STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
|
---|
66 | STDMETHOD(COMGETTER(IOBase) ) (ULONG *aIOBase);
|
---|
67 | STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
|
---|
68 | STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
|
---|
69 | STDMETHOD(COMSETTER(Path)) (IN_BSTR aPath);
|
---|
70 | STDMETHOD(COMGETTER(Server)) (BOOL *aServer);
|
---|
71 | STDMETHOD(COMSETTER(Server)) (BOOL aServer);
|
---|
72 |
|
---|
73 | // public methods only for internal purposes
|
---|
74 |
|
---|
75 | HRESULT loadSettings(const settings::SerialPort &data);
|
---|
76 | HRESULT saveSettings(settings::SerialPort &data);
|
---|
77 |
|
---|
78 | bool isModified();
|
---|
79 | void rollback();
|
---|
80 | void commit();
|
---|
81 | void copyFrom(SerialPort *aThat);
|
---|
82 |
|
---|
83 | void applyDefaults (GuestOSType *aOsType);
|
---|
84 |
|
---|
85 | // public methods for internal purposes only
|
---|
86 | // (ensure there is a caller and a read lock before calling them!)
|
---|
87 |
|
---|
88 | private:
|
---|
89 | HRESULT checkSetPath(const Utf8Str &str);
|
---|
90 |
|
---|
91 | struct Data;
|
---|
92 | Data *m;
|
---|
93 | };
|
---|
94 |
|
---|
95 | #endif // ____H_SERIALPORTIMPL
|
---|
96 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|