VirtualBox

Changeset 71454 in vbox


Ignore:
Timestamp:
Mar 22, 2018 1:21:57 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9049: Full cleanup for UIMainEventListener.

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  
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121
    2222/* Qt includes: */
     23# include <QMutex>
    2324# include <QThread>
    24 # include <QMutex>
    2525
    2626/* GUI includes: */
     27# include "VBoxGlobal.h"
    2728# include "UIMainEventListener.h"
    28 # include "VBoxGlobal.h"
    2929
    3030/* COM includes: */
     
    4040# include "CGuestProcessIOEvent.h"
    4141# include "CGuestProcessRegisteredEvent.h"
     42# include "CGuestProcessStateChangedEvent.h"
    4243# include "CGuestSessionRegisteredEvent.h"
    43 # include "CGuestProcessStateChangedEvent.h"
    4444# include "CGuestSessionStateChangedEvent.h"
    4545# include "CKeyboardLedsChangedEvent.h"
     46# include "CMachineDataChangedEvent.h"
    4647# include "CMachineStateChangedEvent.h"
    47 # include "CMachineDataChangedEvent.h"
    4848# include "CMachineRegisteredEvent.h"
     49# include "CMediumChangedEvent.h"
     50# include "CMouseCapabilityChangedEvent.h"
    4951# include "CMousePointerShapeChangedEvent.h"
    50 # include "CMouseCapabilityChangedEvent.h"
    51 # include "CMediumChangedEvent.h"
    5252# include "CNetworkAdapterChangedEvent.h"
    5353# include "CProgressPercentageChangedEvent.h"
     
    5656# include "CSessionStateChangedEvent.h"
    5757# include "CShowWindowEvent.h"
     58# include "CSnapshotChangedEvent.h"
     59# include "CSnapshotDeletedEvent.h"
     60# include "CSnapshotRestoredEvent.h"
    5861# include "CSnapshotTakenEvent.h"
    59 # include "CSnapshotDeletedEvent.h"
    60 # include "CSnapshotChangedEvent.h"
    61 # include "CSnapshotRestoredEvent.h"
    6262# include "CStateChangedEvent.h"
    6363# include "CStorageDeviceChangedEvent.h"
     
    7878public:
    7979
    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);
    8282    /** Destructs Main events listener thread. */
    8383    ~UIMainEventListeningThread();
     
    9696
    9797    /** Holds the Main event source reference. */
    98     CEventSource m_source;
     98    CEventSource m_comSource;
    9999    /** Holds the Main event listener reference. */
    100     CEventListener m_listener;
     100    CEventListener m_comListener;
    101101
    102102    /** Holds the mutex instance which protects thread access. */
     
    111111*********************************************************************************************************************************/
    112112
    113 UIMainEventListeningThread::UIMainEventListeningThread(const CEventSource &source, const CEventListener &listener)
    114     : m_source(source)
    115     , m_listener(listener)
     113UIMainEventListeningThread::UIMainEventListeningThread(const CEventSource &comSource, const CEventListener &comListener)
     114    : m_comSource(comSource)
     115    , m_comListener(comListener)
    116116    , m_fShutdown(false)
    117117{
     
    133133
    134134    /* Copy source wrapper to this thread: */
    135     CEventSource source = m_source;
     135    CEventSource comSource = m_comSource;
    136136    /* Copy listener wrapper to this thread: */
    137     CEventListener listener = m_listener;
     137    CEventListener comListener = m_comListener;
    138138
    139139    /* While we are not in shutdown: */
     
    141141    {
    142142        /* 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())
    145145        {
    146146            /* 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);
    150150        }
    151151    }
     
    189189}
    190190
    191 void UIMainEventListener::registerSource(const CEventSource &source, const CEventListener &listener)
     191void UIMainEventListener::registerSource(const CEventSource &comSource, const CEventListener &comListener)
    192192{
    193193    /* Make sure source and listener are valid: */
    194     AssertReturnVoid(!source.isNull());
    195     AssertReturnVoid(!listener.isNull());
     194    AssertReturnVoid(!comSource.isNull());
     195    AssertReturnVoid(!comListener.isNull());
    196196
    197197    /* Create thread for passed source: */
    198     m_threads << new UIMainEventListeningThread(source, listener);
     198    m_threads << new UIMainEventListeningThread(comSource, comListener);
    199199    /* And start it: */
    200200    m_threads.last()->start();
     
    207207}
    208208
    209 STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T /* type */, IEvent *pEvent)
     209STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T, IEvent *pEvent)
    210210{
    211211    /* Try to acquire COM cleanup protection token first: */
     
    213213        return S_OK;
    214214
    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())
    218218    {
    219219        case KVBoxEventType_OnVBoxSVCAvailabilityChanged:
    220220        {
    221             CVBoxSVCAvailabilityChangedEvent es(pEvent);
    222             emit sigVBoxSVCAvailabilityChange(es.GetAvailable());
     221            CVBoxSVCAvailabilityChangedEvent comEventSpecific(pEvent);
     222            emit sigVBoxSVCAvailabilityChange(comEventSpecific.GetAvailable());
    223223            break;
    224224        }
     
    226226        case KVBoxEventType_OnMachineStateChanged:
    227227        {
    228             CMachineStateChangedEvent es(pEvent);
    229             emit sigMachineStateChange(es.GetMachineId(), es.GetState());
     228            CMachineStateChangedEvent comEventSpecific(pEvent);
     229            emit sigMachineStateChange(comEventSpecific.GetMachineId(), comEventSpecific.GetState());
    230230            break;
    231231        }
    232232        case KVBoxEventType_OnMachineDataChanged:
    233233        {
    234             CMachineDataChangedEvent es(pEvent);
    235             emit sigMachineDataChange(es.GetMachineId());
     234            CMachineDataChangedEvent comEventSpecific(pEvent);
     235            emit sigMachineDataChange(comEventSpecific.GetMachineId());
    236236            break;
    237237        }
    238238        case KVBoxEventType_OnMachineRegistered:
    239239        {
    240             CMachineRegisteredEvent es(pEvent);
    241             emit sigMachineRegistered(es.GetMachineId(), es.GetRegistered());
     240            CMachineRegisteredEvent comEventSpecific(pEvent);
     241            emit sigMachineRegistered(comEventSpecific.GetMachineId(), comEventSpecific.GetRegistered());
    242242            break;
    243243        }
    244244        case KVBoxEventType_OnSessionStateChanged:
    245245        {
    246             CSessionStateChangedEvent es(pEvent);
    247             emit sigSessionStateChange(es.GetMachineId(), es.GetState());
     246            CSessionStateChangedEvent comEventSpecific(pEvent);
     247            emit sigSessionStateChange(comEventSpecific.GetMachineId(), comEventSpecific.GetState());
    248248            break;
    249249        }
    250250        case KVBoxEventType_OnSnapshotTaken:
    251251        {
    252             CSnapshotTakenEvent es(pEvent);
    253             emit sigSnapshotTake(es.GetMachineId(), es.GetSnapshotId());
     252            CSnapshotTakenEvent comEventSpecific(pEvent);
     253            emit sigSnapshotTake(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId());
    254254            break;
    255255        }
    256256        case KVBoxEventType_OnSnapshotDeleted:
    257257        {
    258             CSnapshotDeletedEvent es(pEvent);
    259             emit sigSnapshotDelete(es.GetMachineId(), es.GetSnapshotId());
     258            CSnapshotDeletedEvent comEventSpecific(pEvent);
     259            emit sigSnapshotDelete(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId());
    260260            break;
    261261        }
    262262        case KVBoxEventType_OnSnapshotChanged:
    263263        {
    264             CSnapshotChangedEvent es(pEvent);
    265             emit sigSnapshotChange(es.GetMachineId(), es.GetSnapshotId());
     264            CSnapshotChangedEvent comEventSpecific(pEvent);
     265            emit sigSnapshotChange(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId());
    266266            break;
    267267        }
    268268        case KVBoxEventType_OnSnapshotRestored:
    269269        {
    270             CSnapshotRestoredEvent es(pEvent);
    271             emit sigSnapshotRestore(es.GetMachineId(), es.GetSnapshotId());
     270            CSnapshotRestoredEvent comEventSpecific(pEvent);
     271            emit sigSnapshotRestore(comEventSpecific.GetMachineId(), comEventSpecific.GetSnapshotId());
    272272            break;
    273273        }
     
    277277        case KVBoxEventType_OnExtraDataCanChange:
    278278        {
    279             CExtraDataCanChangeEvent es(pEvent);
     279            CExtraDataCanChangeEvent comEventSpecific(pEvent);
    280280            /* Has to be done in place to give an answer: */
    281281            bool fVeto = false;
    282282            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);
    284285            if (fVeto)
    285                 es.AddVeto(strReason);
     286                comEventSpecific.AddVeto(strReason);
    286287            break;
    287288        }
    288289        case KVBoxEventType_OnExtraDataChanged:
    289290        {
    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());
    292293            break;
    293294        }
     
    295296        case KVBoxEventType_OnMousePointerShapeChanged:
    296297        {
    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());
    299303            break;
    300304        }
    301305        case KVBoxEventType_OnMouseCapabilityChanged:
    302306        {
    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());
    305310            break;
    306311        }
    307312        case KVBoxEventType_OnCursorPositionChanged:
    308313        {
    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());
    311317            break;
    312318        }
    313319        case KVBoxEventType_OnKeyboardLedsChanged:
    314320        {
    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());
    317325            break;
    318326        }
    319327        case KVBoxEventType_OnStateChanged:
    320328        {
    321             CStateChangedEvent es(pEvent);
    322             emit sigStateChange(es.GetState());
     329            CStateChangedEvent comEventSpecific(pEvent);
     330            emit sigStateChange(comEventSpecific.GetState());
    323331            break;
    324332        }
     
    330338        case KVBoxEventType_OnNetworkAdapterChanged:
    331339        {
    332             CNetworkAdapterChangedEvent es(pEvent);
    333             emit sigNetworkAdapterChange(es.GetNetworkAdapter());
     340            CNetworkAdapterChangedEvent comEventSpecific(pEvent);
     341            emit sigNetworkAdapterChange(comEventSpecific.GetNetworkAdapter());
    334342            break;
    335343        }
    336344        case KVBoxEventType_OnStorageDeviceChanged:
    337345        {
    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());
    340350            break;
    341351        }
    342352        case KVBoxEventType_OnMediumChanged:
    343353        {
    344             CMediumChangedEvent es(pEvent);
    345             emit sigMediumChange(es.GetMediumAttachment());
     354            CMediumChangedEvent comEventSpecific(pEvent);
     355            emit sigMediumChange(comEventSpecific.GetMediumAttachment());
    346356            break;
    347357        }
     
    364374        case KVBoxEventType_OnUSBDeviceStateChanged:
    365375        {
    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());
    368380            break;
    369381        }
     
    380392        case KVBoxEventType_OnGuestMonitorChanged:
    381393        {
    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()));
    385398            break;
    386399        }
    387400        case KVBoxEventType_OnRuntimeError:
    388401        {
    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());
    391404            break;
    392405        }
    393406        case KVBoxEventType_OnCanShowWindow:
    394407        {
    395             CCanShowWindowEvent es(pEvent);
     408            CCanShowWindowEvent comEventSpecific(pEvent);
    396409            /* Has to be done in place to give an answer: */
    397410            bool fVeto = false;
     
    399412            emit sigCanShowWindow(fVeto, strReason);
    400413            if (fVeto)
    401                 es.AddVeto(strReason);
     414                comEventSpecific.AddVeto(strReason);
    402415            else
    403                 es.AddApproval(strReason);
     416                comEventSpecific.AddApproval(strReason);
    404417            break;
    405418        }
    406419        case KVBoxEventType_OnShowWindow:
    407420        {
    408             CShowWindowEvent es(pEvent);
     421            CShowWindowEvent comEventSpecific(pEvent);
    409422            /* Has to be done in place to give an answer: */
    410             qint64 winId = es.GetWinId();
     423            qint64 winId = comEventSpecific.GetWinId();
    411424            if (winId != 0)
    412425                break; /* Already set by some listener. */
    413426            emit sigShowWindow(winId);
    414             es.SetWinId(winId);
     427            comEventSpecific.SetWinId(winId);
    415428            break;
    416429        }
     
    422435        case KVBoxEventType_OnProgressPercentageChanged:
    423436        {
    424             CProgressPercentageChangedEvent es(pEvent);
    425             emit sigProgressPercentageChange(es.GetProgressId(), (int)es.GetPercent());
     437            CProgressPercentageChangedEvent comEventSpecific(pEvent);
     438            emit sigProgressPercentageChange(comEventSpecific.GetProgressId(), (int)comEventSpecific.GetPercent());
    426439            break;
    427440        }
    428441        case KVBoxEventType_OnProgressTaskCompleted:
    429442        {
    430             CProgressTaskCompletedEvent es(pEvent);
    431             emit sigProgressTaskComplete(es.GetProgressId());
     443            CProgressTaskCompletedEvent comEventSpecific(pEvent);
     444            emit sigProgressTaskComplete(comEventSpecific.GetProgressId());
    432445            break;
    433446        }
     
    435448        {
    436449
    437             CGuestSessionRegisteredEvent cEvent(pEvent);
    438             if(cEvent.GetRegistered())
    439                 emit sigGuestSessionRegistered(cEvent.GetSession());
     450            CGuestSessionRegisteredEvent comEventSpecific(pEvent);
     451            if (comEventSpecific.GetRegistered())
     452                emit sigGuestSessionRegistered(comEventSpecific.GetSession());
    440453            else
    441                 emit sigGuestSessionUnregistered(cEvent.GetSession());
     454                emit sigGuestSessionUnregistered(comEventSpecific.GetSession());
    442455            break;
    443456        }
    444457        case KVBoxEventType_OnGuestProcessRegistered:
    445458        {
    446             CGuestProcessRegisteredEvent cEvent(pEvent);
    447             if(cEvent.GetRegistered())
    448                 emit sigGuestProcessRegistered(cEvent.GetProcess());
     459            CGuestProcessRegisteredEvent comEventSpecific(pEvent);
     460            if (comEventSpecific.GetRegistered())
     461                emit sigGuestProcessRegistered(comEventSpecific.GetProcess());
    449462            else
    450                 emit sigGuestProcessUnregistered(cEvent.GetProcess());
     463                emit sigGuestProcessUnregistered(comEventSpecific.GetProcess());
    451464            break;
    452465        }
    453466        case KVBoxEventType_OnGuestSessionStateChanged:
    454467        {
    455             CGuestSessionStateChangedEvent cEvent(pEvent);
    456             emit sigGuestSessionStatedChanged(cEvent);
     468            CGuestSessionStateChangedEvent comEventSpecific(pEvent);
     469            emit sigGuestSessionStatedChanged(comEventSpecific);
    457470            break;
    458471        }
     
    464477        case KVBoxEventType_OnGuestProcessStateChanged:
    465478        {
    466             CGuestProcessStateChangedEvent cEvent(pEvent);
    467             cEvent.GetError();
    468             emit sigGuestProcessStateChanged(cEvent);
     479            CGuestProcessStateChangedEvent comEventSpecific(pEvent);
     480            comEventSpecific.GetError();
     481            emit sigGuestProcessStateChanged(comEventSpecific);
    469482            break;
    470483        }
     
    489502
    490503#include "UIMainEventListener.moc"
     504
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r71089 r71454  
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020
    2121/* Qt includes: */
     22#include <QList>
    2223#include <QObject>
    23 #include <QList>
    2424
    2525/* COM includes: */
     
    3636
    3737/* Forward declarations: */
     38class QPoint;
     39class QSize;
     40class QString;
    3841class UIMainEventListeningThread;
    3942class CEventListener;
     
    5558
    5659/** Main event listener. */
    57 class UIMainEventListener: public QObject
     60class UIMainEventListener : public QObject
    5861{
    5962    Q_OBJECT;
     
    6164signals:
    6265
    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    /** @} */
    6571
    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    /** @} */
    8291
    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    /** @} */
    8799
    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    /** @} */
    129144
    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    /** @} */
    134152
    135153    /** @name Guest Session related signals
    136154      * @{ */
    137155        /** 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);
    140158
    141159        /** 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 &cEvent);
    145         void sigGuestProcessStateChanged(const CGuestProcessStateChangedEvent &cEvent);
     160        void sigGuestProcessRegistered(CGuestProcess comGuestProcess);
     161        void sigGuestProcessUnregistered(CGuestProcess comGuestProcess);
     162        void sigGuestSessionStatedChanged(const CGuestSessionStateChangedEvent &comEvent);
     163        void sigGuestProcessStateChanged(const CGuestProcessStateChangedEvent &comEvent);
    146164    /** @} */
    147165
     
    157175
    158176    /** 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);
    160178    /** Unregisters event sources. */
    161179    void unregisterSources();
     
    168186};
    169187
    170 /* Wrap the IListener interface around our implementation class. */
     188/** Wraps the IListener interface around our implementation class. */
    171189typedef ListenerImpl<UIMainEventListener, QObject*> UIMainEventListenerImpl;
    172190
    173191#endif /* !___UIMainEventListener_h___ */
     192
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette