1 /* |
|
2 * Copyright (c) 2009-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cperemotepartyinfoproxy.h" |
|
19 |
|
20 #include <talogger.h> |
|
21 |
|
22 |
|
23 |
|
24 // ======== MEMBER FUNCTIONS ======== |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // Constructor |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 CPERemotePartyInfoProxy::CPERemotePartyInfoProxy( MPEMediator& aMediator ) |
|
31 :iMediator( aMediator ) |
|
32 { |
|
33 |
|
34 } |
|
35 |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // Second phase constructor. |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CPERemotePartyInfoProxy::ConstructL() |
|
42 { |
|
43 |
|
44 } |
|
45 |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // Static constructor |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CPERemotePartyInfoProxy* CPERemotePartyInfoProxy::NewL( MPEMediator& aMediator ) |
|
52 { |
|
53 CPERemotePartyInfoProxy* self = CPERemotePartyInfoProxy::NewLC( aMediator ); |
|
54 CleanupStack::Pop( self ); |
|
55 return self; |
|
56 } |
|
57 |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // Static constructor |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 CPERemotePartyInfoProxy* CPERemotePartyInfoProxy::NewLC( MPEMediator& aMediator ) |
|
64 { |
|
65 CPERemotePartyInfoProxy* self = new( ELeave ) CPERemotePartyInfoProxy( aMediator ); |
|
66 CleanupStack::PushL( self ); |
|
67 self->ConstructL(); |
|
68 return self; |
|
69 } |
|
70 |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // Destructor |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CPERemotePartyInfoProxy::~CPERemotePartyInfoProxy() |
|
77 { |
|
78 delete iRemotePartyData; |
|
79 } |
|
80 |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // From base class MPEMediator |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 void CPERemotePartyInfoProxy::SendResponse( TUid aCategory, |
|
87 TInt aCommandId, |
|
88 const TDesC8& aData ) |
|
89 { |
|
90 TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::SendResponse(): IN" ); |
|
91 |
|
92 iRemotePartyData = aData.Alloc(); |
|
93 |
|
94 // No need to filter command responses |
|
95 iMediator.SendResponse( aCategory, |
|
96 aCommandId, |
|
97 aData ); |
|
98 |
|
99 TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::SendResponse(): OUT" ); |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // From base class MPEMediator |
|
104 // --------------------------------------------------------------------------- |
|
105 // |
|
106 void CPERemotePartyInfoProxy::RaiseEvent( TUid aCategory, |
|
107 TInt aEventId, |
|
108 const TDesC8& aData ) |
|
109 { |
|
110 TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::RaiseEvent(): IN" ); |
|
111 |
|
112 |
|
113 |
|
114 // if changes in data or no data --> update proxy's data and pass event forward. |
|
115 if ( !iRemotePartyData || !iRemotePartyData->Match( aData ) == KErrNone ) |
|
116 { |
|
117 delete iRemotePartyData; |
|
118 iRemotePartyData = aData.Alloc(); |
|
119 iMediator.RaiseEvent( aCategory, |
|
120 aEventId, |
|
121 aData ); |
|
122 } |
|
123 |
|
124 TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::RaiseEvent(): OUT" ); |
|
125 } |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|