VirtualBox

source: vbox/trunk/src/VBox/Main/include/SerialPortImpl.h@ 25414

Last change on this file since 25414 was 25203, checked in by vboxsync, 15 years ago

Main: make SerialPort instance data private and make it use the XML settings struct for simplicity

  • Property svn:eol-style set to native
File size: 3.3 KB
Line 
1/* $Id$ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_SERIALPORTIMPL
25#define ____H_SERIALPORTIMPL
26
27#include "VirtualBoxBase.h"
28
29class Machine;
30class GuestOSType;
31
32namespace settings
33{
34 struct SerialPort;
35}
36
37class ATL_NO_VTABLE SerialPort :
38 public VirtualBoxBase,
39 public VirtualBoxSupportErrorInfoImpl<SerialPort, ISerialPort>,
40 public VirtualBoxSupportTranslation<SerialPort>,
41 VBOX_SCRIPTABLE_IMPL(ISerialPort)
42{
43public:
44 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (SerialPort)
45
46 DECLARE_NOT_AGGREGATABLE(SerialPort)
47
48 DECLARE_PROTECT_FINAL_CONSTRUCT()
49
50 BEGIN_COM_MAP(SerialPort)
51 COM_INTERFACE_ENTRY (ISupportErrorInfo)
52 COM_INTERFACE_ENTRY (ISerialPort)
53 COM_INTERFACE_ENTRY2 (IDispatch, ISerialPort)
54 END_COM_MAP()
55
56 DECLARE_EMPTY_CTOR_DTOR (SerialPort)
57
58 HRESULT FinalConstruct();
59 void FinalRelease();
60
61 // public initializer/uninitializer for internal purposes only
62 HRESULT init (Machine *aParent, ULONG aSlot);
63 HRESULT init (Machine *aParent, SerialPort *aThat);
64 HRESULT initCopy (Machine *parent, SerialPort *aThat);
65 void uninit();
66
67 // ISerialPort properties
68 STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
69 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
70 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
71 STDMETHOD(COMGETTER(HostMode)) (PortMode_T *aHostMode);
72 STDMETHOD(COMSETTER(HostMode)) (PortMode_T aHostMode);
73 STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
74 STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
75 STDMETHOD(COMGETTER(IOBase) ) (ULONG *aIOBase);
76 STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
77 STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
78 STDMETHOD(COMSETTER(Path)) (IN_BSTR aPath);
79 STDMETHOD(COMGETTER(Server)) (BOOL *aServer);
80 STDMETHOD(COMSETTER(Server)) (BOOL aServer);
81
82 // public methods only for internal purposes
83
84 HRESULT loadSettings(const settings::SerialPort &data);
85 HRESULT saveSettings(settings::SerialPort &data);
86
87 bool isModified();
88 bool isReallyModified();
89 bool rollback();
90 void commit();
91 void copyFrom(SerialPort *aThat);
92
93 void applyDefaults (GuestOSType *aOsType);
94
95 // public methods for internal purposes only
96 // (ensure there is a caller and a read lock before calling them!)
97
98 // for VirtualBoxSupportErrorInfoImpl
99 static const wchar_t *getComponentName() { return L"SerialPort"; }
100
101private:
102 HRESULT checkSetPath(const Utf8Str &str);
103
104 struct Data;
105 Data *m;
106};
107
108#endif // ____H_FLOPPYDRIVEIMPL
109/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use