1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 // System includes |
|
23 #include <manualvideoeditor.rsg> |
|
24 // User includes |
|
25 #include "VeiSettingsContainer.h" |
|
26 #include "VeiSettingItemList.h" |
|
27 #include "VideoEditorCommon.h" // Help (application) UID |
|
28 #include "VideoEditorHelp.hlp.hrh" // Topic context (literal) |
|
29 #include "VideoEditorDebugUtils.h" |
|
30 |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // CVeiSettingsContainer::ConstructL(const TRect& aRect) |
|
36 // EPOC two phased constructor |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 void CVeiSettingsContainer::ConstructL( const TRect& aRect, TVeiSettings& aSettings ) |
|
40 { |
|
41 CreateWindowL(); |
|
42 SetRect( aRect ); |
|
43 |
|
44 iSettingItemList = new( ELeave )CVeiSettingItemList( aSettings ); |
|
45 iSettingItemList->SetMopParent( this ); |
|
46 iSettingItemList->ConstructFromResourceL( R_VEI_SETTING_ITEM_LIST ); |
|
47 |
|
48 |
|
49 ActivateL(); |
|
50 } |
|
51 |
|
52 // Destructor |
|
53 CVeiSettingsContainer::~CVeiSettingsContainer() |
|
54 { |
|
55 delete iSettingItemList; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // CVeiSettingsContainer::CountComponentControls() const |
|
60 // return nbr of controls inside this container |
|
61 // --------------------------------------------------------- |
|
62 // |
|
63 TInt CVeiSettingsContainer::CountComponentControls()const |
|
64 { |
|
65 return 1; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------- |
|
69 // CVeiSettingsContainer::ComponentControl(TInt aIndex) const |
|
70 // --------------------------------------------------------- |
|
71 // |
|
72 CCoeControl* CVeiSettingsContainer::ComponentControl( TInt aIndex )const |
|
73 { |
|
74 switch ( aIndex ) |
|
75 { |
|
76 case 0: |
|
77 return iSettingItemList; |
|
78 default: |
|
79 return NULL; |
|
80 } |
|
81 } |
|
82 |
|
83 // ---------------------------------------------------------------------------- |
|
84 // CVeiSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const |
|
85 // |
|
86 // |
|
87 // ---------------------------------------------------------------------------- |
|
88 // |
|
89 void CVeiSettingsContainer::GetHelpContext( TCoeHelpContext& aContext )const |
|
90 { |
|
91 // Set UID of the CS Help file (same as application UID). |
|
92 aContext.iMajor = KUidVideoEditor; |
|
93 |
|
94 // Set the context. |
|
95 aContext.iContext = KVED_HLP_SETTINGS_VIEW; |
|
96 } |
|
97 |
|
98 |
|
99 void CVeiSettingsContainer::ChangeFocusedItemL() |
|
100 { |
|
101 if ( iSettingItemList ) |
|
102 { |
|
103 iSettingItemList->ChangeFocusedItemL(); |
|
104 } |
|
105 } |
|
106 |
|
107 |
|
108 // --------------------------------------------------------- |
|
109 // CVeiSettingsContainer::OfferKeyEventL( |
|
110 // const TKeyEvent& aKeyEvent,TEventCode aType ) |
|
111 // --------------------------------------------------------- |
|
112 // |
|
113 |
|
114 TKeyResponse CVeiSettingsContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) |
|
115 { |
|
116 if ( iSettingItemList ) |
|
117 { |
|
118 return iSettingItemList->OfferKeyEventL( aKeyEvent, aType ); |
|
119 } |
|
120 else |
|
121 { |
|
122 return EKeyWasNotConsumed; |
|
123 } |
|
124 } |
|
125 |
|
126 void CVeiSettingsContainer::HandleResourceChange( TInt aType ) |
|
127 { |
|
128 LOGFMT( KVideoEditorLogFile, "CVeiSettingsContainer::HandleResourceChange() In, aType:%d", aType ); |
|
129 |
|
130 if ( aType == KEikDynamicLayoutVariantSwitch && OwnsWindow()) |
|
131 { |
|
132 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::HandleResourceChange() 1" ); |
|
133 TRect rect; |
|
134 |
|
135 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); |
|
136 LOGFMT4( KVideoEditorLogFile, "CVeiSettingsContainer::HandleResourceChange(): 2, (%d,%d),(%d,%d)", rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY ); |
|
137 SetRect( rect ); |
|
138 } |
|
139 iSettingItemList->DrawNow(); |
|
140 CCoeControl::HandleResourceChange( aType ); |
|
141 |
|
142 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::HandleResourceChange() Out" ); |
|
143 } |
|
144 |
|
145 |
|
146 |
|
147 void CVeiSettingsContainer::SizeChanged() |
|
148 { |
|
149 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::SizeChanged(): In" ); |
|
150 //TRect rect( Rect() ); |
|
151 TRect rect; |
|
152 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); |
|
153 |
|
154 LOGFMT4( KVideoEditorLogFile, "CVeiSettingsContainer::SizeChanged(): 1, (%d,%d),(%d,%d)", rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY ); |
|
155 |
|
156 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::SizeChanged(): 2" ); |
|
157 if ( iSettingItemList ) |
|
158 { |
|
159 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::SizeChanged(): 3" ); |
|
160 iSettingItemList->SetRect( rect ); |
|
161 } |
|
162 LOG( KVideoEditorLogFile, "CVeiSettingsContainer::SizeChanged(): Out" ); |
|
163 } |
|
164 |
|
165 |
|
166 // End of File |
|