VRDPServerImpl.h revision 68b7971bd3dc7072763235a81c6015b4863751a1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* $Id$ */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/** @file
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * VirtualBox COM class implementation
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * available from http://www.virtualbox.org. This file is free software;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * General Public License (GPL) as published by the Free Software
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * additional information or have any questions.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef ____H_VRDPSERVER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define ____H_VRDPSERVER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "VirtualBoxBase.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <VBox/VRDPAuth.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncclass Machine;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncnamespace settings
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync{
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct VRDPSettings;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync}
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncclass ATL_NO_VTABLE VRDPServer :
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync public VirtualBoxBase,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync public VirtualBoxSupportErrorInfoImpl<VRDPServer, IVRDPServer>,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync public VirtualBoxSupportTranslation<VRDPServer>,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VBOX_SCRIPTABLE_IMPL(IVRDPServer)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync{
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncpublic:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct Data
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync bool operator== (const Data &that) const
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync return this == &that ||
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync (mEnabled == that.mEnabled &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mVRDPPorts == that.mVRDPPorts &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mVRDPAddress == that.mVRDPAddress &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mAuthType == that.mAuthType &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mAuthTimeout == that.mAuthTimeout &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mAllowMultiConnection == that.mAllowMultiConnection &&
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync mReuseSingleConnection == that.mReuseSingleConnection);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync }
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BOOL mEnabled;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bstr mVRDPPorts;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bstr mVRDPAddress;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VRDPAuthType_T mAuthType;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ULONG mAuthTimeout;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BOOL mAllowMultiConnection;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BOOL mReuseSingleConnection;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync };
VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (VRDPServer)
DECLARE_NOT_AGGREGATABLE(VRDPServer)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(VRDPServer)
COM_INTERFACE_ENTRY (ISupportErrorInfo)
COM_INTERFACE_ENTRY (IVRDPServer)
COM_INTERFACE_ENTRY2 (IDispatch, IVRDPServer)
END_COM_MAP()
DECLARE_EMPTY_CTOR_DTOR (VRDPServer)
HRESULT FinalConstruct();
void FinalRelease();
// public initializer/uninitializer for internal purposes only
HRESULT init(Machine *aParent);
HRESULT init(Machine *aParent, VRDPServer *aThat);
HRESULT initCopy (Machine *aParent, VRDPServer *aThat);
void uninit();
// IVRDPServer properties
STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
STDMETHOD(COMSETTER(Enabled)) (BOOL aEnable);
STDMETHOD(COMGETTER(Ports)) (BSTR *aPorts);
STDMETHOD(COMSETTER(Ports)) (IN_BSTR aPorts);
STDMETHOD(COMGETTER(NetAddress)) (BSTR *aAddress);
STDMETHOD(COMSETTER(NetAddress)) (IN_BSTR aAddress);
STDMETHOD(COMGETTER(AuthType)) (VRDPAuthType_T *aType);
STDMETHOD(COMSETTER(AuthType)) (VRDPAuthType_T aType);
STDMETHOD(COMGETTER(AuthTimeout)) (ULONG *aTimeout);
STDMETHOD(COMSETTER(AuthTimeout)) (ULONG aTimeout);
STDMETHOD(COMGETTER(AllowMultiConnection)) (BOOL *aAllowMultiConnection);
STDMETHOD(COMSETTER(AllowMultiConnection)) (BOOL aAllowMultiConnection);
STDMETHOD(COMGETTER(ReuseSingleConnection)) (BOOL *aReuseSingleConnection);
STDMETHOD(COMSETTER(ReuseSingleConnection)) (BOOL aReuseSingleConnection);
// IVRDPServer methods
// public methods only for internal purposes
HRESULT loadSettings(const settings::VRDPSettings &data);
HRESULT saveSettings(settings::VRDPSettings &data);
bool isModified() { AutoWriteLock alock (this); return mData.isBackedUp(); }
bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); }
bool rollback();
void commit();
void copyFrom (VRDPServer *aThat);
// for VirtualBoxSupportErrorInfoImpl
static const wchar_t *getComponentName() { return L"VRDPServer"; }
private:
const ComObjPtr<Machine, ComWeakRef> mParent;
const ComObjPtr<VRDPServer> mPeer;
Backupable<Data> mData;
};
#endif // ____H_VRDPSERVER
/* vi: set tabstop=4 shiftwidth=4 expandtab: */