VirtualBox

Changeset 42566 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Aug 3, 2012 8:57:23 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79743
Message:

Guest Control 2.0: Update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r42551 r42566  
    3131
    3232/**
    33  * TODO
     33 * Abstract base class for a lenghtly per-session operation which
     34 * runs in a Main worker thread.
     35 */
     36class GuestSessionTask
     37{
     38public:
     39
     40    GuestSessionTask(GuestSession *pSession, Progress *pProgress);
     41
     42    virtual ~GuestSessionTask(void);
     43
     44public:
     45
     46    virtual int Run(void) = 0;
     47    virtual int RunAsync(const Utf8Str &strDesc) = 0;
     48
     49    int setProgress(unsigned uPercent);
     50    int setProgressSuccess(void);
     51    int setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg);
     52
     53protected:
     54
     55    Utf8Str                 mDesc;
     56    ComObjPtr<GuestSession> mSession;
     57    ComObjPtr<Progress>     mProgress;
     58};
     59
     60/**
     61 * Task for copying files from host to the guest.
     62 */
     63class SessionTaskCopyTo : public GuestSessionTask
     64{
     65public:
     66
     67    SessionTaskCopyTo(GuestSession *pSession, Progress *pProgress,
     68                      const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags);
     69
     70    virtual ~SessionTaskCopyTo(void);
     71
     72public:
     73
     74    int Run(void);
     75    int RunAsync(const Utf8Str &strDesc);
     76    static int taskThread(RTTHREAD Thread, void *pvUser);
     77
     78protected:
     79
     80    Utf8Str  mSource;
     81    Utf8Str  mDest;
     82    uint32_t mFlags;
     83};
     84
     85/**
     86 * Task for copying files from guest to the host.
     87 */
     88class SessionTaskCopyFrom : public GuestSessionTask
     89{
     90public:
     91
     92    SessionTaskCopyFrom(GuestSession *pSession, Progress *pProgress,
     93                        const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags);
     94
     95    virtual ~SessionTaskCopyFrom(void);
     96
     97public:
     98
     99    int Run(void);
     100    int RunAsync(const Utf8Str &strDesc);
     101    static int taskThread(RTTHREAD Thread, void *pvUser);
     102
     103protected:
     104
     105    Utf8Str  mSource;
     106    Utf8Str  mDest;
     107    uint32_t mFlags;
     108};
     109
     110/**
     111 * Guest session implementation.
    34112 */
    35113class ATL_NO_VTABLE GuestSession :
     
    72150     * @{ */
    73151    STDMETHOD(Close)(void);
    74     STDMETHOD(CopyFrom)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(ULONG, aFlags), IProgress **aProgress);
    75     STDMETHOD(CopyTo)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(ULONG, aFlags), IProgress **aProgress);
     152    STDMETHOD(CopyFrom)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress);
     153    STDMETHOD(CopyTo)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress);
    76154    STDMETHOD(DirectoryCreate)(IN_BSTR aPath, ULONG aMode, ComSafeArrayIn(DirectoryCreateFlag_T, aFlags), IGuestDirectory **aDirectory);
    77155    STDMETHOD(DirectoryCreateTemp)(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aName, IGuestDirectory **aDirectory);
     
    137215    inline bool             processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess);
    138216    inline int              processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess);
     217    int                     startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress);
    139218    int                     queryInfo(void);
    140219    /** @}  */
Note: See TracChangeset for help on using the changeset viewer.

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