ImagePrint/ImagePrintUI/imageprintapp/src/cimgpviewemptyview.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 <aknViewAppUi.h>
       
    20 #include <eikenv.h>
       
    21 #include <eikspane.h>
       
    22 #include <aknnavi.h>
       
    23 #include <aknnavide.h>
       
    24 #include <avkon.hrh>
       
    25 #include <imageprintapp.rsg>
       
    26 
       
    27 #include "cimgpviewemptyview.h"
       
    28 #include "cimageprintappui.h"
       
    29 #include "cimageprintblankcontainer.h"
       
    30 
       
    31 // CONSTRUCTION
       
    32 CIMGPViewEmptyView* CIMGPViewEmptyView::NewL()
       
    33     {
       
    34     CIMGPViewEmptyView* self = new (ELeave) CIMGPViewEmptyView;
       
    35     CleanupStack::PushL( self );
       
    36     self->ConstructL();
       
    37     CleanupStack::Pop( self );
       
    38     return self;
       
    39     }
       
    40 
       
    41 // Default constructor
       
    42 CIMGPViewEmptyView::CIMGPViewEmptyView()
       
    43     {
       
    44     }
       
    45 
       
    46 // 2nd phase constructor
       
    47 void CIMGPViewEmptyView::ConstructL()
       
    48     {
       
    49     BaseConstructL( R_EMPTY_VIEW );
       
    50     }
       
    51 
       
    52 // Destructor
       
    53 CIMGPViewEmptyView::~CIMGPViewEmptyView()
       
    54     {
       
    55     if ( iContainer )
       
    56         {
       
    57         AppUi()->RemoveFromViewStack( *this, iContainer );
       
    58         delete iContainer;
       
    59         }
       
    60     }
       
    61 
       
    62 // Returns view's ID
       
    63 TUid CIMGPViewEmptyView::Id() const
       
    64     {
       
    65     return KIMGPViewEmptyViewId;
       
    66     }
       
    67 
       
    68 // Handles view commands
       
    69 void CIMGPViewEmptyView::HandleCommandL(
       
    70     TInt /*aCommand*/ )
       
    71     {
       
    72     AppUi()->HandleCommandL( EAknCmdExit );
       
    73     }
       
    74 
       
    75 // Activates the view, creates the container and other UI controls
       
    76 void CIMGPViewEmptyView::DoActivateL(
       
    77    const TVwsViewId& /*aPrevViewId*/,
       
    78    TUid /*aCustomMessageId*/,
       
    79    const TDesC8& /*aCustomMessage*/)
       
    80     {
       
    81     TRect rect( AppUi()->ClientRect() );
       
    82     iContainer = CImagePrintBlankContainer::NewL(rect);
       
    83     iContainer->SetMopParent( this );
       
    84     AppUi()->AddToStackL( *this, iContainer );
       
    85     }
       
    86 
       
    87 // Deactivates the view, deletes print container
       
    88 void CIMGPViewEmptyView::DoDeactivate()
       
    89     {
       
    90     if ( iContainer )
       
    91         {
       
    92         AppUi()->RemoveFromViewStack( *this, iContainer );
       
    93         delete iContainer;
       
    94         iContainer = 0;
       
    95         }
       
    96     }
       
    97 
       
    98 
       
    99 void CIMGPViewEmptyView::SizeChanged()
       
   100     {
       
   101     //No Implementetion needed
       
   102     }   
       
   103 
       
   104 
       
   105 void CIMGPViewEmptyView::HandleForegroundEventL( TBool aForeground )
       
   106     {
       
   107     if ( aForeground )
       
   108         {
       
   109         ViewScreenDeviceChangedL();
       
   110         }
       
   111     }
       
   112 
       
   113 //  End of File