1 /* |
|
2 * Copyright (c) 2009 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: Cpp file for CGSConnSettingsSelectionDlg class. |
|
15 * |
|
16 */ |
|
17 |
|
18 // Includes |
|
19 #include "gsconnsettingsselectiondlg.h" |
|
20 #include <AknInfoPopupNoteController.h> |
|
21 #include <StringLoader.h> |
|
22 #include <eiklbo.h> |
|
23 #include <gulalign.h> |
|
24 |
|
25 #include <gsconnsettingspluginrsc.rsg> |
|
26 |
|
27 // Constants |
|
28 |
|
29 |
|
30 // ========================= MEMBER FUNCTIONS ================================ |
|
31 |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // CGSConnSettingsSelectionDlg::NewL |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CGSConnSettingsSelectionDlg* CGSConnSettingsSelectionDlg::NewL(TInt aResourceID, |
|
38 TInt& aCurrentSelectionIndex, |
|
39 const MDesCArray* aItemArray, |
|
40 TInt aPopupResource) |
|
41 { |
|
42 CGSConnSettingsSelectionDlg* self = new( ELeave ) CGSConnSettingsSelectionDlg( |
|
43 aResourceID, |
|
44 aCurrentSelectionIndex, |
|
45 aItemArray, |
|
46 aPopupResource ); |
|
47 CleanupStack::PushL( self ); |
|
48 self->ConstructL( aPopupResource ); |
|
49 CleanupStack::Pop( self ); |
|
50 return self; |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // CGSConnSettingsSelectionDlg::ConstructL |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 void CGSConnSettingsSelectionDlg::ConstructL( TInt aPopupResource) |
|
58 { |
|
59 iPopupController = CAknInfoPopupNoteController::NewL(); |
|
60 iPopupItems = iCoeEnv->ReadDesC16ArrayResourceL( aPopupResource ); |
|
61 // ShowInfoPopupL(); |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // CGSConnSettingsSelectionDlg::CGSConnSettingsSelectionDlg |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 CGSConnSettingsSelectionDlg::CGSConnSettingsSelectionDlg( |
|
69 TInt aResourceID, |
|
70 TInt& aCurrentSelectionIndex, |
|
71 const MDesCArray* aItemArray, |
|
72 TInt /* aPopupResource */) |
|
73 : CAknRadioButtonSettingPage( |
|
74 aResourceID, |
|
75 aCurrentSelectionIndex, |
|
76 aItemArray ) |
|
77 { |
|
78 |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CGSConnSettingsSelectionDlg::~CGSConnSettingsSelectionDlg |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 CGSConnSettingsSelectionDlg::~CGSConnSettingsSelectionDlg() |
|
86 { |
|
87 if ( iPopupController ) |
|
88 { |
|
89 delete iPopupController; |
|
90 } |
|
91 |
|
92 if ( iPopupItems ) |
|
93 { |
|
94 iPopupItems->Reset(); |
|
95 delete iPopupItems; |
|
96 } |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // CGSConnSettingsSelectionDlg::OfferKeyEventL |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 TKeyResponse CGSConnSettingsSelectionDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType) |
|
104 { |
|
105 TKeyResponse response ( EKeyWasNotConsumed ); |
|
106 |
|
107 response = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEvent, aType ); |
|
108 |
|
109 //EKeyNull enables here launching of popup note immediately when we enter the setting page |
|
110 if ( aKeyEvent.iCode == EKeyNull || |
|
111 aKeyEvent.iCode == EKeyUpArrow || |
|
112 aKeyEvent.iCode == EKeyDownArrow ) |
|
113 { |
|
114 ShowInfoPopupL(); |
|
115 } |
|
116 return response; |
|
117 } |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // CGSConnSettingsSelectionDlg::HandleListBoxEventL |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void CGSConnSettingsSelectionDlg::HandleListBoxEventL( |
|
124 CEikListBox* aListBox, |
|
125 TListBoxEvent aEventType ) |
|
126 { |
|
127 if ( aEventType == EEventItemClicked || |
|
128 aEventType == EEventItemSingleClicked ) |
|
129 { |
|
130 ShowInfoPopupL(); |
|
131 } |
|
132 CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); |
|
133 } |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // CGSConnSettingsSelectionDlg::ShowInfoPopupL |
|
137 // --------------------------------------------------------------------------- |
|
138 // |
|
139 void CGSConnSettingsSelectionDlg::ShowInfoPopupL() |
|
140 { |
|
141 TInt currentIndex = this->ListBoxControl()->CurrentItemIndex(); |
|
142 |
|
143 iPopupController->HideInfoPopupNote(); |
|
144 |
|
145 iPopupController->SetTextL( (*iPopupItems)[currentIndex] ); |
|
146 iPopupController->SetTimeDelayBeforeShow( 500 ); |
|
147 iPopupController->SetTimePopupInView( 0 ); //Zero means that popup stays in screen until it is destroyed |
|
148 iPopupController->ShowInfoPopupNote(); |
|
149 } |
|
150 |
|
151 // End of file |
|
152 |
|