|
1 /* |
|
2 * Copyright (c) 2004-2005 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: Monitoring startup and reading/writing to shared data. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CSOSENPOLICYENLISTHANDLER_H |
|
21 #define CSOSENPOLICYENLISTHANDLER_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "CSOSEmergencyNumberPolicyHandler.h" |
|
26 #include <RPhCltServer.h> |
|
27 #include <cenrepnotifyhandler.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * It is the monitor for startup status, and provides services for |
|
36 * reading and writing to/from shared data. |
|
37 * |
|
38 * @since Series60_2.6 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CSosEnPolicyENListHandler ) : public CBase, |
|
41 public MCenRepNotifyHandlerCallback |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Creates a new monitor and starts it. |
|
47 * |
|
48 * @return Pointer to created CSosEnPolicyENListHandler instance. |
|
49 */ |
|
50 |
|
51 static CSosEnPolicyENListHandler* NewL(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CSosEnPolicyENListHandler(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Reads product specific numbers. |
|
62 * |
|
63 * @return Returns space separated list of emergency numbers, in case |
|
64 * of error, empty list is returned. |
|
65 */ |
|
66 const TDesC& ReadProductSpecificNumbers(); |
|
67 |
|
68 /** |
|
69 * Adds Emergency number to list to be written to Central Repository |
|
70 * |
|
71 * @param aNumber This is emergency number to be added. |
|
72 * @param aPermanent If this is set to ETrue, number will not be |
|
73 * cleared with ClearCurrentList function. |
|
74 * For numbers which are read in the startup. |
|
75 * Permanent numbers should be written first. Also adding new permanent |
|
76 * number removes all non permanent numbers. |
|
77 */ |
|
78 void AddToList( const TDesC& aNumber, TBool aPermanent = EFalse ); |
|
79 |
|
80 /** |
|
81 * Clears Current list. |
|
82 * Does not touch to permanent numbers. |
|
83 */ |
|
84 void ClearCurrentList(); |
|
85 |
|
86 /** |
|
87 * Writes current list to Central Repository. |
|
88 */ |
|
89 void WriteListToCentralRepository(); |
|
90 |
|
91 /** |
|
92 * Is number in current list with normal mode. |
|
93 * |
|
94 * @param aNumber This is number to be checked. |
|
95 * @return Returns ETrue if in list, otherwice EFalse. |
|
96 */ |
|
97 TBool IsInListByNormalMode ( const TDesC& aNumber ); |
|
98 |
|
99 /** |
|
100 * Is number in current list with advanced mode. |
|
101 * |
|
102 * @param aNumber This is number to be checked. |
|
103 * @return Returns ETrue if in list, otherwice EFalse. |
|
104 */ |
|
105 TBool IsInListByAdvancedMode ( TDes& aNumber ); |
|
106 |
|
107 private: // From MCenRepNotifyHandlerCallback |
|
108 |
|
109 void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue ); |
|
110 |
|
111 private: |
|
112 |
|
113 /** |
|
114 * C++ constructor. |
|
115 * |
|
116 */ |
|
117 |
|
118 CSosEnPolicyENListHandler(); |
|
119 |
|
120 /** |
|
121 * By default Symbian 2nd phase constructor is private. |
|
122 */ |
|
123 void ConstructL(); |
|
124 |
|
125 private: // Data |
|
126 |
|
127 // Central repository instance. |
|
128 CRepository* iRepository; |
|
129 |
|
130 // The product specific emergency numbers. |
|
131 TBuf< KEnPolicySDEmergencyNumberListLength > iProductSpecificList; |
|
132 |
|
133 // The current emergency number list. |
|
134 TBuf< KEnPolicySDEmergencyNumberListLength > iCurrentList; |
|
135 |
|
136 // The current place in the emergency number list. |
|
137 TInt iCurrentListPlace; |
|
138 |
|
139 // The start point of current emergency number list. |
|
140 TInt iCurrentListStart; |
|
141 |
|
142 /** |
|
143 * CenRep listener |
|
144 * |
|
145 * Own |
|
146 */ |
|
147 CCenRepNotifyHandler* iListener; |
|
148 |
|
149 }; |
|
150 |
|
151 #endif // CSOSENPOLICYENLISTHANDLER_H |
|
152 |
|
153 |
|
154 // End of File |