uifw/AvKon/src/AknIndicatorContainer.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 16 71dd06cfe933
child 23 3d340a0166ff
equal deleted inserted replaced
16:71dd06cfe933 18:0aa5fbdfbc30
  1960             continue;
  1960             continue;
  1961             }
  1961             }
  1962 
  1962 
  1963         TInt uid = indicator->Uid().iUid;
  1963         TInt uid = indicator->Uid().iUid;
  1964 
  1964 
  1965         if ( uid == EAknNaviPaneEditorIndicatorSecuredConnection ||
  1965         if ( uid == EAknNaviPaneEditorIndicatorGprs || 
  1966              uid == EAknNaviPaneEditorIndicatorProgressBar       ||
  1966              uid == EAknNaviPaneEditorIndicatorWlanAvailable ||
  1967              uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe      ||
  1967              uid == EAknNaviPaneEditorIndicatorWlanActive || 
  1968              uid == EAknNaviPaneEditorIndicatorGprs              ||
  1968              uid == EAknNaviPaneEditorIndicatorWlanActiveSecure || 
  1969              uid == EAknNaviPaneEditorIndicatorFileSize          ||
  1969              (!isLandscape && 
  1970              uid == EAknNaviPaneEditorIndicatorWaitBar           ||
  1970                      (uid  == EAknNaviPaneEditorIndicatorProgressBar ||
  1971              uid == EAknNaviPaneEditorIndicatorWlanAvailable     ||
  1971                       uid  == EAknNaviPaneEditorIndicatorFileSize || 
  1972              uid == EAknNaviPaneEditorIndicatorWlanActive        ||
  1972                       uid  == EAknNaviPaneEditorIndicatorWaitBar || 
  1973              uid == EAknNaviPaneEditorIndicatorWlanActiveSecure )
  1973                       uid  == EAknNaviPaneEditorIndicatorSecuredConnection || 
       
  1974                       uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe)))
  1974             {
  1975             {
  1975             // These indicators are not shown in this statuspane layout.
  1976             // These indicators are not shown in this statuspane layout.
  1976             indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) );
  1977             indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) );
  1977             iIndicatorsShown++;
  1978             iIndicatorsShown++;
  1978             continue;
  1979             continue;
  1979             }
  1980             }
  1980 
  1981 
  1981 
  1982 
  1982         if ( iLayoutOrientation == EVertical )
  1983         if ( iLayoutOrientation == EVertical )
  1983             {
  1984             {
       
  1985             if (uid == EAknNaviPaneEditorIndicatorProgressBar || uid
       
  1986                     == EAknNaviPaneEditorIndicatorFileSize || uid
       
  1987                     == EAknNaviPaneEditorIndicatorWaitBar || uid
       
  1988                     == EAknNaviPaneEditorIndicatorSecuredConnection || uid
       
  1989                     == EAknNaviPaneEditorIndicatorWmlWaitGlobe)
       
  1990                 {
       
  1991                 indicator->SetExtent(TPoint(0, 0), TSize(0, 0));
       
  1992                 iIndicatorsShown++;
       
  1993                 continue;
       
  1994                 }
  1984             // Highest priority indicator is put topmost.
  1995             // Highest priority indicator is put topmost.
  1985             if ( height < indicator->IconSize().iHeight )
  1996             if ( height < indicator->IconSize().iHeight )
  1986                 {
  1997                 {
  1987                 // Space for indicators is full.
  1998                 // Space for indicators is full.
  1988                 // Rest of low priority indicators are not shown.
  1999                 // Rest of low priority indicators are not shown.
  2020 
  2031 
  2021             TBool textIndicatorOffsetNeeded = ETrue;
  2032             TBool textIndicatorOffsetNeeded = ETrue;
  2022 
  2033 
  2023             TInt textIndicatorLeftOffset = KMinSpaceBetweenIconsInPixels;
  2034             TInt textIndicatorLeftOffset = KMinSpaceBetweenIconsInPixels;
  2024 
  2035 
       
  2036             ////////////////////////////////////////////////////////////////////////////
       
  2037             //small status pane
       
  2038             TRect smallStatusPaneRect;
       
  2039             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane,
       
  2040                     smallStatusPaneRect);
       
  2041 
       
  2042             // small statuspane, secure state indicator
       
  2043             TAknWindowLineLayout
       
  2044                     smallStatusSecureStateLayout =
       
  2045                             AknLayout::Small_status_pane_descendants_and_elements_Line_5();
       
  2046             TAknLayoutRect smallStatusSecureStateLayoutRect;
       
  2047             smallStatusSecureStateLayoutRect.LayoutRect(smallStatusPaneRect,
       
  2048                     smallStatusSecureStateLayout);
       
  2049             TRect smallStatusSecureStateRect(
       
  2050                     smallStatusSecureStateLayoutRect.Rect());
       
  2051 
       
  2052             // small statuspane, wait pane
       
  2053             TAknWindowComponentLayout smallStatusWaitPaneLayout =
       
  2054                     AknLayoutScalable_Avkon::status_small_wait_pane(3);
       
  2055             TAknLayoutRect smallStatusWaitPaneLayoutRect;
       
  2056             smallStatusWaitPaneLayoutRect.LayoutRect(smallStatusPaneRect,
       
  2057                     smallStatusWaitPaneLayout);
       
  2058             TRect smallStatusWaitPaneRect(
       
  2059                     smallStatusWaitPaneLayoutRect.Rect());
       
  2060 
       
  2061             // small statuspane, globe
       
  2062             TAknWindowComponentLayout smallStatusWmlGlobeLayout =
       
  2063                     AknLayoutScalable_Avkon::status_small_pane_g4(0);
       
  2064             TAknLayoutRect smallStatusWmlGlobeLayoutRect;
       
  2065             smallStatusWmlGlobeLayoutRect.LayoutRect(smallStatusPaneRect,
       
  2066                     smallStatusWmlGlobeLayout);
       
  2067             TRect smallStatusWmlGlobeRect(
       
  2068                     smallStatusWmlGlobeLayoutRect.Rect());
       
  2069 
       
  2070             TInt waitBarIndicatorLeftOffset = smallStatusWaitPaneRect.iTl.iX;
       
  2071             TInt progressBarIndicatorLeftOffset = 0;
       
  2072             TInt wmlWaitGlobeLeftOffset = smallStatusWmlGlobeRect.iTl.iX;
       
  2073 
       
  2074             TRect rectForMiddleIndicators(wmlWaitGlobeLeftOffset,
       
  2075                     containerRect.iTl.iY, wmlWaitGlobeLeftOffset,
       
  2076                     containerRect.iBr.iY);
       
  2077 
       
  2078             if (AknLayoutUtils::LayoutMirrored())
       
  2079                 {
       
  2080                 wmlWaitGlobeLeftOffset = smallStatusPaneRect.iBr.iX
       
  2081                         - smallStatusWmlGlobeRect.iBr.iX;
       
  2082                 waitBarIndicatorLeftOffset = smallStatusPaneRect.iBr.iX
       
  2083                         - smallStatusWaitPaneRect.iBr.iX;
       
  2084                 }
       
  2085 
       
  2086             if (uid == EAknNaviPaneEditorIndicatorProgressBar)
       
  2087                 {
       
  2088                 indicatorWidth = smallStatusWaitPaneRect.Width();
       
  2089                 indicatorHeight = smallStatusWaitPaneRect.Height();                
       
  2090                 verticalOffset = (containerRect.Height() - indicatorHeight)/ 2;
       
  2091                 leftOffset = progressBarIndicatorLeftOffset;
       
  2092 
       
  2093                 textIndicatorOffsetNeeded = ETrue;
       
  2094                 }
       
  2095             else if (uid == EAknNaviPaneEditorIndicatorFileSize)
       
  2096                 {
       
  2097                 verticalOffset = verticalOffsetForTextIndicator;
       
  2098 
       
  2099                 // need left offset in western, right offset in A&H layout.
       
  2100                 if (AknLayoutUtils::LayoutMirrored())
       
  2101                     {
       
  2102                     rightOffset = textIndicatorLeftOffset;
       
  2103                     }
       
  2104                 else
       
  2105                     {
       
  2106                     leftOffset = KMinSpaceBetweenIconsInPixels;
       
  2107                     }
       
  2108                 }
       
  2109             else if (uid == EAknNaviPaneEditorIndicatorWmlWaitGlobe)
       
  2110                 {
       
  2111                 verticalOffset = (containerRect.Height()
       
  2112                         - indicator->IconSize().iHeight) / 2;
       
  2113                 indicatorWidth = smallStatusWmlGlobeRect.Width();
       
  2114                 }
       
  2115             else if (uid == EAknNaviPaneEditorIndicatorWaitBar)
       
  2116                 {
       
  2117                 indicatorWidth = smallStatusWaitPaneRect.Width();
       
  2118                 indicatorHeight = smallStatusWaitPaneRect.Height();
       
  2119                 verticalOffset = (containerRect.Height() - indicatorHeight)/ 2;
       
  2120                 leftOffset = waitBarIndicatorLeftOffset;
       
  2121                 textIndicatorOffsetNeeded = ETrue;
       
  2122                 }
       
  2123             else if (uid == EAknNaviPaneEditorIndicatorSecuredConnection)
       
  2124                 {
       
  2125                 verticalOffset = (containerRect.Height()
       
  2126                         - smallStatusSecureStateRect.Height()) / 2;
       
  2127 
       
  2128                 // because icon bitmap does not contain enough space, increase offset as
       
  2129                 // the layout spec states.
       
  2130                 if (AknLayoutUtils::LayoutMirrored())
       
  2131                     {
       
  2132                     leftOffset = KMinSpaceBetweenIconsInPixels;
       
  2133                     }
       
  2134                 else
       
  2135                     {
       
  2136                     rightOffset = KMinSpaceBetweenIconsInPixels;
       
  2137                     }
       
  2138                 textIndicatorOffsetNeeded = EFalse;
       
  2139                 progressBarIndicatorLeftOffset = 0;
       
  2140                 }
       
  2141             ////////////////////////////////////////////////////////////////////////
  2025             if ( uid == EAknNaviPaneEditorIndicatorMessageInfo    ||
  2142             if ( uid == EAknNaviPaneEditorIndicatorMessageInfo    ||
  2026                  uid == EAknNaviPaneEditorIndicatorWmlWindowsText ||
  2143                  uid == EAknNaviPaneEditorIndicatorWmlWindowsText ||
  2027                  uid == EAknNaviPaneEditorIndicatorMessageLength )
  2144                  uid == EAknNaviPaneEditorIndicatorMessageLength )
  2028                 {
  2145                 {
  2029                 verticalOffset = verticalOffsetForTextIndicator;
  2146                 verticalOffset = verticalOffsetForTextIndicator;
  2188 
  2305 
  2189 
  2306 
  2190             // Place indicators to the middle if any.
  2307             // Place indicators to the middle if any.
  2191             if ( indicatorPosition == EMiddle )
  2308             if ( indicatorPosition == EMiddle )
  2192                 {
  2309                 {
  2193                 // Not supported for now, always set size to zero.
  2310                 TRect requiredRect( rectForMiddleIndicators.iTl.iX,
  2194                 indicator->SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) );
  2311                         rectForMiddleIndicators.iTl.iY,
  2195                 iIndicatorsShown++;
  2312                         rectForMiddleIndicators.iTl.iX + leftOffset
       
  2313                                 + indicatorWidth + rightOffset,
       
  2314                         rectForMiddleIndicators.iBr.iY );
       
  2315 
       
  2316                 // check if indicator fits
       
  2317                 if (( requiredRect.Intersects( rectForRightSideIndicators )
       
  2318                         || requiredRect.Intersects(rectForLeftSideIndicators ))
       
  2319                         || ( rectForMiddleIndicators.Width() != 0 ))
       
  2320                     {
       
  2321                     indicator->SetExtent(TPoint(0, 0), TSize(0, 0));
       
  2322                     iIndicatorsShown++;
       
  2323                     continue;
       
  2324                     }
       
  2325                 else
       
  2326                     {
       
  2327                     indicator->SetExtent( TPoint(
       
  2328                             rectForMiddleIndicators.iTl.iX + leftOffset,
       
  2329                             verticalOffset ), TSize( indicatorWidth,
       
  2330                             indicatorHeight ));
       
  2331                     rectForMiddleIndicators.iTl.iX += rightOffset;
       
  2332                     rectForMiddleIndicators.iTl.iX += indicatorWidth;
       
  2333                     }
  2196                 }
  2334                 }
  2197             }
  2335             }
  2198 
  2336 
  2199 
  2337 
  2200         iIndicatorsShown++;
  2338         iIndicatorsShown++;