|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSTSAPDU_H |
|
20 #define CSTSAPDU_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 namespace java |
|
26 { |
|
27 namespace satsa |
|
28 { |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Wrapper class for byte apdu message. |
|
33 */ |
|
34 NONSHARABLE_CLASS(CSTSApdu): public CBase |
|
35 { |
|
36 public: // data types |
|
37 enum TSTSApduStandard |
|
38 { |
|
39 ESTSGSM, |
|
40 ESTSUICC |
|
41 }; |
|
42 |
|
43 public: |
|
44 |
|
45 static CSTSApdu* NewLC(TDesC8& aApduBytes, |
|
46 TSTSApduStandard aStandard); |
|
47 |
|
48 static CSTSApdu* NewL(TDesC8& aApduBytes, |
|
49 TSTSApduStandard aStandard); |
|
50 |
|
51 static CSTSApdu* NewLC(TInt aMaxLength, |
|
52 TSTSApduStandard aStandard); |
|
53 |
|
54 static CSTSApdu* NewL(TInt aMaxLength, |
|
55 TSTSApduStandard aStandard); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CSTSApdu(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Getter for command and response Apdu bytes |
|
66 * @return Bytes in modifiable TPtr8 reference |
|
67 */ |
|
68 TPtr8& ApduPtr(); |
|
69 |
|
70 /** |
|
71 * Reallocates apdu buffer if needed |
|
72 * @param aMaxLength The maximum length of data that the new |
|
73 * apdu buffer is to represent |
|
74 */ |
|
75 void ReAllocL(TInt aMaxLength); |
|
76 |
|
77 /** |
|
78 * Returns type of apdu standard |
|
79 * @return Type of apdu standard |
|
80 */ |
|
81 TSTSApduStandard Standard() const; |
|
82 |
|
83 private: |
|
84 |
|
85 void ConstructL(TDesC8& aApduBytes); |
|
86 |
|
87 void ConstructL(TInt aMaxLength); |
|
88 |
|
89 CSTSApdu(TSTSApduStandard aStandard); |
|
90 |
|
91 private: |
|
92 |
|
93 TPtr8 iApduBytesPtr; |
|
94 TSTSApduStandard iStandard; |
|
95 |
|
96 // Apdu bytes, owned |
|
97 HBufC8* iApduBytes; |
|
98 |
|
99 }; |
|
100 |
|
101 } // namespace satsa |
|
102 } // namespace java |
|
103 #endif // CSTSAPDU_H |
|
104 // End of File |