|
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: Handles mailbox number settings in OMA provisioning. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MbxNbrAdapter_H |
|
20 #define MbxNbrAdapter_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <CWPAdapter.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 //struct TMbxNbrAdapterData; |
|
28 |
|
29 |
|
30 // MODULE DATA STRUCTURES |
|
31 |
|
32 // ENUMERATIONS |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CMbxNbrAdapter handles accesspoint settings. |
|
39 */ |
|
40 class CMbxNbrAdapter : public CWPAdapter |
|
41 { |
|
42 private: // ENUMERATIONS |
|
43 |
|
44 enum TMailboxType |
|
45 { |
|
46 ECSVoiceMailbox = 1, // Default if type is not received in XML |
|
47 ECSVideoMailbox |
|
48 }; |
|
49 |
|
50 private: // MODULE DATA STRUCTURES |
|
51 |
|
52 struct TMbxNbrAdapterData |
|
53 { |
|
54 TPtrC iName; |
|
55 TPtrC iMailboxNumber; |
|
56 TBool iVidiosupport; |
|
57 TBool iIsVideosupport; |
|
58 TMailboxType iMailboxType; |
|
59 }; |
|
60 |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * @return a instance of class. |
|
66 */ |
|
67 static CMbxNbrAdapter* NewL(); |
|
68 |
|
69 /** |
|
70 * Destructor |
|
71 */ |
|
72 virtual ~CMbxNbrAdapter(); |
|
73 |
|
74 public: // Functions from base classes |
|
75 |
|
76 /** |
|
77 * From CWPAdapter |
|
78 */ |
|
79 TInt ItemCount() const; |
|
80 |
|
81 /** |
|
82 * From CWPAdapter |
|
83 */ |
|
84 const TDesC16& SummaryTitle( TInt aIndex ) const; |
|
85 |
|
86 /** |
|
87 * From CWPAdapter |
|
88 */ |
|
89 const TDesC16& SummaryText( TInt aIndex ) const; |
|
90 |
|
91 /** |
|
92 * From CWPAdapter |
|
93 */ |
|
94 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
95 |
|
96 /** |
|
97 * From CWPAdapter |
|
98 */ |
|
99 void SaveL( TInt aItem ); |
|
100 |
|
101 /** |
|
102 * From CWPAdapter |
|
103 */ |
|
104 TBool CanSetAsDefault( TInt aItem ) const; |
|
105 |
|
106 /** |
|
107 * From CWPAdapter |
|
108 */ |
|
109 void SetAsDefaultL( TInt aItem ); |
|
110 |
|
111 /** |
|
112 * From CWPAdapter |
|
113 */ |
|
114 void VisitL( CWPCharacteristic& aElement ); |
|
115 |
|
116 /** |
|
117 * From CWPAdapter |
|
118 */ |
|
119 void VisitL( CWPParameter& aElement ); |
|
120 |
|
121 /** |
|
122 * From CWPAdapter |
|
123 */ |
|
124 void VisitLinkL( CWPCharacteristic& aCharacteristic ); |
|
125 |
|
126 private: // Default constructors |
|
127 |
|
128 /** |
|
129 * C++ default constructor. |
|
130 */ |
|
131 CMbxNbrAdapter(); |
|
132 |
|
133 /** |
|
134 * By default Symbian 2nd phase constructor is private. |
|
135 */ |
|
136 void ConstructL(); |
|
137 |
|
138 private: // New functions |
|
139 |
|
140 /** |
|
141 * Validates the data in iTempData. |
|
142 */ |
|
143 TBool IsValid(); |
|
144 |
|
145 /** |
|
146 * Validates the phone number string. |
|
147 */ |
|
148 TBool IsValidPhoneNumber( const TDesC& aPtr ); |
|
149 |
|
150 /** |
|
151 * Parses an mailbox type from a descriptor. |
|
152 */ |
|
153 void ParseMbxTypeL( const TDesC& aPtr, TMailboxType& aInt ); |
|
154 |
|
155 /** |
|
156 * Parses an video ON/OFF type from a descriptor. |
|
157 */ |
|
158 |
|
159 void ParseVideoTypeL( const TDesC& aPtr, TBool& aInt, TBool& aInt1 ); |
|
160 |
|
161 private: // Data |
|
162 |
|
163 HBufC* iTitle; |
|
164 |
|
165 TPtrC iAppId; |
|
166 RArray<TMbxNbrAdapterData> iSettings; |
|
167 TMbxNbrAdapterData iTempData; |
|
168 |
|
169 private: |
|
170 friend class T_CWPMbxNbrAdapter; |
|
171 |
|
172 |
|
173 }; |
|
174 |
|
175 #endif // MbxNbrAdapter_H |
|
176 |
|
177 // End of File |