uiservicetab/vimpstengine/src/vimpstenginecasts.cpp
branchRCL_3
changeset 23 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
22:3104fc151679 23:9a48e301e94b
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Provides the Casr Functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "mvimpstengineimsubservice.h"
       
    21 #include "mvimpstenginepresencesubservice.h"
       
    22 #include "mvimpstenginecontactmgmtextention.h"
       
    23 
       
    24 #include "mvimpstenginesearchmgrextention.h"
       
    25 
       
    26 enum TPanicCode
       
    27 	{
       
    28 	EPanicTypeMismatch = 1
       
    29 	};
       
    30 #ifdef _DEBUG	
       
    31 void Panic( TPanicCode aPanic )
       
    32 	{	
       
    33 	_LIT( KPanicCat, "VIMPSTEngine::Cast" );
       
    34 	User::Panic( KPanicCat, aPanic );
       
    35 	}
       
    36 #else
       
    37 void Panic( TPanicCode /*aPanic*/ )
       
    38     {   
       
    39 
       
    40     }
       
    41 #endif // _DEBUG
       
    42 
       
    43 
       
    44 EXPORT_C MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast
       
    45         (MVIMPSTEngineSubService& aSubService)
       
    46     {
       
    47     __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM,
       
    48         Panic(EPanicTypeMismatch) );
       
    49     return static_cast<MVIMPSTEngineIMSubService&>(aSubService);
       
    50     }
       
    51 
       
    52 EXPORT_C const MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast
       
    53         (const MVIMPSTEngineSubService& aSubService)
       
    54     {
       
    55     __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM,
       
    56         Panic(EPanicTypeMismatch) );
       
    57     return static_cast<const MVIMPSTEngineIMSubService&>(aSubService);
       
    58     }
       
    59 
       
    60 
       
    61 EXPORT_C MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast
       
    62         (MVIMPSTEngineSubService& aSubService)
       
    63     {
       
    64     __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence,
       
    65         Panic(EPanicTypeMismatch) );
       
    66     return static_cast<MVIMPSTEnginePresenceSubService&>(aSubService);
       
    67     }
       
    68 
       
    69 EXPORT_C const MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast
       
    70         (const MVIMPSTEngineSubService& aSubService)
       
    71     {
       
    72     __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence,
       
    73         Panic(EPanicTypeMismatch) );
       
    74     return static_cast<const MVIMPSTEnginePresenceSubService&>(aSubService);
       
    75     }
       
    76 
       
    77 EXPORT_C MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast
       
    78         (MVIMPSTEngineExtentionFeatures& aExtentionFeature)
       
    79     {
       
    80     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement,
       
    81         Panic(EPanicTypeMismatch) );
       
    82     return static_cast<MVIMPSTEngineContactMgmtExtention&>(aExtentionFeature);
       
    83     }
       
    84 
       
    85 EXPORT_C const MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast
       
    86         (const MVIMPSTEngineExtentionFeatures& aExtentionFeature)
       
    87     {
       
    88     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement,
       
    89         Panic(EPanicTypeMismatch) );
       
    90     return static_cast<const MVIMPSTEngineContactMgmtExtention&>(aExtentionFeature);
       
    91     }
       
    92 
       
    93 EXPORT_C MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast
       
    94         (MVIMPSTEngineExtentionFeatures& aExtentionFeature)
       
    95     {
       
    96     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch,
       
    97         Panic(EPanicTypeMismatch) );
       
    98     return static_cast<MVIMPSTEngineSearchMgrExtention&>(aExtentionFeature);
       
    99     }
       
   100 
       
   101 EXPORT_C const MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast
       
   102         (const MVIMPSTEngineExtentionFeatures& aExtentionFeature)
       
   103     {
       
   104     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch,
       
   105         Panic(EPanicTypeMismatch) );
       
   106     return static_cast<const MVIMPSTEngineSearchMgrExtention&>(aExtentionFeature);
       
   107     }
       
   108 
       
   109 
       
   110 
       
   111 
       
   112