contacts_plat/virtual_phonebook_policy_api/inc/phonebook/CVPbkContactNameConstructionPolicy.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  An ECOM interface for the virtual phonebook name 
       
    15 *                construction policy.
       
    16 *                The name construction policy implementation must have an UID
       
    17 *                KVPbkContactNameConstructionPolicyImplementationUID
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef CVPBKCONTACTNAMECONSTRUCTIONPOLICY_H
       
    23 #define CVPBKCONTACTNAMECONSTRUCTIONPOLICY_H
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <ecom/ecom.h>
       
    27 #include <VPbkPolicyUid.h>
       
    28 #include <MVPbkContactNameConstructionPolicy.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MVPbkFieldTypeList;
       
    32 
       
    33 /**
       
    34  * Virtual Phonebook contact name construction policy
       
    35  */
       
    36 class CVPbkContactNameConstructionPolicy : 
       
    37         public CBase,
       
    38         public MVPbkContactNameConstructionPolicy
       
    39     {
       
    40     public: // Types
       
    41         struct TParam
       
    42             {
       
    43             /**
       
    44              * @param aMasterFieldTypeList Field type list.
       
    45              */
       
    46             inline TParam( const MVPbkFieldTypeList& aMasterFieldTypeList );
       
    47 
       
    48             /// Ref: Master field type list of vpbk
       
    49             const MVPbkFieldTypeList& iMasterFieldTypeList;
       
    50             ///Own: Reserve for future extension
       
    51             TAny* iSpare;
       
    52             };
       
    53             
       
    54     public: // Interface
       
    55         /**
       
    56          * Creates a new object of this class.
       
    57          *
       
    58          * @param aParam parameters for the name construction policy
       
    59          * @return A new object of this class.
       
    60          */
       
    61         static CVPbkContactNameConstructionPolicy* NewL( TParam& aParam );
       
    62 
       
    63         /**
       
    64          * Destructor.
       
    65          */
       
    66         ~CVPbkContactNameConstructionPolicy();
       
    67         
       
    68     private:
       
    69         /// Own: ID key for destructor
       
    70         TUid iDtorIDKey;
       
    71     };
       
    72 
       
    73 // INLINE FUNCTIONS
       
    74 inline CVPbkContactNameConstructionPolicy::TParam::TParam(
       
    75         const MVPbkFieldTypeList& aMasterFieldTypeList ) :
       
    76     iMasterFieldTypeList( aMasterFieldTypeList )
       
    77     {
       
    78     }
       
    79 
       
    80 inline CVPbkContactNameConstructionPolicy* CVPbkContactNameConstructionPolicy::NewL(
       
    81         TParam& aParam )
       
    82     {
       
    83     // Instantiate the correct ECom plugin
       
    84     TAny* ptr = NULL;
       
    85     ptr = REComSession::CreateImplementationL(
       
    86             TUid::Uid( KVPbkContactNameConstructionPolicyImplementationUID ),
       
    87             _FOFF( CVPbkContactNameConstructionPolicy, iDtorIDKey), &aParam );
       
    88 
       
    89     return reinterpret_cast<CVPbkContactNameConstructionPolicy*>( ptr );
       
    90     }
       
    91     
       
    92 inline CVPbkContactNameConstructionPolicy::~CVPbkContactNameConstructionPolicy()
       
    93     {
       
    94     REComSession::DestroyedImplementation( iDtorIDKey );
       
    95     }   
       
    96 
       
    97 #endif // CVPBKCONTACTNAMECONSTRUCTIONPOLICY_H
       
    98 
       
    99 // End of File