VirtualBox

source: vbox/trunk/src/VBox/Main/include/SessionImpl.h@ 48282

Last change on this file since 48282 was 48282, checked in by vboxsync, 12 years ago

32-bit main API on 64-bit solaris.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/** @file
2 * VBox Client Session COM Class definition
3 */
4
5/*
6 * Copyright (C) 2006-2013 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.215389.xyz. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef ____H_SESSIONIMPL
18#define ____H_SESSIONIMPL
19
20#include "VirtualBoxBase.h"
21#include "ConsoleImpl.h"
22
23#ifdef RT_OS_WINDOWS
24# include "win/resource.h"
25#endif
26
27#ifdef RT_OS_WINDOWS
28[threading(free)]
29#endif
30class ATL_NO_VTABLE Session :
31 public VirtualBoxBase,
32 VBOX_SCRIPTABLE_IMPL(ISession),
33 VBOX_SCRIPTABLE_IMPL(IInternalSessionControl)
34#ifdef RT_OS_WINDOWS
35 , public CComCoClass<Session, &CLSID_Session>
36#endif
37{
38public:
39
40 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Session, ISession)
41
42 DECLARE_CLASSFACTORY()
43
44 DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
45 DECLARE_NOT_AGGREGATABLE(Session)
46
47 DECLARE_PROTECT_FINAL_CONSTRUCT()
48
49 BEGIN_COM_MAP(Session)
50 VBOX_DEFAULT_INTERFACE_ENTRIES(ISession)
51 COM_INTERFACE_ENTRY2(IDispatch, IInternalSessionControl)
52 COM_INTERFACE_ENTRY(IInternalSessionControl)
53 END_COM_MAP()
54
55 HRESULT FinalConstruct();
56 void FinalRelease();
57
58 // public initializers/uninitializers only for internal purposes
59 HRESULT init();
60 void uninit();
61
62 // ISession properties
63 STDMETHOD(COMGETTER(State))(SessionState_T *aState);
64 STDMETHOD(COMGETTER(Type))(SessionType_T *aType);
65 STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
66 STDMETHOD(COMGETTER(Console))(IConsole **aConsole);
67
68 // ISession methods
69 STDMETHOD(UnlockMachine)();
70
71 // IInternalSessionControl methods
72 STDMETHOD(GetPID)(ULONG *aPid);
73 STDMETHOD(GetRemoteConsole)(IConsole **aConsole);
74 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType, IN_BSTR aTokenId);
75 STDMETHOD(AssignRemoteMachine)(IMachine *aMachine, IConsole *aConsole);
76 STDMETHOD(UpdateMachineState)(MachineState_T aMachineState);
77 STDMETHOD(Uninitialize)();
78 STDMETHOD(OnNetworkAdapterChange)(INetworkAdapter *networkAdapter, BOOL changeAdapter);
79 STDMETHOD(OnSerialPortChange)(ISerialPort *serialPort);
80 STDMETHOD(OnParallelPortChange)(IParallelPort *parallelPort);
81 STDMETHOD(OnStorageControllerChange)();
82 STDMETHOD(OnMediumChange)(IMediumAttachment *aMediumAttachment, BOOL aForce);
83 STDMETHOD(OnCPUChange)(ULONG aCPU, BOOL aRemove);
84 STDMETHOD(OnCPUExecutionCapChange)(ULONG aExecutionCap);
85 STDMETHOD(OnVRDEServerChange)(BOOL aRestart);
86 STDMETHOD(OnVideoCaptureChange)();
87 STDMETHOD(OnUSBControllerChange)();
88 STDMETHOD(OnSharedFolderChange)(BOOL aGlobal);
89 STDMETHOD(OnClipboardModeChange)(ClipboardMode_T aClipboardMode);
90 STDMETHOD(OnDragAndDropModeChange)(DragAndDropMode_T aDragAndDropMode);
91 STDMETHOD(OnUSBDeviceAttach)(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
92 STDMETHOD(OnUSBDeviceDetach)(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
93 STDMETHOD(OnShowWindow)(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
94 STDMETHOD(OnBandwidthGroupChange)(IBandwidthGroup *aBandwidthGroup);
95 STDMETHOD(OnStorageDeviceChange)(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
96 STDMETHOD(AccessGuestProperty)(IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags,
97 BOOL aIsSetter, BSTR *aRetValue, LONG64 *aRetTimestamp, BSTR *aRetFlags);
98 STDMETHOD(EnumerateGuestProperties)(IN_BSTR aPatterns,
99 ComSafeArrayOut(BSTR, aNames),
100 ComSafeArrayOut(BSTR, aValues),
101 ComSafeArrayOut(LONG64, aTimestamps),
102 ComSafeArrayOut(BSTR, aFlags));
103 STDMETHOD(OnlineMergeMedium)(IMediumAttachment *aMediumAttachment,
104 ULONG aSourceIdx, ULONG aTargetIdx,
105 IMedium *aSource, IMedium *aTarget,
106 BOOL aMergeForward, IMedium *aParentForTarget,
107 ComSafeArrayIn(IMedium *, aChildrenToReparent),
108 IProgress *aProgress);
109 STDMETHOD(EnableVMMStatistics)(BOOL aEnable);
110 STDMETHOD(PauseWithReason)(Reason_T aReason);
111 STDMETHOD(ResumeWithReason)(Reason_T aReason);
112 STDMETHOD(SaveStateWithReason)(Reason_T aReason, IProgress **aProgress);
113
114private:
115
116 HRESULT unlockMachine(bool aFinalRelease, bool aFromServer);
117
118 SessionState_T mState;
119 SessionType_T mType;
120
121 ComPtr<IInternalMachineControl> mControl;
122
123#ifndef VBOX_COM_INPROC_API_CLIENT
124 ComObjPtr<Console> mConsole;
125#endif
126
127 ComPtr<IMachine> mRemoteMachine;
128 ComPtr<IConsole> mRemoteConsole;
129
130 ComPtr<IVirtualBox> mVirtualBox;
131
132 class ClientTokenHolder;
133
134 ClientTokenHolder *mClientTokenHolder;
135};
136
137#endif // !____H_SESSIONIMPL
138/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette