calendarui/views/src/caleneventviewcontainer.cpp
branchRCL_3
changeset 86 ed599363c2d7
parent 74 97232defd20e
equal deleted inserted replaced
78:356f28cd5ca0 86:ed599363c2d7
    68 #include <calenservices.h>
    68 #include <calenservices.h>
    69 #include <calentoolbar.h>
    69 #include <calentoolbar.h>
    70 #include <calcalendarinfo.h>
    70 #include <calcalendarinfo.h>
    71 #include <DocumentHandler.h>
    71 #include <DocumentHandler.h>
    72 
    72 
    73 #include <bldvariant.hrh> // for feature definitions
       
    74 
       
    75 // user includes
    73 // user includes
    76 #include "caleneventviewcontainer.h"
    74 #include "caleneventviewcontainer.h"
    77 #include "caleneventview.h"
    75 #include "caleneventview.h"
    78 #include "calennativeview.h"
    76 #include "calennativeview.h"
    79 #include "calendarui_debug.h"
    77 #include "calendarui_debug.h"
   160     delete iCenRepSession;	
   158     delete iCenRepSession;	
   161     
   159     
   162     //Reset the attachment posiitons array
   160     //Reset the attachment posiitons array
   163     iAttachmentPosInfoArray.Reset();
   161     iAttachmentPosInfoArray.Reset();
   164     
   162     
   165     // Do not call UnInitializeLib() if InitalizeLib() leaves.
       
   166     if ( iFeatMgrInitialized )
       
   167         {
       
   168         // Frees the TLS. Must be done after FeatureManager is used.
       
   169         FeatureManager::UnInitializeLib();  
       
   170         }  
       
   171     
       
   172 	TRACE_EXIT_POINT;
   163 	TRACE_EXIT_POINT;
   173 	}
   164 	}
   174 
   165 
   175 // ----------------------------------------------------------------------------
   166 // ----------------------------------------------------------------------------
   176 // CCalenEventViewContainer::ConstructImplL
   167 // CCalenEventViewContainer::ConstructImplL
   206     iTextEditor->SetRect( Rect() );
   197     iTextEditor->SetRect( Rect() );
   207 	
   198 	
   208         
   199         
   209     iDocHandler->SetExitObserver( this );
   200     iDocHandler->SetExitObserver( this );
   210     iTextEditor->EnableKineticScrollingL(ETrue);
   201     iTextEditor->EnableKineticScrollingL(ETrue);
   211 
       
   212     // Sets up TLS, must be done before FeatureManager is used.
       
   213     FeatureManager::InitializeLibL();
       
   214     // Used in destructor. 
       
   215     iFeatMgrInitialized = ETrue;
       
   216      
       
   217 	TRACE_EXIT_POINT;
   202 	TRACE_EXIT_POINT;
   218 	}
   203 	}
   219 
   204 
   220 // ----------------------------------------------------------------------------
   205 // ----------------------------------------------------------------------------
   221 // CCalenEventViewContainer::UpdateSize
   206 // CCalenEventViewContainer::UpdateSize
   538                         
   523                         
   539                             TTmPosInfo2 *posInfo = new(ELeave) TTmPosInfo2;
   524                             TTmPosInfo2 *posInfo = new(ELeave) TTmPosInfo2;
   540                             textView->FindXyPosL(aPointerEvent.iPosition,*posInfo);
   525                             textView->FindXyPosL(aPointerEvent.iPosition,*posInfo);
   541                         
   526                         
   542                             // Check if it is tapped on any attachment name, if yes then open that attachment
   527                             // Check if it is tapped on any attachment name, if yes then open that attachment
   543                             CheckAndOpenTappedAttachmentL(posInfo);
   528                             CheckAndOpenTappedAttachment(posInfo);
   544                             delete posInfo;
   529                             delete posInfo;
   545                             }
   530                             }
   546                         }
   531                         }
   547     			    }
   532     			    }
   548     				break;
   533     				break;
   825             break;
   810             break;
   826 
   811 
   827         case CCalEntry::EAnniv:
   812         case CCalEntry::EAnniv:
   828             {
   813             {
   829             // date field
   814             // date field
   830             if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
   815             AddDateFieldL(iEventViewData->StartDateTime());
   831                 {
       
   832                 AddDateFieldL( iServices.Infobar() );
       
   833                 }
       
   834             else
       
   835                 {
       
   836                 AddDateFieldL( iEventViewData->StartDateTime() );
       
   837                 }
       
   838             
   816             
   839             // against the location field in the viewer
   817             // against the location field in the viewer
   840             iTimeFieldLines = 1;
   818             iTimeFieldLines = 1;
   841             // location
   819             // location
   842             AddLocationFieldL();
   820             AddLocationFieldL();
  1552     CleanupStack::PopAndDestroy(textHeading);
  1530     CleanupStack::PopAndDestroy(textHeading);
  1553     AddDateFieldL(aDate);
  1531     AddDateFieldL(aDate);
  1554 
  1532 
  1555     TRACE_EXIT_POINT;
  1533     TRACE_EXIT_POINT;
  1556     }
  1534     }
  1557 
       
  1558 // -----------------------------------------------------------------------------
       
  1559 // CCalenEventViewContainer::AddDateFieldL
       
  1560 // Add a date field to the form.
       
  1561 // (other items were commented in a header).
       
  1562 // -----------------------------------------------------------------------------
       
  1563 //
       
  1564 void CCalenEventViewContainer::AddDateFieldL( const TDesC& aDate )
       
  1565     {
       
  1566     TRACE_ENTRY_POINT;
       
  1567 	if (FeatureManager::FeatureSupported( KFeatureIdKorean )) 
       
  1568 		{
       
  1569 		TBuf<KMaxDateLength> formattedDate;
       
  1570     	if ( aDate.Length() < KMaxDateLength && aDate.Length() > 0 )
       
  1571     		{
       
  1572     		formattedDate.Copy( aDate );
       
  1573     		}
       
  1574     	AknTextUtils::DisplayTextLanguageSpecificNumberConversion( formattedDate );
       
  1575     	SetFormatAndAddBodyL( formattedDate );
       
  1576 		}
       
  1577     TRACE_EXIT_POINT;
       
  1578     }
       
  1579 
       
  1580 // -----------------------------------------------------------------------------
  1535 // -----------------------------------------------------------------------------
  1581 // CCalenEventViewContainer::AddDateFieldL
  1536 // CCalenEventViewContainer::AddDateFieldL
  1582 // Add a field to the form in the format "DATE - DATE".
  1537 // Add a field to the form in the format "DATE - DATE".
  1583 // (other items were commented in a header).
  1538 // (other items were commented in a header).
  1584 // -----------------------------------------------------------------------------
  1539 // -----------------------------------------------------------------------------
  2654 // CCalenEventViewContainer::CheckAndOpenTappedAttachment
  2609 // CCalenEventViewContainer::CheckAndOpenTappedAttachment
  2655 // Checks if it is tapped on any attachment, if yes, then opens that attachment
  2610 // Checks if it is tapped on any attachment, if yes, then opens that attachment
  2656 // (other items were commented in a header).
  2611 // (other items were commented in a header).
  2657 // ----------------------------------------------------------------------------
  2612 // ----------------------------------------------------------------------------
  2658 //
  2613 //
  2659 void CCalenEventViewContainer::CheckAndOpenTappedAttachmentL(TTmPosInfo2* posInfo)
  2614 void CCalenEventViewContainer::CheckAndOpenTappedAttachment(TTmPosInfo2* posInfo)
  2660     {
  2615     {
  2661     // iterate through iAttachmentPosInfoArray to see if posInfo falls in any of the range
  2616     // iterate through iAttachmentPosInfoArray to see if posInfo falls in any of the range
  2662     TInt attachmentToBeOpened = -1;
  2617     TInt attachmentToBeOpened = -1;
  2663     for(TInt i = 0; i < iAttachmentPosInfoArray.Count(); i++)
  2618     for(TInt i = 0; i < iAttachmentPosInfoArray.Count(); i++)
  2664         {
  2619         {