|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "gfxtransadapterstub.h" |
|
17 |
|
18 // |
|
19 // DLL interface. |
|
20 // |
|
21 EXPORT_C MGfxTransAdapter* MGfxTransAdapter::CreateL(MGfxTransClient* aClient) |
|
22 { |
|
23 CGfxTransAdapterStub* adapter = new (ELeave) CGfxTransAdapterStub(aClient); |
|
24 CleanupStack::PushL(adapter); |
|
25 adapter->ConstructL(); |
|
26 CleanupStack::Pop(adapter); |
|
27 return adapter; |
|
28 } |
|
29 |
|
30 EXPORT_C void MGfxTransAdapter::Destroy(MGfxTransAdapter* aAdapter) |
|
31 { |
|
32 delete static_cast<CGfxTransAdapterStub*>(aAdapter); |
|
33 } |
|
34 |
|
35 // |
|
36 // Construction/Destruction |
|
37 // |
|
38 CGfxTransAdapterStub::CGfxTransAdapterStub(MGfxTransClient* aClient) : |
|
39 iClient(aClient) |
|
40 { |
|
41 } |
|
42 |
|
43 CGfxTransAdapterStub::~CGfxTransAdapterStub() |
|
44 { |
|
45 } |
|
46 |
|
47 void CGfxTransAdapterStub::ConstructL() |
|
48 { |
|
49 } |
|
50 |
|
51 // |
|
52 // MGfxTransAdapter implementation |
|
53 // |
|
54 TInt CGfxTransAdapterStub::HandleClientState(TClientState /*aState*/, const CCoeControl* /* aKey*/, TInt /*aHandle*/) |
|
55 { |
|
56 //Adapter should respond to the state here if it needs to. |
|
57 //Most adapters will probably not be interested in most states. |
|
58 |
|
59 //aKey can be NULL if no control is available for that state and aHandle can be 0 if its not valid. |
|
60 //(like global abort) |
|
61 |
|
62 //You can also request the CTransitionData here, if you got a valid handle. |
|
63 //Be aware though that it might not yet be complete. |
|
64 //(For example, in EPostBeginCapture, the begin state has just been captured, but |
|
65 // the endstate has not yet been.) |
|
66 |
|
67 return KErrNone; |
|
68 } |
|
69 |
|
70 TBool CGfxTransAdapterStub::IsActive() |
|
71 { |
|
72 return ETrue; |
|
73 } |
|
74 |
|
75 TControlPolicy* CGfxTransAdapterStub::GetTransitionPolicies(TInt& /* aCount*/) |
|
76 { |
|
77 return NULL; |
|
78 } |
|
79 |
|
80 void CGfxTransAdapterStub::StartTransition(TInt aHandle) |
|
81 { |
|
82 //Get information about the transition collected by the client like this: |
|
83 const CTransitionData* transition; |
|
84 iClient->GetTransitionData(aHandle,transition); |
|
85 |
|
86 //Check gfxtransdatatype.h to see what information is available through CTransitionData. |
|
87 |
|
88 |
|
89 // A start transition call from the client MUST always be followed by a transitionfinished callback to it. |
|
90 // If not getting it, the client can't know when to clean up the transition information. |
|
91 iClient->TransitionFinished(aHandle); |
|
92 } |
|
93 |
|
94 void CGfxTransAdapterStub::NotifyExternalState(TInt /*aState*/, const TDesC8* /* aArg */) |
|
95 { |
|
96 //This one is called if the new NotifyExternalState API function is called. |
|
97 // anything passed in from the API gets through to here unmodified. |
|
98 } |
|
99 |
|
100 void CGfxTransAdapterStub::HandleParticpantUpdate(TInt /*aHandle*/, const CParticipantData* /*aParticipant*/, RWsGraphicMsgBuf* /*aCommandBuffer*/, const TRect& /*aDrawRect*/, const TRect& /*aBoundingRect*/) |
|
101 { |
|
102 //This function will be called if the client finds a participant has been updated (called drawnow on) |
|
103 //while the transition is animating. |
|
104 //(That is, after End has return, but before the client has got TransitionFinished from the adapter) |
|
105 |
|
106 //For this stubadapter, this can never happen since all transitions are finished immediatly. |
|
107 //A real adapter would though do this in an async way, returning from StartTransition without calling |
|
108 //TransitionFinished, and then call this at a later point when the animation has finished. |
|
109 } |
|
110 |
|
111 void CGfxTransAdapterStub::BeginFullScreen(TUint /*aAction*/, const TRect& /*aEffectArea*/) |
|
112 { |
|
113 } |
|
114 |
|
115 void CGfxTransAdapterStub::BeginFullScreen(TUint /*aAction*/, const TRect& /*aEffectArea*/, TUint /*aType*/, const TDesC8& /*aParams*/) |
|
116 { |
|
117 } |
|
118 |
|
119 void CGfxTransAdapterStub::EndFullScreen() |
|
120 { |
|
121 } |
|
122 |
|
123 void CGfxTransAdapterStub::AbortFullScreen() |
|
124 { |
|
125 } |