|
1 /* |
|
2 * Copyright (c) 2005 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: Implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 #include "TMCETestUIEngineCmdAcceptEvent.h" |
|
23 #include "CMCETestUIEngineInEvent.h" |
|
24 #include "CMCETestUIQuestionDataQuery.h" |
|
25 #include "CMCETestUIQuestionSingleSelection.h" |
|
26 #include <MCEInEvent.h> |
|
27 #include <mceinrefer.h> |
|
28 |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // TMCETestUIEngineCmdAcceptEvent::TMCETestUIEngineCmdAcceptEvent |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TMCETestUIEngineCmdAcceptEvent::TMCETestUIEngineCmdAcceptEvent( |
|
35 CMCETestUIEngine& aEngine, |
|
36 CMCETestUIEngineInEvent& aInEvent ) |
|
37 : TMCETestUIEngineCmdBase( aEngine ), |
|
38 iInEvent( aInEvent) |
|
39 { |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // TMCETestUIEngineCmdAcceptEvent::ExecuteL |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 EXPORT_C void TMCETestUIEngineCmdAcceptEvent::ExecuteL() |
|
47 { |
|
48 iInEvent.InEvent().AcceptL(); |
|
49 iEngine.EngineStateChangedL(); |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // TMCETestUIEngineCmdAcceptEvent::Caption |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C const TDesC& TMCETestUIEngineCmdAcceptEvent::Caption() const |
|
57 { |
|
58 return KCommandCaptionAcceptEvent; |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // TMCETestUIEngineCmdAcceptRefer::TMCETestUIEngineCmdAcceptRefer |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 TMCETestUIEngineCmdAcceptRefer::TMCETestUIEngineCmdAcceptRefer( |
|
66 CMCETestUIEngine& aEngine, |
|
67 CMCETestUIEngineInRefer& aInRefer ) |
|
68 : TMCETestUIEngineCmdBase( aEngine ), |
|
69 iInRefer( aInRefer) |
|
70 { |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // TMCETestUIEngineCmdAcceptRefer::ExecuteL |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 EXPORT_C void TMCETestUIEngineCmdAcceptRefer::ExecuteL() |
|
78 { |
|
79 iEngine.CreateInEventL(iInRefer.InRefer().AcceptL()); |
|
80 iEngine.EngineStateChangedL(); |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // TMCETestUIEngineCmdAcceptRefer::Caption |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C const TDesC& TMCETestUIEngineCmdAcceptRefer::Caption() const |
|
88 { |
|
89 return KCommandCaptionAcceptRefer; |
|
90 } |
|
91 // ----------------------------------------------------------------------------- |
|
92 // TMCETestUIEngineCmdRespondRefer::TMCETestUIEngineCmdRespondRefer |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 TMCETestUIEngineCmdRespondRefer::TMCETestUIEngineCmdRespondRefer( |
|
96 CMCETestUIEngine& aEngine, |
|
97 CMCETestUIEngineInRefer& aInRefer ) |
|
98 : TMCETestUIEngineCmdBase( aEngine ), |
|
99 iInRefer( aInRefer) |
|
100 { |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // TMCETestUIEngineCmdRespondRefer::ExecuteL |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 EXPORT_C void TMCETestUIEngineCmdRespondRefer::ExecuteL() |
|
108 { |
|
109 TSessionResponseValues responseValues; |
|
110 if(iEngine.SessionResponseValues( responseValues)) |
|
111 { |
|
112 CMCETestUIQuestionDataQuery* question = |
|
113 CMCETestUIQuestionDataQuery::NewLC(); |
|
114 question->SetCaptionL( KUserQuestionInputRecipient ); |
|
115 question->SetDefaultValueL(responseValues.reason ); |
|
116 question->SetAnswerL( responseValues.reason ); |
|
117 TBufC8<100> reason( question->Answer8() ); |
|
118 CleanupStack::PopAndDestroy( question ); |
|
119 iEngine.CreateInEventL(iInRefer.InRefer().RespondL(reason,responseValues.code)); |
|
120 } |
|
121 iEngine.EngineStateChangedL(); |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // TMCETestUIEngineCmdRespondRefer::Caption |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 EXPORT_C const TDesC& TMCETestUIEngineCmdRespondRefer::Caption() const |
|
129 { |
|
130 return KCommandCaptionRespondRefer; |
|
131 } |
|
132 |
|
133 // End of File |