|
1 /* |
|
2 * Copyright (c) 2005-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 "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 * Name : CSatNotifyMoSmControlRequest.h |
|
16 * Part of : Common SIM ATK TSY / commonsimatktsy |
|
17 * Class for mobile oriented short message control |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CSATNOTIFYMOSMCONTROLREQUEST_H |
|
25 #define CSATNOTIFYMOSMCONTROLREQUEST_H |
|
26 |
|
27 |
|
28 // INCLUDES |
|
29 #include "MSatNotificationsBase.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CSatDataPackage; |
|
33 class CSatNotificationsTsy; |
|
34 |
|
35 /** |
|
36 * DESCRIPTION |
|
37 * SAT MO-SMS Control notification class. |
|
38 * Used when client requests to be notified when MO SM control request |
|
39 * command arrives from SIM. |
|
40 * |
|
41 * This is used especially for returning AlphaId and |
|
42 * ControlResult to SatServer. |
|
43 * @lib Commonsimatktsy |
|
44 * @since 3.1 |
|
45 */ |
|
46 NONSHARABLE_CLASS ( CSatNotifyMoSmControlRequest ) : public CBase, |
|
47 public MSatNotificationsBase |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
54 * return CSatNotifyMoSmControlRequest*: created object |
|
55 */ |
|
56 static CSatNotifyMoSmControlRequest* NewL( |
|
57 CSatNotificationsTsy* aNotificationsTsy ); |
|
58 |
|
59 /** |
|
60 * C++ Destructor. |
|
61 */ |
|
62 ~CSatNotifyMoSmControlRequest(); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * By default C++ constructor is private. |
|
67 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
68 * @return None |
|
69 */ |
|
70 CSatNotifyMoSmControlRequest( CSatNotificationsTsy* aNotificationsTsy ); |
|
71 |
|
72 /** |
|
73 * Class attributes are created in ConstructL. |
|
74 * @param None |
|
75 * @return None |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 public: // Functions from base classes |
|
80 |
|
81 |
|
82 /** |
|
83 * GetInput Notification request received from client |
|
84 * @param aTsyReqHandle request handle from ETel |
|
85 * @param aPackage: Packed data |
|
86 * @return KErrNone |
|
87 */ |
|
88 TInt Notify( const TTsyReqHandle aTsyReqHandle, |
|
89 const TDataPackage& aPackage ); |
|
90 |
|
91 /** |
|
92 * Cancels notification request for GetInput. |
|
93 * @param aReqHandle notify request handle |
|
94 * @return KErrNone |
|
95 */ |
|
96 TInt CancelNotification( const TTsyReqHandle aReqHandle ); |
|
97 |
|
98 /** |
|
99 * Completes GetInput message to client |
|
100 * @param aDataPackage: Packaged return data |
|
101 * @param aErrorCode: Possible error code |
|
102 * @return KErrNone/ KErrCorrupt |
|
103 */ |
|
104 TInt CompleteNotifyL( CSatDataPackage* aDataPackage, TInt aErrorCode ); |
|
105 |
|
106 public: // New methods |
|
107 |
|
108 /* |
|
109 * Create an MO-SMS envelope to in order to check wheter the SMS |
|
110 * can be sent or not. The response will be used to send forward |
|
111 * to the server needing the information |
|
112 * @param aDataPackage contains aAddressData1 RP address and |
|
113 * aAddressData2 TP address |
|
114 * @param aResult KErrNone |
|
115 */ |
|
116 void CreateMoSmsCtrlEnvelopeL( CSatDataPackage* aDataPackage, |
|
117 TInt aResult ); |
|
118 |
|
119 /* |
|
120 * Set iIsMoSmsCtrlActivated to the given value |
|
121 * @param aDataPackage contains aAddressData1 RP address and |
|
122 * aAddressData2 TP address |
|
123 * @return none |
|
124 */ |
|
125 void SetActivationStatus( CSatDataPackage* aDataPackage ); |
|
126 |
|
127 /* |
|
128 * Returns MO-SMS Control activation status |
|
129 * If ETrue: Allows this object to process incoming Mo-Sm requests |
|
130 * If EFalse: Prevents this object to process incoming Mo-Sm requests |
|
131 * @return activation status |
|
132 */ |
|
133 TBool ActivationStatus(); |
|
134 |
|
135 /* |
|
136 * This method cleans the address data, so that all the byte found |
|
137 * after a 0xXF or a 0xFX are ignored and removed. |
|
138 * @param aAddr Address data to be cleaned |
|
139 * @return None |
|
140 */ |
|
141 void CleanAddressData( TDes8& aAddr ); |
|
142 |
|
143 /* |
|
144 * Extracts data from AtkSwDataNtf message data part |
|
145 * @param aAtkData, TLV data from NAA |
|
146 * @param aAddr1, contains the RP address provided by the SIM |
|
147 * @param aAddr2, contains the TP address provided by the SIM |
|
148 * @param aAlphaId, contains the alpha id provided by the SIM |
|
149 * @return none |
|
150 */ |
|
151 void ParseNotification( const TDesC8& aAtkData, TDes8& aAddr1, |
|
152 TDes8& aAddr2, RSat::TAlphaId& aAlphaId ); |
|
153 |
|
154 /* |
|
155 * This method checks the consistency of the data sent by the NAA to |
|
156 * the ME, when the call is allowed and modified. |
|
157 * @param aRPAddr SMSC RP address |
|
158 * @param aTPAddr TP Destinatiion address |
|
159 * @return ETtrue if data is consistent, else EFalse |
|
160 */ |
|
161 TBool VerifyNotificationData( TDes8& aRPAddr, TDes8& aTPAddr ); |
|
162 |
|
163 private: // Data |
|
164 |
|
165 // Pointer to the notifications tsy class |
|
166 CSatNotificationsTsy* iNotificationsTsy; |
|
167 |
|
168 // Notify Call Control struct. Package allocated |
|
169 // in this class and received from ETel |
|
170 RSat::TMoSmControlV1Pckg* iMoSmControlV1Pckg; |
|
171 |
|
172 // Boolean to check whether MO-SMS Control is activated. This is used |
|
173 // by CTsySatMessaging::MoSmsControlReceived, in order to know if this |
|
174 // object is in use or not |
|
175 TBool iIsMoSmsCtrlActivated; |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // CSATNOTIFYMOSMCONTROLREQUEST_H |