1 /* |
|
2 * Copyright (c) 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: Sends UUI message. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cspuuimessagesender.h" |
|
20 #include "csplogger.h" |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // Constructor |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CSPUUIMessageSender::CSPUUIMessageSender( |
|
29 RMobileCall& aCall ) : |
|
30 CActive( CActive::EPriorityStandard ), |
|
31 iCall( aCall ), |
|
32 iUUSRequestPckg( iUUSRequest ) |
|
33 { |
|
34 CActiveScheduler::Add( this ); |
|
35 } |
|
36 |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // 2nd phase constructor |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 void CSPUUIMessageSender::ConstructL() |
|
43 { |
|
44 } |
|
45 |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // Static constructor |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CSPUUIMessageSender* CSPUUIMessageSender::NewL( |
|
52 RMobileCall& aCall ) |
|
53 { |
|
54 CSPUUIMessageSender* self = |
|
55 new( ELeave ) CSPUUIMessageSender( aCall ); |
|
56 CleanupStack::PushL( self ); |
|
57 self->ConstructL(); |
|
58 CleanupStack::Pop( self ); |
|
59 return self; |
|
60 } |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // Destructor |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 CSPUUIMessageSender::~CSPUUIMessageSender() |
|
67 { |
|
68 Cancel(); |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // Sends the UUI message. |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 void CSPUUIMessageSender::SendUUIMessage( const TDesC& aMessage ) |
|
76 { |
|
77 CSPLOGSTRING(CSPOBJECT, "CSPUUIMessageSender::SendUUIMessage start"); |
|
78 Cancel(); |
|
79 iUUSRequest.iServiceReq = RMobileCall::KUUS1Implicit; |
|
80 iUUSRequest.iUUI = aMessage; |
|
81 iCall.ActivateUUS( iStatus, iUUSRequestPckg ); |
|
82 SetActive(); |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------------------------- |
|
86 // From class CActive |
|
87 // Cancels the outstanding request. |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 void CSPUUIMessageSender::DoCancel() |
|
91 { |
|
92 iCall.CancelAsyncRequest( EMobileCallActivateUUS ); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // From class CActive |
|
97 // No need to react the completion. The message is sent or not. |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void CSPUUIMessageSender::RunL() |
|
101 { |
|
102 CSPLOGSTRING2(CSPINT, "CSPUUIMessageSender::RunL %d iStatus", iStatus.Int() ); |
|
103 } |
|