1 /* |
|
2 * Copyright (c) 2002 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: Ussd client for SAT usage. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHCLTUSSDSATCLIENT_H |
|
20 #define CPHCLTUSSDSATCLIENT_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPhCltUssdSatActive; |
|
29 class CPhCltUssdImp; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Ussd client for SAT Server. |
|
36 * |
|
37 * @lib phoneclient.lib |
|
38 * @since 1.0 |
|
39 */ |
|
40 class CPhCltUssdSatClient :public CBase |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Values to tell the used DCS in SAT message received from network. |
|
46 */ |
|
47 enum TPhCltDcs |
|
48 { |
|
49 EPhCltDcs7Bit = 1, // DCS was 7bit. |
|
50 EPhCltDcs8Bit, // DCS wass 8bit. |
|
51 EPhCltDcsUCS2, // DCS was UCS2. |
|
52 EPhCltDcsUnknown // DCS was unknown. |
|
53 }; |
|
54 |
|
55 |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 * |
|
61 * @param aShowNotes Show notes on first and last message? |
|
62 * @return Pointer to created CPhCltUssdSatClient instance. |
|
63 */ |
|
64 IMPORT_C static CPhCltUssdSatClient* NewL( TBool aShowNotes ); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 IMPORT_C virtual ~CPhCltUssdSatClient(); |
|
70 |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** |
|
75 * Start Ussd session from SAT. |
|
76 * |
|
77 * @param aSendMessage The string which is sent to network. |
|
78 * @param iSendDcs Specifies DCS and the send type. |
|
79 * @param aReceiveMessage Here is copied the return message. |
|
80 * @param aSendCompletedFirst ETrue if send is completed before receive. |
|
81 * @param aReceivedDcs The used DCS in message sent by network. |
|
82 * @return Error code. KErrNone no errors |
|
83 * KErrInUse send is already active. |
|
84 * Others from the network or from connection. |
|
85 */ |
|
86 IMPORT_C TInt SendSatMessage( |
|
87 const TDesC& aSendMessage, |
|
88 const TUint8 iSendDcs, |
|
89 TDes& aReceiveMessage, |
|
90 TBool& aSendCompletedFirst, |
|
91 TUint8& aReceivedDcs |
|
92 ); |
|
93 |
|
94 /** |
|
95 * Cancels outstanding Send request. |
|
96 */ |
|
97 IMPORT_C void SendSatMessageCancel(); |
|
98 |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * C++ default constructor. |
|
104 */ |
|
105 CPhCltUssdSatClient(); |
|
106 |
|
107 /** |
|
108 * By default Symbian 2nd phase constructor is private. |
|
109 */ |
|
110 void ConstructL( TBool aShowNotes ); |
|
111 |
|
112 /** |
|
113 * Decodes the dcs received from Phone Server. Puts the result to |
|
114 * parameter aReceivedDcs. |
|
115 */ |
|
116 void DecodeDcs( TUint8& aReceivedDcs ); |
|
117 |
|
118 |
|
119 private: // Data |
|
120 |
|
121 // Storage place for note show information. |
|
122 TBool iShowNotes; |
|
123 |
|
124 // Storage for SAT error code. |
|
125 TInt iSatError; |
|
126 |
|
127 // Storage for received message. |
|
128 TPtrC iReceiveMessage; |
|
129 |
|
130 // Send completion information. |
|
131 TBool* iSendCompletedFirst; |
|
132 |
|
133 // Helper class, private |
|
134 CPhCltUssdSatActive* iSatActive; |
|
135 |
|
136 |
|
137 // USSD wrapper class. |
|
138 CPhCltUssdImp* iUssdWrapper; |
|
139 |
|
140 // This variable has two purposes: |
|
141 // 1) Client -> Server: Tells whether to show the notes or not. |
|
142 // 2) Server -> Client: Tells the used dcs in received message. |
|
143 TUint iShowNotesAndDcs; |
|
144 }; |
|
145 |
|
146 #endif // CPHCLTUSSDSATCLIENT_H |
|
147 |
|
148 // End of File |
|