|
1 /* |
|
2 * Copyright (c) 2008 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: command process for close conversation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "cvimpstcmdcloseconversation.h" |
|
21 |
|
22 #include "vimpstcmd.hrh" |
|
23 #include "mvimpstcmdobserver.h" |
|
24 |
|
25 #include "uiservicetabtracer.h" |
|
26 |
|
27 #include <e32def.h> |
|
28 #include "mvimpstengine.h" |
|
29 #include "mvimpstenginesubservice.h" |
|
30 #include "mvimpstengineimsubservice.h" |
|
31 |
|
32 // Constants |
|
33 |
|
34 // -------------------------------------------------------------------------- |
|
35 // CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation |
|
36 // -------------------------------------------------------------------------- |
|
37 // |
|
38 CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation( const TInt aCommandId, |
|
39 const TDesC& aContactId, |
|
40 MVIMPSTEngine& aEngine ): |
|
41 iCommandId( aCommandId ), |
|
42 iContactId( aContactId ), |
|
43 iEngine(aEngine) |
|
44 { |
|
45 } |
|
46 |
|
47 // -------------------------------------------------------------------------- |
|
48 // CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation |
|
49 // -------------------------------------------------------------------------- |
|
50 // |
|
51 CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation() |
|
52 { |
|
53 |
|
54 } |
|
55 |
|
56 // -------------------------------------------------------------------------- |
|
57 // CVIMPSTCmdCloseConversation::NewL |
|
58 // -------------------------------------------------------------------------- |
|
59 // |
|
60 CVIMPSTCmdCloseConversation* CVIMPSTCmdCloseConversation::NewL( const TInt aCommandId, |
|
61 const TDesC& aContactId, |
|
62 MVIMPSTEngine& aEngine ) |
|
63 { |
|
64 TRACER_AUTO; |
|
65 CVIMPSTCmdCloseConversation* self = new (ELeave ) CVIMPSTCmdCloseConversation( aCommandId ,aContactId, aEngine); |
|
66 self->ConstructL(); //use contsurctL if necessary |
|
67 return self; |
|
68 } |
|
69 // -------------------------------------------------------------------------- |
|
70 // CVIMPSTCmdCloseConversation::ConstructL |
|
71 // -------------------------------------------------------------------------- |
|
72 // |
|
73 void CVIMPSTCmdCloseConversation::ConstructL() |
|
74 { |
|
75 iError = KErrNone; |
|
76 } |
|
77 |
|
78 // -------------------------------------------------------------------------- |
|
79 // CVIMPSTCmdCloseConversation::ExecuteLD |
|
80 // -------------------------------------------------------------------------- |
|
81 // |
|
82 void CVIMPSTCmdCloseConversation::ExecuteLD() |
|
83 { |
|
84 |
|
85 TRACER_AUTO; |
|
86 //push to the cleanupstack |
|
87 CleanupStack::PushL( this ); |
|
88 |
|
89 //Get IM SubService |
|
90 MVIMPSTEngineSubService* subService1 = |
|
91 (iEngine.SubService(TVIMPSTEnums::EIM)); |
|
92 |
|
93 if(subService1) |
|
94 { |
|
95 MVIMPSTEngineIMSubService& imSubService = |
|
96 MVIMPSTEngineIMSubService::Cast (*subService1); |
|
97 imSubService.CloseConversationL( iContactId ); |
|
98 } |
|
99 |
|
100 if(iObserver) |
|
101 { |
|
102 iObserver->CommandFinishedL(*this); |
|
103 } |
|
104 |
|
105 |
|
106 CleanupStack::PopAndDestroy(); |
|
107 |
|
108 } |
|
109 |
|
110 |
|
111 // -------------------------------------------------------------------------- |
|
112 // CVIMPSTCmdCloseConversation::AddObserver |
|
113 // -------------------------------------------------------------------------- |
|
114 // |
|
115 void CVIMPSTCmdCloseConversation::AddObserver( MVIMPSTCmdObserver& aObserver ) |
|
116 { |
|
117 // store the observer to notify the command completion |
|
118 iObserver = &aObserver; |
|
119 } |
|
120 |
|
121 |
|
122 // -------------------------------------------------------------------------- |
|
123 // CVIMPSTCmdCloseConversation::CommandId |
|
124 // -------------------------------------------------------------------------- |
|
125 // |
|
126 TInt CVIMPSTCmdCloseConversation::CommandId() const |
|
127 { |
|
128 return iCommandId; |
|
129 } |
|
130 |
|
131 // -------------------------------------------------------------------------- |
|
132 // CVIMPSTCmdCloseConversation::Result |
|
133 // -------------------------------------------------------------------------- |
|
134 // |
|
135 TInt CVIMPSTCmdCloseConversation::Result() const |
|
136 { |
|
137 //return valid data regd the command operation |
|
138 return iError; |
|
139 } |
|
140 |
|
141 // End of File |