26
|
1 |
/* Copyright (c) 2010 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 |
* Initial Contributors:
|
|
8 |
* Nokia Corporation - initial contribution.
|
|
9 |
*
|
|
10 |
* Contributors:
|
|
11 |
* Description :
|
|
12 |
*
|
|
13 |
*/
|
|
14 |
|
|
15 |
#ifndef CUSDCOMMANDHANDLER_H
|
|
16 |
#define CUSDCOMMANDHANDLER_H
|
|
17 |
|
|
18 |
#include <e32base.h>
|
|
19 |
#include <etelmm.h>
|
|
20 |
#include <mmretrieve.h>
|
|
21 |
#include <gsmuelem.h>
|
|
22 |
|
32
|
23 |
#include "atcmdsyncbase.h"
|
26
|
24 |
|
32
|
25 |
class CUSSDSendMessageImpl;
|
|
26 |
class CUSSDReadMessageImpl;
|
26
|
27 |
/**
|
|
28 |
* Class for accessing plugin information and common functionality
|
|
29 |
*/
|
|
30 |
NONSHARABLE_CLASS( MUSSDCallback )
|
|
31 |
{
|
|
32 |
public:
|
|
33 |
/**
|
32
|
34 |
* Callback method for handling received USSD messages
|
|
35 |
* @param aError - the result code from the read operation
|
26
|
36 |
*/
|
32
|
37 |
virtual void HandleReadMessageComplete(TInt aError) = 0;
|
26
|
38 |
|
|
39 |
/**
|
32
|
40 |
* Callback method for handling sent USSD messages
|
|
41 |
* @param aError - the result code from the send operation
|
26
|
42 |
*/
|
32
|
43 |
virtual void HandleSendMessageComplete(TInt aError) = 0;
|
26
|
44 |
};
|
|
45 |
|
32
|
46 |
/**
|
|
47 |
* Class for handling USSD requests
|
|
48 |
*/
|
|
49 |
NONSHARABLE_CLASS( CCUSDCommandHandler ) : public CATCmdSyncBase,
|
26
|
50 |
public MUSSDCallback
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
static CCUSDCommandHandler* NewL(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone);
|
|
54 |
~CCUSDCommandHandler();
|
32
|
55 |
|
26
|
56 |
private: // methods from MUSSDCallback
|
32
|
57 |
virtual void HandleSendMessageComplete(TInt aError);
|
|
58 |
virtual void HandleReadMessageComplete(TInt aError);
|
26
|
59 |
|
|
60 |
private: // methods from CATCmdAsyncBase
|
|
61 |
virtual void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded );
|
|
62 |
virtual void HandleCommandCancel();
|
|
63 |
|
|
64 |
private:
|
|
65 |
CCUSDCommandHandler(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone);
|
|
66 |
void ConstructL();
|
|
67 |
|
32
|
68 |
TInt ParseCUSDCmd();
|
26
|
69 |
void CCUSDCommandHandler::FindFirstCarriageReturnL(
|
|
70 |
const TDesC& aBuffer ,
|
|
71 |
TUint& aSkipChars ,
|
|
72 |
TUint& aStartBit );
|
|
73 |
|
|
74 |
TInt Pack(const TDesC8& aIn, TDes8& aOut);
|
|
75 |
TInt ElementSizeInBits(TSmsDataCodingScheme::TSmsAlphabet aAlphabet) const;
|
|
76 |
TInt PackedOctetsRequired( TInt aNumUDUnits ) const;
|
|
77 |
TBool IsDcsValid( const TUint8 aDcs ) const;
|
|
78 |
void FormatUSSDReceivedData();
|
|
79 |
|
|
80 |
private:
|
|
81 |
TBool iSendCommandSent;
|
|
82 |
RBuf8 iReply;
|
|
83 |
|
|
84 |
RMobileUssdMessaging iUssdMessaging;
|
|
85 |
|
32
|
86 |
CUSSDSendMessageImpl* iUSSDSender;
|
26
|
87 |
RMobileUssdMessaging::TMobileUssdAttributesV1 iSendAttributes;
|
|
88 |
RBuf8 iUSSDCommand;
|
|
89 |
|
32
|
90 |
CUSSDReadMessageImpl* iUSSDReader;
|
26
|
91 |
RMobileUssdMessaging::TGsmUssdMessageData iReceivedData;
|
|
92 |
TInt iDisplayRetMessage;
|
|
93 |
RMobileUssdMessaging::TMobileUssdAttributesV1 iReceiveAttributes;
|
|
94 |
};
|
|
95 |
|
|
96 |
#endif // CUSDCOMMANDHANDLER_H
|