SerialPortImpl.h revision f4ce78cbf606a9d451fcc56eef48a664307fc701
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync/* $Id$ */
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync/** @file
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync *
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * VirtualBox COM class implementation
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync */
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync/*
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Copyright (C) 2006-2012 Oracle Corporation
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync *
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * available from http://www.virtualbox.org. This file is free software;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * you can redistribute it and/or modify it under the terms of the GNU
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * General Public License (GPL) as published by the Free Software
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync */
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#ifndef ____H_SERIALPORTIMPL
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#define ____H_SERIALPORTIMPL
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#include "VirtualBoxBase.h"
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsyncclass GuestOSType;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsyncnamespace settings
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync{
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync struct SerialPort;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync}
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsyncclass ATL_NO_VTABLE SerialPort :
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync public VirtualBoxBase,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync VBOX_SCRIPTABLE_IMPL(ISerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync{
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsyncpublic:
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SerialPort, ISerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync DECLARE_NOT_AGGREGATABLE(SerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync BEGIN_COM_MAP(SerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync VBOX_DEFAULT_INTERFACE_ENTRIES (ISerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync END_COM_MAP()
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync DECLARE_EMPTY_CTOR_DTOR (SerialPort)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT FinalConstruct();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void FinalRelease();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync // public initializer/uninitializer for internal purposes only
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT init (Machine *aParent, ULONG aSlot);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT init (Machine *aParent, SerialPort *aThat);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT initCopy (Machine *parent, SerialPort *aThat);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void uninit();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync // ISerialPort properties
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(HostMode)) (PortMode_T *aHostMode);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(HostMode)) (PortMode_T aHostMode);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(IRQ)) (ULONG *aIRQ);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(IRQ)) (ULONG aIRQ);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(IOBase) ) (ULONG *aIOBase);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(IOBase)) (ULONG aIOBase);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(Path)) (IN_BSTR aPath);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMGETTER(Server)) (BOOL *aServer);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync STDMETHOD(COMSETTER(Server)) (BOOL aServer);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync // public methods only for internal purposes
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT loadSettings(const settings::SerialPort &data);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT saveSettings(settings::SerialPort &data);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync bool isModified();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void rollback();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void commit();
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void copyFrom(SerialPort *aThat);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync void applyDefaults (GuestOSType *aOsType);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync // public methods for internal purposes only
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync // (ensure there is a caller and a read lock before calling them!)
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsyncprivate:
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync HRESULT checkSetPath(const Utf8Str &str);
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync struct Data;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Data *m;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync};
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#endif // ____H_SERIALPORTIMPL
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync