1 /* |
|
2 * Copyright (c) 2007-2008 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: cosssenddataoperation.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include <e32std.h> |
|
20 |
|
21 #include "cosssenddataoperation.h" |
|
22 #include "ossprotocolpluginlogger.h" |
|
23 |
|
24 // ======== MEMBER FUNCTIONS ======== |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // COssSendDataOperation::COssSendDataOperation() |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 COssSendDataOperation::COssSendDataOperation () |
|
31 : iOpId ( KErrNone ) |
|
32 { |
|
33 iData = NULL; |
|
34 LOGGER ( TXT ( "COssSendDataOperation::COssSendDataOperation Start End" ) ); |
|
35 } |
|
36 // --------------------------------------------------------------------------- |
|
37 // COssSendDataOperation::~COssSendDataOperation() |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 COssSendDataOperation::~COssSendDataOperation () |
|
41 { |
|
42 LOGGER ( TXT ( "COssSendDataOperation::~COssSendDataOperation Start" ) ); |
|
43 delete iData; |
|
44 |
|
45 if ( iStatus ) |
|
46 { |
|
47 User::RequestComplete ( iStatus, KErrCancel ); |
|
48 } |
|
49 |
|
50 LOGGER ( TXT ( "COssSendDataOperation::~COssSendDataOperation End" ) ); |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // COssSendDataOperation::SetIds() |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 void COssSendDataOperation::SetIds ( TInt aOperationId, TInt aLogId ) |
|
58 { |
|
59 LOGGER ( TXT ( "COssSendDataOperation::SetIds Start" ) ); |
|
60 iOpId = aOperationId; |
|
61 iLogId = aLogId; |
|
62 LOGGER ( TXT ( "COssSendDataOperation::SetIds End" ) ); |
|
63 } |
|
64 |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // COssSendDataOperation::SetRequestStatus() |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 void COssSendDataOperation::SetRequestStatus ( TRequestStatus& aStatus ) |
|
71 { |
|
72 LOGGER ( TXT ( "COssSendDataOperation::SetRequestStatus Start" ) ); |
|
73 iStatus = &aStatus; |
|
74 LOGGER ( TXT ( "COssSendDataOperation::SetRequestStatus End" ) ); |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // COssSendDataOperation::Status() |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 TRequestStatus* COssSendDataOperation::Status() |
|
82 { |
|
83 LOGGER ( TXT ( "COssSendDataOperation::Status Start-End" ) ); |
|
84 return iStatus; |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // COssSendDataOperation::OperationId() |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 TInt COssSendDataOperation::OperationId() const |
|
92 { |
|
93 LOGGER ( TXT ( "COssSendDataOperation::OperationId Start-End" ) ); |
|
94 return iOpId; |
|
95 } |
|
96 // --------------------------------------------------------------------------- |
|
97 // COssSendDataOperation::NewLC() |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 COssSendDataOperation* COssSendDataOperation::NewLC() |
|
101 { |
|
102 LOGGER ( TXT ( "COssSendDataOperation::NewLC Start-End" ) ); |
|
103 COssSendDataOperation* self = new ( ELeave ) |
|
104 COssSendDataOperation(); |
|
105 |
|
106 CleanupStack::PushL ( self ); |
|
107 LOGGER ( TXT ( "COssSendDataOperation::NewLC End" ) ); |
|
108 return self; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // COssSendDataOperation::CompletedOperation() |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 void COssSendDataOperation::CompletedOperation ( TInt aCode ) |
|
116 { |
|
117 LOGGER ( TXT ( "COssSendDataOperation::CompletedOperation Start :id:%d,code:%d" ), |
|
118 iOpId, |
|
119 aCode ); |
|
120 |
|
121 if ( !iStatus ) |
|
122 { |
|
123 LOGGER ( TXT ( "COssSendDataOperation::CompletedOperation:!!Double Completion!!!" ) ); |
|
124 return; |
|
125 } |
|
126 |
|
127 User::RequestComplete ( iStatus, aCode ); |
|
128 |
|
129 iStatus = NULL; |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // COssSendDataOperation::SetResponse() |
|
134 // --------------------------------------------------------------------------- |
|
135 void COssSendDataOperation::SetResponse ( char* aBuff ) |
|
136 { |
|
137 LOGGER ( TXT ( "CPEngPureDataHandler::SetResponse - id: %d" ), iOpId ); |
|
138 delete iData; |
|
139 iData = aBuff; |
|
140 LOGGER ( TXT ( "COssSendDataOperation::SetResponse End" ) ); |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // COssSendDataOperation::Response() |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 char* COssSendDataOperation::Response() |
|
148 { |
|
149 LOGGER ( TXT ( "CPEngPureDataHandler::Response Start" ) ); |
|
150 char* b = iData; |
|
151 iData = NULL; |
|
152 LOGGER ( TXT ( "CPEngPureDataHandler::Response End" ) ); |
|
153 return b; |
|
154 } |
|
155 |
|
156 |
|
157 // End of File |
|