phonebookui/Phonebook/App/src/CPbkSyncMlCmd.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *           Provides phonebook SyncML command object methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CPbkSyncMlCmd.h"
       
    22 
       
    23 #include <CPbkContactItem.h>
       
    24 #include <TPbkContactItemField.h>
       
    25 #include <CPbkFieldInfo.h>
       
    26 #include <Phonebook.hrh>
       
    27 #include <PbkUid.h>
       
    28 #include <pbkdebug.h>
       
    29 
       
    30 #include <coemain.h>
       
    31 #include <AiwServiceHandler.h>      // AIW
       
    32 #include <AiwCommon.hrh>            // AIW
       
    33 #include <AiwGenericParam.hrh>
       
    34 
       
    35 // ================= MEMBER FUNCTIONS =======================
       
    36 
       
    37 // Default constructor
       
    38 CPbkSyncMlCmd::CPbkSyncMlCmd(        
       
    39         TInt aCommandId,
       
    40         CAiwServiceHandler& aServiceHandler) :			
       
    41             iCommandId(aCommandId),
       
    42             iServiceHandler(aServiceHandler)
       
    43 	{
       
    44     PBK_DEBUG_PRINT
       
    45         (PBK_DEBUG_STRING("CPbkSyncMlCmd::CPbkSyncMlCmd(0x%x)"), this);    
       
    46     }
       
    47 
       
    48 // Static constructor
       
    49 CPbkSyncMlCmd* CPbkSyncMlCmd::NewL(        
       
    50         TInt aCommandId,
       
    51         CAiwServiceHandler& aServiceHandler)
       
    52     {
       
    53     CPbkSyncMlCmd* self = new(ELeave) CPbkSyncMlCmd(        
       
    54         aCommandId,
       
    55         aServiceHandler);
       
    56     return self;
       
    57     }
       
    58 
       
    59 // Destructor
       
    60 CPbkSyncMlCmd::~CPbkSyncMlCmd()
       
    61     {
       
    62     PBK_DEBUG_PRINT
       
    63         (PBK_DEBUG_STRING("CPbkSyncMlCmd::~CPbkSyncMlCmd(0x%x)"), this);
       
    64     }
       
    65 
       
    66 void CPbkSyncMlCmd::ExecuteLD()
       
    67     {
       
    68     PBK_DEBUG_PRINT
       
    69         (PBK_DEBUG_STRING("CPbkSyncMlCmd::ExecuteLD(0x%x)"), this);
       
    70 
       
    71    	CleanupStack::PushL(this);
       
    72    
       
    73     // Set parameters for the AIW SyncMl
       
    74     CAiwGenericParamList& paramList = iServiceHandler.InParamListL();
       
    75     
       
    76     TAiwVariant variant;
       
    77     // Variant value not relevant when all contacts synchronized
       
    78     variant.Set(EGenericParamUnspecified);
       
    79     
       
    80     // Param value for Contacts syncrhonization
       
    81 	TAiwGenericParam param(EGenericParamContactItem, variant);
       
    82 	paramList.AppendL( param );
       
    83     
       
    84     // Relay the command to AIW for handling
       
    85         iServiceHandler.ExecuteMenuCmdL(
       
    86             iCommandId,
       
    87             paramList,
       
    88             iServiceHandler.OutParamListL(),
       
    89             0,      // No options used.
       
    90             NULL);  // No need for callback    
       
    91 
       
    92 	// Destroy itself as promised
       
    93     CleanupStack::PopAndDestroy(); // this
       
    94 
       
    95     }
       
    96 
       
    97 void CPbkSyncMlCmd::ProcessFinished(MPbkBackgroundProcess& /*aProcess*/)
       
    98     {
       
    99     PBK_DEBUG_PRINT
       
   100         (PBK_DEBUG_STRING("CPbkSyncMlCmd::ProcessFinished(0x%x)"), this);
       
   101     }
       
   102 
       
   103 //  End of File