syncmlfw/common/sosserver_clientapi/src/NSmlContactSuiteClientAPI.cpp
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 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:  Implementation of common client api.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <s32mem.h>
       
    21 #include <SyncMLObservers.h>
       
    22 
       
    23 #include "NSmlClientAPIDefs.h"
       
    24 #include "NSmlClientAPIUtils.h"
       
    25 #include "NSmlClientAPIActiveCallback.h"
       
    26 #include "nsmlsosserverdefs.h"
       
    27 #include "NSmlErrorCodeConversion.h"
       
    28 #include <SyncMLContactSuiteProgressClient.h>
       
    29 #include "NSmlClientContactSuiteAPIActiveCallback.h"
       
    30 
       
    31 #define KSmlContactSuiteAppUID 0x101f4CCE
       
    32   
       
    33 EXPORT_C void RContactSuiteSyncMLSession::CloseContactSuiteSession()
       
    34     {
       
    35     delete iContactSuiteCallBack;
       
    36     iContactSuiteCallBack = NULL;    
       
    37     Close();
       
    38     }
       
    39 
       
    40 EXPORT_C void RContactSuiteSyncMLSession::RequestContactSuiteProgressL( TInt aProfileId, MSyncMLProgressObserver& aProgressObserver )
       
    41     {
       
    42     RProcess loadedProcess;
       
    43     if( loadedProcess.SecureId() != KSmlContactSuiteAppUID )
       
    44         {
       
    45         return ;
       
    46         }
       
    47     
       
    48    if ( iContactSuiteCallBack == NULL )
       
    49         {
       
    50         // callback not yet created, create
       
    51         iContactSuiteCallBack = new (ELeave) CSmlContactSuiteActiveCallback( *this );            
       
    52         }
       
    53 
       
    54     Send( ECmdContactSuiteRegisterObserversWithProfileId, TIpcArgs (aProfileId) );
       
    55     iContactSuiteCallBack->SetProgressObserverL( aProgressObserver );               
       
    56     };