|
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: List box model for the SUPL session UI |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_LOCSUPLSESSIONLBMODEL_H_ |
|
19 #define C_LOCSUPLSESSIONLBMODEL_H_ |
|
20 |
|
21 // System Include |
|
22 #include <e32base.h> |
|
23 #include <bamdesca.h> // MDesCArray |
|
24 |
|
25 // Forward Declaration |
|
26 class CLocSUPLSettingsUiEngine; |
|
27 class CTriggerParams; |
|
28 |
|
29 // Class Declaration |
|
30 /** |
|
31 * Model for the SUPL Sessions UI container. |
|
32 * |
|
33 * The model interacts with the SUPL Settings Engine inorder to obtain the latest |
|
34 * SUPL UI session array |
|
35 * |
|
36 * @lib locsuplsettings.lib |
|
37 * @since S60 v3.1 |
|
38 */ |
|
39 class CLocSUPLSessionLBModel : public CBase, |
|
40 public MDesCArray |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Two-phased constructor |
|
45 * |
|
46 * @param aEngine Reference the SUPL Settings Engine |
|
47 * @return CLocSUPLSessionLBModel* Reference to the object created |
|
48 */ |
|
49 static CLocSUPLSessionLBModel* NewL( |
|
50 CLocSUPLSettingsUiEngine& aEngine ); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor |
|
54 * |
|
55 * @param aEngine Reference the SUPL Settings Engine |
|
56 * @return CLocSUPLSessionLBModel* Reference to the object created |
|
57 */ |
|
58 static CLocSUPLSessionLBModel* NewLC( |
|
59 CLocSUPLSettingsUiEngine& aEngine ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CLocSUPLSessionLBModel(); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Returns the session id array to get session attributes |
|
70 */ |
|
71 RArray<TInt64>& SessionIds(); |
|
72 |
|
73 /** |
|
74 * Refresh the session id array list from the supl settings |
|
75 */ |
|
76 void UpdateSessionIdsL(); |
|
77 |
|
78 /** |
|
79 * Return the session name identified by session id |
|
80 */ |
|
81 TPtrC SessionName( TInt aIndex ); |
|
82 |
|
83 protected: |
|
84 /** |
|
85 * Inherited from MDesCArray |
|
86 */ |
|
87 TInt MdcaCount() const; |
|
88 |
|
89 /** |
|
90 * Inherited from MDesCArray |
|
91 */ |
|
92 TPtrC16 MdcaPoint( TInt aIndex ) const; |
|
93 |
|
94 private: |
|
95 /** |
|
96 * C++ constructor. |
|
97 */ |
|
98 CLocSUPLSessionLBModel( CLocSUPLSettingsUiEngine& aEngine ); |
|
99 |
|
100 /** |
|
101 * Second Phase constructor |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 /** |
|
106 * Appends the session name and type to the buffer passed. |
|
107 * |
|
108 * @param aPtr Buffer to which session name and type will be |
|
109 * appended. |
|
110 * @param aIndex index to get session entry |
|
111 */ |
|
112 void AppendSuplSessionDetail( TDes& aPtr, TInt aIndex ) const; |
|
113 |
|
114 private: |
|
115 /** |
|
116 * Enumerations for Supl sessions type |
|
117 */ |
|
118 enum TSUPLSessionType |
|
119 { |
|
120 /** |
|
121 * Supl session is of Terminal Initiaon Type |
|
122 */ |
|
123 ESUPLSessionTIType = 0, |
|
124 /** |
|
125 * Supl session is of Network Initiaon Type |
|
126 */ |
|
127 ESUPLSessionNIType |
|
128 }; |
|
129 |
|
130 private: |
|
131 /** |
|
132 * Format conversion buffer |
|
133 * Owns |
|
134 */ |
|
135 HBufC16* iBuffer; |
|
136 |
|
137 /** |
|
138 * Reference the SUPL Settings Engine |
|
139 */ |
|
140 CLocSUPLSettingsUiEngine& iEngine; |
|
141 |
|
142 /** |
|
143 * SUPL Sessions Id |
|
144 * Owns. |
|
145 */ |
|
146 RArray< TInt64 > iSessionIdList; |
|
147 |
|
148 /** |
|
149 * SUPL Sessions Name |
|
150 * Owns. |
|
151 */ |
|
152 RPointerArray< HBufC > iSessionNameList; |
|
153 |
|
154 /** |
|
155 * SUPL Sessions Type. |
|
156 * Owns. |
|
157 */ |
|
158 RArray< TSUPLSessionType > iSessionTypeList; |
|
159 |
|
160 /** |
|
161 * Unnamed session SUPL Sessions Name |
|
162 * Owns. |
|
163 */ |
|
164 HBufC* iUnnamedSuplActiveSessions; |
|
165 }; |
|
166 |
|
167 #endif // C_LOCSUPLSESSIONLBMODEL_H_ |
|
168 |