sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "tsmallwindowzoom.h" sl@0: sl@0: sl@0: const TRect KMinimumZoomRect(TSize(20, 20)); sl@0: sl@0: CTSmallWindowZoom::CTSmallWindowZoom(const TPoint& aStartingPoint, const TSize& aWindowSize): sl@0: CTSmallWindowRaster(aStartingPoint, aWindowSize) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: CTSmallWindowZoom::~CTSmallWindowZoom() sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: CTWindow* CTSmallWindowZoom::NewL(RWsSession &aWs, sl@0: const RWindowTreeNode &aParent, sl@0: const TPoint& aStartingPoint, sl@0: const TSize& aWindowSize) sl@0: { sl@0: CTSmallWindowZoom* self = new (ELeave)CTSmallWindowZoom(aStartingPoint, aWindowSize); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aWs, aParent); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: void CTSmallWindowZoom::ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent) sl@0: { sl@0: CTSmallWindowRaster::ConstructL(aWs, aParent); sl@0: iDelta = 1; sl@0: iZoom = EZoomIn; sl@0: } sl@0: sl@0: void CTSmallWindowZoom::LoadL(CSurfaceUtility* aUtility, TPtrC aFileName) sl@0: { sl@0: CTSmallWindowRaster::LoadL(aUtility, aFileName); sl@0: iZoomRect = iSourceRect; sl@0: } sl@0: sl@0: void CTSmallWindowZoom::RenderL() sl@0: { sl@0: CTWindow::RenderL(); sl@0: if (iLoaded) sl@0: { sl@0: DrawBitmap(iZoomRect); sl@0: if (iZoom == EZoomIn) sl@0: { sl@0: iZoomRect.Shrink(iDelta, iDelta); sl@0: if (iZoomRect.Width() <= KMinimumZoomRect.Width()) sl@0: { sl@0: iZoom = EZoomOut; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iZoomRect.Grow(iDelta, iDelta); sl@0: if (iZoomRect.Width() >= iSourceRect.Width()) sl@0: { sl@0: iZoom = EZoomIn; sl@0: } sl@0: } sl@0: } sl@0: sl@0: sl@0: }