os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/src/HindiDemocontainer.cpp
First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Series 60 version of Hindi Demo application
16 * Implementation of CHindiDemoContainer
22 #include <HindiDemo.rsg>
24 #include "HindiDemocontainer.h"
26 CHindiDemoContainer::~CHindiDemoContainer()
31 // -----------------------------------------------------------------------
32 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY
33 // -----------------------------------------------------------------------
34 CAknSettingItem* CHindiDemoContainer::CreateSettingItemL(TInt aSettingId)
36 CAknSettingItem * settingItem = NULL;
46 void CHindiDemoContainer::EditItemL(TInt aIndex, TBool aCalledFromMenu)
48 CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
51 // -----------------------------------------------------------------------
52 // Here we dispatch to Command Event Handlers
54 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY
55 // -----------------------------------------------------------------------
56 bool CHindiDemoContainer::DispatchViewCommandEvents(TInt aCommand)
61 // -----------------------------------------------------------------------
62 // Routine that creates and initializes designed components
64 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY
65 // -----------------------------------------------------------------------
66 void CHindiDemoContainer::InitComponentsL()
69 CEikStatusPane * sp = iEikonEnv->AppUiFactory()->StatusPane();
71 iContextPane = ( CAknContextPane * ) sp->ControlL( TUid::Uid( EEikStatusPaneUidContext ) );
72 TResourceReader reader;
73 iCoeEnv->CreateResourceReaderLC( reader, R_HINDIDEMO_IAKNCONTEXTPANE1 );
74 iContextPane->SetFromResourceL( reader );
75 CleanupStack::PopAndDestroy();
78 iTitlePane = ( CAknTitlePane * ) sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) );
79 TResourceReader reader;
80 iCoeEnv->CreateResourceReaderLC( reader, R_HINDIDEMO_IAKNTITLEPANE1 );
81 iTitlePane->SetFromResourceL( reader );
82 CleanupStack::PopAndDestroy();
84 iNaviPane = ( CAknNavigationControlContainer * ) sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
85 iEikonEnv->AppUiFactory()->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );
88 // -----------------------------------------------------------------------
89 // Routine that cleans up designed components
91 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY
92 // -----------------------------------------------------------------------
93 void CHindiDemoContainer::CleanupComponents()
96 delete iNaviDecorator;
99 // -----------------------------------------------------------------------
103 // -----------------------------------------------------------------------
104 void CHindiDemoContainer::Draw(const TRect& aRect) const
110 // -----------------------------------------------------------------------
111 // Method invoked by control framework to handle key events
112 // -----------------------------------------------------------------------
113 TKeyResponse CHindiDemoContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
115 #ifdef WITH_TAB_GROUP
116 if (aType == EEventKey && (aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow))
117 return EKeyWasNotConsumed;
119 return CAknSettingItemList::OfferKeyEventL(aKeyEvent, aType);
122 void CHindiDemoContainer::SizeChanged()
126 ListBox()->SetRect(Rect());