|
1 // Copyright (c) 1997-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 // The implementation of the transition classes upon the CMailtoSchemeHandler class methods. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @SYMCreationDate Created : 24/05/01 15:57:46 |
|
21 */ |
|
22 |
|
23 // ______________________________________________________________________________ |
|
24 // |
|
25 _LIT(KMailtoSchemeHandlerNewLTransition,"CMailtoSchemeHandler_NewL_Transition"); |
|
26 |
|
27 inline CMailtoSchemeHandler_NewL_Transition::CMailtoSchemeHandler_NewL_Transition(CUnitTestContext& aUTContext, |
|
28 TTransitionValidator& aValidator) |
|
29 : CTransitionType(KMailtoSchemeHandlerNewLTransition, aUTContext, aValidator) |
|
30 { |
|
31 // Do nothing here. |
|
32 } |
|
33 |
|
34 inline void CMailtoSchemeHandler_NewL_Transition::TransitMethodL() |
|
35 { |
|
36 _LIT(KMailtoSchemeHandlerNewLTransitMethod, "CMailtoSchemeHandler::NewL transition"); |
|
37 Context().DataLogger().LogInformation(KMailtoSchemeHandlerNewLTransitMethod); |
|
38 Context().iMailtoSchemeHandler = CMailtoSchemeHandler::NewL(); |
|
39 } |
|
40 |
|
41 inline CMailtoSchemeHandler_UnitTestContext& CMailtoSchemeHandler_NewL_Transition::Context() const |
|
42 { |
|
43 return REINTERPRET_CAST(CMailtoSchemeHandler_UnitTestContext&,iUTContext); |
|
44 } |
|
45 |
|
46 // ______________________________________________________________________________ |
|
47 // |
|
48 _LIT(KMailtoSchemeHandlerDtorTransition,"CMailtoSchemeHandler_Dtor_Transition"); |
|
49 |
|
50 inline CMailtoSchemeHandler_Dtor_Transition::CMailtoSchemeHandler_Dtor_Transition(CUnitTestContext& aUTContext, |
|
51 TTransitionValidator& aValidator) |
|
52 : CTransitionType(KMailtoSchemeHandlerDtorTransition, aUTContext, aValidator) |
|
53 { |
|
54 // Do nothing here. |
|
55 } |
|
56 |
|
57 inline void CMailtoSchemeHandler_Dtor_Transition::TransitMethodL() |
|
58 { |
|
59 _LIT(KMailtoSchemeHandlerDtorTransitMethod, "CMailtoSchemeHandler::Dtor transition"); |
|
60 Context().DataLogger().LogInformation(KMailtoSchemeHandlerDtorTransitMethod); |
|
61 delete Context().iMailtoSchemeHandler; |
|
62 Context().iMailtoSchemeHandler = NULL; |
|
63 } |
|
64 |
|
65 inline CMailtoSchemeHandler_UnitTestContext& CMailtoSchemeHandler_Dtor_Transition::Context() const |
|
66 { |
|
67 return REINTERPRET_CAST(CMailtoSchemeHandler_UnitTestContext&,iUTContext); |
|
68 } |
|
69 |
|
70 |
|
71 |
|
72 // ______________________________________________________________________________ |
|
73 // |
|
74 _LIT(KMailtoSchemeHandlerParseUrlLTransition,"CMailtoSchemeHandler_ParseUrlL_Transition"); |
|
75 |
|
76 inline CMailtoSchemeHandler_ParseUrlL_Transition::CMailtoSchemeHandler_ParseUrlL_Transition(CUnitTestContext& aUTContext, |
|
77 TTransitionValidator& aValidator) |
|
78 : CTransitionType(KMailtoSchemeHandlerParseUrlLTransition, aUTContext, aValidator) |
|
79 { |
|
80 // Do nothing here. |
|
81 } |
|
82 |
|
83 inline void CMailtoSchemeHandler_ParseUrlL_Transition::TransitMethodL() |
|
84 { |
|
85 _LIT(KMailtoSchemeHandlerParseUrlLTransitMethod, "CMailtoSchemeHandler::ParseUrlL transition"); |
|
86 Context().DataLogger().LogInformation(KMailtoSchemeHandlerParseUrlLTransitMethod); |
|
87 /** |
|
88 Set up any asynchronous calls by setting iStatus = KRequestPending, |
|
89 calling SetActive() etc..., |
|
90 Handle method parameter passing, if any. |
|
91 N.B. Do the right thing on construction/destruction |
|
92 E.g. For heap based classes: |
|
93 If this is a d'tor, don't forget to NULL the iMailtoSchemeHandler pointer. |
|
94 and conversely if this is a c'tor assign the |
|
95 created class to the iMailtoSchemeHandler pointer. |
|
96 |
|
97 Note: To transit a private method you will almost certainly have to do |
|
98 something like this: |
|
99 REINTERPRET_CAST(TMailtoSchemeHandler_StateAccessor&, Context().StateAccessor()).ParseUrlL(Context().iMailtoSchemeHandler, Context().iParameter1, etc...); |
|
100 */ |
|
101 TMailtoSchemeHandler_StateAccessor& accessor = REINTERPRET_CAST(TMailtoSchemeHandler_StateAccessor&, Context().StateAccessor()); |
|
102 accessor.ParseUrlL(*(Context().iMailtoSchemeHandler), *Context().iUrl); |
|
103 } |
|
104 |
|
105 inline CMailtoSchemeHandler_UnitTestContext& CMailtoSchemeHandler_ParseUrlL_Transition::Context() const |
|
106 { |
|
107 return REINTERPRET_CAST(CMailtoSchemeHandler_UnitTestContext&,iUTContext); |
|
108 } |
|
109 |
|
110 |
|
111 // ______________________________________________________________________________ |
|
112 // |
|
113 _LIT(KMailtoSchemeHandlerParseUrlAndSendLTransition,"CMailtoSchemeHandler_ParseUrlAndSendL_Transition"); |
|
114 |
|
115 inline CMailtoSchemeHandler_ParseUrlAndSendL_Transition::CMailtoSchemeHandler_ParseUrlAndSendL_Transition(CUnitTestContext& aUTContext, |
|
116 TTransitionValidator& aValidator) |
|
117 : CTransition(KMailtoSchemeHandlerParseUrlAndSendLTransition, aUTContext, aValidator) |
|
118 { |
|
119 // Do nothing here. |
|
120 } |
|
121 |
|
122 inline void CMailtoSchemeHandler_ParseUrlAndSendL_Transition::TransitMethodL() |
|
123 { |
|
124 _LIT(KMailtoSchemeHandlerParseUrlAndSendLTransitMethod, "CMailtoSchemeHandler::ParseUrlAndSendL transition"); |
|
125 Context().DataLogger().LogInformation(KMailtoSchemeHandlerParseUrlAndSendLTransitMethod); |
|
126 /** |
|
127 Set up any asynchronous calls by setting iStatus = KRequestPending, |
|
128 calling SetActive() etc..., |
|
129 Handle method parameter passing, if any. |
|
130 N.B. Do the right thing on construction/destruction |
|
131 E.g. For heap based classes: |
|
132 If this is a d'tor, don't forget to NULL the iMailtoSchemeHandler pointer. |
|
133 and conversely if this is a c'tor assign the |
|
134 created class to the iMailtoSchemeHandler pointer. |
|
135 |
|
136 Note: To transit a private method you will almost certainly have to do |
|
137 something like this: |
|
138 REINTERPRET_CAST(TMailtoSchemeHandler_StateAccessor&, Context().StateAccessor()).ParseUrlAndSendL(Context().iMailtoSchemeHandler, Context().iParameter1, etc...); |
|
139 */ |
|
140 Context().iMailtoSchemeHandler->ParseUrlAndSendL(*Context().iUrl); |
|
141 } |
|
142 |
|
143 inline CMailtoSchemeHandler_UnitTestContext& CMailtoSchemeHandler_ParseUrlAndSendL_Transition::Context() const |
|
144 { |
|
145 return REINTERPRET_CAST(CMailtoSchemeHandler_UnitTestContext&,iUTContext); |
|
146 } |
|
147 |
|
148 |
|
149 // ______________________________________________________________________________ |
|
150 // |
|
151 _LIT(KMailtoSchemeHandlerCreateEmailLTransition,"CMailtoSchemeHandler_CreateEmailL_Transition"); |
|
152 |
|
153 |