|
1 /* |
|
2 * Copyright (c) 2006 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: Domain selection query pop-up |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CCNUIDOMAINSELECTIONQUERYDIALOG_H |
|
20 #define C_CCNUIDOMAINSELECTIONQUERYDIALOG_H |
|
21 |
|
22 #include <aknlistquerydialog.h> |
|
23 |
|
24 class CFbsBitmap; |
|
25 class CIMPSSAPSettings; |
|
26 |
|
27 /** |
|
28 * Domain selection query pop-up |
|
29 * |
|
30 * @lib IMPSConnectionUi.lib |
|
31 * @since S60 v3.1 |
|
32 */ |
|
33 class CCnUiDomainSelectionQueryDialog : public CAknListQueryDialog |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Symbian constructor. |
|
40 * @param aIndex After query is dismissed, aIndex will hold |
|
41 * the value of selected item. |
|
42 * @param aSap Current SAP in use, can be NULL. |
|
43 */ |
|
44 static CCnUiDomainSelectionQueryDialog* NewL( |
|
45 TInt* aIndex, |
|
46 CIMPSSAPSettings* aSap = NULL ); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CCnUiDomainSelectionQueryDialog(); |
|
52 |
|
53 public: |
|
54 |
|
55 // from base class CAknListQueryDialog |
|
56 |
|
57 /** |
|
58 * Sets item text array to listbox. |
|
59 * @since S60 v3.1 |
|
60 * @param aItemTextArray Item text array to be added |
|
61 */ |
|
62 void SetItemTextArray( MDesCArray* aItemTextArray ); |
|
63 |
|
64 /** |
|
65 * Sets ownership type of item array. |
|
66 * @since S6 v3.1 |
|
67 * @param aOwnershipType Type of ownership. |
|
68 */ |
|
69 void SetOwnershipType( TListBoxModelItemArrayOwnership aOwnershipType ); |
|
70 |
|
71 protected: |
|
72 |
|
73 // from base class CAknListQueryDialog |
|
74 |
|
75 /** |
|
76 * Handle key events. |
|
77 * @since S60 v3.1 |
|
78 * @param aKeyEvent Key event. |
|
79 * @param aType Type of the event. |
|
80 * @return Indicates whether or not the key event was used by this control. |
|
81 */ |
|
82 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
83 |
|
84 /** |
|
85 * This function is called by application framework just |
|
86 * before the dialog is activated. |
|
87 * @since S60 v3.1 |
|
88 */ |
|
89 void PreLayoutDynInitL(); |
|
90 |
|
91 /** |
|
92 * This function is called by tapplication framework when user activates button. |
|
93 * @since S60 v3.1 |
|
94 * @param aButtonId ID of button that was activated. |
|
95 * @return Should return ETrue if dialog should exit, |
|
96 * and EFalse if it should not. |
|
97 */ |
|
98 TBool OkToExitL( TInt aButtonId ); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * Constructor. |
|
104 * @param aIndex After query is dismissed, aIndex will hold |
|
105 * the value of selected item. |
|
106 */ |
|
107 CCnUiDomainSelectionQueryDialog( TInt* aIndex, |
|
108 CIMPSSAPSettings* aSap ); |
|
109 |
|
110 /** |
|
111 * Symbian second phase constructor. |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 /** |
|
116 * Update radio button in query. |
|
117 * @since S60 v3.1 |
|
118 * @param aSelectedIndex index of currently selected item. |
|
119 */ |
|
120 void UpdateRadioButtonL( TInt aSelectedIndex, TBool aForceUpdate = EFalse ); |
|
121 |
|
122 /** |
|
123 * Calls ResetAndDestroy to given array |
|
124 * @since 3.1 |
|
125 * @param aObject Array |
|
126 */ |
|
127 static void DestroyCloseArray( TAny* aObject ); |
|
128 |
|
129 private: // data |
|
130 |
|
131 /** |
|
132 * Bitmaps for list icons. |
|
133 * Owns. |
|
134 */ |
|
135 CFbsBitmap* iRadioButton; |
|
136 CFbsBitmap* iRadioButtonMask; |
|
137 CFbsBitmap* iEmpty; |
|
138 CFbsBitmap* iEmptyMask; |
|
139 |
|
140 /** |
|
141 * Item text array. |
|
142 * Owned by default, ownership can be dropped by |
|
143 * calling SetOwnershipType with parameter ELbmDoesNotOwnItemArray. |
|
144 */ |
|
145 MDesCArray* iItemTextArray; |
|
146 |
|
147 /** |
|
148 * Ownership of item text array. |
|
149 * ELbmOwnsItemArray by default. |
|
150 */ |
|
151 TListBoxModelItemArrayOwnership iOwnershipType; |
|
152 |
|
153 /** |
|
154 * Ownership indicated by iSapOwned. |
|
155 * Pointer to current SAP, can be NULL. |
|
156 */ |
|
157 CIMPSSAPSettings* iSap; |
|
158 |
|
159 /** |
|
160 * Indicates wether iSap is owned or not. |
|
161 */ |
|
162 TBool iSapOwned; |
|
163 }; |
|
164 |
|
165 #endif // C_CCNUIDOMAINSELECTIONQUERYDIALOG_H |