43
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <QString>
|
|
19 |
|
|
20 |
#include "glxeffectpluginresolver.h"
|
|
21 |
#include "glxeffectpluginbase.h"
|
|
22 |
#include "glxfadeeffectplugin.h"
|
|
23 |
#include "glxflipeffectplugin.h"
|
|
24 |
#include "glxzoominoutplugin.h"
|
45
|
25 |
#include "glxhelixeffectplugin.h"
|
43
|
26 |
|
|
27 |
GlxEffectPluginResolver::GlxEffectPluginResolver()
|
|
28 |
{
|
|
29 |
mEffectPluginList.clear();
|
|
30 |
}
|
|
31 |
|
|
32 |
QString GlxEffectPluginResolver::effectName( int effectId )
|
|
33 |
{
|
45
|
34 |
qDebug( " GlxEffectPluginResolver::effectName %d ", effectId );
|
43
|
35 |
switch ( effectId ) {
|
|
36 |
case FLIP_EFFECT :
|
|
37 |
return GlxFlipEffectPlugin::effectName();
|
|
38 |
|
|
39 |
case SMOOTH_FADE :
|
|
40 |
return GlxFadeEffectPlugin::effectName() ;
|
|
41 |
|
|
42 |
case ZOOM_TO_FACE :
|
45
|
43 |
return GlxZoomInOutEffectPlugin::effectName();
|
|
44 |
|
|
45 |
case HELIX_EFFECT :
|
|
46 |
return GlxHelixEffectPlugin::effectName();
|
43
|
47 |
|
|
48 |
default :
|
|
49 |
return GlxFadeEffectPlugin::effectName() ;
|
|
50 |
}
|
|
51 |
}
|
|
52 |
|
|
53 |
GlxEffectPluginBase *GlxEffectPluginResolver::effectPlugin( int effectId )
|
|
54 |
{
|
45
|
55 |
qDebug( " GlxEffectPluginResolver::effectPlugin %d ", effectId );
|
43
|
56 |
GlxEffectPluginBase * effectPlugin = mEffectPluginList.value( ( GlxEffect )effectId );
|
|
57 |
if ( effectPlugin ) {
|
|
58 |
return effectPlugin ;
|
|
59 |
}
|
|
60 |
|
|
61 |
switch ( effectId ) {
|
|
62 |
case FLIP_EFFECT :
|
|
63 |
effectPlugin = new GlxFlipEffectPlugin();
|
|
64 |
mEffectPluginList[ FLIP_EFFECT ] = effectPlugin ;
|
|
65 |
break ;
|
|
66 |
|
|
67 |
case ZOOM_TO_FACE :
|
|
68 |
effectPlugin = new GlxZoomInOutEffectPlugin() ;
|
|
69 |
mEffectPluginList[ ZOOM_TO_FACE ] = effectPlugin ;
|
|
70 |
break ;
|
|
71 |
|
45
|
72 |
case HELIX_EFFECT :
|
|
73 |
effectPlugin = new GlxHelixEffectPlugin() ;
|
|
74 |
mEffectPluginList[ HELIX_EFFECT ] = effectPlugin ;
|
|
75 |
break ;
|
|
76 |
|
43
|
77 |
case SMOOTH_FADE :
|
|
78 |
default :
|
|
79 |
effectPlugin = mEffectPluginList.value( SMOOTH_FADE );
|
|
80 |
if ( effectPlugin == NULL ) {
|
|
81 |
effectPlugin = new GlxFadeEffectPlugin();
|
|
82 |
mEffectPluginList[ SMOOTH_FADE ] = effectPlugin ;
|
|
83 |
}
|
|
84 |
break ;
|
|
85 |
}
|
|
86 |
|
|
87 |
return effectPlugin ;
|
|
88 |
}
|
|
89 |
|
|
90 |
GlxEffectPluginResolver::~GlxEffectPluginResolver()
|
|
91 |
{
|
|
92 |
foreach( GlxEffectPluginBase *list, mEffectPluginList) {
|
|
93 |
delete list;
|
|
94 |
list = NULL;
|
|
95 |
}
|
|
96 |
mEffectPluginList.clear();
|
|
97 |
}
|