applicationmanagement/server/inc/AMDownloadStore.h
changeset 47 d316aecb87fd
equal deleted inserted replaced
46:b9b00b134b0d 47:d316aecb87fd
       
     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 "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: Implementation of applicationmanagement components
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef __CAMDOWNLOADSTORE_H__
       
    19 #define __CAMDOWNLOADSTORE_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <qobject.h>
       
    23 #include "AMDeploymentComponent.h"
       
    24 #include "appmgmtdownloadmgr.h"
       
    25 
       
    26 
       
    27 namespace NApplicationManagement
       
    28     {
       
    29 
       
    30     
       
    31     // FORWARD DECLARATIONS
       
    32     class CDeploymentComponent;
       
    33     class CAMDwnldQTWrap;
       
    34     
       
    35     
       
    36     class MDownloadMngrObserver
       
    37           {
       
    38     public:
       
    39           virtual void ComponentDownloadComplete(
       
    40                   class CDeploymentComponent *aComponent, TInt iapid,
       
    41                   HBufC8* aServerId) = 0;
       
    42           virtual TBool HasUidL(const TUid &aUid,
       
    43                   CDeploymentComponent *& aCompo,
       
    44                   CDeploymentComponent *aIgnored) = 0;
       
    45           };
       
    46     
       
    47     
       
    48 
       
    49     class CAMDownloadStore : public CActive
       
    50         {
       
    51 
       
    52     private:
       
    53         /**
       
    54          * C++ default constructor.
       
    55          */
       
    56         CAMDownloadStore(MDownloadMngrObserver& aObserver);
       
    57 
       
    58         /**
       
    59          * By default Symbian 2nd phase constructor is private.
       
    60          */
       
    61         void ConstructL();
       
    62 
       
    63     public:
       
    64         // Constructors and destructor
       
    65 
       
    66         /**
       
    67          * Two-phased constructor.
       
    68          */
       
    69         static CAMDownloadStore* NewL(MDownloadMngrObserver& aObserver);
       
    70         /**
       
    71          * Destructor.
       
    72          */
       
    73         virtual ~CAMDownloadStore();
       
    74 
       
    75     public:
       
    76 
       
    77         void AddDownloadL(CDeploymentComponent *aComponent);
       
    78         
       
    79         void RunL();
       
    80         
       
    81         void DoCancel();
       
    82 
       
    83         void StartDownload();
       
    84         
       
    85         TInt DownloadCount();
       
    86 
       
    87         RPointerArray<CAMDwnldQTWrap> iDwnldStore;
       
    88         MDownloadMngrObserver& iObserver;
       
    89 
       
    90         };
       
    91 
       
    92     class CAMDwnldQTWrap : public CBase, public MDownloadCallback, public MDownloadMgrQTCallback
       
    93         {
       
    94     private:
       
    95         /**
       
    96          * C++ default constructor.
       
    97          */
       
    98         CAMDwnldQTWrap(MDownloadMngrObserver& aObserver, CDeploymentComponent *aComponent);
       
    99 
       
   100         /**
       
   101          * By default Symbian 2nd phase constructor is private.
       
   102          */
       
   103         void ConstructL();
       
   104 
       
   105     public:
       
   106         // Constructors and destructor
       
   107 
       
   108         /**
       
   109          * Two-phased constructor.
       
   110          */
       
   111         static CAMDwnldQTWrap* NewL(MDownloadMngrObserver& aObserver, CDeploymentComponent *aComponent);
       
   112         /**
       
   113          * Destructor.
       
   114          */
       
   115         virtual ~CAMDwnldQTWrap();
       
   116         
       
   117     public:
       
   118         void StartDownload(CDeploymentComponent *aComponent, TRequestStatus& aStatus);
       
   119         
       
   120         TInt getPendingDownloads();
       
   121 
       
   122 
       
   123     public:
       
   124         void DownloadCompleteL(CDeploymentComponent *aComponent);
       
   125 	  void DownloadCompleted();
       
   126 	  void DownloadFailed(TInt aDownloaderr);
       
   127 	  void SetStatus(TInt aStatus);
       
   128         
       
   129         
       
   130     public:
       
   131         void DownloadComplete(class CDeploymentComponent *aComponent,
       
   132                 TInt aStatus);
       
   133         TBool UidExistsL(const TUid &aUid, CDeploymentComponent *& aCompo,
       
   134                 CDeploymentComponent *aIgnored);
       
   135         
       
   136     public:
       
   137         appmgmtdownloadmgr* appdwnld;
       
   138         MDownloadMngrObserver& iObserver;
       
   139         CDeploymentComponent *iComponent;
       
   140         HBufC8* serverid;
       
   141 	  TInt iap;
       
   142         };
       
   143 
       
   144     }
       
   145 
       
   146 #endif