|
1 /* |
|
2 * Copyright (c) 2008-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 the License "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 * sifinstallerrequest.cpp |
|
16 * This file implements the CSifTransportTask class. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #include <usif/sif/siftransporttask.h> |
|
22 #include <usif/usiferror.h> |
|
23 |
|
24 using namespace Usif; |
|
25 |
|
26 EXPORT_C TTransportTaskParams::TTransportTaskParams() |
|
27 : iComponentInfo(NULL), |
|
28 iComponentId(EInvalidComponentId), |
|
29 iFileName(NULL), |
|
30 iFileHandle(NULL), |
|
31 iCustomArguments(NULL), |
|
32 iCustomResults(NULL), |
|
33 iRequestStatus(NULL) |
|
34 { |
|
35 } |
|
36 |
|
37 // =========================================================================================================== |
|
38 |
|
39 EXPORT_C CSifTransportTask::CSifTransportTask(TTransportTaskParams& aParams, TBool aAutoCompletion) |
|
40 : iParams(aParams), iAutoCompletion(aAutoCompletion) |
|
41 { |
|
42 } |
|
43 |
|
44 EXPORT_C CSifTransportTask::~CSifTransportTask() |
|
45 { |
|
46 } |
|
47 |
|
48 TBool CSifTransportTask::Execute() |
|
49 { |
|
50 TBool done(EFalse); |
|
51 TRAPD(err, done = ExecuteImplL()); |
|
52 if (err != KErrNone) |
|
53 { |
|
54 TRequestStatus* status(iParams.iRequestStatus); |
|
55 User::RequestComplete(status, err); |
|
56 done = ETrue; |
|
57 } |
|
58 else if (iAutoCompletion) |
|
59 { |
|
60 TRequestStatus* status(iParams.iRequestStatus); |
|
61 User::RequestComplete(status, KErrNone); |
|
62 } |
|
63 return done; |
|
64 } |
|
65 |
|
66 void CSifTransportTask::Cancel() |
|
67 { |
|
68 CancelImpl(); |
|
69 } |
|
70 |
|
71 EXPORT_C void CSifTransportTask::CancelImpl() |
|
72 { |
|
73 } |
|
74 |
|
75 EXPORT_C TComponentId CSifTransportTask::ComponentId() const |
|
76 { |
|
77 return iParams.iComponentId; |
|
78 } |
|
79 |
|
80 EXPORT_C const TDesC* CSifTransportTask::FileName() const |
|
81 { |
|
82 return iParams.iFileName; |
|
83 } |
|
84 |
|
85 EXPORT_C RFile* CSifTransportTask::FileHandle() |
|
86 { |
|
87 return iParams.iFileHandle; |
|
88 } |
|
89 |
|
90 EXPORT_C const COpaqueNamedParams* CSifTransportTask::CustomArguments() const |
|
91 { |
|
92 return iParams.iCustomArguments; |
|
93 } |
|
94 |
|
95 EXPORT_C COpaqueNamedParams* CSifTransportTask::CustomResults() |
|
96 { |
|
97 return iParams.iCustomResults; |
|
98 } |
|
99 |
|
100 EXPORT_C const TSecurityContext* CSifTransportTask::SecurityContext() const |
|
101 { |
|
102 return iParams.iSecurityContext; |
|
103 } |
|
104 |
|
105 EXPORT_C TRequestStatus* CSifTransportTask::RequestStatus() |
|
106 { |
|
107 return iParams.iRequestStatus; |
|
108 } |
|
109 |
|
110 EXPORT_C CComponentInfo* CSifTransportTask::ComponentInfo() |
|
111 { |
|
112 return iParams.iComponentInfo; |
|
113 } |