172 _LIT( KSetConstructingMenuBarOwnerL, |
166 _LIT( KSetConstructingMenuBarOwnerL, |
173 "AknItemActionMenuRegister::SetConstructingMenuBarOwnerL" ); |
167 "AknItemActionMenuRegister::SetConstructingMenuBarOwnerL" ); |
174 _LIT( KIsSingleClickCompatible, |
168 _LIT( KIsSingleClickCompatible, |
175 "CAknAppUiBase::IsSingleClickCompatible()" ); |
169 "CAknAppUiBase::IsSingleClickCompatible()" ); |
176 _LIT( KRegisterCollectionL, "CAknItemActionMenu::RegisterCollectionL" ); |
170 _LIT( KRegisterCollectionL, "CAknItemActionMenu::RegisterCollectionL" ); |
|
171 _LIT( KRegisterCollection2L, |
|
172 "CAknItemActionMenu::RegisterCollectionL( MAknCollection, MObjectProvider" ); |
177 _LIT( KInitMenuL, "CAknItemActionMenu::InitMenuL" ); |
173 _LIT( KInitMenuL, "CAknItemActionMenu::InitMenuL" ); |
178 _LIT( KShowMenuL, "CAknItemActionMenu::ShowMenuL" ); |
174 _LIT( KShowMenuL, "CAknItemActionMenu::ShowMenuL" ); |
179 _LIT( KRemoveCollection, "CAknItemActionMenu::RemoveCollection" ); |
175 _LIT( KRemoveCollection, "CAknItemActionMenu::RemoveCollection" ); |
180 _LIT( KItemSpecificCommandsEnabled, |
176 _LIT( KItemSpecificCommandsEnabled, |
181 "CEikMenuBar::ItemSpecificCommandsEnabled()" ); |
177 "CEikMenuBar::ItemSpecificCommandsEnabled()" ); |
182 _LIT( KSetItemSpecific, "CEikMenuPane::SetItemSpecific()" ); |
178 _LIT( KSetItemSpecific, "CEikMenuPane::SetItemSpecific()" ); |
183 #ifdef RD_TOUCH2 |
|
184 _LIT( KSetOverridingMenuBarOwnerL, |
179 _LIT( KSetOverridingMenuBarOwnerL, |
185 "AknItemActionMenuRegister::SetOverridingMenuBarOwnerL" ); |
180 "AknItemActionMenuRegister::SetOverridingMenuBarOwnerL" ); |
186 _LIT( KCollectionChanged, "CAknItemActionMenu::CollectionChanged" ); |
181 _LIT( KCollectionChanged, "CAknItemActionMenu::CollectionChanged" ); |
187 #endif // RD_TOUCH2 |
|
188 |
182 |
189 //AknItemActionMenuRegister::SetConstructingMenuBarOwnerL is invoked in |
183 //AknItemActionMenuRegister::SetConstructingMenuBarOwnerL is invoked in |
190 //CAknView::BaseConstructL(). |
184 //CAknView::BaseConstructL(). |
191 AssertTrueL( ETrue, KSetConstructingMenuBarOwnerL ); |
185 AssertTrueL( ETrue, KSetConstructingMenuBarOwnerL ); |
192 |
186 |
193 #ifdef RD_TOUCH2 |
|
194 CCoeControl* dummy = new ( ELeave ) CCoeControl; |
187 CCoeControl* dummy = new ( ELeave ) CCoeControl; |
195 CleanupStack::PushL( dummy ); |
188 CleanupStack::PushL( dummy ); |
196 AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( dummy ); |
189 AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( dummy ); |
197 AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL ); |
190 AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL ); |
198 AssertTrueL( ETrue, KSetOverridingMenuBarOwnerL ); |
191 AssertTrueL( ETrue, KSetOverridingMenuBarOwnerL ); |
199 CleanupStack::PopAndDestroy(); |
192 CleanupStack::PopAndDestroy(); |
200 #endif // RD_TOUCH2 |
|
201 |
193 |
202 TBool isSingleClick = iAvkonAppUiBase->IsSingleClickCompatible(); |
194 TBool isSingleClick = iAvkonAppUiBase->IsSingleClickCompatible(); |
203 AssertTrueL( isSingleClick, KIsSingleClickCompatible ); |
195 AssertTrueL( isSingleClick, KIsSingleClickCompatible ); |
204 |
196 |
205 CAknItemActionMenu* aknItemActionMenu = |
197 CAknItemActionMenu* aknItemActionMenu = |
206 CAknItemActionMenu::RegisterCollectionL( *this ); |
198 CAknItemActionMenu::RegisterCollectionL( *this ); |
207 AssertTrueL( ETrue, KRegisterCollectionL ); |
199 AssertTrueL( ETrue, KRegisterCollectionL ); |
|
200 |
208 if ( aknItemActionMenu ) |
201 if ( aknItemActionMenu ) |
209 { |
202 { |
210 aknItemActionMenu->InitMenuL(); |
203 aknItemActionMenu->InitMenuL(); |
211 AssertTrueL( ETrue, KInitMenuL ); |
204 AssertTrueL( ETrue, KInitMenuL ); |
212 |
205 |
213 TPoint p( 10, 10 ); |
206 TPoint p( 10, 10 ); |
214 aknItemActionMenu->ShowMenuL( p ); |
207 aknItemActionMenu->ShowMenuL( p ); |
215 AssertTrueL( ETrue, KShowMenuL ); |
208 AssertTrueL( ETrue, KShowMenuL ); |
216 |
209 |
217 #ifdef RD_TOUCH2 |
|
218 aknItemActionMenu->CollectionChanged( *this ); |
210 aknItemActionMenu->CollectionChanged( *this ); |
219 AssertTrueL( ETrue, KCollectionChanged ); |
211 AssertTrueL( ETrue, KCollectionChanged ); |
220 #endif // RD_TOUCH2 |
|
221 |
212 |
222 aknItemActionMenu->RemoveCollection( *this ); |
213 aknItemActionMenu->RemoveCollection( *this ); |
223 AssertTrueL( ETrue, KRemoveCollection ); |
214 AssertTrueL( ETrue, KRemoveCollection ); |
224 } |
215 } |
225 |
216 |
226 #ifdef RD_TOUCH2 |
217 CAknItemActionMenu* aknItemActionMenu2 = |
|
218 CAknItemActionMenu::RegisterCollectionL( *this, this ); |
|
219 AssertTrueL( ETrue, KRegisterCollection2L ); |
|
220 |
|
221 if ( aknItemActionMenu2 ) |
|
222 { |
|
223 aknItemActionMenu2->RemoveCollection( *this ); |
|
224 } |
|
225 |
|
226 |
227 TVwsViewId uid; |
227 TVwsViewId uid; |
228 |
228 |
229 iAvkonViewAppUi->GetActiveViewId( uid ); |
229 iAvkonViewAppUi->GetActiveViewId( uid ); |
230 CEikMenuBar* menuBar = iAvkonViewAppUi->View( uid.iViewUid )->MenuBar(); |
230 CEikMenuBar* menuBar = iAvkonViewAppUi->View( uid.iViewUid )->MenuBar(); |
231 #else |
|
232 CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); |
|
233 #endif // RD_TOUCH2 |
|
234 CEikMenuPane* menuPane = NULL; |
231 CEikMenuPane* menuPane = NULL; |
235 if ( menuBar ) |
232 if ( menuBar ) |
236 { |
233 { |
237 menuBar->ItemSpecificCommandsEnabled(); |
234 menuBar->ItemSpecificCommandsEnabled(); |
238 AssertTrueL( ETrue, KItemSpecificCommandsEnabled ); |
235 AssertTrueL( ETrue, KItemSpecificCommandsEnabled ); |