1 // Copyright (c) 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 // @file atphbkenreadall.h |
|
15 // This contains CAtPhbkEnReadAll which is used to read all PhonebookEn Entries |
|
16 // |
|
17 |
|
18 #ifndef ATPHBKENREADALL_H |
|
19 #define ATPHBKENREADALL_H |
|
20 |
|
21 //system include |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 //user include |
|
26 #include "atcommandbase.h" |
|
27 |
|
28 //constant defination |
|
29 const TInt KEnNumberLength = 6; |
|
30 |
|
31 /** |
|
32 * CAtPhbkEnReadAll |
|
33 * |
|
34 */ |
|
35 class CAtPhbkEnReadAll : public CAtCommandBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Destructor |
|
40 * |
|
41 */ |
|
42 ~CAtPhbkEnReadAll(); |
|
43 |
|
44 /** |
|
45 * static NewL |
|
46 * |
|
47 * @param aGloblePhone |
|
48 * @param aCtsyDispatcherCallback |
|
49 */ |
|
50 static CAtPhbkEnReadAll* NewL(CGlobalPhonemanager& aGloblePhone, |
|
51 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
52 |
|
53 /** |
|
54 * static NewLC |
|
55 * |
|
56 * @param aGloblePhone |
|
57 * @param aCtsyDispatcherCallback |
|
58 */ |
|
59 static CAtPhbkEnReadAll* NewLC(CGlobalPhonemanager& aGloblePhone, |
|
60 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
61 |
|
62 /** |
|
63 * Virtual function. Inherited from CAtCommandBase |
|
64 * Start Execute AT Command |
|
65 */ |
|
66 virtual void ExecuteCommand(); |
|
67 |
|
68 /** |
|
69 * Will be called by AT Manager whenever a event was triggered |
|
70 * |
|
71 * @param aEventSource |
|
72 * @param aStatus |
|
73 */ |
|
74 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
75 |
|
76 /** |
|
77 * Virtual function. Inherited from CAtCommandBase |
|
78 * |
|
79 * @param aResponseBuf Line buf reading from baseband |
|
80 */ |
|
81 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
82 |
|
83 /** |
|
84 * Start this request |
|
85 * |
|
86 */ |
|
87 void StartRequest(); |
|
88 protected: |
|
89 /** |
|
90 * Constructor |
|
91 * |
|
92 * @param aGloblePhone |
|
93 * @param aCtsyDispatcherCallback |
|
94 */ |
|
95 CAtPhbkEnReadAll(CGlobalPhonemanager& aGloblePhone, |
|
96 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
97 |
|
98 /** |
|
99 * 2nd Constructor |
|
100 */ |
|
101 void ConstructL(); |
|
102 private: |
|
103 /** |
|
104 * Executer AT command for reading phonebook entries |
|
105 */ |
|
106 void ReadEntry(); |
|
107 private: |
|
108 /** |
|
109 * state machine for EventSignal |
|
110 */ |
|
111 enum |
|
112 { |
|
113 ESetEnName, |
|
114 ESetEnNameComplete, |
|
115 EReadEntry, |
|
116 EReadEntryComplete, |
|
117 EATNotInProgress |
|
118 }iState; |
|
119 |
|
120 /** |
|
121 * The return error value of AT command executed |
|
122 */ |
|
123 TInt iError; |
|
124 |
|
125 /* |
|
126 * the first index should be read |
|
127 */ |
|
128 TInt iIndex; |
|
129 |
|
130 /* |
|
131 * the phonebooken number want to read |
|
132 */ |
|
133 TBuf<KEnNumberLength> iNumber; |
|
134 |
|
135 /* |
|
136 * indicate whether it is OK or ERROR string |
|
137 */ |
|
138 TBool iEndFlag; |
|
139 |
|
140 }; // class CAtPhbkEnReadAll |
|
141 #endif // ATPHBKENREADALL_H |
|