|
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: Withdraw presence from presentity |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <ximpprotocolconnection.h> |
|
20 #include <protocolpresenceauthorization.h> |
|
21 #include <protocolpresencefeatures.h> |
|
22 |
|
23 #include "operationcancelpresenceblockfrompresentity.h" |
|
24 #include "presenceblockinfoimp.h" |
|
25 #include "ximpidentityimp.h" |
|
26 #include "ximpobjecthelpers.h" |
|
27 #include "protocolpresenceauthorizationdatahostimp.h" |
|
28 #include "ximprestrictedobjectcollectionimp.h" |
|
29 #include "ximphost.h" |
|
30 #include "ximpstatusimp.h" |
|
31 #include "protocolpresencedatahostimp.h" |
|
32 |
|
33 #include "ximptrace.h" |
|
34 |
|
35 // ============================ MEMBER FUNCTIONS ============================= |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // COperationCancelPresenceBlockFromPresentity::COperationCancelPresenceBlockFromPresentity() |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C COperationCancelPresenceBlockFromPresentity::COperationCancelPresenceBlockFromPresentity() |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // COperationCancelPresenceBlockFromPresentity::~COperationCancelPresenceBlockFromPresentity() |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 COperationCancelPresenceBlockFromPresentity::~COperationCancelPresenceBlockFromPresentity() |
|
51 { |
|
52 delete iIdentity; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // COperationCancelPresenceBlockFromPresentity::ConstructL() |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 void COperationCancelPresenceBlockFromPresentity::ConstructL( const TDesC8& aParamPck ) |
|
60 { |
|
61 iIdentity = CXIMPIdentityImp::NewLC(); |
|
62 CleanupStack::Pop( iIdentity ); |
|
63 TXIMPObjectPacker< CXIMPIdentityImp >::UnPackL( *iIdentity, aParamPck ); |
|
64 } |
|
65 |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // COperationCancelPresenceBlockFromPresentity::ProcessL() |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 void COperationCancelPresenceBlockFromPresentity::ProcessL() |
|
72 { |
|
73 TRACE(_L("COperationCancelPresenceBlockFromPresentity::ProcessL()" ) ); |
|
74 CXIMPOperationBase::ProcessL(); |
|
75 |
|
76 MProtocolPresenceAuthorization& authorization = |
|
77 iMyHost->GetConnection().ProtocolPresenceFeatures().PresenceAuthorization(); |
|
78 |
|
79 authorization.DoCancelPresenceBlockFromPresentityL( *iIdentity, iReqId ); |
|
80 |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // COperationCancelPresenceBlockFromPresentity::RequestCompleted() |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 void COperationCancelPresenceBlockFromPresentity::RequestCompletedL() |
|
88 { |
|
89 TRACE(_L("COperationCancelPresenceBlockFromPresentity::RequestCompletedL()" ) ); |
|
90 CXIMPOperationBase::RequestCompletedL(); |
|
91 |
|
92 MXIMPBase* object = NULL; |
|
93 iObjCollection->GetByType( object, |
|
94 MPresenceBlockInfo::KInterfaceId ); |
|
95 if( object ) |
|
96 { |
|
97 CPresenceBlockInfoImp* blockInfo = |
|
98 TXIMPGetImpClassOrPanic< CPresenceBlockInfoImp >::From( *object ); |
|
99 CleanupStack::PushL( blockInfo ); |
|
100 delete iIdentity; |
|
101 iIdentity = NULL; |
|
102 iIdentity = TXIMPObjectCloner< CXIMPIdentityImp >::CloneL( |
|
103 blockInfo->IdentityImp() ); |
|
104 CleanupStack::PopAndDestroy( blockInfo ); |
|
105 } |
|
106 |
|
107 if ( iStatusObj->ResultCode() == KErrNone ) |
|
108 { |
|
109 iMyHost->PresenceDataAccess().AuthorizationDataAccess().HandlePresenceBlockCanceledL( iIdentity ); |
|
110 iIdentity = NULL; |
|
111 } |
|
112 SynthesiseEventL(); |
|
113 } |
|
114 |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // COperationCancelPresenceBlockFromPresentity::Type() |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 TInt |
|
121 COperationCancelPresenceBlockFromPresentity::Type() const |
|
122 { |
|
123 return NPresenceOps::EPrCancelPresenceBlockFromPresentity; |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // COperationCancelPresenceBlockFromPresentity::SynthesiseEventL() |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 void COperationCancelPresenceBlockFromPresentity::SynthesiseEventL() |
|
131 { |
|
132 } |
|
133 |
|
134 |
|
135 |
|
136 // End of file |