remotestoragefw/remotefileengine/src/rsfwremoteaccess.cpp
changeset 13 6b4fc789785b
parent 2 c32dc0be5eb4
equal deleted inserted replaced
2:c32dc0be5eb4 13:6b4fc789785b
     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:  Access Protocol plug-in loader
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "rsfwremoteaccess.h"
       
    21 #include <ecom.h>
       
    22 
       
    23 
       
    24 // ----------------------------------------------------------------------------
       
    25 // CRsfwRemoteAccess* CRsfwRemoteAccess::NewL
       
    26 // ----------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CRsfwRemoteAccess* CRsfwRemoteAccess::NewL(const TDesC8& aProtocol)
       
    29     {
       
    30     // Set up the interface find for the default resolver
       
    31     TBuf8<KMaxMatchStringSize> matchString;
       
    32     _LIT8(KRemoteMatchPrefix, "remoteaccess/");
       
    33     matchString.Copy(KRemoteMatchPrefix);
       
    34 
       
    35     // Both "http" and "https" are handled by davaccess module
       
    36     _LIT8(KHttps, "https"); 
       
    37     if (aProtocol.Compare(KHttps) == 0)
       
    38         {
       
    39         _LIT8(KHttp, "http");   
       
    40         matchString.Append(KHttp);
       
    41         }
       
    42     else
       
    43         {
       
    44         matchString.Append(aProtocol);
       
    45         }
       
    46     TEComResolverParams resolverParams;
       
    47     resolverParams.SetDataType(matchString);
       
    48     // Disable wildcard matching
       
    49     resolverParams.SetWildcardMatch(EFalse);
       
    50 
       
    51     return REINTERPRET_CAST(CRsfwRemoteAccess*,
       
    52         REComSession::CreateImplementationL(
       
    53             KCRemoteAccessUid,
       
    54             _FOFF(CRsfwRemoteAccess, iDtor_ID_Key),
       
    55             resolverParams));
       
    56     }
       
    57 
       
    58 // ----------------------------------------------------------------------------
       
    59 // CRsfwRemoteAccess::~CRsfwRemoteAccess
       
    60 // ----------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CRsfwRemoteAccess::~CRsfwRemoteAccess()
       
    63     {
       
    64     // Inform the framework that this specific 
       
    65     // instance of the interface has been destroyed.
       
    66     REComSession::DestroyedImplementation(iDtor_ID_Key);
       
    67     }
       
    68 
       
    69 // ----------------------------------------------------------------------------
       
    70 // CRsfwRemoteAccess:: GetQuotaAndSizeL
       
    71 // ----------------------------------------------------------------------------
       
    72 //    
       
    73 EXPORT_C TInt CRsfwRemoteAccess:: GetQuotaAndSizeL(TInt& aQuota, TInt& aSize)
       
    74     {
       
    75     aQuota = KMountReportedSize;
       
    76     aSize = KMountReportedFreeSize;
       
    77     return 0;
       
    78     }
       
    79 
       
    80 // End of File