Changeset 71454 in vbox
- Timestamp:
- Mar 22, 2018 1:21:57 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r71089 r71454 5 5 6 6 /* 7 * Copyright (C) 2010-201 7Oracle Corporation7 * Copyright (C) 2010-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 22 22 /* Qt includes: */ 23 # include <QMutex> 23 24 # include <QThread> 24 # include <QMutex>25 25 26 26 /* GUI includes: */ 27 # include "VBoxGlobal.h" 27 28 # include "UIMainEventListener.h" 28 # include "VBoxGlobal.h"29 29 30 30 /* COM includes: */ … … 40 40 # include "CGuestProcessIOEvent.h" 41 41 # include "CGuestProcessRegisteredEvent.h" 42 # include "CGuestProcessStateChangedEvent.h" 42 43 # include "CGuestSessionRegisteredEvent.h" 43 # include "CGuestProcessStateChangedEvent.h"44 44 # include "CGuestSessionStateChangedEvent.h" 45 45 # include "CKeyboardLedsChangedEvent.h" 46 # include "CMachineDataChangedEvent.h" 46 47 # include "CMachineStateChangedEvent.h" 47 # include "CMachineDataChangedEvent.h"48 48 # include "CMachineRegisteredEvent.h" 49 # include "CMediumChangedEvent.h" 50 # include "CMouseCapabilityChangedEvent.h" 49 51 # include "CMousePointerShapeChangedEvent.h" 50 # include "CMouseCapabilityChangedEvent.h"51 # include "CMediumChangedEvent.h"52 52 # include "CNetworkAdapterChangedEvent.h" 53 53 # include "CProgressPercentageChangedEvent.h" … … 56 56 # include "CSessionStateChangedEvent.h" 57 57 # include "CShowWindowEvent.h" 58 # include "CSnapshotChangedEvent.h" 59 # include "CSnapshotDeletedEvent.h" 60 # include "CSnapshotRestoredEvent.h" 58 61 # include "CSnapshotTakenEvent.h" 59 # include "CSnapshotDeletedEvent.h"60 # include "CSnapshotChangedEvent.h"61 # include "CSnapshotRestoredEvent.h"62 62 # include "CStateChangedEvent.h" 63 63 # include "CStorageDeviceChangedEvent.h" … … 78 78 public: 79 79 80 /** Constructs Main events listener thread redirecting events from @a source to @a listener. */81 UIMainEventListeningThread(const CEventSource & source, const CEventListener &listener);80 /** Constructs Main events listener thread redirecting events from @a comSource to @a comListener. */ 81 UIMainEventListeningThread(const CEventSource &comSource, const CEventListener &comListener); 82 82 /** Destructs Main events listener thread. */ 83 83 ~UIMainEventListeningThread(); … … 96 96 97 97 /** Holds the Main event source reference. */ 98 CEventSource m_ source;98 CEventSource m_comSource; 99 99 /** Holds the Main event listener reference. */ 100 CEventListener m_ listener;100 CEventListener m_comListener; 101 101 102 102 /** Holds the mutex instance which protects thread access. */ … … 111 111 *********************************************************************************************************************************/ 112 112 113 UIMainEventListeningThread::UIMainEventListeningThread(const CEventSource & source, const CEventListener &listener)114 : m_ source(source)115 , m_ listener(listener)113 UIMainEventListeningThread::UIMainEventListeningThread(const CEventSource &comSource, const CEventListener &comListener) 114 : m_comSource(comSource) 115 , m_comListener(comListener) 116 116 , m_fShutdown(false) 117 117 { … … 133 133 134 134 /* Copy source wrapper to this thread: */ 135 CEventSource source = m_source;135 CEventSource comSource = m_comSource; 136 136 /* Copy listener wrapper to this thread: */ 137 CEventListener listener = m_listener;137 CEventListener comListener = m_comListener; 138 138 139 139 /* While we are not in shutdown: */ … … 141 141 { 142 142 /* Fetch the event from the queue: */ 143 CEvent event = source.GetEvent(listener, 500);144 if (! event.isNull())143 CEvent comEvent = comSource.GetEvent(comListener, 500); 144 if (!comEvent.isNull()) 145 145 { 146 146 /* Process the event and tell the listener: */ 147 listener.HandleEvent(event);148 if ( event.GetWaitable())149 source.EventProcessed(listener, event);147 comListener.HandleEvent(comEvent); 148 if (comEvent.GetWaitable()) 149 comSource.EventProcessed(comListener, comEvent); 150 150 } 151 151 } … … 189 189 } 190 190 191 void UIMainEventListener::registerSource(const CEventSource & source, const CEventListener &listener)191 void UIMainEventListener::registerSource(const CEventSource &comSource, const CEventListener &comListener) 192 192 { 193 193 /* Make sure source and listener are valid: */ 194 AssertReturnVoid(! source.isNull());195 AssertReturnVoid(! listener.isNull());194 AssertReturnVoid(!comSource.isNull()); 195 AssertReturnVoid(!comListener.isNull()); 196 196 197 197 /* Create thread for passed source: */ 198 m_threads << new UIMainEventListeningThread( source, listener);198 m_threads << new UIMainEventListeningThread(comSource, comListener); 199 199 /* And start it: */ 200 200 m_threads.last()->start(); … … 207 207 } 208 208 209 STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T /* type */, IEvent *pEvent)209 STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T, IEvent *pEvent) 210 210 { 211 211 /* Try to acquire COM cleanup protection token first: */ … … 213 213 return S_OK; 214 214 215 CEvent event(pEvent);216 //printf("Event received: %d\n", event.GetType());217 switch ( event.GetType())215 CEvent comEvent(pEvent); 216 //printf("Event received: %d\n", comEvent.GetType()); 217 switch (comEvent.GetType()) 218 218 { 219 219 case KVBoxEventType_OnVBoxSVCAvailabilityChanged: 220 220 { 221 CVBoxSVCAvailabilityChangedEvent es(pEvent);222 emit sigVBoxSVCAvailabilityChange( es.GetAvailable());221 CVBoxSVCAvailabilityChangedEvent comEventSpecific(pEvent); 222 emit sigVBoxSVCAvailabilityChange(comEventSpecific.GetAvailable()); 223 223 break; 224 224 } … … 226 226 case KVBoxEventType_OnMachineStateChanged: 227 227 { 228 CMachineStateChangedEvent es(pEvent);229 emit sigMachineStateChange( es.GetMachineId(), es.GetState());228 CMachineStateChangedEvent comEventSpecific(pEvent); 229 emit sigMachineStateChange(comEventSpecific.GetMachineId(), comEventSpecific.GetState()); 230 230 break; 231 231 } 232 232 case KVBoxEventType_OnMachineDataChanged: 233 233 { 234 CMachineDataChangedEvent es(pEvent);235 emit sigMachineDataChange( es.GetMachineId());234 CMachineDataChangedEvent comEventSpecific(pEvent); 235 emit sigMachineDataChange(comEventSpecific.GetMachineId()); 236 236 break; 237 237 } 238 238 case KVBoxEventType_OnMachineRegistered: 239 239 { 240 CMachineRegisteredEvent es(pEvent);241 emit sigMachineRegistered( es.GetMachineId(), es.GetRegistered());240 CMachineRegisteredEvent comEventSpecific(pEvent); 241 emit sigMachineRegistered(comEventSpecific.GetMachineId(), comEventSpecific.GetRegistered()); 242 242 break; 243 243 } 244 244 case KVBoxEventType_OnSessionStateChanged: 245 245 { 246 CSessionStateChangedEvent es(pEvent);247 emit sigSessionStateChange( es.GetMachineId(), es.GetState());246 CSessionStateChangedEvent comEventSpecific(pEvent); 247 emit sigSessionStateChange(comEventSpecific.GetMachineId(), comEventSpecific.GetState()); 248 248 break; 249 249 } 250 250 case KVBoxEventType_OnSnapshotTaken: 251 251 { 252 CSnapshotTakenEvent es(pEvent);253 emit sigSnapshotTake( es.GetMachineId(), es.GetSnapshotId());252 CSnapshotTakenEvent comEventSpecific(pEvent); 253 emit sigSnapshotTake(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId()); 254 254 break; 255 255 } 256 256 case KVBoxEventType_OnSnapshotDeleted: 257 257 { 258 CSnapshotDeletedEvent es(pEvent);259 emit sigSnapshotDelete( es.GetMachineId(), es.GetSnapshotId());258 CSnapshotDeletedEvent comEventSpecific(pEvent); 259 emit sigSnapshotDelete(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId()); 260 260 break; 261 261 } 262 262 case KVBoxEventType_OnSnapshotChanged: 263 263 { 264 CSnapshotChangedEvent es(pEvent);265 emit sigSnapshotChange( es.GetMachineId(), es.GetSnapshotId());264 CSnapshotChangedEvent comEventSpecific(pEvent); 265 emit sigSnapshotChange(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId()); 266 266 break; 267 267 } 268 268 case KVBoxEventType_OnSnapshotRestored: 269 269 { 270 CSnapshotRestoredEvent es(pEvent);271 emit sigSnapshotRestore( es.GetMachineId(), es.GetSnapshotId());270 CSnapshotRestoredEvent comEventSpecific(pEvent); 271 emit sigSnapshotRestore(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId()); 272 272 break; 273 273 } … … 277 277 case KVBoxEventType_OnExtraDataCanChange: 278 278 { 279 CExtraDataCanChangeEvent es(pEvent);279 CExtraDataCanChangeEvent comEventSpecific(pEvent); 280 280 /* Has to be done in place to give an answer: */ 281 281 bool fVeto = false; 282 282 QString strReason; 283 emit sigExtraDataCanChange(es.GetMachineId(), es.GetKey(), es.GetValue(), fVeto, strReason); 283 emit sigExtraDataCanChange(comEventSpecific.GetMachineId(), comEventSpecific.GetKey(), 284 comEventSpecific.GetValue(), fVeto, strReason); 284 285 if (fVeto) 285 es.AddVeto(strReason);286 comEventSpecific.AddVeto(strReason); 286 287 break; 287 288 } 288 289 case KVBoxEventType_OnExtraDataChanged: 289 290 { 290 CExtraDataChangedEvent es(pEvent);291 emit sigExtraDataChange( es.GetMachineId(), es.GetKey(), es.GetValue());291 CExtraDataChangedEvent comEventSpecific(pEvent); 292 emit sigExtraDataChange(comEventSpecific.GetMachineId(), comEventSpecific.GetKey(), comEventSpecific.GetValue()); 292 293 break; 293 294 } … … 295 296 case KVBoxEventType_OnMousePointerShapeChanged: 296 297 { 297 CMousePointerShapeChangedEvent es(pEvent); 298 emit sigMousePointerShapeChange(es.GetVisible(), es.GetAlpha(), QPoint(es.GetXhot(), es.GetYhot()), QSize(es.GetWidth(), es.GetHeight()), es.GetShape()); 298 CMousePointerShapeChangedEvent comEventSpecific(pEvent); 299 emit sigMousePointerShapeChange(comEventSpecific.GetVisible(), comEventSpecific.GetAlpha(), 300 QPoint(comEventSpecific.GetXhot(), comEventSpecific.GetYhot()), 301 QSize(comEventSpecific.GetWidth(), comEventSpecific.GetHeight()), 302 comEventSpecific.GetShape()); 299 303 break; 300 304 } 301 305 case KVBoxEventType_OnMouseCapabilityChanged: 302 306 { 303 CMouseCapabilityChangedEvent es(pEvent); 304 emit sigMouseCapabilityChange(es.GetSupportsAbsolute(), es.GetSupportsRelative(), es.GetSupportsMultiTouch(), es.GetNeedsHostCursor()); 307 CMouseCapabilityChangedEvent comEventSpecific(pEvent); 308 emit sigMouseCapabilityChange(comEventSpecific.GetSupportsAbsolute(), comEventSpecific.GetSupportsRelative(), 309 comEventSpecific.GetSupportsMultiTouch(), comEventSpecific.GetNeedsHostCursor()); 305 310 break; 306 311 } 307 312 case KVBoxEventType_OnCursorPositionChanged: 308 313 { 309 CCursorPositionChangedEvent es(pEvent); 310 emit sigCursorPositionChange(es.GetHasData(), (unsigned long)es.GetX(), (unsigned long)es.GetY()); 314 CCursorPositionChangedEvent comEventSpecific(pEvent); 315 emit sigCursorPositionChange(comEventSpecific.GetHasData(), 316 (unsigned long)comEventSpecific.GetX(), (unsigned long)comEventSpecific.GetY()); 311 317 break; 312 318 } 313 319 case KVBoxEventType_OnKeyboardLedsChanged: 314 320 { 315 CKeyboardLedsChangedEvent es(pEvent); 316 emit sigKeyboardLedsChangeEvent(es.GetNumLock(), es.GetCapsLock(), es.GetScrollLock()); 321 CKeyboardLedsChangedEvent comEventSpecific(pEvent); 322 emit sigKeyboardLedsChangeEvent(comEventSpecific.GetNumLock(), 323 comEventSpecific.GetCapsLock(), 324 comEventSpecific.GetScrollLock()); 317 325 break; 318 326 } 319 327 case KVBoxEventType_OnStateChanged: 320 328 { 321 CStateChangedEvent es(pEvent);322 emit sigStateChange( es.GetState());329 CStateChangedEvent comEventSpecific(pEvent); 330 emit sigStateChange(comEventSpecific.GetState()); 323 331 break; 324 332 } … … 330 338 case KVBoxEventType_OnNetworkAdapterChanged: 331 339 { 332 CNetworkAdapterChangedEvent es(pEvent);333 emit sigNetworkAdapterChange( es.GetNetworkAdapter());340 CNetworkAdapterChangedEvent comEventSpecific(pEvent); 341 emit sigNetworkAdapterChange(comEventSpecific.GetNetworkAdapter()); 334 342 break; 335 343 } 336 344 case KVBoxEventType_OnStorageDeviceChanged: 337 345 { 338 CStorageDeviceChangedEvent es(pEvent); 339 emit sigStorageDeviceChange(es.GetStorageDevice(), es.GetRemoved(), es.GetSilent()); 346 CStorageDeviceChangedEvent comEventSpecific(pEvent); 347 emit sigStorageDeviceChange(comEventSpecific.GetStorageDevice(), 348 comEventSpecific.GetRemoved(), 349 comEventSpecific.GetSilent()); 340 350 break; 341 351 } 342 352 case KVBoxEventType_OnMediumChanged: 343 353 { 344 CMediumChangedEvent es(pEvent);345 emit sigMediumChange( es.GetMediumAttachment());354 CMediumChangedEvent comEventSpecific(pEvent); 355 emit sigMediumChange(comEventSpecific.GetMediumAttachment()); 346 356 break; 347 357 } … … 364 374 case KVBoxEventType_OnUSBDeviceStateChanged: 365 375 { 366 CUSBDeviceStateChangedEvent es(pEvent); 367 emit sigUSBDeviceStateChange(es.GetDevice(), es.GetAttached(), es.GetError()); 376 CUSBDeviceStateChangedEvent comEventSpecific(pEvent); 377 emit sigUSBDeviceStateChange(comEventSpecific.GetDevice(), 378 comEventSpecific.GetAttached(), 379 comEventSpecific.GetError()); 368 380 break; 369 381 } … … 380 392 case KVBoxEventType_OnGuestMonitorChanged: 381 393 { 382 CGuestMonitorChangedEvent es(pEvent); 383 emit sigGuestMonitorChange(es.GetChangeType(), es.GetScreenId(), 384 QRect(es.GetOriginX(), es.GetOriginY(), es.GetWidth(), es.GetHeight())); 394 CGuestMonitorChangedEvent comEventSpecific(pEvent); 395 emit sigGuestMonitorChange(comEventSpecific.GetChangeType(), comEventSpecific.GetScreenId(), 396 QRect(comEventSpecific.GetOriginX(), comEventSpecific.GetOriginY(), 397 comEventSpecific.GetWidth(), comEventSpecific.GetHeight())); 385 398 break; 386 399 } 387 400 case KVBoxEventType_OnRuntimeError: 388 401 { 389 CRuntimeErrorEvent es(pEvent);390 emit sigRuntimeError( es.GetFatal(), es.GetId(), es.GetMessage());402 CRuntimeErrorEvent comEventSpecific(pEvent); 403 emit sigRuntimeError(comEventSpecific.GetFatal(), comEventSpecific.GetId(), comEventSpecific.GetMessage()); 391 404 break; 392 405 } 393 406 case KVBoxEventType_OnCanShowWindow: 394 407 { 395 CCanShowWindowEvent es(pEvent);408 CCanShowWindowEvent comEventSpecific(pEvent); 396 409 /* Has to be done in place to give an answer: */ 397 410 bool fVeto = false; … … 399 412 emit sigCanShowWindow(fVeto, strReason); 400 413 if (fVeto) 401 es.AddVeto(strReason);414 comEventSpecific.AddVeto(strReason); 402 415 else 403 es.AddApproval(strReason);416 comEventSpecific.AddApproval(strReason); 404 417 break; 405 418 } 406 419 case KVBoxEventType_OnShowWindow: 407 420 { 408 CShowWindowEvent es(pEvent);421 CShowWindowEvent comEventSpecific(pEvent); 409 422 /* Has to be done in place to give an answer: */ 410 qint64 winId = es.GetWinId();423 qint64 winId = comEventSpecific.GetWinId(); 411 424 if (winId != 0) 412 425 break; /* Already set by some listener. */ 413 426 emit sigShowWindow(winId); 414 es.SetWinId(winId);427 comEventSpecific.SetWinId(winId); 415 428 break; 416 429 } … … 422 435 case KVBoxEventType_OnProgressPercentageChanged: 423 436 { 424 CProgressPercentageChangedEvent es(pEvent);425 emit sigProgressPercentageChange( es.GetProgressId(), (int)es.GetPercent());437 CProgressPercentageChangedEvent comEventSpecific(pEvent); 438 emit sigProgressPercentageChange(comEventSpecific.GetProgressId(), (int)comEventSpecific.GetPercent()); 426 439 break; 427 440 } 428 441 case KVBoxEventType_OnProgressTaskCompleted: 429 442 { 430 CProgressTaskCompletedEvent es(pEvent);431 emit sigProgressTaskComplete( es.GetProgressId());443 CProgressTaskCompletedEvent comEventSpecific(pEvent); 444 emit sigProgressTaskComplete(comEventSpecific.GetProgressId()); 432 445 break; 433 446 } … … 435 448 { 436 449 437 CGuestSessionRegisteredEvent c Event(pEvent);438 if (cEvent.GetRegistered())439 emit sigGuestSessionRegistered(c Event.GetSession());450 CGuestSessionRegisteredEvent comEventSpecific(pEvent); 451 if (comEventSpecific.GetRegistered()) 452 emit sigGuestSessionRegistered(comEventSpecific.GetSession()); 440 453 else 441 emit sigGuestSessionUnregistered(c Event.GetSession());454 emit sigGuestSessionUnregistered(comEventSpecific.GetSession()); 442 455 break; 443 456 } 444 457 case KVBoxEventType_OnGuestProcessRegistered: 445 458 { 446 CGuestProcessRegisteredEvent c Event(pEvent);447 if (cEvent.GetRegistered())448 emit sigGuestProcessRegistered(c Event.GetProcess());459 CGuestProcessRegisteredEvent comEventSpecific(pEvent); 460 if (comEventSpecific.GetRegistered()) 461 emit sigGuestProcessRegistered(comEventSpecific.GetProcess()); 449 462 else 450 emit sigGuestProcessUnregistered(c Event.GetProcess());463 emit sigGuestProcessUnregistered(comEventSpecific.GetProcess()); 451 464 break; 452 465 } 453 466 case KVBoxEventType_OnGuestSessionStateChanged: 454 467 { 455 CGuestSessionStateChangedEvent c Event(pEvent);456 emit sigGuestSessionStatedChanged(c Event);468 CGuestSessionStateChangedEvent comEventSpecific(pEvent); 469 emit sigGuestSessionStatedChanged(comEventSpecific); 457 470 break; 458 471 } … … 464 477 case KVBoxEventType_OnGuestProcessStateChanged: 465 478 { 466 CGuestProcessStateChangedEvent c Event(pEvent);467 c Event.GetError();468 emit sigGuestProcessStateChanged(c Event);479 CGuestProcessStateChangedEvent comEventSpecific(pEvent); 480 comEventSpecific.GetError(); 481 emit sigGuestProcessStateChanged(comEventSpecific); 469 482 break; 470 483 } … … 489 502 490 503 #include "UIMainEventListener.moc" 504 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r71089 r71454 5 5 6 6 /* 7 * Copyright (C) 2010-201 7Oracle Corporation7 * Copyright (C) 2010-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 21 21 /* Qt includes: */ 22 #include <QList> 22 23 #include <QObject> 23 #include <QList>24 24 25 25 /* COM includes: */ … … 36 36 37 37 /* Forward declarations: */ 38 class QPoint; 39 class QSize; 40 class QString; 38 41 class UIMainEventListeningThread; 39 42 class CEventListener; … … 55 58 56 59 /** Main event listener. */ 57 class UIMainEventListener : public QObject60 class UIMainEventListener : public QObject 58 61 { 59 62 Q_OBJECT; … … 61 64 signals: 62 65 63 /** Notifies about the VBoxSVC become @a fAvailable. */ 64 void sigVBoxSVCAvailabilityChange(bool fAvailable); 66 /** @name VirtualBoxClient related signals 67 * @{ */ 68 /** Notifies about the VBoxSVC become @a fAvailable. */ 69 void sigVBoxSVCAvailabilityChange(bool fAvailable); 70 /** @} */ 65 71 66 /** Notifies about @a state change event for the machine with @a strId. */ 67 void sigMachineStateChange(QString strId, KMachineState state); 68 /** Notifies about data change event for the machine with @a strId. */ 69 void sigMachineDataChange(QString strId); 70 /** Notifies about machine with @a strId was @a fRegistered. */ 71 void sigMachineRegistered(QString strId, bool fRegistered); 72 /** Notifies about @a state change event for the session of the machine with @a strId. */ 73 void sigSessionStateChange(QString strId, KSessionState state); 74 /** Notifies about snapshot with @a strSnapshotId was taken for the machine with @a strId. */ 75 void sigSnapshotTake(QString strId, QString strSnapshotId); 76 /** Notifies about snapshot with @a strSnapshotId was deleted for the machine with @a strId. */ 77 void sigSnapshotDelete(QString strId, QString strSnapshotId); 78 /** Notifies about snapshot with @a strSnapshotId was changed for the machine with @a strId. */ 79 void sigSnapshotChange(QString strId, QString strSnapshotId); 80 /** Notifies about snapshot with @a strSnapshotId was restored for the machine with @a strId. */ 81 void sigSnapshotRestore(QString strId, QString strSnapshotId); 72 /** @name VirtualBox related signals 73 * @{ */ 74 /** Notifies about @a state change event for the machine with @a strId. */ 75 void sigMachineStateChange(QString strId, KMachineState state); 76 /** Notifies about data change event for the machine with @a strId. */ 77 void sigMachineDataChange(QString strId); 78 /** Notifies about machine with @a strId was @a fRegistered. */ 79 void sigMachineRegistered(QString strId, bool fRegistered); 80 /** Notifies about @a state change event for the session of the machine with @a strId. */ 81 void sigSessionStateChange(QString strId, KSessionState state); 82 /** Notifies about snapshot with @a strSnapshotId was taken for the machine with @a strId. */ 83 void sigSnapshotTake(QString strId, QString strSnapshotId); 84 /** Notifies about snapshot with @a strSnapshotId was deleted for the machine with @a strId. */ 85 void sigSnapshotDelete(QString strId, QString strSnapshotId); 86 /** Notifies about snapshot with @a strSnapshotId was changed for the machine with @a strId. */ 87 void sigSnapshotChange(QString strId, QString strSnapshotId); 88 /** Notifies about snapshot with @a strSnapshotId was restored for the machine with @a strId. */ 89 void sigSnapshotRestore(QString strId, QString strSnapshotId); 90 /** @} */ 82 91 83 /** Notifies about extra-data of the machine with @a strId can be changed for the key @a strKey to value @a strValue. */ 84 void sigExtraDataCanChange(QString strId, QString strKey, QString strValue, bool &fVeto, QString &strVetoReason); /* use Qt::DirectConnection */ 85 /** Notifies about extra-data of the machine with @a strId changed for the key @a strKey to value @a strValue. */ 86 void sigExtraDataChange(QString strId, QString strKey, QString strValue); 92 /** @name VirtualBox Extra-data related signals 93 * @{ */ 94 /** Notifies about extra-data of the machine with @a strId can be changed for the key @a strKey to value @a strValue. */ 95 void sigExtraDataCanChange(QString strId, QString strKey, QString strValue, bool &fVeto, QString &strVetoReason); /* use Qt::DirectConnection */ 96 /** Notifies about extra-data of the machine with @a strId changed for the key @a strKey to value @a strValue. */ 97 void sigExtraDataChange(QString strId, QString strKey, QString strValue); 98 /** @} */ 87 99 88 /** Notifies about mouse pointer become @a fVisible and his shape changed to @a fAlpha, @a hotCorner, @a size and @a shape. */ 89 void sigMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape); 90 /** Notifies about mouse capability change to @a fSupportsAbsolute, @a fSupportsRelative, @a fSupportsMultiTouch and @a fNeedsHostCursor. */ 91 void sigMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fSupportsMultiTouch, bool fNeedsHostCursor); 92 /** Notifies about guest request to change the cursor position to @a uX * @a uY. 93 * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */ 94 void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY); 95 /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */ 96 void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock); 97 /** Notifies about machine @a state change. */ 98 void sigStateChange(KMachineState state); 99 /** Notifies about guest additions state change. */ 100 void sigAdditionsChange(); 101 /** Notifies about network @a adapter state change. */ 102 void sigNetworkAdapterChange(CNetworkAdapter adapter); 103 /** Notifies about storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */ 104 void sigStorageDeviceChange(CMediumAttachment attachment, bool fRemoved, bool fSilent); 105 /** Notifies about storage medium @a attachment state change. */ 106 void sigMediumChange(CMediumAttachment attachment); 107 /** Notifies about VRDE device state change. */ 108 void sigVRDEChange(); 109 /** Notifies about Video Capture device state change. */ 110 void sigVideoCaptureChange(); 111 /** Notifies about USB controller state change. */ 112 void sigUSBControllerChange(); 113 /** Notifies about USB @a device state change to @a fAttached, holding additional @a error information. */ 114 void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error); 115 /** Notifies about shared folder state change. */ 116 void sigSharedFolderChange(); 117 /** Notifies about CPU execution-cap change. */ 118 void sigCPUExecutionCapChange(); 119 /** Notifies about guest-screen configuration change of @a type for @a uScreenId with @a screenGeo. */ 120 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 121 /** Notifies about Runtime error with @a strErrorId which is @a fFatal and have @a strMessage. */ 122 void sigRuntimeError(bool fFatal, QString strErrorId, QString strMessage); 123 /** Notifies about VM window can be shown, allowing to prevent it by @a fVeto with @a strReason. */ 124 void sigCanShowWindow(bool &fVeto, QString &strReason); /* use Qt::DirectConnection */ 125 /** Notifies about VM window with specified @a winId should be shown. */ 126 void sigShowWindow(qint64 &winId); /* use Qt::DirectConnection */ 127 /** Notifies about audio adapter state change. */ 128 void sigAudioAdapterChange(); 100 /** @name Console related signals 101 * @{ */ 102 /** Notifies about mouse pointer become @a fVisible and his shape changed to @a fAlpha, @a hotCorner, @a size and @a shape. */ 103 void sigMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape); 104 /** Notifies about mouse capability change to @a fSupportsAbsolute, @a fSupportsRelative, @a fSupportsMultiTouch and @a fNeedsHostCursor. */ 105 void sigMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fSupportsMultiTouch, bool fNeedsHostCursor); 106 /** Notifies about guest request to change the cursor position to @a uX * @a uY. 107 * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */ 108 void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY); 109 /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */ 110 void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock); 111 /** Notifies about machine @a state change. */ 112 void sigStateChange(KMachineState state); 113 /** Notifies about guest additions state change. */ 114 void sigAdditionsChange(); 115 /** Notifies about network @a adapter state change. */ 116 void sigNetworkAdapterChange(CNetworkAdapter comAdapter); 117 /** Notifies about storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */ 118 void sigStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent); 119 /** Notifies about storage medium @a attachment state change. */ 120 void sigMediumChange(CMediumAttachment comAttachment); 121 /** Notifies about VRDE device state change. */ 122 void sigVRDEChange(); 123 /** Notifies about Video Capture device state change. */ 124 void sigVideoCaptureChange(); 125 /** Notifies about USB controller state change. */ 126 void sigUSBControllerChange(); 127 /** Notifies about USB @a device state change to @a fAttached, holding additional @a error information. */ 128 void sigUSBDeviceStateChange(CUSBDevice comDevice, bool fAttached, CVirtualBoxErrorInfo comError); 129 /** Notifies about shared folder state change. */ 130 void sigSharedFolderChange(); 131 /** Notifies about CPU execution-cap change. */ 132 void sigCPUExecutionCapChange(); 133 /** Notifies about guest-screen configuration change of @a type for @a uScreenId with @a screenGeo. */ 134 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 135 /** Notifies about Runtime error with @a strErrorId which is @a fFatal and have @a strMessage. */ 136 void sigRuntimeError(bool fFatal, QString strErrorId, QString strMessage); 137 /** Notifies about VM window can be shown, allowing to prevent it by @a fVeto with @a strReason. */ 138 void sigCanShowWindow(bool &fVeto, QString &strReason); /* use Qt::DirectConnection */ 139 /** Notifies about VM window with specified @a winId should be shown. */ 140 void sigShowWindow(qint64 &winId); /* use Qt::DirectConnection */ 141 /** Notifies about audio adapter state change. */ 142 void sigAudioAdapterChange(); 143 /** @} */ 129 144 130 /** Notifies about @a iPercent change for progress with @a strProgressId. */ 131 void sigProgressPercentageChange(QString strProgressId, int iPercent); 132 /** Notifies about task complete for progress with @a strProgressId. */ 133 void sigProgressTaskComplete(QString strProgressId); 145 /** @name Progress related signals 146 * @{ */ 147 /** Notifies about @a iPercent change for progress with @a strProgressId. */ 148 void sigProgressPercentageChange(QString strProgressId, int iPercent); 149 /** Notifies about task complete for progress with @a strProgressId. */ 150 void sigProgressTaskComplete(QString strProgressId); 151 /** @} */ 134 152 135 153 /** @name Guest Session related signals 136 154 * @{ */ 137 155 /** Notifies about guest session (un)registered event @a is the (un)registed guest session. */ 138 void sigGuestSessionRegistered(CGuestSession guestSession);139 void sigGuestSessionUnregistered(CGuestSession guestSession);156 void sigGuestSessionRegistered(CGuestSession comGuestSession); 157 void sigGuestSessionUnregistered(CGuestSession comGuestSession); 140 158 141 159 /** Notifies about guest process (un)registered event @a is the (un)registed guest process. */ 142 void sigGuestProcessRegistered(CGuestProcess guestProcess);143 void sigGuestProcessUnregistered(CGuestProcess guestProcess);144 void sigGuestSessionStatedChanged(const CGuestSessionStateChangedEvent &c Event);145 void sigGuestProcessStateChanged(const CGuestProcessStateChangedEvent &c Event);160 void sigGuestProcessRegistered(CGuestProcess comGuestProcess); 161 void sigGuestProcessUnregistered(CGuestProcess comGuestProcess); 162 void sigGuestSessionStatedChanged(const CGuestSessionStateChangedEvent &comEvent); 163 void sigGuestProcessStateChanged(const CGuestProcessStateChangedEvent &comEvent); 146 164 /** @} */ 147 165 … … 157 175 158 176 /** Registers event @a source for passive event @a listener. */ 159 void registerSource(const CEventSource & source, const CEventListener &listener);177 void registerSource(const CEventSource &comSource, const CEventListener &comListener); 160 178 /** Unregisters event sources. */ 161 179 void unregisterSources(); … … 168 186 }; 169 187 170 /* Wrapthe IListener interface around our implementation class. */188 /** Wraps the IListener interface around our implementation class. */ 171 189 typedef ListenerImpl<UIMainEventListener, QObject*> UIMainEventListenerImpl; 172 190 173 191 #endif /* !___UIMainEventListener_h___ */ 192
Note:
See TracChangeset
for help on using the changeset viewer.