|
1 /* |
|
2 * Copyright (c) 2008 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: It encapsulates all dependencies. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEPARSERFEATURES_H |
|
20 #define CPHONEPARSERFEATURES_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CPhCltEmergencyCall; |
|
25 class CRepository; |
|
26 |
|
27 // INCLUDES |
|
28 #include <MPhCltEmergencyCallObserver.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * It is extension for options. |
|
36 * |
|
37 * @since 1.2 |
|
38 * @lib phoneparser.lib |
|
39 */ |
|
40 NONSHARABLE_CLASS( CPhoneParserFeatures ) |
|
41 : public CBase, public MPhCltEmergencyCallObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CPhoneParserFeatures* InstanceL(); |
|
49 |
|
50 /** |
|
51 * To release resources. |
|
52 */ |
|
53 static void Free(); |
|
54 |
|
55 public: // From MPhCltEmergencyCallObserver |
|
56 |
|
57 /** |
|
58 * It is called whenever client's dial request is completed. |
|
59 * |
|
60 * @param aStatus error code of the success of the operation. |
|
61 */ |
|
62 void HandleEmergencyDialL( const TInt aStatus ); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * Checks if life timer is enabled. |
|
68 * |
|
69 * @return ETrue if supported. |
|
70 */ |
|
71 static TBool LifeTimerEnabled(); |
|
72 |
|
73 /** |
|
74 * Checks if two digit calling is enabled. |
|
75 * |
|
76 * @return ETrue if supported. |
|
77 */ |
|
78 static TBool TwoDigitCallingEnabled(); |
|
79 |
|
80 /** |
|
81 * Checks if zero send should make a call. |
|
82 * |
|
83 * @return ETrue if enabled. |
|
84 */ |
|
85 static TBool IsZeroDialEnabled(); |
|
86 |
|
87 /** |
|
88 * Checks if feature is supported. |
|
89 * |
|
90 * @param aFeature feature. |
|
91 * @return ETrue if supported. |
|
92 */ |
|
93 static TBool FeatureSupported( TInt aFeature ); |
|
94 |
|
95 /** |
|
96 * Checks if given number is emergency. |
|
97 * |
|
98 * @param aNumber Number to be queried.aNumber might contain prefix (SS code) |
|
99 * and/or postfix (DTMF part). |
|
100 * The aNumber parameter should be a buffer and the |
|
101 * clients are provided with a typedef called |
|
102 * TPhCltEmergencyNumber. |
|
103 * |
|
104 * @param aEmergencyNumber Matched emergencynumber without prefix or |
|
105 * postfix is returned in this parameter. The aMatchedEmergencyNumber |
|
106 * parameter should be a buffer and the clients are |
|
107 * provided with atypedef called TPhCltEmergencyNumber. |
|
108 * |
|
109 * @returns ETrue if emergency. |
|
110 */ |
|
111 static TBool IsEmergencyNumber( |
|
112 const TDesC& aNumber, |
|
113 TDes& aEmergencyNumber ); |
|
114 |
|
115 /** |
|
116 * To set stub for testing purposes. |
|
117 * |
|
118 * @param aStub test stub. |
|
119 */ |
|
120 #ifdef __WINS__ |
|
121 static void SetInstance( CPhoneParserFeatures* aStub ); |
|
122 #endif // __WINS__ |
|
123 |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * C++ default constructor. |
|
129 */ |
|
130 CPhoneParserFeatures(); |
|
131 |
|
132 /** |
|
133 * Symbian OS constructor. |
|
134 */ |
|
135 void ConstructL(); |
|
136 |
|
137 /** |
|
138 * Non leaving instance method. |
|
139 */ |
|
140 static CPhoneParserFeatures* Instance(); |
|
141 |
|
142 /** |
|
143 * Destructor. |
|
144 */ |
|
145 ~CPhoneParserFeatures(); |
|
146 |
|
147 /** |
|
148 * Checks if given number is emergency. |
|
149 * |
|
150 * @param aNumber Number to be queried.aNumber might contain prefix (SS code) |
|
151 * and/or postfix (DTMF part). |
|
152 * The aNumber parameter should be a buffer and the |
|
153 * clients are provided with a typedef called |
|
154 * TPhCltEmergencyNumber. |
|
155 * |
|
156 * @param aEmergencyNumber Matched emergencynumber without prefix or |
|
157 * postfix is returned in this parameter. The aMatchedEmergencyNumber |
|
158 * parameter should be a buffer and the clients are |
|
159 * provided with atypedef called TPhCltEmergencyNumber. |
|
160 * |
|
161 * @returns ETrue if emergency. |
|
162 */ |
|
163 virtual TBool IsEmergencyPhoneNumber( |
|
164 const TDesC& aNumber, |
|
165 TDes& aEmergencyNumber ); |
|
166 |
|
167 /** |
|
168 * Checks if feature is supported. |
|
169 * |
|
170 * @param aFeature feature. |
|
171 * @return ETrue if supported. |
|
172 */ |
|
173 virtual TBool IsFeatureSupported( TInt aFeature ); |
|
174 |
|
175 virtual TInt GetTelephoneVariant(); |
|
176 |
|
177 private: // Data |
|
178 |
|
179 |
|
180 // Owned: Phone client emergency number session. |
|
181 CPhCltEmergencyCall* iEmergencyCall; |
|
182 |
|
183 CRepository* iRepository; |
|
184 |
|
185 }; |
|
186 |
|
187 #endif // CPHONEPARSERFEATURES_H |
|
188 |
|
189 // End of File |