camerauis/activepalette/Inc/ActivePalette2Styler.inl
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Active Palette Styler inline methods*
       
    15 */
       
    16 
       
    17 
       
    18 /**
       
    19  * @file ActivePalette2Styler.inl
       
    20  * Active Palette Styler inline methods
       
    21  */
       
    22 
       
    23 #include "ActivePalette2Cfg.h"
       
    24 #include "ActivePalette2Utils.h"
       
    25     
       
    26 // -----------------------------------------------------------------------------
       
    27 // CActivePalette2Styler::TopSectionRect()
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 inline TRect CActivePalette2Styler::TopSectionRect()
       
    31     {
       
    32     return TRect(TPoint(0,0), TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight)));
       
    33     }
       
    34     
       
    35 // -----------------------------------------------------------------------------
       
    36 // CActivePalette2Styler::BottomSectionRect()
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 inline TRect CActivePalette2Styler::BottomSectionRect()
       
    40     {
       
    41     return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + iNumItems * ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + iNumGaps * ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)), 
       
    42                  TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight)));    
       
    43     }
       
    44     
       
    45 // -----------------------------------------------------------------------------
       
    46 // CActivePalette2Styler::ItemRect()
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 inline TRect CActivePalette2Styler::ItemRect(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal)
       
    50     {
       
    51     TInt offset = ((ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) * aOffsetFrame) / aOffsetTotal;
       
    52     return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + aScreenPos * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) - offset), 
       
    53                  TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight)));
       
    54     }
       
    55     
       
    56 // -----------------------------------------------------------------------------
       
    57 // CActivePalette2Styler::GapRect()
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 inline TRect CActivePalette2Styler::GapRect(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal)
       
    61     {
       
    62     TInt offset = ((ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) * aOffsetFrame) / aOffsetTotal;
       
    63     return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + (aScreenPos+1) * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) - ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) - offset), 
       
    64                  TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)));
       
    65     }
       
    66