phonebookui/Phonebook2/inc/CPbk2MigrationInterface.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Plug-in interface for Phonebook 2 migration support.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2MIGRATIONINTERFACE_H
       
    20 #define CPBK2MIGRATIONINTERFACE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <ecom/ecom.h>
       
    25 #include <Pbk2InternalUID.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CPbk2ViewState;
       
    29 class CVPbkContactManager;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * Plug-in interface for Phonebook 2 migration support.
       
    36  *
       
    37  * @internal This interface is internal to Phonebook2.
       
    38  */
       
    39 class CPbk2MigrationInterface : public CBase
       
    40     {
       
    41     public: // Constructor and destructor
       
    42 
       
    43         /**
       
    44          * Creates a new instance of this class.
       
    45          *
       
    46          * @param aContactManager   Virtual Phonebook contact manager.
       
    47          * @return  A new instance of this class.
       
    48          */
       
    49         static CPbk2MigrationInterface* NewLC(
       
    50                 CVPbkContactManager& aContactManager );
       
    51 
       
    52         /**
       
    53          * Destructor.
       
    54          */
       
    55         ~CPbk2MigrationInterface();
       
    56 
       
    57     public: // Interface
       
    58 
       
    59         /**
       
    60          * Converts the data in a CPbkViewState format descriptor
       
    61          * to a CPbk2ViewState object.
       
    62          *
       
    63          * @param aCustomMessage    Custom message containing a descriptor
       
    64          *                          in Phonebook 1 view state format.
       
    65          * @param aViewState        View state object in Phonebook 2 format.
       
    66          */
       
    67         virtual void ConvertViewStateL(
       
    68                 const TDesC8& aCustomMessage,
       
    69                 CPbk2ViewState& aViewState ) = 0;
       
    70 
       
    71     protected: // Implementation
       
    72         CPbk2MigrationInterface();
       
    73 
       
    74     private: // Data
       
    75         /// Own: Destructor id key
       
    76         TUid iDtor_ID_Key;
       
    77     };
       
    78 
       
    79 // INLINE FUNCTIONS
       
    80 
       
    81 // --------------------------------------------------------------------------
       
    82 // CPbk2MigrationInterface::CPbk2MigrationInterface
       
    83 // --------------------------------------------------------------------------
       
    84 //
       
    85 inline CPbk2MigrationInterface::CPbk2MigrationInterface()
       
    86     {
       
    87     }
       
    88 
       
    89 // --------------------------------------------------------------------------
       
    90 // CPbk2MigrationInterface::~CPbk2MigrationInterface
       
    91 // --------------------------------------------------------------------------
       
    92 //
       
    93 inline CPbk2MigrationInterface::~CPbk2MigrationInterface()
       
    94     {
       
    95     REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    96     }
       
    97 
       
    98 // --------------------------------------------------------------------------
       
    99 // CPbk2MigrationInterface::NewLC
       
   100 // --------------------------------------------------------------------------
       
   101 //
       
   102 inline CPbk2MigrationInterface* CPbk2MigrationInterface::NewLC(
       
   103         CVPbkContactManager& aContactManager )
       
   104     {
       
   105     TAny* ptr = REComSession::CreateImplementationL(
       
   106             TUid::Uid( KPbk2MigrationSupportImplementationUID ),
       
   107             _FOFF( CPbk2MigrationInterface, iDtor_ID_Key ),
       
   108             static_cast<TAny*>( &aContactManager ) );
       
   109 
       
   110     CPbk2MigrationInterface* impl =
       
   111             static_cast<CPbk2MigrationInterface*>( ptr );
       
   112     CleanupStack::PushL( impl );
       
   113     return impl;
       
   114     }
       
   115 
       
   116 #endif // CPBK2MIGRATIONINTERFACE_H
       
   117 
       
   118 // End of File