codhandler/coddownload/src/CodDownload.cpp
changeset 0 dd21522fd290
child 36 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 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:  Implementation of class CCodDownload.   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "CodDownload.h"
       
    22 #include "CodDownloadImpl.h"
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 // ---------------------------------------------------------
       
    27 // CCodDownload::NewL()
       
    28 // ---------------------------------------------------------
       
    29 //
       
    30 EXPORT_C CCodDownload* CCodDownload::NewL
       
    31         (
       
    32         const TDesC8& aBuf,
       
    33         const TDesC8& aType,
       
    34         MCodDownloadObserver& aObserver,
       
    35         CEikonEnv* aEikEnv
       
    36         )
       
    37     {
       
    38     CCodDownload* download = new (ELeave) CCodDownload();
       
    39     CleanupStack::PushL( download );
       
    40     download->iImpl = CCodDownloadImpl::NewL
       
    41         ( *download, aBuf, aType, aObserver, aEikEnv, NULL, NULL );
       
    42     CleanupStack::Pop( download );
       
    43     return download;
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // CCodDownload::NewL()
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 EXPORT_C CCodDownload* CCodDownload::NewL
       
    51         (
       
    52         const TInt aDownloadId,
       
    53         const TUid aDlUid,
       
    54         const TDesC8& aType,
       
    55         MCodDownloadObserver& aObserver,
       
    56         CEikonEnv* aEikEnv )
       
    57     {
       
    58     CCodDownload* download = new (ELeave) CCodDownload();
       
    59     CleanupStack::PushL( download );
       
    60     download->iImpl = CCodDownloadImpl::NewL
       
    61         ( *download, aDownloadId, aDlUid ,aType, aObserver, aEikEnv, NULL, NULL );
       
    62     CleanupStack::Pop( download );
       
    63     return download;
       
    64     }
       
    65 // ---------------------------------------------------------
       
    66 // CCodDownload::NewL()
       
    67 // ---------------------------------------------------------
       
    68 //
       
    69 EXPORT_C CCodDownload* CCodDownload::NewL
       
    70         (
       
    71         const TDesC8& aBuf,
       
    72         const TDesC8& aType,
       
    73         MCodDownloadObserver& aObserver,
       
    74         CEikonEnv* aEikEnv,
       
    75         const TDesC8* aMultipartBoundary,
       
    76         const TDesC16* aMultipartUrl
       
    77         )
       
    78     {
       
    79     CCodDownload* download = new (ELeave) CCodDownload();
       
    80     CleanupStack::PushL( download );
       
    81     download->iImpl = CCodDownloadImpl::NewL( *download, aBuf, aType,
       
    82         aObserver, aEikEnv, aMultipartBoundary, aMultipartUrl );
       
    83     CleanupStack::Pop( download );
       
    84     return download;
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------
       
    88 // CCodDownload::~CCodDownload()
       
    89 // ---------------------------------------------------------
       
    90 //
       
    91 EXPORT_C CCodDownload::~CCodDownload()
       
    92     {
       
    93     delete iImpl;
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------
       
    97 // CCodDownload::StartL()
       
    98 // ---------------------------------------------------------
       
    99 //
       
   100 EXPORT_C void CCodDownload::StartL( const CAiwGenericParamList* aParams )
       
   101     {
       
   102     iImpl->StartL( aParams );
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------
       
   106 // CCodDownload::Stop()
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 EXPORT_C void CCodDownload::Stop()
       
   110     {
       
   111     iImpl->Stop();
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------
       
   115 // CCodDownload::Progress()
       
   116 // ---------------------------------------------------------
       
   117 //
       
   118 EXPORT_C const TCodDownloadProgress& CCodDownload::Progress() const
       
   119     {
       
   120     return iImpl->Progress();
       
   121     }
       
   122 
       
   123 // ---------------------------------------------------------
       
   124 // CCodDownload::Name()
       
   125 // ---------------------------------------------------------
       
   126 //
       
   127 EXPORT_C TPtrC CCodDownload::Name()
       
   128     {
       
   129     return iImpl->Name();
       
   130     }
       
   131 
       
   132 // ---------------------------------------------------------
       
   133 // CCodDownload::Type()
       
   134 // ---------------------------------------------------------
       
   135 //
       
   136 EXPORT_C TPtrC8 CCodDownload::Type() const
       
   137     {
       
   138     return iImpl->Type();
       
   139     }
       
   140 
       
   141 // ---------------------------------------------------------
       
   142 // CCodDownload::GetPath()
       
   143 // ---------------------------------------------------------
       
   144 //
       
   145 EXPORT_C TPtrC CCodDownload::GetPath() const
       
   146     {
       
   147     return iImpl->GetPath();
       
   148     }
       
   149     
       
   150 // ---------------------------------------------------------
       
   151 // CCodDownload::GetDestFilePath()
       
   152 // ---------------------------------------------------------
       
   153 //
       
   154 EXPORT_C TPtrC CCodDownload::GetDestFilePath (TInt aMOIndex ) const
       
   155     {
       
   156     return iImpl->GetDestFilePath(aMOIndex);
       
   157     }    
       
   158 
       
   159 // ---------------------------------------------------------
       
   160 // CCodDownload::ServiceFlowL()
       
   161 // ---------------------------------------------------------
       
   162 //
       
   163 EXPORT_C void CCodDownload::ServiceFlowL()
       
   164     {
       
   165     iImpl->ServiceFlowL();
       
   166     }
       
   167 
       
   168 // ---------------------------------------------------------
       
   169 // CCodDownload::NextUrlL()
       
   170 // ---------------------------------------------------------
       
   171 //
       
   172 EXPORT_C HBufC8* CCodDownload::NextUrlL() const
       
   173     {
       
   174     return iImpl->NextUrlL();
       
   175     }
       
   176 
       
   177 // ---------------------------------------------------------
       
   178 // CCodDownload::GetPostResponseUrlL()
       
   179 // ---------------------------------------------------------
       
   180 //
       
   181 EXPORT_C HBufC8* CCodDownload::GetPostResponseUrlL() const
       
   182     {
       
   183     return iImpl->GetPostResponseUrlL();
       
   184     }
       
   185     
       
   186 
       
   187 // ---------------------------------------------------------
       
   188 // CCodDownload::RemovableMedia()
       
   189 // ---------------------------------------------------------
       
   190 //
       
   191 EXPORT_C TBool CCodDownload::RemovableMedia() const
       
   192     {
       
   193     return iImpl->RemovableMedia();
       
   194     }
       
   195 
       
   196 // ---------------------------------------------------------
       
   197 // CCodDownload::UserData()
       
   198 // ---------------------------------------------------------
       
   199 //
       
   200 EXPORT_C TAny* CCodDownload::UserData() const
       
   201     {
       
   202     return iImpl->UserData();
       
   203     }
       
   204 
       
   205 // ---------------------------------------------------------
       
   206 // CCodDownload::SetUserData()
       
   207 // ---------------------------------------------------------
       
   208 //
       
   209 EXPORT_C void CCodDownload::SetUserData( TAny* aUserData )
       
   210     {
       
   211     iImpl->SetUserData( aUserData );
       
   212     }
       
   213 
       
   214 // ---------------------------------------------------------
       
   215 // CCodDownload::SetCodDlAttached()
       
   216 // ---------------------------------------------------------
       
   217 //
       
   218 EXPORT_C void CCodDownload::SetCodDlAttached(const TBool aValue)
       
   219     {
       
   220     iImpl->SetCodDlAttached(aValue);
       
   221     }
       
   222     
       
   223 // ---------------------------------------------------------
       
   224 // CCodDownload::UpdatedDDURI()
       
   225 // ---------------------------------------------------------
       
   226 //
       
   227 EXPORT_C HBufC8* CCodDownload::UpdatedDDUriL() const
       
   228     {
       
   229     return iImpl->UpdatedDDUriL();
       
   230     }
       
   231 
       
   232 // ---------------------------------------------------------
       
   233 // CCodDownload::UpdatedDownloadDataL()
       
   234 // ---------------------------------------------------------
       
   235 //
       
   236 EXPORT_C HBufC8* CCodDownload::UpdatedDownloadDataL() const
       
   237     {
       
   238     return iImpl->UpdatedDownloadDataL();
       
   239     }
       
   240     
       
   241 // ---------------------------------------------------------
       
   242 // CCodDownload::UpdatedTrackDataL()
       
   243 // ---------------------------------------------------------
       
   244 //
       
   245 EXPORT_C HBufC8* CCodDownload::UpdatedTrackDataL(TInt& aValue) const
       
   246     {
       
   247     return iImpl->UpdatedTrackDataL(aValue);
       
   248     }
       
   249 
       
   250 // ---------------------------------------------------------
       
   251 // CCodDownload::CCodDownload()
       
   252 // ---------------------------------------------------------
       
   253 //
       
   254 CCodDownload::CCodDownload()
       
   255     {
       
   256     }
       
   257 
       
   258 // ---------------------------------------------------------
       
   259 // CCodDownload::Pause()
       
   260 // ---------------------------------------------------------
       
   261 //    
       
   262 EXPORT_C void CCodDownload::Pause()
       
   263     {
       
   264     iImpl->Pause();
       
   265     }
       
   266 
       
   267 
       
   268 // ---------------------------------------------------------
       
   269 // CCodDownload::ActiveDownload()
       
   270 // ---------------------------------------------------------
       
   271 //        
       
   272 EXPORT_C TInt CCodDownload::ActiveDownload()
       
   273     {
       
   274     return iImpl->ActiveDownload();
       
   275     }