uifw/EikStd/coctlsrc/akndoublespanscrollindicatoritem.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 23:04:46 +0200
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 23 3d340a0166ff
permissions -rw-r--r--
Revision: 201003 Kit: 201007

/*
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Indicator item for double span scroll bar.
*
*
*/


#include "AknDoubleSpanScrollIndicatorItem.h"
#include <aknconsts.h>
#include <AknUtils.h>
#include <AknsDrawUtils.h>
#include <aknappui.h>
#include <aknlayoutscalable_avkon.cdl.h>

CAknDoubleSpanScrollIndicatorItem* CAknDoubleSpanScrollIndicatorItem::NewL(TBool aRotated,
       TAknsItemID aTopItem,
        TInt        aTopItemBitmapId,
        TInt        aTopItemMaskId,
        TAknsItemID aMiddleItem,
        TInt        aMiddleItemBitmapId,
        TInt        aMiddleItemMaskId,
        TAknsItemID aBottomItem,
        TInt        aBottomItemBitmapId,
        TInt        aBottomItemMaskId)
    {
    CAknDoubleSpanScrollIndicatorItem* self = new (ELeave) CAknDoubleSpanScrollIndicatorItem();
    CleanupStack::PushL(self);
    self->ConstructL(aRotated,
        aTopItem,
        aTopItemBitmapId,
        aTopItemMaskId,
        aMiddleItem,
        aMiddleItemBitmapId,
        aMiddleItemMaskId,
        aBottomItem,
        aBottomItemBitmapId,
        aBottomItemMaskId);
    CleanupStack::Pop();
    return self;
    }

CAknDoubleSpanScrollIndicatorItem* CAknDoubleSpanScrollIndicatorItem::NewL()
    {
    CAknDoubleSpanScrollIndicatorItem* self
        = new ( ELeave ) CAknDoubleSpanScrollIndicatorItem;

    return self;
    }

CAknDoubleSpanScrollIndicatorItem::CAknDoubleSpanScrollIndicatorItem()
    {
    }

CAknDoubleSpanScrollIndicatorItem::~CAknDoubleSpanScrollIndicatorItem()
    {
    }

void CAknDoubleSpanScrollIndicatorItem::ConstructL(TBool /*aRotated*/,
        TAknsItemID aTopItem,
        TInt        /*aTopItemBitmapId*/,
        TInt        /*aTopItemMaskId*/,
        TAknsItemID aMiddleItem,
        TInt        /*aMiddleItemBitmapId*/,
        TInt        /*aMiddleItemMaskId*/,
        TAknsItemID aBottomItem,
        TInt        /*aBottomItemBitmapId*/,
        TInt        /*aBottomItemMaskId*/)
    {
    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
    iTopId = aTopItem;
    iMidId = aMiddleItem;
    iBottomId = aBottomItem;
    }

void CAknDoubleSpanScrollIndicatorItem::CreateSkinnedBitmapAndMaskL(MAknsSkinInstance* aInstance,
    const TAknsItemID& aID,
    CFbsBitmap*& aBitmap,
    CFbsBitmap*& aMask,
    TBool /*aRotated*/)
    {
    CFbsBitmap* skinnedBitmap = NULL;
    CFbsBitmap* skinnedMask = NULL;

    // note, real fallback icons are not (yet) available in avkon icon file.
    TRAP_IGNORE(AknsUtils::CreateIconL( aInstance, aID, skinnedBitmap, skinnedMask, KNullDesC, -1, -1 ));

    if(!skinnedBitmap)
        {
        AknsUtils::CreateIconL( aInstance, aID, skinnedBitmap, KNullDesC, -1 );
        }

    aBitmap = skinnedBitmap;
    aMask = skinnedMask;

    }