launcher/src/launcherviewoutput.cpp
branchRCL_3
changeset 20 fad26422216a
equal deleted inserted replaced
19:b3cee849fa46 20:fad26422216a
       
     1 /*
       
     2 * Copyright (c) 2009 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 FILES
       
    20 #include  <aknViewAppUi.h>
       
    21 #include  <avkon.hrh>
       
    22 #include  <Launcher.rsg>
       
    23 #include  "launcherviewoutput.h"
       
    24 #include  "launchercontaineroutput.h" 
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // ---------------------------------------------------------
       
    29 // CLauncherViewOutput::ConstructL(const TRect& aRect)
       
    30 // EPOC two-phased constructor
       
    31 // ---------------------------------------------------------
       
    32 //
       
    33 void CLauncherViewOutput::ConstructL(CLauncherEngine* aEngine)
       
    34     {
       
    35     BaseConstructL( R_LAUNCHER_VIEW2 );
       
    36 
       
    37     iContainer = new (ELeave) CLauncherContainerOutput;
       
    38     iContainer->SetMopParent(this);
       
    39     iContainer->ConstructL( ClientRect(), aEngine );
       
    40 
       
    41     AppUi()->AddToStackL( *this, iContainer );
       
    42 
       
    43     aEngine->SetContainerOutput(iContainer);
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // CLauncherViewOutput::~CLauncherViewOutput()
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 CLauncherViewOutput::~CLauncherViewOutput()
       
    51     {
       
    52     AppUi()->RemoveFromViewStack( *this, iContainer );
       
    53     delete iContainer;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------
       
    57 // TUid CLauncherViewOutput::Id()
       
    58 // ---------------------------------------------------------
       
    59 //
       
    60 TUid CLauncherViewOutput::Id() const
       
    61     {
       
    62     return KView2Id;
       
    63     }
       
    64 
       
    65 // ------------------------------------------------------------------------------
       
    66 // CLauncherViewApps::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
       
    67 //  This function is called by the EIKON framework just before it displays
       
    68 //  a menu pane. Its default implementation is empty, and by overriding it,
       
    69 //  the application can set the state of menu items dynamically according
       
    70 //  to the state of application data.
       
    71 // ------------------------------------------------------------------------------
       
    72 //
       
    73 
       
    74 void CLauncherViewOutput::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
       
    75     {
       
    76     if (aResourceId == R_LAUNCHER_VIEW2_MENU)
       
    77         {
       
    78         // ...
       
    79         }
       
    80     else
       
    81         {
       
    82         AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
       
    83         }
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------
       
    87 // CLauncherViewOutput::HandleCommandL(TInt aCommand)
       
    88 // ---------------------------------------------------------
       
    89 //
       
    90 void CLauncherViewOutput::HandleCommandL(TInt aCommand)
       
    91     {   
       
    92 
       
    93     switch ( aCommand )
       
    94         {
       
    95         case ECmdClearWindow:
       
    96             {
       
    97             iContainer->ClearOutputWindowL();
       
    98             break;
       
    99             }
       
   100         default:
       
   101             {
       
   102             AppUi()->HandleCommandL( aCommand );
       
   103             break;
       
   104             }
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------
       
   109 // CLauncherViewOutput::HandleClientRectChange()
       
   110 // ---------------------------------------------------------
       
   111 //
       
   112 void CLauncherViewOutput::HandleClientRectChange()
       
   113     {
       
   114     if ( iContainer )
       
   115         {
       
   116         iContainer->SetRect( ClientRect() );
       
   117         }
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // CLauncherViewOutput::DoActivateL(...)
       
   122 // ---------------------------------------------------------
       
   123 //
       
   124 void CLauncherViewOutput::DoActivateL(
       
   125    const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
       
   126    const TDesC8& /*aCustomMessage*/)
       
   127     {
       
   128     //AppUi()->AddToStackL( *this, iContainer );
       
   129     iContainer->ActivateL();
       
   130     iContainer->MakeVisible(ETrue);
       
   131     }
       
   132 
       
   133 // ---------------------------------------------------------
       
   134 // CLauncherViewOutput::DoDeactivate()
       
   135 // ---------------------------------------------------------
       
   136 //
       
   137 void CLauncherViewOutput::DoDeactivate()
       
   138     {
       
   139     iContainer->MakeVisible(EFalse);
       
   140     //AppUi()->RemoveFromViewStack( *this, iContainer );
       
   141     }
       
   142 
       
   143 // End of File
       
   144