VirtualBox

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

Last change on this file since 52232 was 52232, checked in by vboxsync, 11 years ago

Main: ISession partially converted to use API wrappers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 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
53#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
54 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType, IN_BSTR aTokenId);
55#else /* VBOX_WITH_GENERIC_SESSION_WATCHER */
56 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType, IToken *aToken);
57#endif /* VBOX_WITH_GENERIC_SESSION_WATCHER */
58
59private:
60
61 // Wrapped Isession properties
62 HRESULT getState(SessionState_T *aState);
63 HRESULT getType(SessionType_T *aType);
64 HRESULT getMachine(ComPtr<IMachine> &aMachine);
65 HRESULT getConsole(ComPtr<IConsole> &aConsole);
66
67 // Wrapped Isession methods
68 HRESULT unlockMachine();
69 HRESULT getPID(ULONG *aPid);
70 HRESULT getRemoteConsole(ComPtr<IConsole> &aConsole);
71 HRESULT assignRemoteMachine(const ComPtr<IMachine> &aMachine,
72 const ComPtr<IConsole> &aConsole);
73 HRESULT updateMachineState(MachineState_T aMachineState);
74 HRESULT uninitialize();
75 HRESULT onNetworkAdapterChange(const ComPtr<INetworkAdapter> &aNetworkAdapter,
76 BOOL aChangeAdapter);
77 HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort);
78 HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort);
79 HRESULT onStorageControllerChange();
80 HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
81 BOOL aForce);
82 HRESULT onStorageDeviceChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
83 BOOL aRemove,
84 BOOL aSilent);
85 HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
86 HRESULT onDnDModeChange(DnDMode_T aDndMode);
87 HRESULT onCPUChange(ULONG aCpu,
88 BOOL aAdd);
89 HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
90 HRESULT onVRDEServerChange(BOOL aRestart);
91 HRESULT onVideoCaptureChange();
92 HRESULT onUSBControllerChange();
93 HRESULT onSharedFolderChange(BOOL aGlobal);
94 HRESULT onUSBDeviceAttach(const ComPtr<IUSBDevice> &aDevice,
95 const ComPtr<IVirtualBoxErrorInfo> &aError,
96 ULONG aMaskedInterfaces);
97 HRESULT onUSBDeviceDetach(const com::Guid &aId,
98 const ComPtr<IVirtualBoxErrorInfo> &aError);
99 HRESULT onShowWindow(BOOL aCheck,
100 BOOL *aCanShow,
101 LONG64 *aWinId);
102 HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
103 HRESULT accessGuestProperty(const com::Utf8Str &aName,
104 const com::Utf8Str &aValue,
105 const com::Utf8Str &aFlags,
106 BOOL aIsSetter,
107 com::Utf8Str &aRetValue,
108 LONG64 *aRetTimestamp,
109 com::Utf8Str &aRetFlags);
110 HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
111 std::vector<com::Utf8Str> &aKeys,
112 std::vector<com::Utf8Str> &aValues,
113 std::vector<LONG64> &aTimestamps,
114 std::vector<com::Utf8Str> &aFlags);
115 HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
116 ULONG aSourceIdx,
117 ULONG aTargetIdx,
118 const ComPtr<IProgress> &aProgress);
119 HRESULT enableVMMStatistics(BOOL aEnable);
120 HRESULT pauseWithReason(Reason_T aReason);
121 HRESULT resumeWithReason(Reason_T aReason);
122 HRESULT saveStateWithReason(Reason_T aReason,
123 ComPtr<IProgress> &aProgress);
124 HRESULT unlockMachine(bool aFinalRelease, bool aFromServer);
125
126 SessionState_T mState;
127 SessionType_T mType;
128
129 ComPtr<IInternalMachineControl> mControl;
130
131#ifndef VBOX_COM_INPROC_API_CLIENT
132 ComObjPtr<Console> mConsole;
133#endif
134
135 ComPtr<IMachine> mRemoteMachine;
136 ComPtr<IConsole> mRemoteConsole;
137
138 ComPtr<IVirtualBox> mVirtualBox;
139
140 class ClientTokenHolder;
141
142 ClientTokenHolder *mClientTokenHolder;
143};
144
145#endif // !____H_SESSIONIMPL
146/* 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