diff -r 000000000000 -r 8466d47a6819 meetingrequest/mrviewercalplugin/src/cesmrviewersimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrviewercalplugin/src/cesmrviewersimpl.cpp Thu Dec 17 08:39:21 2009 +0200 @@ -0,0 +1,166 @@ +/* +* 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: Implementation of CMRViewers ECom API +* +*/ + + +// ---------------------------------------------------------------------------- +// INCLUDE FILES +// ---------------------------------------------------------------------------- +// +#include "emailtrace.h" +#include "cesmrviewersimpl.h" + +// From ESMRVIEWER +#include "cesmrviewerctrl.h" +#include "caleneditorsplugin.h" + +// From MR Mailbox Utils +#include +#include + +// From System +#include +#include +#include +#include + +// Logging utilities +// Removed profiling. + +// ---------------------------------------------------------------------------- +// MEMBER FUNCTIONS +// ---------------------------------------------------------------------------- +// + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::CESMRViewersImpl +// ---------------------------------------------------------------------------- +// +CESMRViewersImpl::CESMRViewersImpl() + { + FUNC_LOG; + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::~CESMRViewersImpl +// ---------------------------------------------------------------------------- +// +CESMRViewersImpl::~CESMRViewersImpl() + { + FUNC_LOG; + delete iMtmUid; + delete iController; + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::NewL +// ---------------------------------------------------------------------------- +// +CESMRViewersImpl* CESMRViewersImpl::NewL( TAny* aMtmUid ) + { + FUNC_LOG; + CESMRViewersImpl* self = new (ELeave) CESMRViewersImpl; + CleanupStack::PushL( self ); + self->ConstructL(aMtmUid); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::ConstructL +// ---------------------------------------------------------------------------- +// +void CESMRViewersImpl::ConstructL( TAny* aMtmUid ) // codescanner::LFunctionCantLeave + { + FUNC_LOG; + iMtmUid = reinterpret_cast( aMtmUid ); + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::ExecuteViewL +// ---------------------------------------------------------------------------- +// +TInt CESMRViewersImpl::ExecuteViewL( // codescanner::intleaves + RPointerArray& aEntries, + const TAgnEntryUiInParams& aInParams, + TAgnEntryUiOutParams& aOutParams, + MAgnEntryUiCallback& aCallback) + { + FUNC_LOG; + TRAPD( err, ExecuteViewInternalL( + aEntries, + aInParams, + aOutParams, + aCallback ) ); + + if ( KErrArgument == err ) + { + // ES MR VIEWER controller was unable to show the + // passed meeting request. Let's launc normal meeting viewer + // for showing the entry + + CCalenEditorsPlugin* editorsPlugin = CCalenEditorsPlugin::NewL(); + CleanupStack::PushL( editorsPlugin ); + + err = editorsPlugin->ExecuteViewL( aEntries, + aInParams, + aOutParams, + aCallback ); + + CleanupStack::PopAndDestroy( editorsPlugin ); + } + + return err; + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::SetHelpContext +// ---------------------------------------------------------------------------- +// +void CESMRViewersImpl::SetHelpContext( const TCoeHelpContext& /*aContext*/ ) + { + FUNC_LOG; + } + +// ---------------------------------------------------------------------------- +// CESMRViewersImpl::ExecuteViewInternalL +// ---------------------------------------------------------------------------- +// +TInt CESMRViewersImpl::ExecuteViewInternalL( // codescanner::intleaves + RPointerArray& aEntries, + const MAgnEntryUi::TAgnEntryUiInParams& aInParams, + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + MAgnEntryUiCallback& aCallback) + { + FUNC_LOG; + // ES MR VIEWER controller is created. Controller will handle the + // MR UTILS creation and showing the UI to user. Controller will also + // receive the callback information from user and handles the BLC. + delete iController; + iController = NULL; + iController = + CESMRViewerController::NewL( *iMtmUid, + aEntries, + aInParams, + aOutParams, + aCallback ); + + iController->ExecuteL(); + + return KErrNone; + } +// End of file +