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