|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * Series 60 version of Hindi Demo application |
|
16 * Implementation of CHindiDemoContainer |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #include <aknutils.h> |
|
22 #include <HindiDemo.rsg> |
|
23 #include <uikon.hrh> |
|
24 #include "HindiDemocontainer.h" |
|
25 |
|
26 CHindiDemoContainer::~CHindiDemoContainer() |
|
27 { |
|
28 CleanupComponents(); |
|
29 } |
|
30 |
|
31 // ----------------------------------------------------------------------- |
|
32 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY |
|
33 // ----------------------------------------------------------------------- |
|
34 CAknSettingItem* CHindiDemoContainer::CreateSettingItemL(TInt aSettingId) |
|
35 { |
|
36 CAknSettingItem * settingItem = NULL; |
|
37 switch ( aSettingId ) |
|
38 { |
|
39 |
|
40 /* 13/08/05 20:28 */ |
|
41 default:; |
|
42 } |
|
43 return settingItem; |
|
44 } |
|
45 |
|
46 void CHindiDemoContainer::EditItemL(TInt aIndex, TBool aCalledFromMenu) |
|
47 { |
|
48 CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------- |
|
52 // Here we dispatch to Command Event Handlers |
|
53 // |
|
54 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY |
|
55 // ----------------------------------------------------------------------- |
|
56 bool CHindiDemoContainer::DispatchViewCommandEvents(TInt aCommand) |
|
57 { |
|
58 return false; |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------- |
|
62 // Routine that creates and initializes designed components |
|
63 // |
|
64 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY |
|
65 // ----------------------------------------------------------------------- |
|
66 void CHindiDemoContainer::InitComponentsL() |
|
67 { |
|
68 /* 13/08/05 20:28 */ |
|
69 CEikStatusPane * sp = iEikonEnv->AppUiFactory()->StatusPane(); |
|
70 { |
|
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(); |
|
76 } |
|
77 { |
|
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(); |
|
83 } |
|
84 iNaviPane = ( CAknNavigationControlContainer * ) sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
85 iEikonEnv->AppUiFactory()->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); |
|
86 } |
|
87 |
|
88 // ----------------------------------------------------------------------- |
|
89 // Routine that cleans up designed components |
|
90 // |
|
91 // NOTE: This routine is managed by the C++Builder IDE - DO NOT MODIFY |
|
92 // ----------------------------------------------------------------------- |
|
93 void CHindiDemoContainer::CleanupComponents() |
|
94 { |
|
95 /* 13/08/05 20:28 */ |
|
96 delete iNaviDecorator; |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------- |
|
100 // Draw |
|
101 // |
|
102 // |
|
103 // ----------------------------------------------------------------------- |
|
104 void CHindiDemoContainer::Draw(const TRect& aRect) const |
|
105 { |
|
106 |
|
107 } |
|
108 |
|
109 |
|
110 // ----------------------------------------------------------------------- |
|
111 // Method invoked by control framework to handle key events |
|
112 // ----------------------------------------------------------------------- |
|
113 TKeyResponse CHindiDemoContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) |
|
114 { |
|
115 #ifdef WITH_TAB_GROUP |
|
116 if (aType == EEventKey && (aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow)) |
|
117 return EKeyWasNotConsumed; |
|
118 #endif |
|
119 return CAknSettingItemList::OfferKeyEventL(aKeyEvent, aType); |
|
120 } |
|
121 |
|
122 void CHindiDemoContainer::SizeChanged() |
|
123 { |
|
124 if (ListBox()) |
|
125 { |
|
126 ListBox()->SetRect(Rect()); |
|
127 } |
|
128 } |
|
129 |