browserutilities/downloadmgr/DownloadMgrClntSrv/inc/DownloadMgrEventQueue.h
changeset 0 dd21522fd290
child 25 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __DOWNLOADMGR_EVENTQUEUE_H__
       
    21 #define __DOWNLOADMGR_EVENTQUEUE_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <HttpDownloadMgrCommon.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CHttpDownload;
       
    29 class CEventRecord;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Record the download and its current states.
       
    35 *  internal component
       
    36 *
       
    37 *  @lib ?library
       
    38 *  @since Series ?XX ?SeriesXX_version
       
    39 */
       
    40 NONSHARABLE_CLASS( CEventRecord ) : public CBase
       
    41 	{
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * C++ default constructor.
       
    46         */
       
    47 	    CEventRecord( CHttpDownload* aDownload, 
       
    48                       TInt32 aDownloadState,
       
    49                       TInt32 aProgressState,
       
    50                       TInt32 aMoIndex );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55 	    ~CEventRecord();
       
    56 
       
    57     public: // New function
       
    58 
       
    59         /**
       
    60         * .
       
    61         * @param -
       
    62         * @return None.
       
    63         */
       
    64         void States( TInt32& aDownloadState,
       
    65                      TInt32& aProgressState,
       
    66                      TInt32& aMoIndex );
       
    67 
       
    68         /**
       
    69         * .
       
    70         * @param -
       
    71         * @return None.
       
    72         */
       
    73         CHttpDownload* Download();
       
    74 
       
    75         /**
       
    76         * .
       
    77         * @param -
       
    78         * @return None.
       
    79         */
       
    80         TBool IsDownload( CHttpDownload* aDownload );
       
    81 
       
    82     private:  // Data
       
    83         // download on the  event occured
       
    84 	    CHttpDownload* iDownload;  ///< NOT Owned.
       
    85         // download state
       
    86 	    TInt32         iDownloadState;
       
    87         // download progress state
       
    88         TInt32         iProgressState;
       
    89         // media object index
       
    90         TInt32		   iMoIndex;
       
    91 	};
       
    92 
       
    93 /**
       
    94 *  Queue the event sent by the download mgr engine.
       
    95 *  internal component
       
    96 *
       
    97 *  @lib ?library
       
    98 *  @since Series ?XX ?SeriesXX_version
       
    99 */
       
   100 NONSHARABLE_CLASS( CDownloadMgrEventQueue ) : public CBase
       
   101     {
       
   102     public: // Constructors and destructor
       
   103 
       
   104         /**
       
   105         * C++ default constructor.
       
   106         */
       
   107 	    CDownloadMgrEventQueue();
       
   108 
       
   109         /**
       
   110         * Destructor.
       
   111         */
       
   112 	    ~CDownloadMgrEventQueue();
       
   113 
       
   114     public: // New functions
       
   115 
       
   116         /**
       
   117         * Checks the emptiness of the queue.
       
   118         * @param -
       
   119         * @return TBool.
       
   120         */
       
   121 	    TBool IsEmpty() const;
       
   122 
       
   123         /**
       
   124         * Inserts an entry into the FIFO buffer.
       
   125         * @param -
       
   126         * @return TBool - returns ETrue in case of succes and EFalse otherwise (OOM).
       
   127         */ 
       
   128 	    TBool In(  CHttpDownload* aDownload, 
       
   129                    THttpDownloadState aDlState,
       
   130                    THttpProgressState aProgState,
       
   131                    TInt32 aMoIndex );
       
   132 
       
   133         /**
       
   134         * Returns the next entry from the FIFO buffer.
       
   135         * @param -
       
   136         * @return TBool.
       
   137         */
       
   138 	    CHttpDownload* Next( TInt32& aDownloadState,
       
   139                              TInt32& aProgressState,
       
   140                              TInt32& aMoIndex );
       
   141 
       
   142         /**
       
   143         * Removes the next entry from the queue.
       
   144         * @param -
       
   145         * @return None.
       
   146         */
       
   147 	    void Out();
       
   148 
       
   149        /**
       
   150         * Remove download element(s) from the queue referenced by the parameter.
       
   151         * @param aDownload
       
   152         * @return None.
       
   153         */
       
   154         void Remove( CHttpDownload* aDownload );
       
   155 
       
   156     private:   // Data
       
   157 
       
   158         RPointerArray<CEventRecord> iEventQueue; ///< Has.
       
   159     };
       
   160 
       
   161 #endif      // __DOWNLOADMGR_EVENTQUEUE_H__   
       
   162             
       
   163 // End of File