calendarui/views/src/calendummyview.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Missed alarms view description   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // System Includes
       
    20 #include <Calendar.rsg>
       
    21 #include <StringLoader.h>
       
    22 #include <CalenStatusPaneUtils.h>
       
    23 // User Includes
       
    24 #include "calendarui_debug.h"
       
    25 #include "calendummyview.h"
       
    26 #include "calendummyviewcontainer.h"
       
    27 #include "CalenUid.h"
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CCalenDummyView::NewLC
       
    31 // Symbian OS 2 phased constructor.
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 EXPORT_C CCalenDummyView* CCalenDummyView::NewL( MCalenServices& aServices )
       
    35     {
       
    36     TRACE_ENTRY_POINT;
       
    37 		
       
    38 	CCalenDummyView* self = new( ELeave )CCalenDummyView(aServices);
       
    39     CleanupStack::PushL( self );
       
    40     self->ConstructL();
       
    41     CleanupStack::Pop( self );
       
    42     
       
    43     TRACE_EXIT_POINT;
       
    44     return self;
       
    45     }
       
    46     
       
    47 // -----------------------------------------------------------------------------
       
    48 // CCalenDummyView::ConstructL
       
    49 // Performs the second phase construction.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 void CCalenDummyView::ConstructL()
       
    53     {
       
    54     TRACE_ENTRY_POINT;
       
    55     
       
    56     CommonConstructL( R_CALEN_DUMMY_VIEW );
       
    57     
       
    58     TRACE_EXIT_POINT;
       
    59     }
       
    60 
       
    61 // ----------------------------------------------------------------------------
       
    62 // CCalenDummyView::CCalenEventView
       
    63 // C++ constructor.
       
    64 // ----------------------------------------------------------------------------
       
    65 //
       
    66 CCalenDummyView::CCalenDummyView( MCalenServices& aServices )
       
    67     : CCalenNativeView( aServices ),
       
    68     iPopulationStep( ENothingDone )
       
    69     {
       
    70 	TRACE_ENTRY_POINT;
       
    71 	TRACE_EXIT_POINT;
       
    72     }
       
    73  
       
    74 // ----------------------------------------------------------------------------
       
    75 // CCalenDummyView::~CCalenDummyView
       
    76 // Destructor
       
    77 // ----------------------------------------------------------------------------
       
    78 //
       
    79 CCalenDummyView::~CCalenDummyView()
       
    80 	{
       
    81 	TRACE_ENTRY_POINT;
       
    82 	TRACE_EXIT_POINT;
       
    83 	}
       
    84 
       
    85 // ----------------------------------------------------------------------------
       
    86 // CCalenDummyView::ActiveStepL
       
    87 // From CCalenView:State machine for view population
       
    88 // ----------------------------------------------------------------------------
       
    89 //
       
    90 CCalenView::TNextPopulationStep CCalenDummyView::ActiveStepL()
       
    91     {
       
    92     TRACE_ENTRY_POINT;
       
    93 	
       
    94 	CCalenView::TNextPopulationStep nextStep = CCalenView::EDone;
       
    95 		
       
    96      switch( iPopulationStep )
       
    97         {
       
    98         case ENothingDone:
       
    99         	{
       
   100         	iPopulationStep = EPopulationDone;   
       
   101  			nextStep = CCalenView::EKeepGoing;
       
   102 			}
       
   103         	break;
       
   104         case EPopulationDone:
       
   105 	       	{
       
   106         	nextStep = CCalenView::EDone;
       
   107         	}
       
   108         	break;
       
   109         default:
       
   110             break;
       
   111         }
       
   112     TRACE_EXIT_POINT;  
       
   113     return nextStep;  
       
   114     }
       
   115 
       
   116 // ----------------------------------------------------------------------------
       
   117 // CCalenDummyView::CancelPopulation
       
   118 // From CCalenView:Cencel view population
       
   119 // ----------------------------------------------------------------------------
       
   120 //
       
   121 void CCalenDummyView::CancelPopulation()
       
   122     {
       
   123     TRACE_ENTRY_POINT;
       
   124     
       
   125     iPopulationStep = ENothingDone;
       
   126 
       
   127     TRACE_EXIT_POINT;
       
   128     }
       
   129 
       
   130 // ----------------------------------------------------------------------------
       
   131 // CCalenDummyView::LocalisedViewNameL
       
   132 // From CCalenView:Localised view name
       
   133 // ----------------------------------------------------------------------------
       
   134 //
       
   135 const TDesC& CCalenDummyView::LocalisedViewNameL( CCalenView::TViewName aViewName )
       
   136     {
       
   137     TRACE_ENTRY_POINT;
       
   138 	
       
   139     HBufC* ret = NULL;
       
   140 
       
   141     switch ( aViewName )
       
   142         {
       
   143         case CCalenView::EMenuName:
       
   144             if ( !iMenuName )
       
   145                 {
       
   146                 iMenuName = StringLoader::LoadL( R_QTN_CALE_TITLE_CALENDAR, iCoeEnv );
       
   147                 }
       
   148             ret = iMenuName;
       
   149             break;
       
   150         case CCalenView::ESettingsName:
       
   151             if ( !iSettingsName )
       
   152                 {
       
   153                 iSettingsName = StringLoader::LoadL( R_QTN_CALE_TITLE_CALENDAR,
       
   154                                                      iCoeEnv );
       
   155                 }
       
   156             ret = iSettingsName;
       
   157             break;
       
   158         default:
       
   159             ASSERT( EFalse );
       
   160             break;
       
   161         }
       
   162 
       
   163     TRACE_EXIT_POINT;
       
   164     return *ret;
       
   165     }
       
   166 
       
   167 // ----------------------------------------------------------------------------
       
   168 // CCalenDummyView::ViewIcon
       
   169 // From CCalenView: Returns view specific icon
       
   170 // ----------------------------------------------------------------------------
       
   171 //
       
   172 CGulIcon* CCalenDummyView::ViewIconL() const
       
   173     {
       
   174     TRACE_ENTRY_POINT;
       
   175     TRACE_EXIT_POINT;
       
   176     return NULL;
       
   177     }
       
   178 
       
   179 // -----------------------------------------------------------------------------
       
   180 // CCalenDummyView::HandleCommandL
       
   181 // Handles the commands that are passed from softkey generated commands and menus.
       
   182 // -----------------------------------------------------------------------------
       
   183 //
       
   184 void CCalenDummyView::HandleCommandL(TInt aCommand)
       
   185 	{
       
   186 	TRACE_ENTRY_POINT;
       
   187 	
       
   188 	switch(aCommand)
       
   189 		{
       
   190         default:
       
   191             CCalenNativeView::HandleCommandL(aCommand);
       
   192             break;
       
   193         	}
       
   194  	
       
   195     TRACE_EXIT_POINT;	
       
   196 	}        
       
   197 
       
   198 // ----------------------------------------------------------------------------
       
   199 // CCalenDummyView::DoActivateImplL
       
   200 // Take action before activating the view
       
   201 // ----------------------------------------------------------------------------
       
   202 //
       
   203 void CCalenDummyView::DoActivateImplL( const TVwsViewId& /*aPrevViewId*/,
       
   204                                       TUid /*aCustomMessageId */,
       
   205                                       const TDesC8& /*aCustomMessage*/ )
       
   206     {
       
   207     TRACE_ENTRY_POINT;
       
   208 	
       
   209     RedrawStatusPaneL();
       
   210     
       
   211     TRACE_EXIT_POINT;
       
   212     }
       
   213 
       
   214 // ----------------------------------------------------------------------------
       
   215 // CCalenDummyView::DoDeactivateImpl
       
   216 // Take action before view deactivation
       
   217 // ----------------------------------------------------------------------------
       
   218 //
       
   219 void CCalenDummyView::DoDeactivateImpl()
       
   220     {
       
   221     TRACE_ENTRY_POINT;
       
   222     TRACE_EXIT_POINT;
       
   223     }
       
   224 
       
   225 // ----------------------------------------------------------------------------
       
   226 // CCalenDummyView::OnLocaleChangedL
       
   227 // Handle locale changes
       
   228 // ----------------------------------------------------------------------------
       
   229 //
       
   230 void CCalenDummyView::OnLocaleChangedL(TInt aReason)  
       
   231     {
       
   232     TRACE_ENTRY_POINT;
       
   233     
       
   234     if(iContainer)
       
   235         {
       
   236         if(IsContainerFocused())
       
   237             {
       
   238             if (aReason & EChangesLocale)
       
   239                 {
       
   240                 BeginRepopulationL();
       
   241                 }
       
   242             else
       
   243                 {
       
   244                 RedrawStatusPaneL();
       
   245                 }
       
   246             }
       
   247         else
       
   248             {
       
   249             iLocChangeReason = EChangesLocale;
       
   250             }
       
   251         }
       
   252         
       
   253     TRACE_EXIT_POINT;
       
   254     }
       
   255 
       
   256 // ----------------------------------------------------------------------------
       
   257 // CCalenDummyView::RedrawStatusPaneL
       
   258 // Redraw status pane
       
   259 // ----------------------------------------------------------------------------
       
   260 //
       
   261 void CCalenDummyView::RedrawStatusPaneL()  
       
   262     {
       
   263     TRACE_ENTRY_POINT;
       
   264 	
       
   265     HBufC* titleText = StringLoader::LoadLC( R_QTN_CALE_TITLE_CALENDAR, iCoeEnv );
       
   266     iSPUtils->UnderLineTitleText( EFalse );
       
   267     iSPUtils->SetTitleText( _L(" ").Alloc()/*titleText*/ );    // ownership passed
       
   268     CleanupStack::Pop( titleText );
       
   269     iSPUtils->RefreshStatusPane();
       
   270 
       
   271     TRACE_EXIT_POINT;
       
   272     }
       
   273 
       
   274 // ----------------------------------------------------------------------------
       
   275 // CCalenDummyView::ClearViewSpecificDataL
       
   276 // Clear view specific data
       
   277 // ----------------------------------------------------------------------------
       
   278 //
       
   279 void CCalenDummyView::ClearViewSpecificDataL()
       
   280 	{
       
   281     TRACE_ENTRY_POINT;
       
   282     TRACE_EXIT_POINT;	
       
   283 	}
       
   284 
       
   285 // ----------------------------------------------------------------------------
       
   286 // CCalenDummyView::CyclePosition
       
   287 // Returns view's cycle position
       
   288 // ----------------------------------------------------------------------------
       
   289 //
       
   290 CCalenView::TCyclePosition CCalenDummyView::CyclePosition() const
       
   291 	{
       
   292 	TRACE_ENTRY_POINT;
       
   293     TRACE_EXIT_POINT;	
       
   294 
       
   295     return ENoCyclePosition;
       
   296 	}
       
   297 
       
   298 // -----------------------------------------------------------------------------
       
   299 // CCalenDummyView::Id
       
   300 // Returns the unique id of the view.
       
   301 // -----------------------------------------------------------------------------
       
   302 //
       
   303  TUid CCalenDummyView::Id() const
       
   304  	{
       
   305  	TRACE_ENTRY_POINT;
       
   306 	TRACE_EXIT_POINT;	
       
   307 	
       
   308  	return KUidCalenDummyView;
       
   309  	}	
       
   310 
       
   311 // ----------------------------------------------------------------------------
       
   312 // CCalenDummyView::CreateContainerImplL
       
   313 // (other items were commented in a header).
       
   314 // ----------------------------------------------------------------------------
       
   315 //
       
   316 CCalenContainer* CCalenDummyView::CreateContainerImplL() 
       
   317 	{
       
   318     TRACE_ENTRY_POINT;
       
   319     TRACE_EXIT_POINT;	
       
   320     return new( ELeave )CCalenDummyViewContainer( this, 
       
   321                                               iServices );
       
   322 	}
       
   323 
       
   324 // ----------------------------------------------------------------------------
       
   325 // CCalenDummyView::Container
       
   326 // Return the container pointer.
       
   327 // ----------------------------------------------------------------------------
       
   328 //
       
   329 CCalenDummyViewContainer* CCalenDummyView::Container()
       
   330 	{
       
   331 	TRACE_ENTRY_POINT;
       
   332 	TRACE_EXIT_POINT;
       
   333 	
       
   334 	return static_cast<CCalenDummyViewContainer*>( iContainer );
       
   335 	}
       
   336 
       
   337 // ----------------------------------------------------------------------------
       
   338 // CCalenDummyViewContainer::UpdateSizeL
       
   339 // Do layout changes after calendar settings are
       
   340 // changed.
       
   341 // Implementation for month view without week numbers.
       
   342 // ----------------------------------------------------------------------------
       
   343 //
       
   344 void CCalenDummyViewContainer::UpdateSizeL()
       
   345     {
       
   346     TRACE_ENTRY_POINT;
       
   347 
       
   348 
       
   349     TRACE_EXIT_POINT;
       
   350     }
       
   351 
       
   352 // end of file