calendarui/editors/src/CalenDescription.cpp
changeset 0 f979ecb2b13e
child 5 42814f902fe6
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 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:  To create and handle, entry description field 
       
    15 *                of Unifiededitor.
       
    16 */
       
    17 
       
    18 // system includes
       
    19 #include <aknlistquerydialog.h>
       
    20 #include <aknnotewrappers.h>
       
    21 #include <AknQueryDialog.h>
       
    22 #include <calentry.h>
       
    23 #include <eikmenup.h>
       
    24 #include <NpdApi.h>
       
    25 #include <StringLoader.h>
       
    26 #include <CalenDefaultEditorsData.rsg>
       
    27 
       
    28 // user includes
       
    29 #include "CalenDescription.h"
       
    30 #include "CalenDescriptionField.h"
       
    31 #include "calenunifiededitor.h"
       
    32 #include "CalenDefaultEditors.hrh"
       
    33 
       
    34 // debug
       
    35 #include "calendarui_debug.h"
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // CCalenDescription::CCalenDescription
       
    41 // C++ constructor can NOT contain any code, that might leave.
       
    42 // (other items were commented in a header).
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CCalenDescription::CCalenDescription( CCalenUnifiedEditor& aEditor )
       
    46     : iEditor( aEditor )
       
    47     {
       
    48     TRACE_ENTRY_POINT;
       
    49     TRACE_EXIT_POINT;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // CCalenDescription::ConstructL
       
    54 // Leaving construction.
       
    55 // (other items were commented in a header).
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 void CCalenDescription::ConstructL()
       
    59     {
       
    60     TRACE_ENTRY_POINT;
       
    61     TRACE_EXIT_POINT;
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CCalenDescription::NewL
       
    66 // Two-phased constructor.
       
    67 // (other items were commented in a header).
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 CCalenDescription* CCalenDescription::NewL( CCalenUnifiedEditor& aEditor )
       
    71     {
       
    72     TRACE_ENTRY_POINT;
       
    73 
       
    74     CCalenDescription* self = new( ELeave ) CCalenDescription( aEditor );
       
    75     CleanupStack::PushL( self );
       
    76     self->ConstructL();
       
    77     CleanupStack::Pop();
       
    78 
       
    79     TRACE_EXIT_POINT;
       
    80     return self;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CCalenDescription::~CCalenDescription
       
    85 // Destructor.
       
    86 // (other items were commented in a header).
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 CCalenDescription::~CCalenDescription()
       
    90     {
       
    91     TRACE_ENTRY_POINT;
       
    92     TRACE_EXIT_POINT;
       
    93     }
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CCalenDescription::CreateFieldL
       
    97 // Create a description field.
       
    98 // (other items were commented in a header).
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 SEikControlInfo CCalenDescription::CreateFieldL()
       
   102     {
       
   103     TRACE_ENTRY_POINT;
       
   104 
       
   105     SEikControlInfo control = { NULL, 0, 0 };
       
   106     control.iControl = new ( ELeave ) CCalenDescriptionField( *this );
       
   107     control.iTrailerTextId = 0;
       
   108     control.iFlags = 0;
       
   109 
       
   110     TRACE_EXIT_POINT;
       
   111     return control;
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // CCalenDescription::InitDescritpionFieldLayoutL
       
   116 // Updates fields just before the form is shown.
       
   117 // (other items were commented in a header).
       
   118 // ---------------------------------------------------------------------------
       
   119 //
       
   120 void CCalenDescription::InitDescritpionFieldLayoutL()
       
   121     {
       
   122     TRACE_ENTRY_POINT;
       
   123 
       
   124     if ( EntryHasDescription() )
       
   125         {
       
   126         ShowFieldL();
       
   127         }
       
   128 
       
   129     TRACE_EXIT_POINT;
       
   130     }
       
   131 
       
   132 // ---------------------------------------------------------------------------
       
   133 // CCalenDescription::PostLayoutDynInitL
       
   134 // (other items were commented in a header).
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void CCalenDescription::PostLayoutDynInitL()
       
   138     {
       
   139     TRACE_ENTRY_POINT;
       
   140     TRACE_EXIT_POINT;
       
   141     }
       
   142 
       
   143 // ---------------------------------------------------------------------------
       
   144 // CCalenDescription::DynInitMenuPaneL
       
   145 // Called just before the options menu is shown.
       
   146 // (other items were commented in a header).
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 void CCalenDescription::DynInitMenuPaneL( TInt aResourceId, 
       
   150                                          CEikMenuPane* aMenuPane )
       
   151     {
       
   152     TRACE_ENTRY_POINT;
       
   153     
       
   154     // Handle unified editor menu pane
       
   155     if( aResourceId == R_CALEN_UNIFIED_EDITOR_MENUPANE )
       
   156         {
       
   157         aMenuPane->AddMenuItemsL( R_CALEN_DESCRIPTION_MENU_PANE );
       
   158 
       
   159         if( EntryHasDescription() )
       
   160             {
       
   161             // Entry already has Description, delete Add description menu item
       
   162             aMenuPane->DeleteMenuItem( ECalenCmdAddDescription );
       
   163             if ( !IsFieldFocused() )
       
   164                 {
       
   165                 // Description field not focused,
       
   166                 // delete Show/Remove descripion menu item.
       
   167                 aMenuPane->DeleteMenuItem( ECalenCmdShowDescription );
       
   168                 aMenuPane->DeleteMenuItem( ECalenCmdRemoveDescription );
       
   169                 }
       
   170             }
       
   171         else 
       
   172             {
       
   173             // Entry don't have description,
       
   174             // delete Show/Remove descripion menu item.
       
   175             aMenuPane->DeleteMenuItem( ECalenCmdShowDescription );
       
   176             aMenuPane->DeleteMenuItem( ECalenCmdRemoveDescription );
       
   177             }
       
   178         }
       
   179 
       
   180     TRACE_EXIT_POINT;
       
   181     }
       
   182 
       
   183 // ---------------------------------------------------------------------------
       
   184 // CCalenDescription::ProcessCommandL
       
   185 // Process commands from the user.
       
   186 // (other items were commented in a header).
       
   187 // ---------------------------------------------------------------------------
       
   188 //
       
   189 TBool CCalenDescription::ProcessCommandL( TInt aCommandId )
       
   190     {
       
   191     TRACE_ENTRY_POINT;
       
   192 
       
   193     TBool processed = EFalse;
       
   194     switch( aCommandId )
       
   195         {
       
   196         case ECalenCmdAddDescription:
       
   197             {
       
   198             processed = HandleAddDescriptionL();
       
   199             break;
       
   200             }
       
   201         case ECalenCmdShowDescription:
       
   202             {
       
   203             ShowL();
       
   204             processed = ETrue;
       
   205             break;
       
   206             }
       
   207         case ECalenCmdRemoveDescription:
       
   208             {
       
   209             RemoveL();
       
   210             processed = ETrue;
       
   211             break;
       
   212             }
       
   213          default:
       
   214             break;            
       
   215         }
       
   216 
       
   217     TRACE_EXIT_POINT;
       
   218     return processed;
       
   219     }
       
   220 
       
   221 // ---------------------------------------------------------------------------
       
   222 // CCalenDescription::AddNewL
       
   223 // Add a new description.
       
   224 // (other items were commented in a header).
       
   225 // ---------------------------------------------------------------------------
       
   226 //
       
   227 void CCalenDescription::AddNewL()
       
   228     {
       
   229     TRACE_ENTRY_POINT;
       
   230 
       
   231     __ASSERT_DEBUG( !EntryHasDescription(), User::Invariant() );
       
   232     
       
   233     TInt status = KErrNone;
       
   234     HBufC* desc = ExecTextEditorL( status, KNullDesC );
       
   235     HandleAddL( status, desc );
       
   236 
       
   237     TRACE_EXIT_POINT;
       
   238     }
       
   239 
       
   240 // ---------------------------------------------------------------------------
       
   241 // CCalenDescription::AddMemoL
       
   242 // Add a memo.
       
   243 // (other items were commented in a header).
       
   244 // ---------------------------------------------------------------------------
       
   245 //
       
   246 void CCalenDescription::AddMemoL()
       
   247     {
       
   248     TRACE_ENTRY_POINT;
       
   249 
       
   250     __ASSERT_DEBUG( !EntryHasDescription(), User::Invariant() );
       
   251 
       
   252     HBufC* desc = CNotepadApi::FetchMemoL();
       
   253     HandleAddL( KErrNone, desc ); // ownership of description transferred
       
   254 
       
   255     TRACE_EXIT_POINT;
       
   256     }
       
   257 
       
   258 // ---------------------------------------------------------------------------
       
   259 // CCalenDescription::ShowL
       
   260 // Show the description.
       
   261 // (other items were commented in a header).
       
   262 // ---------------------------------------------------------------------------
       
   263 //
       
   264 void CCalenDescription::ShowL()
       
   265     {
       
   266     TRACE_ENTRY_POINT;
       
   267 
       
   268     __ASSERT_DEBUG( EntryHasDescription(), User::Invariant() );
       
   269     __ASSERT_DEBUG( IsFieldVisible(), User::Invariant() );
       
   270     __ASSERT_DEBUG( IsFieldFocused(), User::Invariant() );
       
   271   
       
   272     TInt status = KErrNone;
       
   273     
       
   274     // Get description text to 'oldDesc'
       
   275     const TDesC& oldDesc = iEditor.Edited().Description();
       
   276 
       
   277       
       
   278     // Open Description in edit mode
       
   279     HBufC* desc = ExecTextEditorL( status, oldDesc );
       
   280 
       
   281     HandleUpdateL( status, desc ); //ownership of description transferred
       
   282 
       
   283     TRACE_EXIT_POINT;
       
   284     }
       
   285 
       
   286 // ---------------------------------------------------------------------------
       
   287 // CCalenDescription::EditL
       
   288 // Edit the description.
       
   289 // (other items were commented in a header).
       
   290 // ---------------------------------------------------------------------------
       
   291 //
       
   292 void CCalenDescription::EditL()
       
   293     {
       
   294     TRACE_ENTRY_POINT;
       
   295 
       
   296     __ASSERT_DEBUG( EntryHasDescription(), User::Invariant() );
       
   297     __ASSERT_DEBUG( IsFieldVisible(), User::Invariant() );
       
   298     __ASSERT_DEBUG( IsFieldFocused(), User::Invariant() );
       
   299 
       
   300     TInt status = KErrNone;
       
   301     
       
   302     // Get description text to 'oldDesc'
       
   303     const TDesC& oldDesc = iEditor.Edited().Description();
       
   304 
       
   305     // Edit Descripton 'oldDesc', in notepad viewer
       
   306     HBufC* desc = ExecTextEditorL( status, oldDesc );
       
   307     HandleUpdateL( status, desc ); //ownership of description transferred
       
   308 
       
   309     TRACE_EXIT_POINT;
       
   310     }
       
   311 
       
   312 // ---------------------------------------------------------------------------
       
   313 // CCalenDescription::RemoveL
       
   314 // Remove the description.
       
   315 // (other items were commented in a header).
       
   316 // ---------------------------------------------------------------------------
       
   317 //
       
   318 void CCalenDescription::RemoveL()
       
   319     {
       
   320     TRACE_ENTRY_POINT;
       
   321 
       
   322     __ASSERT_DEBUG( EntryHasDescription(), User::Invariant() );
       
   323     __ASSERT_DEBUG( IsFieldVisible(), User::Invariant() );
       
   324     __ASSERT_DEBUG( IsFieldFocused(), User::Invariant() );
       
   325 
       
   326     // Ask remove description query.
       
   327     CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
   328     if( dlg->ExecuteLD(R_CALEN_REMOVE_DESCRIPTION_CONFIRMATION_QUERY) )
       
   329         {
       
   330         // remove description
       
   331         DoRemoveL();
       
   332         }
       
   333 
       
   334     TRACE_EXIT_POINT;
       
   335     }
       
   336 
       
   337 // ---------------------------------------------------------------------------
       
   338 // CCalenDescription::EntryHasDescription
       
   339 // Returns ETrue if the entry has a desciption, EFalse otherwise.
       
   340 // (other items were commented in a header).
       
   341 // ---------------------------------------------------------------------------
       
   342 //
       
   343 TBool CCalenDescription::EntryHasDescription() const
       
   344     {
       
   345     TRACE_ENTRY_POINT;
       
   346 
       
   347     TRACE_EXIT_POINT;
       
   348     return iEditor.Edited().Description().Length() > 0;
       
   349     }
       
   350 
       
   351 // ---------------------------------------------------------------------------
       
   352 // CCalenDescription::IsEditedL
       
   353 // Returns ETrue if the description has been edited, EFalse otherwise.
       
   354 // (other items were commented in a header).
       
   355 // ---------------------------------------------------------------------------
       
   356 //
       
   357 TBool CCalenDescription::IsEditedL() const
       
   358     {
       
   359     TRACE_ENTRY_POINT;
       
   360 
       
   361     TRACE_EXIT_POINT;
       
   362     return iEditor.EditorDataHandler().IsDescriptionEdited();
       
   363     }
       
   364 
       
   365 // ---------------------------------------------------------------------------
       
   366 // CCalenDescription::ShowFieldL
       
   367 // Show the description field.
       
   368 // (other items were commented in a header).
       
   369 // ---------------------------------------------------------------------------
       
   370 //
       
   371 void CCalenDescription::ShowFieldL()
       
   372     {
       
   373     TRACE_ENTRY_POINT;
       
   374 
       
   375     Field()->SetTextL( &( iEditor.Edited().Description() ) );
       
   376 
       
   377     TRACE_EXIT_POINT;
       
   378     }
       
   379 
       
   380 // ---------------------------------------------------------------------------
       
   381 // CCalenDescription::HideFieldL
       
   382 // Hide the description field.
       
   383 // (other items were commented in a header).
       
   384 // ---------------------------------------------------------------------------
       
   385 //
       
   386 void CCalenDescription::HideFieldL()
       
   387     {
       
   388     TRACE_ENTRY_POINT;
       
   389 
       
   390     if( iEditor.ControlOrNull( ECalenEditorDescription ) != NULL)
       
   391         {
       
   392         iEditor.DeleteLine( ECalenEditorDescription );
       
   393         }
       
   394 
       
   395     TRACE_EXIT_POINT;
       
   396     }
       
   397 
       
   398 // ---------------------------------------------------------------------------
       
   399 // CCalenDescription::Field
       
   400 // Returns the description field.
       
   401 // (other items were commented in a header).
       
   402 // ---------------------------------------------------------------------------
       
   403 //
       
   404 CCalenDescriptionField* CCalenDescription::Field()
       
   405     {
       
   406     TRACE_ENTRY_POINT;
       
   407 
       
   408     TRACE_EXIT_POINT;
       
   409     return static_cast< CCalenDescriptionField* >( iEditor.Control( ECalenEditorDescription ) );
       
   410     }
       
   411 
       
   412 // ---------------------------------------------------------------------------
       
   413 // CCalenDescription::IsFieldVisible
       
   414 // Returns ETrue if the description field is visible, EFalse otherwise.
       
   415 // (other items were commented in a header).
       
   416 // ---------------------------------------------------------------------------
       
   417 //
       
   418 TBool CCalenDescription::IsFieldVisible()
       
   419     {
       
   420     TRACE_ENTRY_POINT;
       
   421 
       
   422     TRACE_EXIT_POINT;
       
   423     return iEditor.ControlOrNull( ECalenEditorDescription ) != NULL;
       
   424     }
       
   425 
       
   426 // ---------------------------------------------------------------------------
       
   427 // CCalenDescription::IsFieldFocused
       
   428 // Returns ETrue if the description field is focused, EFalse otherwise.
       
   429 // (other items were commented in a header).
       
   430 // ---------------------------------------------------------------------------
       
   431 //
       
   432 TBool CCalenDescription::IsFieldFocused()
       
   433     {
       
   434     TRACE_ENTRY_POINT;
       
   435 
       
   436     if( IsFieldVisible() )
       
   437         {
       
   438         TRACE_EXIT_POINT;
       
   439         return Field()->IsFocused();
       
   440         }
       
   441     else 
       
   442         {
       
   443         TRACE_EXIT_POINT;
       
   444         return EFalse;
       
   445         }
       
   446     }
       
   447 
       
   448 // ---------------------------------------------------------------------------
       
   449 // CCalenDescription::DoRemoveL
       
   450 // Remove the description field.
       
   451 // (other items were commented in a header).
       
   452 // ---------------------------------------------------------------------------
       
   453 //
       
   454 void CCalenDescription::DoRemoveL()
       
   455     {
       
   456     TRACE_ENTRY_POINT;
       
   457 
       
   458     iEditor.Edited().SetDescriptionL( KNullDesC );
       
   459     const TDesC& emptyString = _L("");
       
   460     iEditor.SetEditorTextL( ECalenEditorDescription, &emptyString );
       
   461     iEditor.UpdateFormL();
       
   462 
       
   463     TRACE_EXIT_POINT;
       
   464     }
       
   465 
       
   466 // ---------------------------------------------------------------------------
       
   467 // CCalenDescription::HandleAddL
       
   468 // Handles a new description being added. Sets the new description to the entry.
       
   469 // (other items were commented in a header).
       
   470 // ---------------------------------------------------------------------------
       
   471 //
       
   472 void CCalenDescription::HandleAddL( TInt aStatus, HBufC* aDescription )
       
   473     {
       
   474     TRACE_ENTRY_POINT;
       
   475 
       
   476     if ( aStatus == KErrNone && aDescription != NULL ) // entry was edited
       
   477         {
       
   478         CleanupStack::PushL( aDescription );
       
   479         iEditor.Edited().SetDescriptionL( *aDescription );
       
   480         CleanupStack::PopAndDestroy( aDescription );
       
   481 
       
   482         ShowFieldL();
       
   483         iEditor.UpdateFormL();
       
   484         iEditor.TryChangeFocusToL( ECalenEditorDescription );
       
   485         }
       
   486     else // error 
       
   487         {
       
   488         delete aDescription;
       
   489         }
       
   490 
       
   491     TRACE_EXIT_POINT;
       
   492     }
       
   493 
       
   494 // ---------------------------------------------------------------------------
       
   495 // CCalenDescription::HandleUpdateL
       
   496 // Handle the description being updated.
       
   497 // (other items were commented in a header).
       
   498 // ---------------------------------------------------------------------------
       
   499 //
       
   500 void CCalenDescription::HandleUpdateL( TInt aStatus, HBufC* aDescription )
       
   501     {
       
   502     TRACE_ENTRY_POINT;
       
   503 
       
   504     CleanupStack::PushL( aDescription );
       
   505     if ( aStatus == CNotepadApi::ENpdDataDeleted || 
       
   506          aStatus == CNotepadApi::ENpdDataErased ) // entry was erased or deleted 
       
   507         {
       
   508         DoRemoveL();
       
   509         if( aStatus == CNotepadApi::ENpdDataErased )
       
   510             {
       
   511             // Info note is only shown when erasing from Notepad
       
   512             HBufC* infoText = StringLoader::LoadLC( R_QTN_CALE_INOTE_DESC_DEL_MEMO );
       
   513             CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
       
   514             note->ExecuteLD( *infoText );
       
   515             CleanupStack::PopAndDestroy( infoText );
       
   516             }
       
   517         }
       
   518     else if ( aStatus == KErrNone && aDescription != NULL ) 
       
   519         {
       
   520         CleanupStack::Pop( aDescription );
       
   521         iEditor.Edited().SetDescriptionTransferOwnershipL( aDescription );
       
   522 
       
   523         Field()->SetTextL( &( iEditor.Edited().Description() ) );
       
   524         iEditor.UpdateFormL();
       
   525         // push NULL to cleanup stack to keep it balanced 
       
   526         aDescription = NULL; 
       
   527         CleanupStack::PushL( aDescription );
       
   528         }
       
   529     else // error
       
   530         {
       
   531         // unless some error happened, we should never get here
       
   532         // do nothing
       
   533         } 
       
   534     CleanupStack::PopAndDestroy( aDescription );
       
   535 
       
   536     TRACE_EXIT_POINT;
       
   537     }
       
   538 
       
   539 // ---------------------------------------------------------------------------
       
   540 // CCalenDescription::ExecTextEditorL
       
   541 // Open the notepad editor to allow editing of the description.
       
   542 // (other items were commented in a header).
       
   543 // ---------------------------------------------------------------------------
       
   544 //
       
   545 HBufC* CCalenDescription::ExecTextEditorL( TInt& aStatus, const TDesC& aDescription )
       
   546     {
       
   547     TRACE_ENTRY_POINT;
       
   548 
       
   549     HBufC* title = StringLoader::LoadLC( R_QTN_CALE_NOTE_TITLE );
       
   550     HBufC* delConf = StringLoader::LoadLC( R_QTN_CALE_Q_DEL_NOTEP_DESC );
       
   551     HBufC* desc = CNotepadApi::ExecTextEditorL( aStatus, aDescription,
       
   552                                                 *title, *delConf );
       
   553     CleanupStack::PopAndDestroy( delConf );
       
   554     CleanupStack::PopAndDestroy( title );
       
   555 
       
   556     TRACE_EXIT_POINT;
       
   557     return desc;
       
   558     }
       
   559 
       
   560 // ---------------------------------------------------------------------------
       
   561 // CCalenDescription::ExecTextViewerL
       
   562 // Open the notepad viewer to allow viewing of the description.
       
   563 // (other items were commented in a header).
       
   564 // ---------------------------------------------------------------------------
       
   565 //
       
   566 HBufC* CCalenDescription::ExecTextViewerL( TInt& aStatus, const TDesC& aDescription )
       
   567     {
       
   568     TRACE_ENTRY_POINT;
       
   569 
       
   570     HBufC* title = StringLoader::LoadLC( R_QTN_CALE_NOTE_TITLE );
       
   571     HBufC* delConf = StringLoader::LoadLC( R_QTN_CALE_Q_DEL_NOTEP_DESC );
       
   572     HBufC* desc = CNotepadApi::ExecTextViewerL( aStatus, aDescription,
       
   573                                                 *title, *delConf );
       
   574     CleanupStack::PopAndDestroy( delConf );
       
   575     CleanupStack::PopAndDestroy( title );
       
   576 
       
   577     TRACE_EXIT_POINT;
       
   578     return desc;
       
   579     }
       
   580 
       
   581 // ----------------------------------------------------------------------------
       
   582 // CCalenDescription::HandleAddDescriptionL
       
   583 // Handles the command ECalenAddDescription
       
   584 // ----------------------------------------------------------------------------
       
   585 // 
       
   586 TBool CCalenDescription::HandleAddDescriptionL()
       
   587     {
       
   588     TRACE_ENTRY_POINT;
       
   589     
       
   590     TBool processed = EFalse;
       
   591     TInt selectedIndex(0);
       
   592     CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog(&selectedIndex);
       
   593     dlg->PrepareLC( R_DESCRIPTION_LIST_QUERY );
       
   594     
       
   595     if(dlg->RunLD())
       
   596         {
       
   597         switch(selectedIndex)
       
   598             {
       
   599             case 0:             //ECalenCmdAddDescriptionNew
       
   600                 {
       
   601                 AddNewL();
       
   602                 processed = ETrue;
       
   603                 break;
       
   604                 }
       
   605             case 1:             //ECalenCmdAddDescriptionExisting
       
   606                 {
       
   607                 AddMemoL();
       
   608                 processed = ETrue;
       
   609                 break;
       
   610                 }
       
   611             default:
       
   612                 break;
       
   613             }
       
   614         }
       
   615 	
       
   616 	TRACE_EXIT_POINT;
       
   617 	
       
   618     return processed;
       
   619     
       
   620     }
       
   621 //  End of File