VirtualBox

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

Last change on this file since 52252 was 52251, checked in by vboxsync, 10 years ago

Main: update guest properties API to work with API wrappers, removed unnecesary BSTR conversion.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.5 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 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 HRESULT onUSBDeviceDetach(const com::Guid &aId,
101 const ComPtr<IVirtualBoxErrorInfo> &aError);
102 HRESULT onShowWindow(BOOL aCheck,
103 BOOL *aCanShow,
104 LONG64 *aWinId);
105 HRESULT onBandwidthGroupChange(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
106 HRESULT accessGuestProperty(const com::Utf8Str &aName,
107 const com::Utf8Str &aValue,
108 const com::Utf8Str &aFlags,
109 ULONG aAccessMode,
110 com::Utf8Str &aRetValue,
111 LONG64 *aRetTimestamp,
112 com::Utf8Str &aRetFlags);
113 HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
114 std::vector<com::Utf8Str> &aKeys,
115 std::vector<com::Utf8Str> &aValues,
116 std::vector<LONG64> &aTimestamps,
117 std::vector<com::Utf8Str> &aFlags);
118 HRESULT onlineMergeMedium(const ComPtr<IMediumAttachment> &aMediumAttachment,
119 ULONG aSourceIdx,
120 ULONG aTargetIdx,
121 const ComPtr<IProgress> &aProgress);
122 HRESULT enableVMMStatistics(BOOL aEnable);
123 HRESULT pauseWithReason(Reason_T aReason);
124 HRESULT resumeWithReason(Reason_T aReason);
125 HRESULT saveStateWithReason(Reason_T aReason,
126 ComPtr<IProgress> &aProgress);
127 HRESULT unlockMachine(bool aFinalRelease, bool aFromServer);
128
129 SessionState_T mState;
130 SessionType_T mType;
131
132 ComPtr<IInternalMachineControl> mControl;
133
134#ifndef VBOX_COM_INPROC_API_CLIENT
135 ComObjPtr<Console> mConsole;
136#endif
137
138 ComPtr<IMachine> mRemoteMachine;
139 ComPtr<IConsole> mRemoteConsole;
140
141 ComPtr<IVirtualBox> mVirtualBox;
142
143 class ClientTokenHolder;
144
145 ClientTokenHolder *mClientTokenHolder;
146};
147
148#endif // !____H_SESSIONIMPL
149/* 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