139 iDataObserver = |
138 iDataObserver = |
140 new (ELeave) CAknIndicatorDataObserver( iIndicatorContainer ); |
139 new (ELeave) CAknIndicatorDataObserver( iIndicatorContainer ); |
141 } |
140 } |
142 |
141 |
143 TRAP_IGNORE( CCoeEnv::Static()->AddMessageMonitorObserverL( *this ) ); |
142 TRAP_IGNORE( CCoeEnv::Static()->AddMessageMonitorObserverL( *this ) ); |
144 |
|
145 iFeedback = MTouchFeedback::Instance(); |
|
146 if ( iFeedback && |
|
147 iIndicatorContainer->iIndicatorContext == |
|
148 CAknIndicatorContainer::EUniversalIndicators ) |
|
149 { |
|
150 // Tactile feedback is only used for universal indicator pane. |
|
151 CFeedbackSpec* fbSpec = CFeedbackSpec::New(); |
|
152 if ( fbSpec ) |
|
153 { |
|
154 fbSpec->AddFeedback( ETouchEventStylusDown, |
|
155 ETouchFeedbackSensitiveButton ); |
|
156 fbSpec->AddFeedback( ETouchEventStylusUp, |
|
157 ETouchFeedbackSensitiveButton, |
|
158 ETouchFeedbackVibra ); |
|
159 |
|
160 iFeedback->SetFeedbackArea( iIndicatorContainer, |
|
161 0, |
|
162 iIndicatorContainer->Rect(), |
|
163 fbSpec ); |
|
164 delete fbSpec; |
|
165 } |
|
166 } |
|
167 } |
143 } |
168 |
144 |
169 |
145 |
170 CAknIndicatorContainerExtension::CAknIndicatorContainerExtension( |
146 CAknIndicatorContainerExtension::CAknIndicatorContainerExtension( |
171 CAknIndicatorContainer* aIndicatorContainer ) |
147 CAknIndicatorContainer* aIndicatorContainer ) |
172 : iIndicatorContainer( aIndicatorContainer ) |
148 : iIndicatorContainer( aIndicatorContainer ) |
173 { |
149 { |
174 iSmallStatusPaneLayout = AknStatuspaneUtils::SmallLayoutActive(); |
150 iSmallStatusPaneLayout = AknStatuspaneUtils::SmallLayoutActive(); |
175 iIncallBubbleAllowedInUsual = ETrue; |
151 iIncallBubbleAllowedInUsual = ETrue; |
176 iIsForeground = static_cast<CAknAppUi*>( CEikonEnv::Static()->EikAppUi() )->IsForeground(); |
152 iIsForeground = static_cast<CAknAppUi*>( CEikonEnv::Static()->EikAppUi() )->IsForeground(); |
177 iStatusPane = CEikStatusPaneBase::Current(); |
153 iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle(); |
178 } |
154 } |
179 |
155 |
180 |
156 |
181 CAknIndicatorContainerExtension::~CAknIndicatorContainerExtension() |
157 CAknIndicatorContainerExtension::~CAknIndicatorContainerExtension() |
182 { |
158 { |
183 delete iPictoInterface; |
159 delete iPictoInterface; |
184 delete iDataObserver; |
160 delete iDataObserver; |
185 |
161 |
186 CCoeEnv::Static()->RemoveMessageMonitorObserver( *this ); |
162 CCoeEnv::Static()->RemoveMessageMonitorObserver( *this ); |
187 |
|
188 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
189 if ( feedback ) |
|
190 { |
|
191 feedback->RemoveFeedbackForControl( iIndicatorContainer ); |
|
192 } |
|
193 } |
163 } |
194 |
164 |
195 |
165 |
196 void CAknIndicatorContainerExtension::DrawPictographArea() |
166 void CAknIndicatorContainerExtension::DrawPictographArea() |
197 { |
167 { |
830 AknsUtils::RegisterControlPosition( this ); |
796 AknsUtils::RegisterControlPosition( this ); |
831 } |
797 } |
832 |
798 |
833 EXPORT_C TInt CAknIndicatorContainer::CountComponentControls() const |
799 EXPORT_C TInt CAknIndicatorContainer::CountComponentControls() const |
834 { |
800 { |
835 return iIndicators->Count(); |
801 return (iIndicatorsShown); |
836 } |
802 } |
837 |
803 |
838 TInt CAknIndicatorContainer::CountShownIndicator() const |
804 |
|
805 EXPORT_C CCoeControl* CAknIndicatorContainer::ComponentControl(TInt aIndex) const |
839 { |
806 { |
840 TInt count = iIndicators->Count(); |
807 TInt count = iIndicators->Count(); |
841 TInt indicatorShown = 0; |
808 |
842 for ( TInt i = 0; i< count; i++ ) |
809 TInt ii = 0; |
843 { |
810 for (ii = 0; (ii < count) && (aIndex >= 0); ii++) |
844 if( iIndicators->At(i)->IndicatorState() && iIndicators->At( i )->Priority() != KIndicatorNotShown ) |
811 { |
845 { |
812 if ( iIndicators->At(ii)->IndicatorState() && (iIndicators->At(ii)->Priority() != KIndicatorNotShown)) |
846 indicatorShown++; |
813 { |
847 } |
814 aIndex--; |
848 } |
815 } |
849 return indicatorShown; |
816 } |
850 } |
817 |
851 |
818 if ( ii > 0 ) |
852 |
819 { |
853 EXPORT_C CCoeControl* CAknIndicatorContainer::ComponentControl(TInt aIndex) const |
820 return iIndicators->At(--ii); |
854 { |
|
855 if ( aIndex >= 0 && aIndex < iIndicators->Count() ) |
|
856 { |
|
857 return iIndicators->At( aIndex ); |
|
858 } |
821 } |
859 else |
822 else |
860 { |
823 { |
861 return NULL; |
824 return NULL; |
862 } |
825 } |
863 } |
826 } |
864 |
827 |
865 |
828 |
866 EXPORT_C void CAknIndicatorContainer::Draw( const TRect& aRect ) const |
829 EXPORT_C void CAknIndicatorContainer::Draw( const TRect& /*aRect*/ ) const |
867 { |
830 { |
868 if ( iExtension->iStatusPane && |
831 if ( iExtension->iIsActiveIdle ) |
869 iExtension->iStatusPane->IsTransparent() && |
832 { |
870 ( iIndicatorContext != EQueryEditorIndicators ) ) |
|
871 { |
|
872 CWindowGc& gc = SystemGc(); |
|
873 TRgb rgb(TRgb::Color16MA(0)); |
|
874 gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); |
|
875 gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
876 gc.SetBrushColor(rgb); |
|
877 gc.Clear(aRect); |
|
878 return; |
833 return; |
879 } |
834 } |
880 |
835 |
881 // Don't allow normal background drawing if |
836 // Don't allow normal background drawing if |
882 // background is already drawn with a background drawer. |
837 // background is already drawn with a background drawer. |
1095 if ( rect.Contains( aPointerEvent.iPosition ) ) |
1049 if ( rect.Contains( aPointerEvent.iPosition ) ) |
1096 { |
1050 { |
1097 // set flag that down was inside indicator |
1051 // set flag that down was inside indicator |
1098 iExtension->iFlags |= |
1052 iExtension->iFlags |= |
1099 EAknIndicatorsButton1DownInIndicatorPaneRect; |
1053 EAknIndicatorsButton1DownInIndicatorPaneRect; |
|
1054 |
|
1055 if ( iIndicatorContext == EUniversalIndicators && |
|
1056 iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect |
|
1057 ) |
|
1058 { |
|
1059 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1060 |
|
1061 if ( feedback ) |
|
1062 { |
|
1063 feedback->InstantFeedback( this, ETouchFeedbackSensitiveButton ); |
|
1064 } |
|
1065 } |
1100 } |
1066 } |
1101 break; |
1067 break; |
1102 } |
1068 } |
1103 |
1069 |
1104 case TPointerEvent::EButton1Up: |
1070 case TPointerEvent::EButton1Up: |
1105 { |
1071 { |
1106 // Currently the small digital clock pane, universal |
1072 // Currently the small digital clock pane and universal |
1107 // indicator pane and battery pane (in status pane layouts |
1073 // indicator pane are regarded as one touch responsive area from |
1108 // where it's adjacent to universal indicator or digital |
1074 // which the universal indicator popup should open on tap, |
1109 // clock pane) are regarded as one touch responsive |
1075 // so upon pointer up event it must be checked here if |
1110 // area from which the universal indicator popup should |
1076 // the down event happened inside this control, but the up event |
1111 // open on tap, so upon pointer up event it must be checked |
1077 // inside digital clock pane area. |
1112 // here if the down event happened inside this control, |
|
1113 // but the up event inside digital clock or battery pane area. |
|
1114 CEikStatusPaneBase* sp = CEikStatusPaneBase::Current(); |
1078 CEikStatusPaneBase* sp = CEikStatusPaneBase::Current(); |
1115 TBool pointerUpInClockArea( EFalse ); |
1079 TRect clockRect( 0, 0, 0, 0 ); |
1116 TBool pointerUpInBatteryArea( EFalse ); |
|
1117 |
1080 |
1118 if ( sp ) |
1081 if ( sp ) |
1119 { |
1082 { |
1120 CCoeControl* clockPane = sp->ContainerControlL( |
1083 CCoeControl* clockPane = sp->ContainerControlL( |
1121 TUid::Uid( EEikStatusPaneUidDigitalClock ) ); |
1084 TUid::Uid( EEikStatusPaneUidDigitalClock ) ); |
1122 if ( clockPane ) |
1085 if ( clockPane ) |
1123 { |
1086 { |
1124 TRect clockRect( clockPane->PositionRelativeToScreen(), |
1087 clockRect = TRect( clockPane->PositionRelativeToScreen(), |
1125 clockPane->Size() ); |
1088 clockPane->Size() ); |
1126 pointerUpInClockArea = |
|
1127 clockRect.Contains( aPointerEvent.iParentPosition ); |
|
1128 } |
1089 } |
1129 |
|
1130 if ( !AknStatuspaneUtils::ExtendedFlatLayoutActive() ) |
|
1131 { |
|
1132 CCoeControl* batteryPane = sp->ContainerControlL( |
|
1133 TUid::Uid( EEikStatusPaneUidBattery ) ); |
|
1134 if ( batteryPane ) |
|
1135 { |
|
1136 TRect batteryRect( |
|
1137 batteryPane->PositionRelativeToScreen(), |
|
1138 batteryPane->Size() ); |
|
1139 pointerUpInBatteryArea = |
|
1140 batteryRect.Contains( aPointerEvent.iParentPosition ); |
|
1141 } |
|
1142 } |
|
1143 } |
1090 } |
1144 |
1091 |
1145 // if indicator's rect contains pointer up position |
1092 // if indicator's rect contains pointer up position |
1146 if ( ( iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect && |
1093 if ( iIndicatorContext == EUniversalIndicators && |
|
1094 ( ( iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect && |
1147 rect.Contains( aPointerEvent.iPosition ) ) || |
1095 rect.Contains( aPointerEvent.iPosition ) ) || |
1148 pointerUpInClockArea || |
1096 clockRect.Contains( aPointerEvent.iParentPosition ) ) ) |
1149 pointerUpInBatteryArea ) |
1097 { |
1150 { |
|
1151 if ( iExtension->iFeedback && |
|
1152 ( pointerUpInClockArea || pointerUpInBatteryArea ) ) |
|
1153 { |
|
1154 // The pointer down was received in another control, |
|
1155 // so the tactile feedback must be given directly. |
|
1156 iExtension->iFeedback->InstantFeedback( |
|
1157 this, |
|
1158 ETouchFeedbackSensitiveButton, |
|
1159 ETouchFeedbackVibra, |
|
1160 aPointerEvent ); |
|
1161 } |
|
1162 |
|
1163 CAknSmallIndicator* indicatorNotifier = CAknSmallIndicator::NewLC( TUid::Uid( 0 ) ); |
|
1164 indicatorNotifier->HandleIndicatorTapL(); |
|
1165 //for indicator popup event |
|
1166 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1098 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1167 if ( feedback ) |
1099 if ( feedback ) |
1168 { |
1100 { |
1169 feedback->InstantFeedback( |
1101 feedback->InstantFeedback( this, |
1170 this, |
1102 ETouchFeedbackSensitiveButton, |
1171 ETouchFeedbackPopUp, |
1103 ETouchFeedbackVibra, |
1172 ETouchFeedbackVibra, |
1104 aPointerEvent ); |
1173 aPointerEvent ); |
|
1174 } |
1105 } |
|
1106 CAknSmallIndicator* indicatorNotifier = CAknSmallIndicator::NewLC( TUid::Uid( 0 ) ); |
|
1107 indicatorNotifier->HandleIndicatorTapL(); |
1175 CleanupStack::PopAndDestroy( indicatorNotifier ); |
1108 CleanupStack::PopAndDestroy( indicatorNotifier ); |
1176 } |
1109 } |
1177 |
|
1178 // Up happened, reset button down flag |
1110 // Up happened, reset button down flag |
1179 iExtension->iFlags &= |
1111 iExtension->iFlags &= |
1180 ( ~EAknIndicatorsButton1DownInIndicatorPaneRect ); |
1112 ( ~EAknIndicatorsButton1DownInIndicatorPaneRect ); |
1181 break; |
1113 break; |
1182 } |
1114 } |
1206 if (count < 2) |
1138 if (count < 2) |
1207 { |
1139 { |
1208 return; |
1140 return; |
1209 } |
1141 } |
1210 |
1142 |
1211 // Bubble sorted |
1143 CAknIndicator* temp; |
1212 for (TInt i = 0; i < ( count - 1 ); i++) |
1144 for(TInt ii = 1; ii < count; ii++) |
1213 { |
1145 { |
1214 TBool swaped = EFalse; |
1146 temp = iIndicators->At(ii); |
1215 for (TInt j = count - 1; j > i; j--) |
1147 TInt tempPriority = temp->Priority(); |
1216 { |
1148 if (tempPriority >= 0) |
1217 if ( iIndicators->At( j )->Priority() |
1149 { |
1218 < iIndicators->At( j - 1 )->Priority() ) |
1150 for(TInt jj = 0; jj <= ii; jj++) |
1219 { |
1151 { |
1220 CAknIndicator* temp = iIndicators->At( j ); |
1152 if (tempPriority < iIndicators->At(jj)->Priority()) |
1221 iIndicators->Delete( j ); |
1153 { |
1222 CleanupStack::PushL( temp ); |
1154 iIndicators->Delete( ii ); |
1223 iIndicators->InsertL( j - 1, temp ); |
1155 CleanupStack::PushL( temp ); |
1224 CleanupStack::Pop( temp ); |
1156 iIndicators->InsertL( jj, temp ); |
1225 swaped = ETrue; |
1157 CleanupStack::Pop( temp ); |
1226 } |
1158 break; |
1227 } |
1159 } |
1228 if( !swaped ) |
1160 else if ( jj == (ii-1) ) |
1229 { |
1161 { |
1230 break; |
1162 break; |
1231 } |
1163 } |
1232 } |
1164 } |
1233 |
1165 } |
|
1166 } |
1234 } |
1167 } |
1235 |
1168 |
1236 |
1169 |
1237 TInt CAknIndicatorContainer::TickerCallback(TAny* aThis) |
1170 TInt CAknIndicatorContainer::TickerCallback(TAny* aThis) |
1238 { |
1171 { |
1974 continue; |
1907 continue; |
1975 } |
1908 } |
1976 |
1909 |
1977 TInt uid = indicator->Uid().iUid; |
1910 TInt uid = indicator->Uid().iUid; |
1978 |
1911 |
1979 if ( uid == EAknNaviPaneEditorIndicatorGprs || |
1912 if ( uid == EAknNaviPaneEditorIndicatorSecuredConnection || |
1980 uid == EAknNaviPaneEditorIndicatorWlanAvailable || |
1913 uid == EAknNaviPaneEditorIndicatorProgressBar || |
1981 uid == EAknNaviPaneEditorIndicatorWlanActive || |
1914 uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe || |
1982 uid == EAknNaviPaneEditorIndicatorWlanActiveSecure || |
1915 uid == EAknNaviPaneEditorIndicatorGprs || |
1983 (!isLandscape && |
1916 uid == EAknNaviPaneEditorIndicatorFileSize || |
1984 (uid == EAknNaviPaneEditorIndicatorProgressBar || |
1917 uid == EAknNaviPaneEditorIndicatorWaitBar || |
1985 uid == EAknNaviPaneEditorIndicatorFileSize || |
1918 uid == EAknNaviPaneEditorIndicatorWlanAvailable || |
1986 uid == EAknNaviPaneEditorIndicatorWaitBar || |
1919 uid == EAknNaviPaneEditorIndicatorWlanActive || |
1987 uid == EAknNaviPaneEditorIndicatorSecuredConnection || |
1920 uid == EAknNaviPaneEditorIndicatorWlanActiveSecure ) |
1988 uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe))) |
|
1989 { |
1921 { |
1990 // These indicators are not shown in this statuspane layout. |
1922 // These indicators are not shown in this statuspane layout. |
1991 indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) ); |
1923 indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) ); |
1992 iIndicatorsShown++; |
1924 iIndicatorsShown++; |
1993 continue; |
1925 continue; |
1994 } |
1926 } |
1995 |
1927 |
1996 |
1928 |
1997 if ( iLayoutOrientation == EVertical ) |
1929 if ( iLayoutOrientation == EVertical ) |
1998 { |
1930 { |
1999 if (uid == EAknNaviPaneEditorIndicatorProgressBar || uid |
|
2000 == EAknNaviPaneEditorIndicatorFileSize || uid |
|
2001 == EAknNaviPaneEditorIndicatorWaitBar || uid |
|
2002 == EAknNaviPaneEditorIndicatorSecuredConnection || uid |
|
2003 == EAknNaviPaneEditorIndicatorWmlWaitGlobe) |
|
2004 { |
|
2005 indicator->SetExtent(TPoint(0, 0), TSize(0, 0)); |
|
2006 iIndicatorsShown++; |
|
2007 continue; |
|
2008 } |
|
2009 // Highest priority indicator is put topmost. |
1931 // Highest priority indicator is put topmost. |
2010 if ( height < indicator->IconSize().iHeight ) |
1932 if ( height < indicator->IconSize().iHeight ) |
2011 { |
1933 { |
2012 // Space for indicators is full. |
1934 // Space for indicators is full. |
2013 // Rest of low priority indicators are not shown. |
1935 // Rest of low priority indicators are not shown. |
2045 |
1967 |
2046 TBool textIndicatorOffsetNeeded = ETrue; |
1968 TBool textIndicatorOffsetNeeded = ETrue; |
2047 |
1969 |
2048 TInt textIndicatorLeftOffset = KMinSpaceBetweenIconsInPixels; |
1970 TInt textIndicatorLeftOffset = KMinSpaceBetweenIconsInPixels; |
2049 |
1971 |
2050 //////////////////////////////////////////////////////////////////////////// |
|
2051 //small status pane |
|
2052 TRect smallStatusPaneRect; |
|
2053 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, |
|
2054 smallStatusPaneRect); |
|
2055 |
|
2056 // small statuspane, secure state indicator |
|
2057 TAknWindowLineLayout |
|
2058 smallStatusSecureStateLayout = |
|
2059 AknLayout::Small_status_pane_descendants_and_elements_Line_5(); |
|
2060 TAknLayoutRect smallStatusSecureStateLayoutRect; |
|
2061 smallStatusSecureStateLayoutRect.LayoutRect(smallStatusPaneRect, |
|
2062 smallStatusSecureStateLayout); |
|
2063 TRect smallStatusSecureStateRect( |
|
2064 smallStatusSecureStateLayoutRect.Rect()); |
|
2065 |
|
2066 // small statuspane, wait pane |
|
2067 TAknWindowComponentLayout smallStatusWaitPaneLayout = |
|
2068 AknLayoutScalable_Avkon::status_small_wait_pane(3); |
|
2069 TAknLayoutRect smallStatusWaitPaneLayoutRect; |
|
2070 smallStatusWaitPaneLayoutRect.LayoutRect(smallStatusPaneRect, |
|
2071 smallStatusWaitPaneLayout); |
|
2072 TRect smallStatusWaitPaneRect( |
|
2073 smallStatusWaitPaneLayoutRect.Rect()); |
|
2074 |
|
2075 // small statuspane, globe |
|
2076 TAknWindowComponentLayout smallStatusWmlGlobeLayout = |
|
2077 AknLayoutScalable_Avkon::status_small_pane_g4(0); |
|
2078 TAknLayoutRect smallStatusWmlGlobeLayoutRect; |
|
2079 smallStatusWmlGlobeLayoutRect.LayoutRect(smallStatusPaneRect, |
|
2080 smallStatusWmlGlobeLayout); |
|
2081 TRect smallStatusWmlGlobeRect( |
|
2082 smallStatusWmlGlobeLayoutRect.Rect()); |
|
2083 |
|
2084 TInt waitBarIndicatorLeftOffset = smallStatusWaitPaneRect.iTl.iX; |
|
2085 TInt progressBarIndicatorLeftOffset = 0; |
|
2086 TInt wmlWaitGlobeLeftOffset = smallStatusWmlGlobeRect.iTl.iX; |
|
2087 |
|
2088 TRect rectForMiddleIndicators(wmlWaitGlobeLeftOffset, |
|
2089 containerRect.iTl.iY, wmlWaitGlobeLeftOffset, |
|
2090 containerRect.iBr.iY); |
|
2091 |
|
2092 if (AknLayoutUtils::LayoutMirrored()) |
|
2093 { |
|
2094 wmlWaitGlobeLeftOffset = smallStatusPaneRect.iBr.iX |
|
2095 - smallStatusWmlGlobeRect.iBr.iX; |
|
2096 waitBarIndicatorLeftOffset = smallStatusPaneRect.iBr.iX |
|
2097 - smallStatusWaitPaneRect.iBr.iX; |
|
2098 } |
|
2099 |
|
2100 if (uid == EAknNaviPaneEditorIndicatorProgressBar) |
|
2101 { |
|
2102 indicatorWidth = smallStatusWaitPaneRect.Width(); |
|
2103 indicatorHeight = smallStatusWaitPaneRect.Height(); |
|
2104 verticalOffset = (containerRect.Height() - indicatorHeight)/ 2; |
|
2105 leftOffset = progressBarIndicatorLeftOffset; |
|
2106 |
|
2107 textIndicatorOffsetNeeded = ETrue; |
|
2108 } |
|
2109 else if (uid == EAknNaviPaneEditorIndicatorFileSize) |
|
2110 { |
|
2111 verticalOffset = verticalOffsetForTextIndicator; |
|
2112 |
|
2113 // need left offset in western, right offset in A&H layout. |
|
2114 if (AknLayoutUtils::LayoutMirrored()) |
|
2115 { |
|
2116 rightOffset = textIndicatorLeftOffset; |
|
2117 } |
|
2118 else |
|
2119 { |
|
2120 leftOffset = KMinSpaceBetweenIconsInPixels; |
|
2121 } |
|
2122 } |
|
2123 else if (uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe) |
|
2124 { |
|
2125 verticalOffset = (containerRect.Height() |
|
2126 - indicator->IconSize().iHeight) / 2; |
|
2127 indicatorWidth = smallStatusWmlGlobeRect.Width(); |
|
2128 } |
|
2129 else if (uid == EAknNaviPaneEditorIndicatorWaitBar) |
|
2130 { |
|
2131 indicatorWidth = smallStatusWaitPaneRect.Width(); |
|
2132 indicatorHeight = smallStatusWaitPaneRect.Height(); |
|
2133 verticalOffset = (containerRect.Height() - indicatorHeight)/ 2; |
|
2134 leftOffset = waitBarIndicatorLeftOffset; |
|
2135 textIndicatorOffsetNeeded = ETrue; |
|
2136 } |
|
2137 else if (uid == EAknNaviPaneEditorIndicatorSecuredConnection) |
|
2138 { |
|
2139 verticalOffset = (containerRect.Height() |
|
2140 - smallStatusSecureStateRect.Height()) / 2; |
|
2141 |
|
2142 // because icon bitmap does not contain enough space, increase offset as |
|
2143 // the layout spec states. |
|
2144 if (AknLayoutUtils::LayoutMirrored()) |
|
2145 { |
|
2146 leftOffset = KMinSpaceBetweenIconsInPixels; |
|
2147 } |
|
2148 else |
|
2149 { |
|
2150 rightOffset = KMinSpaceBetweenIconsInPixels; |
|
2151 } |
|
2152 textIndicatorOffsetNeeded = EFalse; |
|
2153 progressBarIndicatorLeftOffset = 0; |
|
2154 } |
|
2155 //////////////////////////////////////////////////////////////////////// |
|
2156 if ( uid == EAknNaviPaneEditorIndicatorMessageInfo || |
1972 if ( uid == EAknNaviPaneEditorIndicatorMessageInfo || |
2157 uid == EAknNaviPaneEditorIndicatorWmlWindowsText || |
1973 uid == EAknNaviPaneEditorIndicatorWmlWindowsText || |
2158 uid == EAknNaviPaneEditorIndicatorMessageLength ) |
1974 uid == EAknNaviPaneEditorIndicatorMessageLength ) |
2159 { |
1975 { |
2160 verticalOffset = verticalOffsetForTextIndicator; |
1976 verticalOffset = verticalOffsetForTextIndicator; |
2319 |
2135 |
2320 |
2136 |
2321 // Place indicators to the middle if any. |
2137 // Place indicators to the middle if any. |
2322 if ( indicatorPosition == EMiddle ) |
2138 if ( indicatorPosition == EMiddle ) |
2323 { |
2139 { |
2324 TRect requiredRect( rectForMiddleIndicators.iTl.iX, |
2140 // Not supported for now, always set size to zero. |
2325 rectForMiddleIndicators.iTl.iY, |
2141 indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) ); |
2326 rectForMiddleIndicators.iTl.iX + leftOffset |
2142 iIndicatorsShown++; |
2327 + indicatorWidth + rightOffset, |
|
2328 rectForMiddleIndicators.iBr.iY ); |
|
2329 |
|
2330 // check if indicator fits |
|
2331 if (( requiredRect.Intersects( rectForRightSideIndicators ) |
|
2332 || requiredRect.Intersects(rectForLeftSideIndicators )) |
|
2333 || ( rectForMiddleIndicators.Width() != 0 )) |
|
2334 { |
|
2335 indicator->SetExtent(TPoint(0, 0), TSize(0, 0)); |
|
2336 iIndicatorsShown++; |
|
2337 continue; |
|
2338 } |
|
2339 else |
|
2340 { |
|
2341 indicator->SetExtent( TPoint( |
|
2342 rectForMiddleIndicators.iTl.iX + leftOffset, |
|
2343 verticalOffset ), TSize( indicatorWidth, |
|
2344 indicatorHeight )); |
|
2345 rectForMiddleIndicators.iTl.iX += rightOffset; |
|
2346 rectForMiddleIndicators.iTl.iX += indicatorWidth; |
|
2347 } |
|
2348 } |
2143 } |
2349 } |
2144 } |
2350 |
2145 |
2351 |
2146 |
2352 iIndicatorsShown++; |
2147 iIndicatorsShown++; |
3076 } |
2871 } |
3077 |
2872 |
3078 iIndicatorsShown++; |
2873 iIndicatorsShown++; |
3079 |
2874 |
3080 TBool showIndicator( ETrue ); |
2875 TBool showIndicator( ETrue ); |
3081 |
|
3082 switch ( iIndicatorsShown ) |
2876 switch ( iIndicatorsShown ) |
3083 { |
2877 { |
3084 case 1: |
2878 case 1: |
3085 { |
2879 { |
3086 if ( extendedFlatLayout ) |
2880 indicatorLayout = |
3087 { |
2881 AknLayoutScalable_Avkon::uni_indicator_pane_g1( 1 ); |
3088 indicatorLayout = |
|
3089 AknLayoutScalable_Avkon::indicator_nsta_pane_cp_g1( 0 ); |
|
3090 } |
|
3091 else |
|
3092 { |
|
3093 indicatorLayout = |
|
3094 AknLayoutScalable_Avkon::uni_indicator_pane_g1( 1 ); |
|
3095 } |
|
3096 break; |
2882 break; |
3097 } |
2883 } |
3098 case 2: |
2884 case 2: |
3099 { |
2885 { |
3100 if ( extendedFlatLayout ) |
2886 indicatorLayout = |
3101 { |
2887 AknLayoutScalable_Avkon::uni_indicator_pane_g2( 1 ); |
3102 indicatorLayout = |
|
3103 AknLayoutScalable_Avkon::indicator_nsta_pane_cp_g2( 0 ); |
|
3104 } |
|
3105 else |
|
3106 { |
|
3107 indicatorLayout = |
|
3108 AknLayoutScalable_Avkon::uni_indicator_pane_g2( 1 ); |
|
3109 } |
|
3110 break; |
2888 break; |
3111 } |
2889 } |
3112 case 3: |
2890 case 3: |
3113 { |
2891 { |
3114 if ( extendedFlatLayout ) |
2892 indicatorLayout = |
3115 { |
2893 AknLayoutScalable_Avkon::uni_indicator_pane_g3( 1 ); |
3116 indicatorLayout = |
|
3117 AknLayoutScalable_Avkon::indicator_nsta_pane_cp_g3( 0 ); |
|
3118 } |
|
3119 else |
|
3120 { |
|
3121 indicatorLayout = |
|
3122 AknLayoutScalable_Avkon::uni_indicator_pane_g3( 1 ); |
|
3123 } |
|
3124 break; |
2894 break; |
3125 } |
2895 } |
|
2896 |
|
2897 // TODO: Add support (remove the extendedFlatLayout checks |
|
2898 // below) for six indicators also in the extended flat layout |
|
2899 // once the layout data is fixed. |
|
2900 |
3126 case 4: |
2901 case 4: |
3127 { |
2902 { |
3128 if ( extendedFlatLayout ) |
2903 if ( !extendedFlatLayout ) |
3129 { |
|
3130 showIndicator = EFalse; |
|
3131 } |
|
3132 else |
|
3133 { |
2904 { |
3134 indicatorLayout = |
2905 indicatorLayout = |
3135 AknLayoutScalable_Avkon::uni_indicator_pane_g4( 1 ); |
2906 AknLayoutScalable_Avkon::uni_indicator_pane_g4( 1 ); |
3136 } |
2907 } |
3137 break; |
2908 else |
3138 } |
|
3139 case 5: |
|
3140 { |
|
3141 if ( extendedFlatLayout ) |
|
3142 { |
2909 { |
3143 showIndicator = EFalse; |
2910 showIndicator = EFalse; |
3144 } |
2911 } |
3145 else |
2912 break; |
|
2913 } |
|
2914 case 5: |
|
2915 { |
|
2916 if ( !extendedFlatLayout ) |
3146 { |
2917 { |
3147 indicatorLayout = |
2918 indicatorLayout = |
3148 AknLayoutScalable_Avkon::uni_indicator_pane_g5( 1 ); |
2919 AknLayoutScalable_Avkon::uni_indicator_pane_g5( 1 ); |
3149 } |
2920 } |
3150 break; |
2921 else |
3151 } |
|
3152 case 6: |
|
3153 { |
|
3154 if ( extendedFlatLayout ) |
|
3155 { |
2922 { |
3156 showIndicator = EFalse; |
2923 showIndicator = EFalse; |
3157 } |
2924 } |
3158 else |
2925 break; |
|
2926 } |
|
2927 case 6: |
|
2928 { |
|
2929 if ( !extendedFlatLayout ) |
3159 { |
2930 { |
3160 indicatorLayout = |
2931 indicatorLayout = |
3161 AknLayoutScalable_Avkon::uni_indicator_pane_g6( 1 ); |
2932 AknLayoutScalable_Avkon::uni_indicator_pane_g6( 1 ); |
|
2933 } |
|
2934 else |
|
2935 { |
|
2936 showIndicator = EFalse; |
3162 } |
2937 } |
3163 break; |
2938 break; |
3164 } |
2939 } |
3165 default: |
2940 default: |
3166 { |
2941 { |
4283 } |
4058 } |
4284 // if not foreground, cancel the timer |
4059 // if not foreground, cancel the timer |
4285 if ( !iExtension->iIsForeground || |
4060 if ( !iExtension->iIsForeground || |
4286 R_AVKON_STATUS_PANE_LAYOUT_EMPTY == curId ) |
4061 R_AVKON_STATUS_PANE_LAYOUT_EMPTY == curId ) |
4287 { |
4062 { |
4288 if ( iTicker ) |
4063 if ( iTicker->IsActive() ) |
4289 { |
4064 { |
4290 iTicker->Cancel(); |
4065 iTicker->Cancel(); |
4291 delete iTicker; |
4066 } |
4292 iTicker = NULL; |
|
4293 } |
|
4294 |
|
4295 return; |
4067 return; |
4296 } |
4068 } |
4297 |
4069 |
4298 if ( iAnimatedIndicatorsShown > 0 ) |
4070 if ( !iTicker->IsActive() && iAnimatedIndicatorsShown > 0 ) |
4299 { |
4071 { |
4300 if ( !iTicker ) |
4072 iTicker->Start( KAknIndicatorAnimationShortDelay, |
4301 { |
4073 KAknIndicatorAnimationInterval, |
4302 TRAP_IGNORE( iTicker = CPeriodic::NewL( CActive::EPriorityLow ) ); |
4074 TCallBack( TickerCallback, this ) ); |
4303 } |
4075 } |
4304 |
4076 else if ( iTicker->IsActive() && iAnimatedIndicatorsShown == 0 ) |
4305 if ( iTicker && !iTicker->IsActive() ) |
|
4306 { |
|
4307 iTicker->Start( KAknIndicatorAnimationShortDelay, |
|
4308 KAknIndicatorAnimationInterval, |
|
4309 TCallBack( TickerCallback, this ) ); |
|
4310 } |
|
4311 } |
|
4312 else if ( iTicker && iAnimatedIndicatorsShown == 0 ) |
|
4313 { |
4077 { |
4314 // Cancel animation timer if animated indicators |
4078 // Cancel animation timer if animated indicators |
4315 // are not visible anymore. |
4079 // are not visible anymore. |
4316 iTicker->Cancel(); |
4080 iTicker->Cancel(); |
4317 delete iTicker; |
|
4318 iTicker = NULL; |
|
4319 iSynchronizingValue = 0; |
4081 iSynchronizingValue = 0; |
4320 } |
4082 } |
4321 } |
4083 } |
4322 |
4084 |
4323 // End of File |
4085 // End of File |