1 | /* $Id: SessionImpl.h 60765 2016-04-29 14:26:58Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Client Session COM Class definition
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2016 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ____H_SESSIONIMPL
|
---|
19 | #define ____H_SESSIONIMPL
|
---|
20 |
|
---|
21 | #include "SessionWrap.h"
|
---|
22 | #include "ConsoleImpl.h"
|
---|
23 |
|
---|
24 | #ifdef RT_OS_WINDOWS
|
---|
25 | # include "win/resource.h"
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | #ifdef RT_OS_WINDOWS
|
---|
29 | [threading(free)]
|
---|
30 | #endif
|
---|
31 | class ATL_NO_VTABLE Session :
|
---|
32 | public SessionWrap
|
---|
33 | #ifdef RT_OS_WINDOWS
|
---|
34 | , public ATL::CComCoClass<Session, &CLSID_Session>
|
---|
35 | #endif
|
---|
36 | {
|
---|
37 | public:
|
---|
38 |
|
---|
39 | DECLARE_CLASSFACTORY()
|
---|
40 |
|
---|
41 | // Do not use any ATL registry support.
|
---|
42 | //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
|
---|
43 |
|
---|
44 | DECLARE_NOT_AGGREGATABLE(Session)
|
---|
45 |
|
---|
46 | DECLARE_EMPTY_CTOR_DTOR(Session)
|
---|
47 |
|
---|
48 | HRESULT FinalConstruct();
|
---|
49 | void FinalRelease();
|
---|
50 |
|
---|
51 | // public initializers/uninitializers only for internal purposes
|
---|
52 | HRESULT init();
|
---|
53 | void uninit();
|
---|
54 |
|
---|
55 | private:
|
---|
56 |
|
---|
57 | // Wrapped ISession properties
|
---|
58 | HRESULT getState(SessionState_T *aState);
|
---|
59 | HRESULT getType(SessionType_T *aType);
|
---|
60 | HRESULT getName(com::Utf8Str &aName);
|
---|
61 | HRESULT setName(const com::Utf8Str &aName);
|
---|
62 | HRESULT getMachine(ComPtr<IMachine> &aMachine);
|
---|
63 | HRESULT getConsole(ComPtr<IConsole> &aConsole);
|
---|
64 |
|
---|
65 | // Wrapped ISession methods
|
---|
66 | HRESULT unlockMachine();
|
---|
67 |
|
---|
68 | // Wrapped IInternalSessionControl properties
|
---|
69 | HRESULT getPID(ULONG *aPid);
|
---|
70 | HRESULT getRemoteConsole(ComPtr<IConsole> &aRemoteConsole);
|
---|
71 | HRESULT getNominalState(MachineState_T *aNominalState);
|
---|
72 |
|
---|
73 | // Wrapped IInternalSessionControl methods
|
---|
74 | #ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
|
---|
75 | HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
|
---|
76 | LockType_T aLockType,
|
---|
77 | const com::Utf8Str &aTokenId);
|
---|
78 | #else
|
---|
79 | HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
|
---|
80 | LockType_T aLockType,
|
---|
81 | const ComPtr<IToken> &aToken);
|
---|
82 | #endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
|
---|
83 | HRESULT assignRemoteMachine(const ComPtr<IMachine> &aMachine,
|
---|
84 | const ComPtr<IConsole> &aConsole);
|
---|
85 | HRESULT updateMachineState(MachineState_T aMachineState);
|
---|
86 | HRESULT uninitialize();
|
---|
87 | HRESULT onNetworkAdapterChange(const ComPtr<INetworkAdapter> &aNetworkAdapter,
|
---|
88 | BOOL aChangeAdapter);
|
---|
89 | HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort);
|
---|
90 | HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort);
|
---|
91 | HRESULT onStorageControllerChange();
|
---|
92 | HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
93 | BOOL aForce);
|
---|
94 | HRESULT onStorageDeviceChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
95 | BOOL aRemove,
|
---|
96 | BOOL aSilent);
|
---|
97 | HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
|
---|
98 | HRESULT onDnDModeChange(DnDMode_T aDndMode);
|
---|
99 | HRESULT onCPUChange(ULONG aCpu,
|
---|
100 | BOOL aAdd);
|
---|
101 | HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
|
---|
102 | HRESULT onVRDEServerChange(BOOL aRestart);
|
---|
103 | HRESULT onVideoCaptureChange();
|
---|
104 | HRESULT onUSBControllerChange();
|
---|
105 | HRESULT onSharedFolderChange(BOOL aGlobal);
|
---|
106 | HRESULT onUSBDeviceAttach(const ComPtr<IUSBDevice> &aDevice,
|
---|
107 | const ComPtr<IVirtualBoxErrorInfo> &aError,
|
---|
108 | ULONG aMaskedInterfaces,
|
---|
109 | const com::Utf8Str &aCaptureFilename);
|
---|
110 | HRESULT onUSBDeviceDetach(const com::Guid &aId,
|
---|
111 | const ComPtr<IVirtualBoxErrorInfo> &aError);
|
---|
112 | HRESULT onShowWindow(BOOL aCheck,
|
---|
113 | BOOL *aCanShow,
|
---|
114 | LONG64 *aWinId);
|
---|
115 | HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
|
---|
116 | HRESULT accessGuestProperty(const com::Utf8Str &aName,
|
---|
117 | const com::Utf8Str &aValue,
|
---|
118 | const com::Utf8Str &aFlags,
|
---|
119 | ULONG aAccessMode,
|
---|
120 | com::Utf8Str &aRetValue,
|
---|
121 | LONG64 *aRetTimestamp,
|
---|
122 | com::Utf8Str &aRetFlags);
|
---|
123 | HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
|
---|
124 | std::vector<com::Utf8Str> &aKeys,
|
---|
125 | std::vector<com::Utf8Str> &aValues,
|
---|
126 | std::vector<LONG64> &aTimestamps,
|
---|
127 | std::vector<com::Utf8Str> &aFlags);
|
---|
128 | HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
129 | ULONG aSourceIdx,
|
---|
130 | ULONG aTargetIdx,
|
---|
131 | const ComPtr<IProgress> &aProgress);
|
---|
132 | HRESULT reconfigureMediumAttachments(const std::vector<ComPtr<IMediumAttachment> > &aAttachments);
|
---|
133 | HRESULT enableVMMStatistics(BOOL aEnable);
|
---|
134 | HRESULT pauseWithReason(Reason_T aReason);
|
---|
135 | HRESULT resumeWithReason(Reason_T aReason);
|
---|
136 | HRESULT saveStateWithReason(Reason_T aReason,
|
---|
137 | const ComPtr<IProgress> &aProgress,
|
---|
138 | const Utf8Str &aStateFilePath,
|
---|
139 | BOOL aPauseVM,
|
---|
140 | BOOL *aLeftPaused);
|
---|
141 | HRESULT cancelSaveStateWithReason();
|
---|
142 |
|
---|
143 |
|
---|
144 | HRESULT i_unlockMachine(bool aFinalRelease, bool aFromServer, AutoWriteLock &aLockW);
|
---|
145 |
|
---|
146 | SessionState_T mState;
|
---|
147 | SessionType_T mType;
|
---|
148 | Utf8Str mName;
|
---|
149 |
|
---|
150 | ComPtr<IInternalMachineControl> mControl;
|
---|
151 |
|
---|
152 | #ifndef VBOX_COM_INPROC_API_CLIENT
|
---|
153 | ComObjPtr<Console> mConsole;
|
---|
154 | #endif
|
---|
155 |
|
---|
156 | ComPtr<IMachine> mRemoteMachine;
|
---|
157 | ComPtr<IConsole> mRemoteConsole;
|
---|
158 |
|
---|
159 | ComPtr<IVirtualBox> mVirtualBox;
|
---|
160 |
|
---|
161 | class ClientTokenHolder;
|
---|
162 |
|
---|
163 | ClientTokenHolder *mClientTokenHolder;
|
---|
164 | };
|
---|
165 |
|
---|
166 | #endif // !____H_SESSIONIMPL
|
---|
167 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|