diff -r 3104fc151679 -r 9a48e301e94b uiservicetab/vimpstengine/src/vimpstenginecasts.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiservicetab/vimpstengine/src/vimpstenginecasts.cpp Wed Sep 01 12:33:36 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2008 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: Provides the Casr Functions +* +*/ + + +// INCLUDES +#include "mvimpstengineimsubservice.h" +#include "mvimpstenginepresencesubservice.h" +#include "mvimpstenginecontactmgmtextention.h" + +#include "mvimpstenginesearchmgrextention.h" + +enum TPanicCode + { + EPanicTypeMismatch = 1 + }; +#ifdef _DEBUG +void Panic( TPanicCode aPanic ) + { + _LIT( KPanicCat, "VIMPSTEngine::Cast" ); + User::Panic( KPanicCat, aPanic ); + } +#else +void Panic( TPanicCode /*aPanic*/ ) + { + + } +#endif // _DEBUG + + +EXPORT_C MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast + (MVIMPSTEngineSubService& aSubService) + { + __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM, + Panic(EPanicTypeMismatch) ); + return static_cast(aSubService); + } + +EXPORT_C const MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast + (const MVIMPSTEngineSubService& aSubService) + { + __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM, + Panic(EPanicTypeMismatch) ); + return static_cast(aSubService); + } + + +EXPORT_C MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast + (MVIMPSTEngineSubService& aSubService) + { + __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence, + Panic(EPanicTypeMismatch) ); + return static_cast(aSubService); + } + +EXPORT_C const MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast + (const MVIMPSTEngineSubService& aSubService) + { + __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence, + Panic(EPanicTypeMismatch) ); + return static_cast(aSubService); + } + +EXPORT_C MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast + (MVIMPSTEngineExtentionFeatures& aExtentionFeature) + { + __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement, + Panic(EPanicTypeMismatch) ); + return static_cast(aExtentionFeature); + } + +EXPORT_C const MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast + (const MVIMPSTEngineExtentionFeatures& aExtentionFeature) + { + __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement, + Panic(EPanicTypeMismatch) ); + return static_cast(aExtentionFeature); + } + +EXPORT_C MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast + (MVIMPSTEngineExtentionFeatures& aExtentionFeature) + { + __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch, + Panic(EPanicTypeMismatch) ); + return static_cast(aExtentionFeature); + } + +EXPORT_C const MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast + (const MVIMPSTEngineExtentionFeatures& aExtentionFeature) + { + __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch, + Panic(EPanicTypeMismatch) ); + return static_cast(aExtentionFeature); + } + + + + +