VirtualBox

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

Last change on this file since 55357 was 55214, checked in by vboxsync, 10 years ago

Main/Console+Machine+Session+Snapshot: move the save state and snapshot related methods from IConsole to IMachine, with lots of unavoidable code restructuring and cleanup. Also define two new machine states (so that the "Saving" one is specifically for saving state now) which requires more changes everywhere
Frontends: necessary adjustments
doc/SDK: document the changes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/** @file
2 * VBox Client Session COM Class definition
3 */
4
5/*
6 * Copyright (C) 2006-2014 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. 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 "SessionWrap.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 SessionWrap
32#ifdef RT_OS_WINDOWS
33 , public CComCoClass<Session, &CLSID_Session>
34#endif
35{
36public:
37
38 DECLARE_CLASSFACTORY()
39
40 DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
41
42 DECLARE_NOT_AGGREGATABLE(Session)
43
44 DECLARE_EMPTY_CTOR_DTOR(Session)
45
46 HRESULT FinalConstruct();
47 void FinalRelease();
48
49 // public initializers/uninitializers only for internal purposes
50 HRESULT init();
51 void uninit();
52
53private:
54
55 // Wrapped ISession properties
56 HRESULT getState(SessionState_T *aState);
57 HRESULT getType(SessionType_T *aType);
58 HRESULT getMachine(ComPtr<IMachine> &aMachine);
59 HRESULT getConsole(ComPtr<IConsole> &aConsole);
60
61 // Wrapped ISession methods
62 HRESULT unlockMachine();
63
64 // Wrapped IInternalSessionControl properties
65 HRESULT getPID(ULONG *aPid);
66 HRESULT getRemoteConsole(ComPtr<IConsole> &aRemoteConsole);
67 HRESULT getNominalState(MachineState_T *aNominalState);
68
69 // Wrapped IInternalSessionControl methods
70#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
71 HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
72 LockType_T aLockType,
73 const com::Utf8Str &aTokenId);
74#else
75 HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
76 LockType_T aLockType,
77 const ComPtr<IToken> &aToken);
78#endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
79 HRESULT assignRemoteMachine(const ComPtr<IMachine> &aMachine,
80 const ComPtr<IConsole> &aConsole);
81 HRESULT updateMachineState(MachineState_T aMachineState);
82 HRESULT uninitialize();
83 HRESULT onNetworkAdapterChange(const ComPtr<INetworkAdapter> &aNetworkAdapter,
84 BOOL aChangeAdapter);
85 HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort);
86 HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort);
87 HRESULT onStorageControllerChange();
88 HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
89 BOOL aForce);
90 HRESULT onStorageDeviceChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
91 BOOL aRemove,
92 BOOL aSilent);
93 HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
94 HRESULT onDnDModeChange(DnDMode_T aDndMode);
95 HRESULT onCPUChange(ULONG aCpu,
96 BOOL aAdd);
97 HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
98 HRESULT onVRDEServerChange(BOOL aRestart);
99 HRESULT onVideoCaptureChange();
100 HRESULT onUSBControllerChange();
101 HRESULT onSharedFolderChange(BOOL aGlobal);
102 HRESULT onUSBDeviceAttach(const ComPtr<IUSBDevice> &aDevice,
103 const ComPtr<IVirtualBoxErrorInfo> &aError,
104 ULONG aMaskedInterfaces,
105 const com::Utf8Str &aCaptureFilename);
106 HRESULT onUSBDeviceDetach(const com::Guid &aId,
107 const ComPtr<IVirtualBoxErrorInfo> &aError);
108 HRESULT onShowWindow(BOOL aCheck,
109 BOOL *aCanShow,
110 LONG64 *aWinId);
111 HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
112 HRESULT accessGuestProperty(const com::Utf8Str &aName,
113 const com::Utf8Str &aValue,
114 const com::Utf8Str &aFlags,
115 ULONG aAccessMode,
116 com::Utf8Str &aRetValue,
117 LONG64 *aRetTimestamp,
118 com::Utf8Str &aRetFlags);
119 HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
120 std::vector<com::Utf8Str> &aKeys,
121 std::vector<com::Utf8Str> &aValues,
122 std::vector<LONG64> &aTimestamps,
123 std::vector<com::Utf8Str> &aFlags);
124 HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
125 ULONG aSourceIdx,
126 ULONG aTargetIdx,
127 const ComPtr<IProgress> &aProgress);
128 HRESULT reconfigureMediumAttachments(const std::vector<ComPtr<IMediumAttachment> > &aAttachments);
129 HRESULT enableVMMStatistics(BOOL aEnable);
130 HRESULT pauseWithReason(Reason_T aReason);
131 HRESULT resumeWithReason(Reason_T aReason);
132 HRESULT saveStateWithReason(Reason_T aReason,
133 const ComPtr<IProgress> &aProgress,
134 const Utf8Str &aStateFilePath,
135 BOOL aPauseVM,
136 BOOL *aLeftPaused);
137 HRESULT cancelSaveStateWithReason();
138
139
140 HRESULT i_unlockMachine(bool aFinalRelease, bool aFromServer);
141
142 SessionState_T mState;
143 SessionType_T mType;
144
145 ComPtr<IInternalMachineControl> mControl;
146
147#ifndef VBOX_COM_INPROC_API_CLIENT
148 ComObjPtr<Console> mConsole;
149#endif
150
151 ComPtr<IMachine> mRemoteMachine;
152 ComPtr<IConsole> mRemoteConsole;
153
154 ComPtr<IVirtualBox> mVirtualBox;
155
156 class ClientTokenHolder;
157
158 ClientTokenHolder *mClientTokenHolder;
159};
160
161#endif // !____H_SESSIONIMPL
162/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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