diff -r 000000000000 -r b497e44ab2fc syncmlfw/common/sosserver_clientapi/src/NSmlContactSuiteClientAPI.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syncmlfw/common/sosserver_clientapi/src/NSmlContactSuiteClientAPI.cpp Thu Dec 17 09:07:52 2009 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of common client api. +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "NSmlClientAPIDefs.h" +#include "NSmlClientAPIUtils.h" +#include "NSmlClientAPIActiveCallback.h" +#include "nsmlsosserverdefs.h" +#include "NSmlErrorCodeConversion.h" +#include +#include "NSmlClientContactSuiteAPIActiveCallback.h" + +#define KSmlContactSuiteAppUID 0x101f4CCE + +EXPORT_C void RContactSuiteSyncMLSession::CloseContactSuiteSession() + { + delete iContactSuiteCallBack; + iContactSuiteCallBack = NULL; + Close(); + } + +EXPORT_C void RContactSuiteSyncMLSession::RequestContactSuiteProgressL( TInt aProfileId, MSyncMLProgressObserver& aProgressObserver ) + { + RProcess loadedProcess; + if( loadedProcess.SecureId() != KSmlContactSuiteAppUID ) + { + return ; + } + + if ( iContactSuiteCallBack == NULL ) + { + // callback not yet created, create + iContactSuiteCallBack = new (ELeave) CSmlContactSuiteActiveCallback( *this ); + } + + Send( ECmdContactSuiteRegisterObserversWithProfileId, TIpcArgs (aProfileId) ); + iContactSuiteCallBack->SetProgressObserverL( aProgressObserver ); + };