mmfenh/enhancedmediaclient/Plugins/DataSourceConfigIntfc/src/DataSourceConfigIntfcImpl.cpp
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  S60 Cache Data Source Plugin implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #include "DataSourceConfigIntfcImpl.h"
       
    19 
       
    20 _LIT(FileDirPath,"c:\\system\\temp\\");
       
    21 //const TUint KDefaultCacheSize = 17408;
       
    22 CDataSourceConfigIntfcImpl::CDataSourceConfigIntfcImpl()
       
    23     {
       
    24     }
       
    25 
       
    26 EXPORT_C CDataSourceConfigIntfcImpl* CDataSourceConfigIntfcImpl::NewL()
       
    27     {
       
    28     CDataSourceConfigIntfcImpl* self = new (ELeave) CDataSourceConfigIntfcImpl();
       
    29     CleanupStack::PushL(self);
       
    30     self->ConstructL();
       
    31     CleanupStack::Pop(self);
       
    32     return self;
       
    33     }
       
    34 
       
    35 
       
    36 CDataSourceConfigIntfcImpl::~CDataSourceConfigIntfcImpl(void)
       
    37     {
       
    38     delete iLocation;
       
    39     }
       
    40 
       
    41 void CDataSourceConfigIntfcImpl::ConstructL()
       
    42     {
       
    43     iCacheType = EBUFFER;
       
    44     iLocation = HBufC::NewL(FileDirPath().Size());
       
    45     TPtr des = iLocation->Des();
       
    46     des.Copy(FileDirPath());
       
    47     }
       
    48 
       
    49 // From CMultimediaDataSource begins
       
    50 TInt CDataSourceConfigIntfcImpl::SetCacheSize( TUint aSizeBytes )
       
    51     {
       
    52     TInt status(KErrNone);    
       
    53     iSizeBytes = aSizeBytes;
       
    54     return status;
       
    55     }
       
    56 
       
    57 TInt CDataSourceConfigIntfcImpl::GetCacheSize( TUint& aSizeBytes )
       
    58     {
       
    59     aSizeBytes = iSizeBytes;
       
    60     return KErrNone;
       
    61     }
       
    62 
       
    63 TInt CDataSourceConfigIntfcImpl::SetCacheType(TCacheType aCacheType)
       
    64     {
       
    65     TInt status(KErrNone);  
       
    66     iCacheType = aCacheType;  
       
    67     return status;
       
    68     }
       
    69 
       
    70 TInt CDataSourceConfigIntfcImpl::GetCacheType(TCacheType& aCacheType)
       
    71     {
       
    72     aCacheType = iCacheType;        
       
    73     return KErrNone;
       
    74     }
       
    75 
       
    76 TInt CDataSourceConfigIntfcImpl::SetCacheLocation(const TDesC& aLocation)
       
    77     {
       
    78     TInt status(KErrNone);  
       
    79     if(iLocation)
       
    80         {
       
    81         delete iLocation;
       
    82         iLocation = NULL;
       
    83         }
       
    84     iLocation = HBufC::NewL(aLocation.Length());
       
    85     TPtr des = iLocation->Des();
       
    86     des.Copy(aLocation);  
       
    87     return status;
       
    88     }
       
    89 
       
    90 TInt CDataSourceConfigIntfcImpl::GetCacheLocation(TDes& aLocation)
       
    91     {
       
    92     TInt status(KErrNone);
       
    93     aLocation.Copy(*iLocation);
       
    94     return status;
       
    95     }
       
    96 
       
    97 TInt CDataSourceConfigIntfcImpl::Reset()
       
    98     {
       
    99     return KErrNone;
       
   100     }
       
   101 // End of file