diff -r 4dc88a4ac6f4 -r f6055a57ae18 obex/obexextensionapi/src/obexerrorextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/obex/obexextensionapi/src/obexerrorextension.cpp Tue Oct 19 11:00:12 2010 +0800 @@ -0,0 +1,72 @@ +// Copyright (c) 2005-2009 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: +// + +/** + @file + @internalComponent +*/ + +#include +#include + +/** +Factory function for CObexClientErrorResolver. Will leave if the associated CObexClient +does not support this extension type. + +@param aClient Reference to the instance of CObexClient being extended. +@return A pointer to a new CObexClientErrorResolver object. +*/ +EXPORT_C CObexClientErrorResolver* CObexClientErrorResolver::NewL(CObexClient& aClient) + { + return NewL(aClient, EObexClientBasicErrorResolutionSet); + } + +/** +Factory function for CObexClientErrorResolver. Will leave if the associated CObexClient +does not support this extension type. + +@param aClient Reference to the instance of CObexClient being extended. +@param aErrorSet The set of errors that the resolved error will lie within. +@return A pointer to a new CObexClientErrorResolver object. +*/ +EXPORT_C CObexClientErrorResolver* CObexClientErrorResolver::NewL(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet) + { + CObexClientErrorResolver* self = new (ELeave)CObexClientErrorResolver(aClient, aErrorSet); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +/** +Function used to retreive an extended error code for the last completed client operation. + +@return An extended error code that lies within the error set specified at construction time. +*/ +EXPORT_C TUint CObexClientErrorResolver::LastError() const + { + return iClientErrorResolver->LastError(iErrorSet); + } + +CObexClientErrorResolver::CObexClientErrorResolver(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet) + : iObexClient(aClient), iErrorSet(aErrorSet) + { + } + +void CObexClientErrorResolver::ConstructL() + { + iClientErrorResolver = static_cast(iObexClient.ExtensionInterface(KObexClientErrorResolverInterface)); + User::LeaveIfNull(iClientErrorResolver); + }