ImagePrint/ImagePrintUI/imgpprintdll/src/cimgpprintprogressdlg.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:30:38 +0100
branchRCL_3
changeset 28 d59c248c9d36
parent 0 d11fb78c4374
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201031 Kit: 201035

/*
* Copyright (c) 2004-2007 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:  
*
*/


#include <eikcapc.h>
#include <AknsUtils.h>
#include <AknsDrawUtils.h>
#include <AknsConstants.h>
#include <AknsListBoxBackgroundControlContext.h>
#include <AknDef.h>

#include "cimgpprintprogressdlg.h"
#include "imageprintapp.hrh"
#include "imageprintconsts.h"
#include "clog.h"

const TInt KBrandingBitmapPosPortY ( 50 );
const TInt KBrandingBitmapPosLandY ( 50 );

//  CONSTRUCTION
CIMGPPrintProgressDlg::CIMGPPrintProgressDlg(
    CEikDialog** aSelfPtr,
    TBool aVisibilityDelayOff )
      : CAknProgressDialog( aSelfPtr, aVisibilityDelayOff )
    {
    }

//  Destructor
CIMGPPrintProgressDlg::~CIMGPPrintProgressDlg()
    {
    }

// Positions the UI controls correctly
void CIMGPPrintProgressDlg::PostLayoutDynInitL()
    {
    LOG("CIMGPPrintProgressDlg::PostLayoutDynInitL");
	TSize screenSize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels();
	TInt bitmapPosY;
	if( screenSize.iWidth == KScreenWidthPortrait )
		{
		bitmapPosY = KBrandingBitmapPosPortY;
		}
	else
		{
		bitmapPosY = KBrandingBitmapPosLandY;
		}
    CAknProgressDialog::PostLayoutDynInitL();
    CEikCaptionedControl* capControl = GetFirstLineOnFirstPageOrNull();
    if( capControl )
        {
        capControl->SetPosition( TPoint( 0, 0 ) ) ;
        }
    Line( EBrandingBitmap )->SetPosition( TPoint( 70, 20 ) );
    Control( EBrandingBitmap )->SetPosition( TPoint( 0, bitmapPosY ) );
    Line( EBrandingBitmap )->SetRect( TRect( TPoint( 70, bitmapPosY ), TPoint( 180, bitmapPosY+40 ) ) );
    }

// Overloaded method to enable the bitmap to appear to dialog
CEikCaptionedControl* CIMGPPrintProgressDlg::GetFirstLineOnFirstPageOrNull()
    {
    return Line( EPrintWaitNote );
    }

void CIMGPPrintProgressDlg::HandleResourceChange( TInt aType )
    {
    LOG1("CIMGPPrintProgressDlg::HandleResourceChange: %d", aType);
    //if (aType == KEikDynamicLayoutVariantSwitch)
    //    {
        CAknNoteDialog::HandleResourceChange( aType );
        TRAP_IGNORE ( PostLayoutDynInitL() );
    //    }
    }
    
TKeyResponse CIMGPPrintProgressDlg::OfferKeyEventL( const TKeyEvent &/*aKeyEvent*/, TEventCode /*aType*/ )
    {
    return EKeyWasConsumed;   
    }

//  End of File