ImagePrint/ImagePrintUI/imgpprintdll/src/cimgpprintprogressdlg.cpp
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <eikcapc.h>
       
    20 #include <AknsUtils.h>
       
    21 #include <AknsDrawUtils.h>
       
    22 #include <AknsConstants.h>
       
    23 #include <AknsListBoxBackgroundControlContext.h>
       
    24 #include <AknDef.h>
       
    25 
       
    26 #include "cimgpprintprogressdlg.h"
       
    27 #include "imageprintapp.hrh"
       
    28 #include "imageprintconsts.h"
       
    29 #include "clog.h"
       
    30 
       
    31 const TInt KBrandingBitmapPosPortY ( 50 );
       
    32 const TInt KBrandingBitmapPosLandY ( 50 );
       
    33 
       
    34 //  CONSTRUCTION
       
    35 CIMGPPrintProgressDlg::CIMGPPrintProgressDlg(
       
    36     CEikDialog** aSelfPtr,
       
    37     TBool aVisibilityDelayOff )
       
    38       : CAknProgressDialog( aSelfPtr, aVisibilityDelayOff )
       
    39     {
       
    40     }
       
    41 
       
    42 //  Destructor
       
    43 CIMGPPrintProgressDlg::~CIMGPPrintProgressDlg()
       
    44     {
       
    45     }
       
    46 
       
    47 // Positions the UI controls correctly
       
    48 void CIMGPPrintProgressDlg::PostLayoutDynInitL()
       
    49     {
       
    50     LOG("CIMGPPrintProgressDlg::PostLayoutDynInitL");
       
    51 	TSize screenSize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels();
       
    52 	TInt bitmapPosY;
       
    53 	if( screenSize.iWidth == KScreenWidthPortrait )
       
    54 		{
       
    55 		bitmapPosY = KBrandingBitmapPosPortY;
       
    56 		}
       
    57 	else
       
    58 		{
       
    59 		bitmapPosY = KBrandingBitmapPosLandY;
       
    60 		}
       
    61     CAknProgressDialog::PostLayoutDynInitL();
       
    62     CEikCaptionedControl* capControl = GetFirstLineOnFirstPageOrNull();
       
    63     if( capControl )
       
    64         {
       
    65         capControl->SetPosition( TPoint( 0, 0 ) ) ;
       
    66         }
       
    67     Line( EBrandingBitmap )->SetPosition( TPoint( 70, 20 ) );
       
    68     Control( EBrandingBitmap )->SetPosition( TPoint( 0, bitmapPosY ) );
       
    69     Line( EBrandingBitmap )->SetRect( TRect( TPoint( 70, bitmapPosY ), TPoint( 180, bitmapPosY+40 ) ) );
       
    70     }
       
    71 
       
    72 // Overloaded method to enable the bitmap to appear to dialog
       
    73 CEikCaptionedControl* CIMGPPrintProgressDlg::GetFirstLineOnFirstPageOrNull()
       
    74     {
       
    75     return Line( EPrintWaitNote );
       
    76     }
       
    77 
       
    78 void CIMGPPrintProgressDlg::HandleResourceChange( TInt aType )
       
    79     {
       
    80     LOG1("CIMGPPrintProgressDlg::HandleResourceChange: %d", aType);
       
    81     //if (aType == KEikDynamicLayoutVariantSwitch)
       
    82     //    {
       
    83         CAknNoteDialog::HandleResourceChange( aType );
       
    84         TRAP_IGNORE ( PostLayoutDynInitL() );
       
    85     //    }
       
    86     }
       
    87     
       
    88 TKeyResponse CIMGPPrintProgressDlg::OfferKeyEventL( const TKeyEvent &/*aKeyEvent*/, TEventCode /*aType*/ )
       
    89     {
       
    90     return EKeyWasConsumed;   
       
    91     }
       
    92 
       
    93 //  End of File