|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "SystemStartupDllInfo.h" |
|
17 |
|
18 // |
|
19 // Standard Symbian factory functions/destructor |
|
20 // |
|
21 |
|
22 CSystemStartupDllInfo* CSystemStartupDllInfo::NewL( ) |
|
23 { |
|
24 CSystemStartupDllInfo* self = CSystemStartupDllInfo::NewLC( ); |
|
25 CleanupStack::Pop(self); |
|
26 return self; |
|
27 } |
|
28 |
|
29 CSystemStartupDllInfo* CSystemStartupDllInfo::NewLC( ) |
|
30 { |
|
31 CSystemStartupDllInfo* self = new (ELeave) CSystemStartupDllInfo(); |
|
32 CleanupStack::PushL(self); |
|
33 self->Construct( ); |
|
34 return self; |
|
35 } |
|
36 |
|
37 CSystemStartupDllInfo::~CSystemStartupDllInfo() |
|
38 { |
|
39 delete iDllBuffer; |
|
40 delete iDllName; |
|
41 } |
|
42 |
|
43 CSystemStartupDllInfo::CSystemStartupDllInfo() |
|
44 {} |
|
45 |
|
46 void CSystemStartupDllInfo::Construct() |
|
47 {} |
|
48 |
|
49 |
|
50 // |
|
51 // Public accessor functions |
|
52 // |
|
53 |
|
54 // Set methods |
|
55 |
|
56 /** |
|
57 Set the DLL name. |
|
58 */ |
|
59 void CSystemStartupDllInfo::SetDllNameL(const TDesC& aDllName) |
|
60 { |
|
61 iDllName = aDllName.AllocL(); |
|
62 } |
|
63 |
|
64 /** |
|
65 Set the ordinal number of the function in the DLL |
|
66 to be executed |
|
67 */ |
|
68 void CSystemStartupDllInfo::SetOrdinal(TUint8 aOrdinal) |
|
69 { |
|
70 iOrdinal = aOrdinal; |
|
71 } |
|
72 |
|
73 |
|
74 /** Set a boolean indicating whether startup should fail or |
|
75 continue if DLL fails to load or DLL function returns an error code |
|
76 */ |
|
77 void CSystemStartupDllInfo::SetFailOnError(TBool aFail) |
|
78 { |
|
79 iFailOnError = aFail; |
|
80 } |
|
81 |
|
82 /** |
|
83 Set the number of times an attempt should be made to load a DLL/execute a |
|
84 DLL function in case of failure |
|
85 */ |
|
86 void CSystemStartupDllInfo::SetNoOfRetries(TUint8 aNoOfRetries) |
|
87 { |
|
88 iNoOfRetries = aNoOfRetries; |
|
89 } |
|
90 |
|
91 /** Set a pointer to the buffer containing data to be |
|
92 used by the DLL function |
|
93 */ |
|
94 void CSystemStartupDllInfo::SetDllBuffer( HBufC8* aDllBuffer) |
|
95 { |
|
96 iDllBuffer = aDllBuffer; |
|
97 } |
|
98 |
|
99 |
|
100 // Get methods |
|
101 |
|
102 /** |
|
103 Retrieve the DLL name. |
|
104 */ |
|
105 TPtrC CSystemStartupDllInfo::DllName() const |
|
106 { |
|
107 return (*iDllName); |
|
108 } |
|
109 |
|
110 /** |
|
111 Retrieve the ordinal number of the function in the DLL |
|
112 to be executed |
|
113 */ |
|
114 TUint8 CSystemStartupDllInfo::Ordinal() const |
|
115 { |
|
116 return iOrdinal; |
|
117 } |
|
118 |
|
119 /** |
|
120 Retrieve the number of times an attempt should be made to |
|
121 load a DLL/execute a DLL function in case of failure |
|
122 */ |
|
123 TUint8 CSystemStartupDllInfo::NoOfRetries() const |
|
124 { |
|
125 return iNoOfRetries; |
|
126 } |
|
127 |
|
128 /** Returns boolean indicating whether startup should fail or |
|
129 continue if DLL fails to load or DLL function returns an error |
|
130 code |
|
131 */ |
|
132 TBool CSystemStartupDllInfo::FailOnError() const |
|
133 { |
|
134 return iFailOnError; |
|
135 } |
|
136 |
|
137 /** Retrieve a pointer to a buffer containing data to be |
|
138 used by the DLL function |
|
139 */ |
|
140 const TDesC8& CSystemStartupDllInfo::DllBuffer() const |
|
141 { |
|
142 return *iDllBuffer ; |
|
143 } |