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
|
---|
30 | class ATL_NO_VTABLE Session :
|
---|
31 | public SessionWrap
|
---|
32 | #ifdef RT_OS_WINDOWS
|
---|
33 | , public CComCoClass<Session, &CLSID_Session>
|
---|
34 | #endif
|
---|
35 | {
|
---|
36 | public:
|
---|
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 | private:
|
---|
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 | HRESULT getPID(ULONG *aPid);
|
---|
64 | HRESULT getRemoteConsole(ComPtr<IConsole> &aConsole);
|
---|
65 | #ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
|
---|
66 | HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
|
---|
67 | LockType_T aLockType,
|
---|
68 | const com::Utf8Str &aTokenId);
|
---|
69 | #else
|
---|
70 | HRESULT assignMachine(const ComPtr<IMachine> &aMachine,
|
---|
71 | LockType_T aLockType,
|
---|
72 | const ComPtr<IToken> &aToken);
|
---|
73 | #endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
|
---|
74 | HRESULT assignRemoteMachine(const ComPtr<IMachine> &aMachine,
|
---|
75 | const ComPtr<IConsole> &aConsole);
|
---|
76 | HRESULT updateMachineState(MachineState_T aMachineState);
|
---|
77 | HRESULT uninitialize();
|
---|
78 | HRESULT onNetworkAdapterChange(const ComPtr<INetworkAdapter> &aNetworkAdapter,
|
---|
79 | BOOL aChangeAdapter);
|
---|
80 | HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort);
|
---|
81 | HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort);
|
---|
82 | HRESULT onStorageControllerChange();
|
---|
83 | HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
84 | BOOL aForce);
|
---|
85 | HRESULT onStorageDeviceChange(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
86 | BOOL aRemove,
|
---|
87 | BOOL aSilent);
|
---|
88 | HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
|
---|
89 | HRESULT onDnDModeChange(DnDMode_T aDndMode);
|
---|
90 | HRESULT onCPUChange(ULONG aCpu,
|
---|
91 | BOOL aAdd);
|
---|
92 | HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
|
---|
93 | HRESULT onVRDEServerChange(BOOL aRestart);
|
---|
94 | HRESULT onVideoCaptureChange();
|
---|
95 | HRESULT onUSBControllerChange();
|
---|
96 | HRESULT onSharedFolderChange(BOOL aGlobal);
|
---|
97 | HRESULT onUSBDeviceAttach(const ComPtr<IUSBDevice> &aDevice,
|
---|
98 | const ComPtr<IVirtualBoxErrorInfo> &aError,
|
---|
99 | ULONG aMaskedInterfaces,
|
---|
100 | const com::Utf8Str &aCaptureFilename);
|
---|
101 | HRESULT onUSBDeviceDetach(const com::Guid &aId,
|
---|
102 | const ComPtr<IVirtualBoxErrorInfo> &aError);
|
---|
103 | HRESULT onShowWindow(BOOL aCheck,
|
---|
104 | BOOL *aCanShow,
|
---|
105 | LONG64 *aWinId);
|
---|
106 | HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
|
---|
107 | HRESULT accessGuestProperty(const com::Utf8Str &aName,
|
---|
108 | const com::Utf8Str &aValue,
|
---|
109 | const com::Utf8Str &aFlags,
|
---|
110 | ULONG aAccessMode,
|
---|
111 | com::Utf8Str &aRetValue,
|
---|
112 | LONG64 *aRetTimestamp,
|
---|
113 | com::Utf8Str &aRetFlags);
|
---|
114 | HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
|
---|
115 | std::vector<com::Utf8Str> &aKeys,
|
---|
116 | std::vector<com::Utf8Str> &aValues,
|
---|
117 | std::vector<LONG64> &aTimestamps,
|
---|
118 | std::vector<com::Utf8Str> &aFlags);
|
---|
119 | HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
|
---|
120 | ULONG aSourceIdx,
|
---|
121 | ULONG aTargetIdx,
|
---|
122 | const ComPtr<IProgress> &aProgress);
|
---|
123 | HRESULT enableVMMStatistics(BOOL aEnable);
|
---|
124 | HRESULT pauseWithReason(Reason_T aReason);
|
---|
125 | HRESULT resumeWithReason(Reason_T aReason);
|
---|
126 | HRESULT saveStateWithReason(Reason_T aReason,
|
---|
127 | ComPtr<IProgress> &aProgress);
|
---|
128 | HRESULT unlockMachine(bool aFinalRelease, bool aFromServer);
|
---|
129 |
|
---|
130 | SessionState_T mState;
|
---|
131 | SessionType_T mType;
|
---|
132 |
|
---|
133 | ComPtr<IInternalMachineControl> mControl;
|
---|
134 |
|
---|
135 | #ifndef VBOX_COM_INPROC_API_CLIENT
|
---|
136 | ComObjPtr<Console> mConsole;
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | ComPtr<IMachine> mRemoteMachine;
|
---|
140 | ComPtr<IConsole> mRemoteConsole;
|
---|
141 |
|
---|
142 | ComPtr<IVirtualBox> mVirtualBox;
|
---|
143 |
|
---|
144 | class ClientTokenHolder;
|
---|
145 |
|
---|
146 | ClientTokenHolder *mClientTokenHolder;
|
---|
147 | };
|
---|
148 |
|
---|
149 | #endif // !____H_SESSIONIMPL
|
---|
150 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|