camerauis/cameraapp/generic/src/CamApplicationPane.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 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:  Control for containing the NaviPane
       
    15 *
       
    16 *  Copyright © 2007 Nokia.  All rights reserved.
       
    17 *  This material, including documentation and any related computer
       
    18 *  programs, is protected by copyright controlled by Nokia.  All
       
    19 *  rights are reserved.  Copying, including reproducing, storing,
       
    20 *  adapting or translating, any or all of this material requires the
       
    21 *  prior written consent of Nokia.  This material also contains
       
    22 *  confidential information which may not be disclosed to others
       
    23 *  without the prior written consent of Nokia.
       
    24 
       
    25 *
       
    26 */
       
    27 
       
    28 
       
    29 // INCLUDE FILES
       
    30 #include <eiklabel.h>
       
    31 #include <eikapp.h>		// For CEikApplication
       
    32 #include <eikenv.h>
       
    33 #include <AknsUtils.h>
       
    34 #include <AknsDrawUtils.h>
       
    35 #include <AknConsts.h>
       
    36 #include <StringLoader.h> // StringLoader
       
    37 #include <e32base.h>
       
    38 #include <barsread.h>    // TResourceReader
       
    39 #include <AknBidiTextUtils.h>
       
    40 #include <cameraapp.mbg>
       
    41 #include <AknLayoutFont.h>
       
    42 #include "CamApplicationPane.h"
       
    43 #include "CamNaviCounter.h"
       
    44 #include "CamNaviProgressBar.h"
       
    45 #include "CamAppUi.h"
       
    46 #include "CamUtility.h"
       
    47 
       
    48 #include <cameraapp.rsg>
       
    49 #include <vgacamsettings.rsg>
       
    50 
       
    51 #include "CamLogger.h"
       
    52 
       
    53 #include "AknsBasicBackgroundControlContext.h"
       
    54 
       
    55 
       
    56 // ========================= MEMBER FUNCTIONS ================================
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CCamApplicationPane::NewL
       
    60 // Factory construction function
       
    61 // ---------------------------------------------------------
       
    62 //
       
    63 CCamApplicationPane* CCamApplicationPane::NewL( CCamAppController& aController )
       
    64     {
       
    65     CCamApplicationPane* self = new( ELeave ) CCamApplicationPane( aController );
       
    66     CleanupStack::PushL( self );
       
    67     self->ConstructL();
       
    68     CleanupStack::Pop( self );
       
    69     return self;
       
    70     }
       
    71 
       
    72 // Destructor
       
    73 CCamApplicationPane::~CCamApplicationPane()
       
    74   {    
       
    75   PRINT( _L("Camera => ~CCamApplicationPane") );
       
    76   iNaviCounter = NULL;        // Not owned     
       
    77   iNaviProgressBar = NULL;    // Not owned
       
    78   PRINT( _L("Camera <= ~CCamApplicationPane") );
       
    79   }
       
    80 
       
    81 
       
    82 // ---------------------------------------------------------
       
    83 // CCamApplicationPane::CCamApplicationPane
       
    84 // C++ constructor
       
    85 // ---------------------------------------------------------
       
    86 //
       
    87 CCamApplicationPane::CCamApplicationPane( CCamAppController& aController ) : iController( aController )
       
    88     {
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------
       
    92 // CCamApplicationPane::ConstructL
       
    93 // Symbian OS 2nd phase constructor
       
    94 // ---------------------------------------------------------
       
    95 //
       
    96 void CCamApplicationPane::ConstructL()
       
    97     {
       
    98     iAppPaneLayoutRect.LayoutRect( Rect(), ROID(R_CAM_APPLICATION_PANE_RECT_ID));                 
       
    99     SetRect( iAppPaneLayoutRect.Rect() );               
       
   100     
       
   101     iPaneInUse = EAppPaneUndefined;
       
   102     }                
       
   103 
       
   104 // ---------------------------------------------------------
       
   105 // CCamApplicationPane::SizeChanged
       
   106 // Called by framework when the view size is changed
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 void CCamApplicationPane::SizeChanged()
       
   110     {    
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------
       
   114 // CCamApplicationPane::Draw
       
   115 // Draw the control
       
   116 // ---------------------------------------------------------
       
   117 //
       
   118 void CCamApplicationPane::Draw( const TRect& /* aRect */ ) const
       
   119     {
       
   120     }
       
   121     
       
   122     
       
   123 // ---------------------------------------------------------
       
   124 // CCamApplicationPane::CountComponentControls
       
   125 // Returns the number of component controls to display
       
   126 // ---------------------------------------------------------
       
   127 //   
       
   128 TInt CCamApplicationPane::CountComponentControls() const
       
   129 	{
       
   130 	// If an active Navi Pane is defined, this is one control to show
       
   131 	if ( iPaneInUse != EAppPaneUndefined ) 	
       
   132 	    return 1;
       
   133 	else 
       
   134 	    return 0;
       
   135 	}
       
   136 
       
   137 // ----------------------------------------------------
       
   138 // CCamApplicationPane::ComponentControl
       
   139 // Return requested control
       
   140 // ----------------------------------------------------
       
   141 //
       
   142 CCoeControl* CCamApplicationPane::ComponentControl( TInt /*aIndex*/ ) const
       
   143 	{    
       
   144 	CCoeControl* con = NULL;
       
   145 	switch ( iPaneInUse )
       
   146 	    {
       
   147 	    case EAppPaneCounter:
       
   148 	        {
       
   149 	        con = iNaviCounter;
       
   150 	        break;	        
       
   151 	        }
       
   152 	        
       
   153 	    case EAppPaneProgress:
       
   154 	        {
       
   155 	        con = iNaviProgressBar;
       
   156 	        break;	    	        
       
   157 	        }
       
   158 	        
       
   159 	    case EAppPaneUndefined:
       
   160 	    default:
       
   161 	        {
       
   162 	        break;        
       
   163 	        }	        
       
   164 	    }	
       
   165 	return con;	
       
   166 	}
       
   167 	
       
   168 
       
   169 
       
   170 // ----------------------------------------------------
       
   171 // CCamApplicationPane::ShowCounter
       
   172 // Shows the NaviCounter control in the Application Pane
       
   173 // ----------------------------------------------------
       
   174 //    
       
   175 void CCamApplicationPane::ShowCounter()
       
   176     {    
       
   177     iPaneInUse = EAppPaneCounter;
       
   178     iNaviCounter->MakeVisible( ETrue );
       
   179     iNaviProgressBar->MakeVisible( EFalse );        
       
   180     }
       
   181 
       
   182 
       
   183 // ----------------------------------------------------
       
   184 // CCamApplicationPane::ShowProgress
       
   185 // Shows the NaviProgress control in the Application Pane
       
   186 // ----------------------------------------------------
       
   187 //       
       
   188 void CCamApplicationPane::ShowProgress()
       
   189     {    
       
   190     iPaneInUse = EAppPaneProgress;    
       
   191     iNaviProgressBar->MakeVisible( ETrue );            
       
   192     iNaviCounter->MakeVisible( EFalse );
       
   193     }
       
   194     
       
   195 
       
   196 // ----------------------------------------------------
       
   197 // CCamApplicationPane::InitialisePanesL
       
   198 // Sets the owned panes to a known good state (all invisible)
       
   199 // ----------------------------------------------------
       
   200 //      
       
   201 void CCamApplicationPane::InitialisePanesL()
       
   202     {      
       
   203     iNaviCounter = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() )->NaviCounter();
       
   204     iNaviCounter->SetMopParent( this );
       
   205     iNaviCounter->SetContainerWindowL( *this );  
       
   206     iNaviCounter->SetRect( Rect() );            
       
   207     iNaviCounter->MakeVisible( EFalse );
       
   208     
       
   209     iNaviProgressBar = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() )->NaviProgressBar();
       
   210     iNaviProgressBar->SetMopParent( this );
       
   211     iNaviProgressBar->SetContainerWindowL( *this );            
       
   212     iNaviProgressBar->SetRect( Rect() );            
       
   213     iNaviProgressBar->MakeVisible( EFalse );    
       
   214     
       
   215     if ( iPaneInUse == EAppPaneCounter )
       
   216         {
       
   217         iNaviCounter->MakeVisible( ETrue );
       
   218         }
       
   219     if ( iPaneInUse == EAppPaneProgress )
       
   220         {
       
   221         iNaviProgressBar->MakeVisible( ETrue );    
       
   222         }    
       
   223     }
       
   224         
       
   225 // ----------------------------------------------------
       
   226 // CCamApplicationPane::SetBurstModelL
       
   227 // Sets the burst model to use if app pane showing burst 
       
   228 // filenames
       
   229 // ----------------------------------------------------
       
   230 //           
       
   231 void CCamApplicationPane::SetBurstModelL( CCamBurstThumbnailGridModel* aModel ) 
       
   232     {
       
   233     iNaviCounter->SetBurstModelL( aModel );
       
   234     }
       
   235 
       
   236 
       
   237 // ----------------------------------------------------
       
   238 // CCamApplicationPane::SetCaptureMode
       
   239 // Sets the capture mode the pane should indicate
       
   240 // ----------------------------------------------------
       
   241 //              
       
   242 void CCamApplicationPane::SetCaptureMode( TCamCameraMode aMode )
       
   243   {
       
   244   TRAP_IGNORE( ignore, iNaviCounter->SetCaptureModeL( aMode ) );
       
   245   }
       
   246     
       
   247 
       
   248 
       
   249 // End of File
       
   250 
       
   251