webservices/wsframework/inc/senpasswordtransform.inl
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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:        Defines the ECom interface for Sen Security Mechanism plug-ins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 // Interface's (abstract base class's) static factory method implementation.
       
    26 // Asks ECOM plugin framework to instantiate appropriate concret plugin
       
    27 // implementation.
       
    28 inline CSenPasswordTransform* CSenPasswordTransform::NewL(MSenCoreServiceManager& aManager)
       
    29     {
       
    30     // Wish to instantiate the default interface - TruncateTransform
       
    31 #ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES        
       
    32     const TUid KTruncateTransformPluginUid = {0x101F9708};
       
    33 #else
       
    34     const TUid KTruncateTransformPluginUid = {0x101F973E};
       
    35 #endif    
       
    36 
       
    37     TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
       
    38 
       
    39     // Find implementation behind KTruncateTransformPluginUid
       
    40     TAny* intf = REComSession::CreateImplementationL (KTruncateTransformPluginUid, 
       
    41                                                       _FOFF (CSenPasswordTransform, 
       
    42                                                       iDtor_ID_Key), 
       
    43                                                       constructorParameters);
       
    44 
       
    45     return reinterpret_cast <CSenPasswordTransform*> (intf);
       
    46     }
       
    47 
       
    48 // Interface's (abstract base class's) static factory method implementation.
       
    49 // Asks ECOM plugin framework to instantiate appropriate concret plugin
       
    50 // implementation.
       
    51 inline CSenPasswordTransform* CSenPasswordTransform::NewL(const TDesC8& aMatch, 
       
    52                                                           MSenCoreServiceManager& aManager)
       
    53     {
       
    54 #ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
       
    55     const TUid KCSenPasswordTransformInterfaceUid = {0x101F9707};
       
    56 #else
       
    57     const TUid KCSenPasswordTransformInterfaceUid = {0x101F973D};
       
    58 #endif    
       
    59 
       
    60     TEComResolverParams resolverParams;
       
    61     resolverParams.SetDataType(aMatch);
       
    62     resolverParams.SetWildcardMatch(EFalse);
       
    63 
       
    64     TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
       
    65 
       
    66     // Find implementation for our interface.
       
    67     // - KCSenPasswordTransformInterfaceUid is the 
       
    68     //   UID of Password Transform ECOM interface.          
       
    69     //
       
    70     // - This call will leave, if the plugin architecture cannot find
       
    71     //   implementation.
       
    72     // - The returned pointer points to one of our interface implementation
       
    73     //   instances.
       
    74     TAny* intf = REComSession::CreateImplementationL (KCSenPasswordTransformInterfaceUid,
       
    75                                                       _FOFF (CSenPasswordTransform, 
       
    76                                                       iDtor_ID_Key), 
       
    77                                                       constructorParameters, 
       
    78                                                       resolverParams); 
       
    79 
       
    80     return reinterpret_cast<CSenPasswordTransform*> (intf);
       
    81     }
       
    82 
       
    83 // Interface's (abstract base class's) destructor
       
    84 inline CSenPasswordTransform::~CSenPasswordTransform()
       
    85     {
       
    86     // If in the NewL some memory is reserved for member data, it must be
       
    87     // released here. This interface does not have any instance variables so
       
    88     // no need to delete anything.
       
    89 
       
    90     // Inform the ECOM framework that this specific instance of the
       
    91     // interface has been destroyed.
       
    92     REComSession::DestroyedImplementation (iDtor_ID_Key);
       
    93     }
       
    94 
       
    95 inline CSenPasswordTransform::CSenPasswordTransform(MSenCoreServiceManager& aServiceManager)
       
    96         :iServiceManager(aServiceManager)
       
    97         {
       
    98         }
       
    99 
       
   100 // End of File