|
1 /* |
|
2 * Copyright (c) 2006 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: Concrete bind operation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <ximpprotocolconnection.h> |
|
20 #include <protocolpresentitygroups.h> |
|
21 #include <protocolpresencefeatures.h> |
|
22 |
|
23 #include "operationupdatepresentitygroupdisplayname.h" |
|
24 #include "presentitygroupinfoimp.h" |
|
25 #include "ximpobjecthelpers.h" |
|
26 #include "ximpidentity.h" |
|
27 #include "ximprestrictedobjectcollectionimp.h" |
|
28 #include "protocolpresentitygroupsdatahostimp.h" |
|
29 #include "ximphost.h" |
|
30 #include "ximpstatusimp.h" |
|
31 #include "ximprequestcompleteeventimp.h" |
|
32 #include "protocolpresencedatahostimp.h" |
|
33 |
|
34 #include "ximptrace.h" |
|
35 // ======== MEMBER FUNCTIONS ======== |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // COperationUpdatePresentityGroupDisplayName::COperationUpdatePresentityGroupDisplayName() |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C COperationUpdatePresentityGroupDisplayName::COperationUpdatePresentityGroupDisplayName() |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // COperationUpdatePresentityGroupDisplayName::ConstructL |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 void COperationUpdatePresentityGroupDisplayName::ConstructL( const TDesC8& aParamPck ) |
|
51 { |
|
52 CPresentityGroupInfoImp* groupInfo = CPresentityGroupInfoImp::NewLC(); |
|
53 TXIMPObjectPacker< CPresentityGroupInfoImp >::UnPackL( *groupInfo, |
|
54 aParamPck ); |
|
55 CleanupStack::Pop( groupInfo ); |
|
56 iGroupInfo = groupInfo; |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // COperationUpdatePresentityGroupDisplayName::~COperationUpdatePresentityGroupDisplayName() |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 COperationUpdatePresentityGroupDisplayName::~COperationUpdatePresentityGroupDisplayName() |
|
64 { |
|
65 delete iGroupInfo; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // COperationUpdatePresentityGroupDisplayName::ProcessL() |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 void COperationUpdatePresentityGroupDisplayName::ProcessL() |
|
73 { |
|
74 TRACE(_L("COperationUpdatePresentityGroupDisplayName::ProcessL()" ) ); |
|
75 CXIMPOperationBase::ProcessL(); |
|
76 |
|
77 MProtocolPresentityGroups& presentityGroups = iMyHost->GetConnection().ProtocolPresenceFeatures().PresentityGroups(); |
|
78 |
|
79 presentityGroups.DoUpdatePresentityGroupDisplayNameL( iGroupInfo->GroupId(), |
|
80 iGroupInfo->GroupDisplayName(), iReqId ); |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // COperationUpdatePresentityGroupDisplayName::RequestCompleted() |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 void COperationUpdatePresentityGroupDisplayName::RequestCompletedL() |
|
88 { |
|
89 TRACE(_L("COperationUpdatePresentityGroupDisplayName::RequestCompletedL()" ) ); |
|
90 CXIMPOperationBase::RequestCompletedL(); |
|
91 |
|
92 MXIMPBase* object = NULL; |
|
93 iObjCollection->GetByType( object, MPresentityGroupInfo::KInterfaceId ); |
|
94 if( object ) |
|
95 { |
|
96 CPresentityGroupInfoImp* groupInfo = |
|
97 TXIMPGetImpClassOrPanic< CPresentityGroupInfoImp >::From( *object ); |
|
98 |
|
99 delete iGroupInfo; |
|
100 iGroupInfo = groupInfo; |
|
101 } |
|
102 |
|
103 if ( iStatusObj->ResultCode() == KErrNone ) |
|
104 { |
|
105 CPresentityGroupInfoImp* groupInfo = |
|
106 TXIMPObjectCloner< CPresentityGroupInfoImp >::CloneL( *iGroupInfo ); |
|
107 CleanupStack::PushL( groupInfo ); |
|
108 iMyHost->PresenceDataAccess().GroupsDataAccess().HandlePresentityGroupDisplayNameUpdatedL( groupInfo ); |
|
109 CleanupStack::Pop( groupInfo ); |
|
110 } |
|
111 |
|
112 // Set information for request complete event. |
|
113 iReqCompleteEvent->AppendParamL( ( CXIMPApiDataObjBase* ) iGroupInfo ); |
|
114 iGroupInfo = NULL; |
|
115 } |
|
116 |
|
117 // --------------------------------------------------------------------------- |
|
118 // COperationUpdatePresentityGroupDisplayName::Type() |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 TInt COperationUpdatePresentityGroupDisplayName::Type() const |
|
122 { |
|
123 return NPresenceOps::EPrUpdatePresentityGroupDisplayName; |
|
124 } |
|
125 |
|
126 // End of file |