|
1 /* |
|
2 * Copyright (c) 2003 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: Class takes care of current server selection logic |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CWVSETTINGSUISERVERSELECTOR_H |
|
21 #define CWVSETTINGSUISERVERSELECTOR_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <badesca.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CIMPSSAPSettingsStore; |
|
29 class CIMPSSAPSettings; |
|
30 class CIMPSSAPSettingsList; |
|
31 class CWVSettingsUIDialogImp; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Server selection popup query |
|
37 * Executes Server selection popup query, and updates model with selected |
|
38 * current server |
|
39 * |
|
40 * @lib WVServiceSettingsUi.dll |
|
41 * @since 2.1 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CWVSettingsUIServerSelector ) : public CBase |
|
44 { |
|
45 public: // New methods |
|
46 |
|
47 /** |
|
48 * Executes a selection query |
|
49 * @since 2.1 |
|
50 * @param aSAPSettingsStore Pointer to settings model |
|
51 * @param aShowDefaultSAP whether to show the default sap or not |
|
52 * @param aForceSelection Does system force user to select something |
|
53 * example in case of deletion |
|
54 */ |
|
55 static void ExecuteSelectionQueryLD( CIMPSSAPSettingsStore& aSAPSettingsStore, |
|
56 CWVSettingsUIDialogImp& aDialog, |
|
57 TBool aShowDefaultSAP = ETrue, |
|
58 TBool aForceSelection = EFalse ); |
|
59 |
|
60 private: //New functions |
|
61 |
|
62 /** |
|
63 * Implementation of selection query |
|
64 * @since 2.1 |
|
65 */ |
|
66 void DoSelectionL(); |
|
67 |
|
68 /** |
|
69 * Reads server data to internal array |
|
70 * Ownership is transferred! |
|
71 * @since 2.1 |
|
72 * @param aCurrentServerIndex Index of an item that was currently |
|
73 * selected |
|
74 * @return array of servers. NOTE can return NULL! |
|
75 */ |
|
76 CDesCArrayFlat* GenerateServerListL( TInt& aCurrentServerIndex ); |
|
77 |
|
78 /** |
|
79 * Find SAP internal ID according to selected index |
|
80 * @since 2.1 |
|
81 * @param aIndex Index to be searched |
|
82 * @return SAP ID |
|
83 */ |
|
84 TUint32 TranslateSelectedIndexL( TInt aIndex ); |
|
85 |
|
86 private: // Constructors and destructor |
|
87 /** |
|
88 * C++ default constructor. |
|
89 * @param aSAPSettingsStore Pointer to settings model |
|
90 * @param aExcludedServer Optional server to be excluded from list, for |
|
91 * @param aForceSelection Does system force user to select something |
|
92 */ |
|
93 CWVSettingsUIServerSelector( CIMPSSAPSettingsStore& aSAPSettingsStore, |
|
94 TBool aShowDefaultSAP, |
|
95 TBool aForceSelection, |
|
96 CWVSettingsUIDialogImp& aDialog ); |
|
97 |
|
98 /** |
|
99 * Destructor |
|
100 */ |
|
101 virtual ~CWVSettingsUIServerSelector(); |
|
102 |
|
103 private: // Data |
|
104 // Doesn't own. pointer to SAP settings store |
|
105 CIMPSSAPSettingsStore& iSAPSettingsStore; |
|
106 // Owns. pointer to SAP settings list |
|
107 CIMPSSAPSettingsList* iSAPSettingsList; |
|
108 // Owns. Pointer to server list |
|
109 CDesCArray* iServerList; |
|
110 // Is selection forced one or not |
|
111 TBool iForceSelection; |
|
112 // Should default sap be displayed in list or not |
|
113 TBool iShowDefaultSAP; |
|
114 |
|
115 // the base dialog of service settings view |
|
116 CWVSettingsUIDialogImp& iDialog; |
|
117 }; |
|
118 |
|
119 #endif // CWVSETTINGSUISERVERSELECTOR_H |
|
120 |
|
121 // End of File |