extras/calcsoft/src/CalcView.cpp
branchRCL_3
changeset 29 9d6a662e71d9
parent 24 10c6e6d6e4d9
equal deleted inserted replaced
27:2e7bab7ab409 29:9d6a662e71d9
    73     BaseConstructL(R_CALC_VIEW_INFO);
    73     BaseConstructL(R_CALC_VIEW_INFO);
    74     
    74     
    75     iCalcDocument = STATIC_CAST(CCalcDocument*, AppUi()->Document());
    75     iCalcDocument = STATIC_CAST(CCalcDocument*, AppUi()->Document());
    76 
    76 
    77     iCalcDocument->SetCalcView( this );
    77     iCalcDocument->SetCalcView( this );
    78 
    78     CreateContainerL();
    79     iCalcDocument->LoadStateL();
    79     iCalcDocument->LoadStateL();
    80    
    80    
    81     /******** Initialize the ServiceHandler in the ConstructL *****/
    81     /******** Initialize the ServiceHandler in the ConstructL *****/
    82     
    82     
    83     iServiceHandler = CAiwServiceHandler::NewL();
    83     iServiceHandler = CAiwServiceHandler::NewL();
    90     }
    90     }
    91 
    91 
    92 // Destructor
    92 // Destructor
    93 CCalcView::~CCalcView()
    93 CCalcView::~CCalcView()
    94     {
    94     {
    95     if ( iContainer )
    95     delete iContainer;
    96         {
    96       if(iServiceHandler)
    97         delete iContainer;
    97       {
    98         iContainer = NULL;
    98             delete iServiceHandler;
    99         }
    99             iServiceHandler = NULL;
   100 
   100       }
   101     if( iServiceHandler )
       
   102         {
       
   103         delete iServiceHandler;
       
   104         iServiceHandler = NULL;
       
   105         }
       
   106      
   101      
   107      }
   102      }
   108 
   103 
   109 // ---------------------------------------------------------
   104 // ---------------------------------------------------------
   110 // CCalcView::State
   105 // CCalcView::State
  1042 void CCalcView::DoActivateL
  1037 void CCalcView::DoActivateL
  1043                 (const TVwsViewId& /* aPrevViewId */,
  1038                 (const TVwsViewId& /* aPrevViewId */,
  1044                  TUid /* aCustomMessageId */,
  1039                  TUid /* aCustomMessageId */,
  1045                  const TDesC8& /* aCustomMessage */)
  1040                  const TDesC8& /* aCustomMessage */)
  1046     {
  1041     {
  1047     if ( iContainer == NULL )
  1042     AppUi()->AddToStackL(*this, iContainer);
  1048         {
  1043     iContainer->ActivateL();
  1049         CreateContainerL();
       
  1050         AppUi()->AddToStackL( *this, iContainer );
       
  1051         iContainer->ActivateL();
       
  1052         } 
       
  1053     
       
  1054     }
  1044     }
  1055 
  1045 
  1056 // ----------------------------------------------------
  1046 // ----------------------------------------------------
  1057 // CCalcView::DoDeactivate
  1047 // CCalcView::DoDeactivate
  1058 // This is called when CCalcView becomes deactive.
  1048 // This is called when CCalcView becomes deactive.
  1059 // (other items were commented in a header).
  1049 // (other items were commented in a header).
  1060 // ----------------------------------------------------
  1050 // ----------------------------------------------------
  1061 //
  1051 //
  1062 void CCalcView::DoDeactivate()
  1052 void CCalcView::DoDeactivate()
  1063     {
  1053     {
  1064     if ( iContainer )
  1054     if (iContainer)
  1065         {
  1055         {
  1066         AppUi()->RemoveFromStack( iContainer );
  1056         AppUi()->RemoveFromStack(iContainer);
  1067         delete iContainer;
       
  1068         iContainer = NULL;
       
  1069         }
  1057         }
  1070     }
  1058     }
  1071 
  1059 
  1072 // ---------------------------------------------------------
  1060 // ---------------------------------------------------------
  1073 // CCalcView::Id
  1061 // CCalcView::Id