VirtualBox

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

Last change on this file since 106901 was 106061, checked in by vboxsync, 3 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 KB
Line 
1/* $Id: SessionImpl.h 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * VBox Client Session COM Class definition
4 */
5
6/*
7 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef MAIN_INCLUDED_SessionImpl_h
29#define MAIN_INCLUDED_SessionImpl_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "SessionWrap.h"
35#include "ConsoleImpl.h"
36
37#ifdef RT_OS_WINDOWS
38# include "win/resource.h"
39#endif
40
41#if defined(RT_OS_WINDOWS) && !RT_MSC_PREREQ(RT_MSC_VER_VC140)
42[threading(free)]
43#endif
44class ATL_NO_VTABLE Session :
45 public SessionWrap
46#ifdef RT_OS_WINDOWS
47 , public ATL::CComCoClass<Session, &CLSID_Session>
48#endif
49{
50public:
51
52 DECLARE_CLASSFACTORY()
53
54 // Do not use any ATL registry support.
55 //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
56
57 DECLARE_NOT_AGGREGATABLE(Session)
58
59 DECLARE_COMMON_CLASS_METHODS(Session)
60
61 HRESULT FinalConstruct();
62 void FinalRelease();
63
64 // public initializers/uninitializers only for internal purposes
65 HRESULT init();
66 void uninit();
67
68private:
69
70 // Wrapped ISession properties
71 HRESULT getState(SessionState_T *aState);
72 HRESULT getType(SessionType_T *aType);
73 HRESULT getName(com::Utf8Str &aName);
74 HRESULT setName(const com::Utf8Str &aName);
75 HRESULT getMachine(ComPtr<IMachine> &aMachine);
76 HRESULT getConsole(ComPtr<IConsole> &aConsole);
77
78 // Wrapped ISession methods
79 HRESULT unlockMachine();
80
81 // Wrapped IInternalSessionControl properties
82 HRESULT getPID(ULONG *aPid);
83 HRESULT getRemoteConsole(ComPtr<IConsole> &aRemoteConsole);
84 HRESULT getNominalState(MachineState_T *aNominalState);
85
86 // Wrapped IInternalSessionControl methods
87#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
88 HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
89 LockType_T aLockType,
90 const com::Utf8Str &aTokenId);
91#else
92 HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
93 LockType_T aLockType,
94 const ComPtr<IToken> &aToken);
95#endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
96 HRESULT assignRemoteMachine(const ComPtr<IMachine> &aMachine,
97 const ComPtr<IConsole> &aConsole);
98 HRESULT updateMachineState(MachineState_T aMachineState);
99 HRESULT uninitialize();
100 HRESULT onNetworkAdapterChange(const ComPtr<INetworkAdapter> &aNetworkAdapter,
101 BOOL aChangeAdapter);
102 HRESULT onAudioAdapterChange(const ComPtr<IAudioAdapter> &aAudioAdapter);
103 HRESULT onHostAudioDeviceChange(const ComPtr<IHostAudioDevice> &aDevice,
104 BOOL aNew, AudioDeviceState_T aState,
105 const ComPtr<IVirtualBoxErrorInfo> &aErrInfo);
106 HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort);
107 HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort);
108 HRESULT onStorageControllerChange(const Guid &aMachineId, const com::Utf8Str& aControllerName);
109 HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
110 BOOL aForce);
111 HRESULT onStorageDeviceChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
112 BOOL aRemove,
113 BOOL aSilent);
114 HRESULT onVMProcessPriorityChange(VMProcPriority_T priority);
115 HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
116 HRESULT onClipboardFileTransferModeChange(BOOL aEnabled);
117 HRESULT onDnDModeChange(DnDMode_T aDndMode);
118 HRESULT onCPUChange(ULONG aCpu,
119 BOOL aAdd);
120 HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
121 HRESULT onVRDEServerChange(BOOL aRestart);
122 HRESULT onRecordingStateChange(BOOL aEnable, ComPtr<IProgress> &aProgress);
123 HRESULT onRecordingScreenStateChange(BOOL aEnable, ULONG aScreen);
124 HRESULT onUSBControllerChange();
125 HRESULT onSharedFolderChange(BOOL aGlobal);
126 HRESULT onGuestDebugControlChange(const ComPtr<IGuestDebugControl> &aGuestDebugControl);
127 HRESULT onUSBDeviceAttach(const ComPtr<IUSBDevice> &aDevice,
128 const ComPtr<IVirtualBoxErrorInfo> &aError,
129 ULONG aMaskedInterfaces,
130 const com::Utf8Str &aCaptureFilename);
131 HRESULT onUSBDeviceDetach(const com::Guid &aId,
132 const ComPtr<IVirtualBoxErrorInfo> &aError);
133 HRESULT onShowWindow(BOOL aCheck,
134 BOOL *aCanShow,
135 LONG64 *aWinId);
136 HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
137 HRESULT accessGuestProperty(const com::Utf8Str &aName,
138 const com::Utf8Str &aValue,
139 const com::Utf8Str &aFlags,
140 ULONG aAccessMode,
141 com::Utf8Str &aRetValue,
142 LONG64 *aRetTimestamp,
143 com::Utf8Str &aRetFlags);
144 HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
145 std::vector<com::Utf8Str> &aKeys,
146 std::vector<com::Utf8Str> &aValues,
147 std::vector<LONG64> &aTimestamps,
148 std::vector<com::Utf8Str> &aFlags);
149 HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
150 ULONG aSourceIdx,
151 ULONG aTargetIdx,
152 const ComPtr<IProgress> &aProgress);
153 HRESULT reconfigureMediumAttachments(const std::vector<ComPtr<IMediumAttachment> > &aAttachments);
154 HRESULT enableVMMStatistics(BOOL aEnable);
155 HRESULT pauseWithReason(Reason_T aReason);
156 HRESULT resumeWithReason(Reason_T aReason);
157 HRESULT saveStateWithReason(Reason_T aReason,
158 const ComPtr<IProgress> &aProgress,
159 const ComPtr<ISnapshot> &aSnapshot,
160 const Utf8Str &aStateFilePath,
161 BOOL aPauseVM,
162 BOOL *aLeftPaused);
163 HRESULT cancelSaveStateWithReason();
164
165
166 HRESULT i_unlockMachine(bool aFinalRelease, bool aFromServer, AutoWriteLock &aLockW);
167
168 SessionState_T mState;
169 SessionType_T mType;
170 Utf8Str mName;
171
172 ComPtr<IInternalMachineControl> mControl;
173
174#ifndef VBOX_COM_INPROC_API_CLIENT
175 ComObjPtr<Console> mConsole;
176#endif
177
178 ComPtr<IMachine> mRemoteMachine;
179 ComPtr<IConsole> mRemoteConsole;
180
181 ComPtr<IVirtualBox> mVirtualBox;
182
183 class ClientTokenHolder;
184
185 ClientTokenHolder *mClientTokenHolder;
186};
187
188#endif /* !MAIN_INCLUDED_SessionImpl_h */
189/* 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