photosgallery/slideshow/engine/tsrc/stubs/tmshweffectmanager_adapter.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 23 b023a8d2866a
child 25 8e5f6eea9c9f
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
     1 /*
       
     2 * Copyright (c) 2006-2007 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:   Stub file for managing effect in slideshow
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 //  CLASS HEADER
       
    22 #include "tmshweffectmanager_adapter.h"
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 //  INTERNAL INCLUDES
       
    26 #include <EUnitMacros.h>
       
    27 
       
    28 // declare the enums to be printable as TInts
       
    29 EUNIT_DECLARE_PRINTABLE_AS_TINT( MShwEffectManager_Observer::TMShwEffectManagerMethodId )
       
    30 
       
    31 // CONSTRUCTION
       
    32 
       
    33 TMShwEffectManager_Adapter::TMShwEffectManager_Adapter(
       
    34 	MShwEffectManager_Observer* aObserver )
       
    35 	: iViewDuration( 0 ),
       
    36 	iTransitionDuration( 0 ),
       
    37     iPrepareVisual( NULL ),
       
    38     iViewVisual( NULL ),
       
    39     iTransitionVisual( NULL ),
       
    40 	iMShwEffectManager_Observer( aObserver ), 
       
    41 	iMShwEffectManager( NULL )
       
    42 	{
       
    43 	}
       
    44 
       
    45 void TMShwEffectManager_Adapter::SetAdaptee( MShwEffectManager* aAdaptee )
       
    46 	{
       
    47 	iMShwEffectManager = aAdaptee;
       
    48 	}
       
    49 
       
    50 //  METHODS
       
    51 void TMShwEffectManager_Adapter::AddEffectL( MShwEffect* aEffect )
       
    52 	{
       
    53 	// inform the observer
       
    54 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
    55 		MShwEffectManager_Observer::E_void_AdoptEffectsL_TArrayMShwEffect_p );
       
    56 
       
    57 	// allocate to cause an alloc leave
       
    58 	TInt* memAlloc = new (ELeave) TInt;
       
    59 	delete memAlloc;
       
    60 
       
    61 	// call the actual method
       
    62 	if ( iMShwEffectManager )
       
    63 		{
       
    64 		iMShwEffectManager->AddEffectL( aEffect );
       
    65 		}
       
    66 	}
       
    67     
       
    68 MShwEffect* TMShwEffectManager_Adapter::CurrentEffect()
       
    69     {
       
    70     // inform the observer
       
    71     iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
    72     	MShwEffectManager_Observer::E_MShwEffect_p_CurrentEffect );
       
    73     // call the actual method
       
    74     if ( iMShwEffectManager )
       
    75         {
       
    76         return iMShwEffectManager->CurrentEffect();
       
    77         }
       
    78     return this;
       
    79     }
       
    80    
       
    81 MShwEffect* TMShwEffectManager_Adapter::Effect( TInt aDirection )
       
    82 	{
       
    83 	// inform the observer
       
    84 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
    85 		MShwEffectManager_Observer::E_MShwEffect_p_NextEffect );
       
    86 	// call the actual method
       
    87 	if ( iMShwEffectManager )
       
    88 		{
       
    89 		return iMShwEffectManager->Effect( aDirection );
       
    90 		}
       
    91 	return this;
       
    92 	}
       
    93     
       
    94 void TMShwEffectManager_Adapter::ProceedToEffect( TInt aDirection )
       
    95 	{
       
    96 	// inform the observer
       
    97 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
    98 		MShwEffectManager_Observer::E_void_ProceedToNextEffect );
       
    99 	// call the actual method
       
   100 	if ( iMShwEffectManager )
       
   101 		{
       
   102 		iMShwEffectManager->ProceedToEffect( aDirection );
       
   103 		}
       
   104 	}
       
   105 
       
   106 void TMShwEffectManager_Adapter::SetEffectOrder(
       
   107 	MShwEffectManager::TShwEffectOrder /*aOrder*/ )
       
   108     {
       
   109     }
       
   110     
       
   111 MShwEffectManager::TShwEffectOrder TMShwEffectManager_Adapter::EffectOrder()
       
   112     {
       
   113     return EEffectOrderProgrammed;
       
   114     }
       
   115     
       
   116 void TMShwEffectManager_Adapter::SetProgrammedEffects(
       
   117 	RArray< TShwEffectInfo >& /*aEffects*/ )
       
   118     {
       
   119     }
       
   120     
       
   121 TInt TMShwEffectManager_Adapter::ProgrammedEffects(
       
   122 	RArray< MShwEffect* >& /*aEffects*/ )
       
   123     {
       
   124     return KErrNone;
       
   125     }
       
   126 	
       
   127 void TMShwEffectManager_Adapter::SetDefaultEffectL( TShwEffectInfo /*aInfo*/ )
       
   128 	{
       
   129 	}
       
   130 
       
   131 void TMShwEffectManager_Adapter::GetActiveEffectsL( RPointerArray< MShwEffect >& /*aEffects*/ )
       
   132 	{
       
   133 	}
       
   134 	
       
   135 /// MShwEffect part
       
   136 MShwEffect* TMShwEffectManager_Adapter::CloneLC()
       
   137 	{
       
   138 	return NULL;
       
   139 	}
       
   140 
       
   141 void TMShwEffectManager_Adapter::InitializeL( 
       
   142 	CHuiEnv* /*aHuiEnv*/,
       
   143     MGlxVisualList* /*aVisualList*/,
       
   144     MGlxMediaList* /*aMediaList*/,
       
   145     TSize /*aScreenSize*/ )
       
   146     {
       
   147 	// inform the observer
       
   148 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   149 		MShwEffectManager_Observer::E_MGlxLayout_InitializeL );
       
   150 
       
   151 	// allocate to cause an alloc leave in OOM tests
       
   152 	TInt* memAlloc = new (ELeave) TInt;
       
   153 	delete memAlloc;
       
   154     }
       
   155 
       
   156 TSize TMShwEffectManager_Adapter::PrepareViewL( CHuiVisual* aVisual, TSize /*aSize*/ )
       
   157 	{
       
   158 	// store the visual
       
   159     iPrepareVisual = aVisual;
       
   160 
       
   161 	// inform the observer
       
   162 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   163 		MShwEffectManager_Observer::E_MGlxLayout_PrepareViewL );
       
   164 
       
   165 	// allocate to cause an alloc leave in OOM tests
       
   166 	TInt* memAlloc = new (ELeave) TInt;
       
   167 	delete memAlloc;
       
   168 
       
   169 	return TSize( 0, 0 );
       
   170 	}
       
   171 
       
   172 MGlxLayout* TMShwEffectManager_Adapter::EnterViewL( 
       
   173 	CHuiVisual* aVisual, TInt aDuration, TInt /*aDuration2*/ )
       
   174 	{
       
   175 	iViewDuration = aDuration;
       
   176 	// store the visual
       
   177     iViewVisual = aVisual;
       
   178 
       
   179 	// inform the observer
       
   180 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   181 		MShwEffectManager_Observer::E_MGlxLayout_EnterViewL_TInt );
       
   182 
       
   183 	// allocate to cause an alloc leave
       
   184 	TInt* memAlloc = new (ELeave) TInt;
       
   185 	delete memAlloc;
       
   186 
       
   187 	return NULL;
       
   188 	}
       
   189 
       
   190 void TMShwEffectManager_Adapter::ExitView( CHuiVisual* aVisual )
       
   191 	{
       
   192 	// store the visual
       
   193     iViewVisual = aVisual;
       
   194 	
       
   195 	// inform the observer
       
   196 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   197 		MShwEffectManager_Observer::E_void_ExitView );
       
   198 	}
       
   199 
       
   200 MGlxLayout* TMShwEffectManager_Adapter::EnterTransitionL(
       
   201 	CHuiVisual* aVisual, TInt aDuration )
       
   202 	{
       
   203 	iTransitionDuration = aDuration;
       
   204 	// store the visual
       
   205     iTransitionVisual = aVisual;
       
   206 
       
   207 	// inform the observer
       
   208 	iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   209 		MShwEffectManager_Observer::E_MGlxLayout_EnterTransitionL_TInt );
       
   210 
       
   211 	// allocate to cause an alloc leave
       
   212 	TInt* memAlloc = new (ELeave) TInt;
       
   213 	delete memAlloc;
       
   214 	
       
   215 	return NULL;
       
   216 	}
       
   217 
       
   218 void TMShwEffectManager_Adapter::ExitTransition( CHuiVisual* aVisual )
       
   219 	{
       
   220 	// store the visual
       
   221     iTransitionVisual = aVisual;
       
   222 
       
   223     // inform the observer
       
   224     iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( 
       
   225     	MShwEffectManager_Observer::E_void_ExitTransition );
       
   226 	}
       
   227 
       
   228 void TMShwEffectManager_Adapter::PauseL()
       
   229 	{
       
   230 	// allocate to cause an alloc leave
       
   231 	TInt* memAlloc = new (ELeave) TInt;
       
   232 	delete memAlloc;
       
   233 	}
       
   234 
       
   235 void TMShwEffectManager_Adapter::Resume()
       
   236 	{
       
   237 	}
       
   238 
       
   239 TShwEffectInfo TMShwEffectManager_Adapter::EffectInfo()
       
   240 	{
       
   241 	TShwEffectInfo info;
       
   242 	info.iName = KNullDesC;
       
   243 	return info;
       
   244 	}
       
   245 
       
   246 //  END OF FILE