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