|
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: implementation of COperationHandleOwnPresence |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "operationhandleownpresence.h" |
|
20 |
|
21 #include "presenceinfoimp.h" |
|
22 #include "ximpobjecthelpers.h" |
|
23 #include "ownpresencesubscriptionitem.h" |
|
24 #include "presencedatacacheimp.h" |
|
25 #include "ximphost.h" |
|
26 |
|
27 #include "ximprestrictedobjectcollectionimp.h" |
|
28 #include "protocolpresencedatahostimp.h" |
|
29 |
|
30 #include "ximptrace.h" |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS ============================= |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // COperationHandleOwnPresence::~COperationHandleOwnPresence() |
|
36 // --------------------------------------------------------------------------- |
|
37 // |
|
38 COperationHandleOwnPresence::~COperationHandleOwnPresence() |
|
39 { |
|
40 delete iPresInfo; |
|
41 } |
|
42 |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // COperationHandleOwnPresence::COperationHandleOwnPresence() |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 EXPORT_C COperationHandleOwnPresence::COperationHandleOwnPresence() |
|
49 { |
|
50 } |
|
51 |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // COperationHandleOwnPresence::ConstructL() |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 void COperationHandleOwnPresence::ConstructL( const TDesC8& /* aParamPck */ ) |
|
58 { |
|
59 } |
|
60 |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // COperationHandleOwnPresence::ProcessL() |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 void COperationHandleOwnPresence::ProcessL() |
|
67 { |
|
68 TRACE(_L("COperationHandleOwnPresence::ProcessL()") ); |
|
69 CXIMPOperationBase::ProcessL(); |
|
70 |
|
71 MXIMPBase* object = NULL; |
|
72 iObjCollection->GetByType( object, MPresenceInfo::KInterfaceId ); |
|
73 if ( object ) |
|
74 { |
|
75 iPresInfo = TXIMPGetImpClassOrPanic< CPresenceInfoImp >::From( *object ); |
|
76 } |
|
77 else |
|
78 { |
|
79 User::Leave( KErrArgument ); |
|
80 } |
|
81 |
|
82 |
|
83 COwnPresenceSubscriptionItem& ownPresence = |
|
84 iMyHost->PresenceDataAccess().PresenceDataCache().OwnPresenceSubscriptionItemLC(); |
|
85 ownPresence.SetPresenceInfoL( iPresInfo ); |
|
86 iPresInfo = NULL; |
|
87 TRAPD( err, ownPresence.SynthesiseSubscriptionEventToAllCtxsL() ); |
|
88 CleanupStack::PopAndDestroy(); // ownPresence |
|
89 iMyHost->HandleAdaptationRequestCompleted( iReqId, err ); |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // COperationHandleOwnPresence::RequestCompleted() |
|
94 // --------------------------------------------------------------------------- |
|
95 // |
|
96 void COperationHandleOwnPresence::RequestCompletedL() |
|
97 { |
|
98 TRACE(_L("COperationHandleOwnPresence::RequestCompletedL()" ) ); |
|
99 CXIMPOperationBase::RequestCompletedL(); |
|
100 |
|
101 // no special handling for error situations |
|
102 } |
|
103 |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // COperationHandleOwnPresence::Type() |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 TInt COperationHandleOwnPresence::Type() const |
|
110 { |
|
111 return NPresenceOps::EPrHandleOwnPresence; |
|
112 } |
|
113 |
|
114 // End of file |