|
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: Implements CNcdServerReportOperationProxy |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <s32strm.h> |
|
20 #include "ncdserverreportoperationproxy.h" |
|
21 #include "ncdserverreportoperationobserver.h" |
|
22 #include "ncdoperationproxyremovehandler.h" |
|
23 #include "catalogsclientserver.h" |
|
24 |
|
25 #include "catalogsdebug.h" |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 CNcdServerReportOperationProxy* CNcdServerReportOperationProxy::NewL( |
|
34 MCatalogsClientServer& aSession, |
|
35 CNcdNodeManagerProxy* aNodeManager, |
|
36 TInt aHandle, |
|
37 MNcdOperationProxyRemoveHandler& aRemoveHandler, |
|
38 MNcdServerReportOperationObserver& aObserver ) |
|
39 { |
|
40 CNcdServerReportOperationProxy* self = CNcdServerReportOperationProxy::NewLC( |
|
41 aSession, aNodeManager, aHandle, aRemoveHandler, aObserver ); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CNcdServerReportOperationProxy* CNcdServerReportOperationProxy::NewLC( |
|
52 MCatalogsClientServer& aSession, |
|
53 CNcdNodeManagerProxy* aNodeManager, |
|
54 TInt aHandle, |
|
55 MNcdOperationProxyRemoveHandler& aRemoveHandler, |
|
56 MNcdServerReportOperationObserver& aObserver ) |
|
57 { |
|
58 CNcdServerReportOperationProxy* self = |
|
59 new (ELeave) CNcdServerReportOperationProxy( aObserver ); |
|
60 |
|
61 self->AddRef(); |
|
62 CleanupReleasePushL( *self ); |
|
63 self->ConstructL( aSession, aNodeManager, aHandle, aRemoveHandler ); |
|
64 return self; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // From MNcdOperation |
|
69 // Operation type getter |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 TNcdInterfaceId CNcdServerReportOperationProxy::OperationType() const |
|
73 { |
|
74 return static_cast< TNcdInterfaceId >( MNcdServerReportOperation::KInterfaceUid ); |
|
75 } |
|
76 |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // Constructor |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 CNcdServerReportOperationProxy::CNcdServerReportOperationProxy( MNcdServerReportOperationObserver& aObserver ) |
|
83 : CNcdOperation< MNcdServerReportOperation >( NULL ), iObserver( aObserver ) |
|
84 { |
|
85 } |
|
86 |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // Destructor |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 CNcdServerReportOperationProxy::~CNcdServerReportOperationProxy() |
|
93 { |
|
94 DLTRACEIN( ( "" ) ); |
|
95 DLTRACE(("Removing proxy from remove handler")); |
|
96 if ( iRemoveHandler ) |
|
97 { |
|
98 iRemoveHandler->RemoveOperationProxy( *this ); |
|
99 } |
|
100 } |
|
101 |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // ConstructL |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 void CNcdServerReportOperationProxy::ConstructL( |
|
108 MCatalogsClientServer& aSession, |
|
109 CNcdNodeManagerProxy* aNodeManager, |
|
110 TInt aHandle, |
|
111 MNcdOperationProxyRemoveHandler& aRemoveHandler ) |
|
112 { |
|
113 DLTRACEIN( ( "" ) ); |
|
114 CNcdBaseOperationProxy::ConstructL( aSession, aHandle, &aRemoveHandler, |
|
115 NULL, aNodeManager ); |
|
116 } |
|
117 |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // Handle progress callback |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void CNcdServerReportOperationProxy::ProgressCallback() |
|
124 { |
|
125 DLTRACEIN( ( "" ) ); |
|
126 } |
|
127 |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // Handle query received callback |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 void CNcdServerReportOperationProxy::QueryReceivedCallback( CNcdQuery* /*aQuery*/ ) |
|
134 { |
|
135 DLTRACEIN( ( "" ) ); |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // Handle operation complete |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void CNcdServerReportOperationProxy::CompleteCallback( TInt aError ) |
|
143 { |
|
144 DLTRACEIN( ( "Error: %d", aError ) ); |
|
145 AddRef(); // in case last reference would be released in OperationComplete callback. |
|
146 iObserver.OperationComplete( *this, aError ); |
|
147 Release(); |
|
148 } |