|
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: |
|
15 * An active object class which takes care of reading the possible new |
|
16 * service centres from SIM and adds them to Sms Settings. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __MSGSIMSCNUMBERDETECTOR_H__ |
|
23 #define __MSGSIMSCNUMBERDETECTOR_H__ |
|
24 |
|
25 // INCLUDES |
|
26 #include <msvapi.h> // for MsvSession |
|
27 #include <smsclnt.h> // for CSmsClientMtm |
|
28 #include <e32base.h> |
|
29 #include <smutsimparam.h> // for CSmsSimParamOperation |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CClientMtmRegistry; |
|
33 class CSmumStartUpMonitor; |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CMsgSimOperation |
|
38 * Inherited from CActive, MMsvSessionObserver |
|
39 */ |
|
40 class CMsgSimOperation: public CActive, public MMsvSessionObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 */ |
|
47 IMPORT_C static CMsgSimOperation* NewL( TRequestStatus& aClientStatus ); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 ~CMsgSimOperation(); |
|
53 |
|
54 public: // new functions |
|
55 |
|
56 /** |
|
57 * Callback function for startup state monitor object |
|
58 */ |
|
59 void HandleStartupReadyL(); |
|
60 |
|
61 private: // new functions |
|
62 |
|
63 /** |
|
64 * C++ constructor which initializes the active object with a |
|
65 * default priority and adds it to the active scheduler. |
|
66 * @param TRequestStatus& aStatus, TInt aPriority |
|
67 * @return nothing |
|
68 */ |
|
69 CMsgSimOperation( TRequestStatus& aStatus, TInt aPriority = EPriorityStandard ); |
|
70 |
|
71 /** |
|
72 * This function simulates issuing request, activates the object and starts to open Msv session |
|
73 * @param none |
|
74 * @return nothing |
|
75 */ |
|
76 void StartL(); |
|
77 |
|
78 /** |
|
79 * Complete this active object's request status |
|
80 * @param TInt aValue |
|
81 * @return nothing |
|
82 */ |
|
83 void CompleteRequest( TInt aValue ); |
|
84 |
|
85 /** |
|
86 * Complete the client's active object request status |
|
87 * @param TInt aValue |
|
88 * @return nothing |
|
89 */ |
|
90 void CompleteClientRequest( TInt aValue ); |
|
91 |
|
92 /** |
|
93 * Do we have a client request status to complete? |
|
94 * @param nothing |
|
95 * @return TBool |
|
96 */ |
|
97 TBool HaveClientRequestStatus() const; |
|
98 |
|
99 private: // Panic related |
|
100 |
|
101 /** |
|
102 * |
|
103 */ |
|
104 enum TSimOperationPanic |
|
105 { |
|
106 ESimOperationPanicRequestAlreadyActive = 0, |
|
107 ESimOperationPanicClientsRequestAlreadyCompleted |
|
108 }; |
|
109 |
|
110 /** |
|
111 * Panic the thread |
|
112 * @param TSimOperationPanic aPanic |
|
113 * @return nothing |
|
114 */ |
|
115 static void Panic(TSimOperationPanic aPanic); |
|
116 |
|
117 private: // from baseclasses |
|
118 |
|
119 /** |
|
120 * From CActive |
|
121 */ |
|
122 void DoCancel(); |
|
123 void RunL(); |
|
124 void DoRunL(); |
|
125 TInt RunError( TInt ); |
|
126 |
|
127 /** |
|
128 * From MMsvSessionObserver |
|
129 */ |
|
130 void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
131 |
|
132 /** |
|
133 * By default Symbian OS constructor is private. |
|
134 */ |
|
135 void ConstructL(); |
|
136 |
|
137 private: // Data |
|
138 TRequestStatus* iClientStatus; |
|
139 CSmsSimParamOperation* iSimOperation; |
|
140 CMsvSession* iMsvSession; |
|
141 CSmsClientMtm* iSmsClientMtm; |
|
142 CClientMtmRegistry* iClientRegistry; |
|
143 TInt iRetryCount; |
|
144 CSmumStartUpMonitor* iStartupMonitor; |
|
145 TBool iCheckSimScAlways; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif // not defined __MSGSIMSCNUMBERDETECTOR_H__ |
|
150 |
|
151 // End of file |