screengrabber/src/SGSettingListView.cpp
branchRCL_3
changeset 21 b3cee849fa46
parent 20 48060abbbeaf
child 22 fad26422216a
equal deleted inserted replaced
20:48060abbbeaf 21:b3cee849fa46
     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 
       
    20 // INCLUDE FILES
       
    21 #include  <aknViewAppUi.h>
       
    22 #include  <avkon.hrh>
       
    23 #include  <screengrabber.rsg>
       
    24 #include  "SGSettingListView.h"
       
    25 #include  "SGSettingListContainer.h"
       
    26 #include  "SGMainView.h"
       
    27 #include  "SG.hrh"
       
    28  
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // ---------------------------------------------------------
       
    33 // CScreenGrabberSettingListView::ConstructL(const TRect& aRect)
       
    34 // EPOC two-phased constructor
       
    35 // ---------------------------------------------------------
       
    36 //
       
    37 void CScreenGrabberSettingListView::ConstructL()
       
    38     {
       
    39     BaseConstructL( R_SCREENGRABBER_VIEW2 );
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------
       
    43 // CScreenGrabberSettingListView::~CScreenGrabberSettingListView()
       
    44 // ?implementation_description
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 CScreenGrabberSettingListView::~CScreenGrabberSettingListView()
       
    48     {
       
    49     if ( iContainer )
       
    50         {
       
    51         AppUi()->RemoveFromViewStack( *this, iContainer );
       
    52         }
       
    53 
       
    54     delete iContainer;
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------
       
    58 // TUid CScreenGrabberSettingListView::Id()
       
    59 // ?implementation_description
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 TUid CScreenGrabberSettingListView::Id() const
       
    63     {
       
    64     return KSettingListViewUID;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------
       
    68 // CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
       
    69 // ?implementation_description
       
    70 // ---------------------------------------------------------
       
    71 //
       
    72 void CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
       
    73     {   
       
    74     switch ( aCommand )
       
    75         {
       
    76         case EScreenGrabberCmdSettingsExit:
       
    77             {
       
    78             // exit the application
       
    79             AppUi()->HandleCommandL( EAknCmdExit );
       
    80 
       
    81             break;
       
    82             }
       
    83 
       
    84         case EScreenGrabberCmdSettingsBack:
       
    85             {
       
    86             // switch back to the main view
       
    87             AppUi()->ActivateLocalViewL( KMainViewUID );
       
    88 
       
    89             break;
       
    90             }
       
    91 
       
    92         case EScreenGrabberCmdSettingsChange:
       
    93             {
       
    94             // show the setting page
       
    95             iContainer->ShowSettingPageL(ETrue);
       
    96 
       
    97             break;
       
    98             }
       
    99 
       
   100         default:
       
   101             {
       
   102             AppUi()->HandleCommandL( aCommand );
       
   103             break;
       
   104             }
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------
       
   109 // CScreenGrabberSettingListView::HandleClientRectChange()
       
   110 // ---------------------------------------------------------
       
   111 //
       
   112 void CScreenGrabberSettingListView::HandleClientRectChange()
       
   113     {
       
   114     if ( iContainer )
       
   115         {
       
   116         iContainer->SetRect( ClientRect() );
       
   117         }
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // CScreenGrabberSettingListView::DoActivateL(...)
       
   122 // ?implementation_description
       
   123 // ---------------------------------------------------------
       
   124 //
       
   125 void CScreenGrabberSettingListView::DoActivateL(
       
   126    const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
       
   127    const TDesC8& /*aCustomMessage*/)
       
   128     {
       
   129     if (!iContainer)
       
   130         {
       
   131         iContainer = new (ELeave) CScreenGrabberSettingListContainer;
       
   132         iContainer->SetMopParent(this);
       
   133         iContainer->ConstructL( ClientRect() );
       
   134         AppUi()->AddToStackL( *this, iContainer );
       
   135         }
       
   136    }
       
   137 
       
   138 // ---------------------------------------------------------
       
   139 // CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
       
   140 // ?implementation_description
       
   141 // ---------------------------------------------------------
       
   142 //
       
   143 void CScreenGrabberSettingListView::DoDeactivate()
       
   144     {
       
   145     if ( iContainer )
       
   146         {
       
   147         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   148         }
       
   149     
       
   150     delete iContainer;
       
   151     iContainer = NULL;
       
   152     }
       
   153 
       
   154 // End of File
       
   155