calendarui/editors/inc/calenunifiededitor.h
branchRCL_3
changeset 30 bd7edf625bdd
child 31 97232defd20e
equal deleted inserted replaced
29:12af337248b1 30:bd7edf625bdd
       
     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:  Unified editor class declaration
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENUNFIEDEDITOR_H
       
    20 #define CALENUNFIEDEDITOR_H
       
    21 
       
    22 // system includes
       
    23 #include <AknForm.h>
       
    24 #include <MAgnEntryUi.h>
       
    25 #include <calcommon.h>
       
    26 #include <calentry.h>
       
    27 #include <fepbase.h>
       
    28 #include <calennotificationhandler.h>
       
    29 
       
    30 // user includes
       
    31 #include "calenentryutil.h"
       
    32 #include "CalenEditorDataHandler.h"
       
    33 #include "calenunifiededitorcontrol.h"
       
    34 
       
    35 // forward declaration
       
    36 class MCalenServices;
       
    37 class CAknNavigationControlContainer;
       
    38 class CCalenEditorDataHandler;
       
    39 class CCalenEntryUpdater;
       
    40 class CCalenEntryUtil;
       
    41 class CCalenGlobalData;
       
    42 class CEnvironmentChangeNotifier;
       
    43 class CPosLandmark;
       
    44 
       
    45 /**
       
    46  * Class declaration for Unified Editor
       
    47  */ 
       
    48 NONSHARABLE_CLASS( CCalenUnifiedEditor ) : public CAknForm,
       
    49                                            public MAgnEntryUi, 
       
    50                                            public MCalenNotificationHandler,
       
    51                                            public MCoeFepObserver
       
    52     {
       
    53     public: // Constructors
       
    54     
       
    55         /**
       
    56          * @brief Two-phased constructor. This overload should be used when 
       
    57          *        it is known which repeat type will be used to edit the entry.
       
    58          *        Use this overload in conjunction with viewer.
       
    59          * @param aEntry: Reference entry
       
    60          */    
       
    61         static CCalenUnifiedEditor* NewL ( CCalEntry& aEntry,
       
    62                                            const TAgnEntryUiInParams& aParams,
       
    63                                            MAgnEntryUiCallback& aCallback,
       
    64                                            TAgnEntryUiOutParams& aOutParams,
       
    65                                            CalCommon::TRecurrenceRange aRepeatType);
       
    66 
       
    67         /**
       
    68          * @brief Two-phased constructor. This overload should be used when
       
    69          *        the user should be prompted to select the repeat type when
       
    70          *        the entry is modified. Use this overload when the viewer is
       
    71          *        not present.
       
    72          * @param aEntry: Reference entry
       
    73          */
       
    74         static CCalenUnifiedEditor* NewL( CCalEntry& aEntry,
       
    75                                           const TAgnEntryUiInParams& aParams,
       
    76                                           MAgnEntryUiCallback& aCallback,
       
    77                                           TAgnEntryUiOutParams& aOutParams );  
       
    78         
       
    79         /**
       
    80          * @brief Destructor
       
    81          */
       
    82         virtual ~CCalenUnifiedEditor();
       
    83 
       
    84     private:
       
    85         
       
    86         /**
       
    87          * @brief Default constructor with repeat type
       
    88          */
       
    89         CCalenUnifiedEditor( CCalEntry& aEntry,
       
    90                              const TAgnEntryUiInParams& aParams,
       
    91                              MAgnEntryUiCallback& aCallback,
       
    92                              TAgnEntryUiOutParams& aOutParams,
       
    93                              CalCommon::TRecurrenceRange aRepeatType );
       
    94 
       
    95         /**
       
    96          * @brief Default constructor
       
    97          */
       
    98         CCalenUnifiedEditor( CCalEntry& aEntry,
       
    99                              const TAgnEntryUiInParams& aParams,
       
   100                              MAgnEntryUiCallback& aCallback,
       
   101                              TAgnEntryUiOutParams& aOutParams );
       
   102         
       
   103     private:
       
   104         
       
   105         /**
       
   106          * @brief Second phase constructor
       
   107          */
       
   108         void ConstructL();
       
   109         
       
   110     private:
       
   111         /**
       
   112          * @brief For handling external database changes keeping
       
   113          *        editor active eg..synchronizing
       
   114          */
       
   115         enum TEntryExistenceStatus
       
   116             {
       
   117             EEntryOk,
       
   118             EEntryModifiedByAnotherProcess,
       
   119             EEntryDeletedByAnotherProcess
       
   120             };
       
   121 
       
   122     public:
       
   123         
       
   124         /**
       
   125          * @brief from MCalenNotificationhandler
       
   126          *        Handles calendar notifications
       
   127          */
       
   128         void HandleNotification( TCalenNotification aNotification );
       
   129         
       
   130         /**
       
   131          * @brief From MCoeFepObserver 
       
   132          * 
       
   133          */
       
   134         void HandleCompletionOfTransactionL();
       
   135         
       
   136     public:      
       
   137         
       
   138         /**
       
   139         * @brief Executes proper UI view based on given parameters.
       
   140         * @param aEntries all having the same GUID, ownership not transferred
       
   141         * @param aInParams input parameters
       
   142         * @param aOutParams contains output when method returns
       
   143         * @param aCallback observer
       
   144         * @return KErrNone or a system wide error code
       
   145         */
       
   146        TInt ExecuteViewL( RPointerArray<CCalEntry>& aEntries,
       
   147                           const TAgnEntryUiInParams& aInParams,
       
   148                           TAgnEntryUiOutParams& aOutParams,                                   
       
   149                           MAgnEntryUiCallback& aCallback );
       
   150 
       
   151         /**
       
   152         * @brief Method for setting help context for the UI.
       
   153         *        Must be called before executing UI.
       
   154         * @param aContext help context
       
   155         */
       
   156         void SetHelpContext(const TCoeHelpContext& aContext);
       
   157         
       
   158         /**
       
   159          * @brief From CEikDialog.
       
   160          *        Handles exiting of the unified editor
       
   161          */
       
   162          TBool OkToExitL( TInt aButtonId );
       
   163           
       
   164         /**
       
   165          * @brief From CCoeControl.
       
   166          *        Handles key events
       
   167          */
       
   168          TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   169          
       
   170         /**
       
   171          * @brief From CEikDialog
       
   172          *        Initializes the dialog's controls before the dialog is sized and 
       
   173          *        layed out. Empty by default.
       
   174          */
       
   175         void PreLayoutDynInitL();
       
   176 
       
   177         /**
       
   178          * @brief From CEikDialog
       
   179          *        Initializes the dialog's controls after the dialog has been sized 
       
   180          *        but before it has been activated. Empty by default.
       
   181          */        
       
   182         void PostLayoutDynInitL();
       
   183         
       
   184         /**
       
   185          * @brief From CEikDialog
       
   186          *        Handles a state change in the control with id aControlId. 
       
   187          *        Empty by default.
       
   188          * @param aControlId holds the control id for which the state is changed
       
   189          */
       
   190         void HandleControlStateChangeL( TInt aControlId );
       
   191         
       
   192         /**
       
   193          * @brief From CEikDialog
       
   194          *        Tries to change focus to the specified line. Fails if the line ID 
       
   195          *        is not valid. Calls @c PrepareForFocusTransitionL() before focus 
       
   196          *        is given to the line.
       
   197          */
       
   198         void PrepareForFocusTransitionL();
       
   199         
       
   200         /**
       
   201          * @brief From CEikDialog
       
   202          *        Handles editor menu commands
       
   203          * @param aCommandId The ID of the commannd to be handled
       
   204          */
       
   205         void ProcessCommandL( TInt aCommandId );
       
   206         
       
   207 //Single click integration
       
   208         /**
       
   209          * From CAknForm.
       
   210          * Takes any action required when the dialog page event happens.
       
   211          * 
       
   212          * @param aEventId Event id. 
       
   213          */
       
   214         void HandleDialogPageEventL( TInt aEventID );
       
   215         
       
   216         /**
       
   217          * @brief From CAknForm
       
   218          * Handles the resource change like layout change/theme change
       
   219          * @param aType Holds the type of the resource change
       
   220          */
       
   221         void HandleResourceChange( TInt aType );
       
   222         
       
   223         /**
       
   224          * @brief From MEikMenuObserver
       
   225          * Delete and add items to menu dynamically
       
   226          * @param aResourceId: Resource ID of menu pane
       
   227          * @param aMenuPane  : Menu Pane object
       
   228          */
       
   229         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   230         
       
   231         /** 
       
   232          * @brief From CEikDialog.
       
   233          *        This is needed to create custom form control
       
   234          * @param aControlType       
       
   235          */
       
   236         SEikControlInfo CreateCustomControlL( TInt aControlType );
       
   237 
       
   238         /**
       
   239          * @brief To get custom control layout correctly in Avkon form
       
   240          * @param aControlType 
       
   241          */
       
   242         MEikDialogPageObserver::TFormControlTypes ConvertCustomControlTypeToBaseControlType( 
       
   243              TInt aControlType ) const;
       
   244         
       
   245         /**
       
   246          * @brief To check for repeattype
       
   247          * @return aRepeatType
       
   248          */
       
   249         CCalenEditorDataHandler::TError AskRepeatingNoteQueriesL(
       
   250             CalCommon::TRecurrenceRange& aRepeatType );
       
   251         
       
   252         /**
       
   253          * @brief Check Start date change query should shown.
       
   254          * @return ETrue if query need to be displayed else EFalse
       
   255          */
       
   256         TBool ShouldQueryForStartDateChange();
       
   257         
       
   258         /**
       
   259          * @brief Display Start date change query
       
   260          * @return CCalenEditorDataHandler::TError
       
   261          */
       
   262         CCalenEditorDataHandler::TError QueryStartDateChangeL();
       
   263         
       
   264         /*
       
   265          * Sets the control as ready to be drawn.
       
   266          * @return void
       
   267          */
       
   268         void  ActivateL();
       
   269         
       
   270         void HandleCalendarDeleteL();
       
   271     private:
       
   272        
       
   273         /**
       
   274          * @brief Handles "Cancel" menu command for discarding the user changes.
       
   275          */
       
   276         void OnCmdCancelL();
       
   277 
       
   278         /**
       
   279          * @brief Handles "Delete" command for deleting the notr
       
   280          */
       
   281         void OnCmdDeleteNoteL();
       
   282         
       
   283         /**
       
   284          * @brief Handles "Help" command.
       
   285          */
       
   286         void OnCmdHelpL();
       
   287 
       
   288         /**
       
   289          * @brief Handles "Exit" command.
       
   290          * @param aCmd Holds the command issued.
       
   291          */
       
   292         void OnCmdExitL(TInt aCmd);
       
   293         
       
   294         /**
       
   295          * @brief Delete note from Calendar.
       
   296          * @param aIsViaDeleteMenu : ETrue if via "Delete" menu.
       
   297          * @return ETrue if note is deleted.
       
   298          */
       
   299         void TryToDeleteNoteL( TBool aIsViaDeleteMenu );
       
   300         
       
   301         /**
       
   302          * @brief Close form without further actions. Needed when note is deleted.
       
   303          */
       
   304         void CloseFormWithoutActionsL();
       
   305         
       
   306         /**
       
   307          * @brief Handles saving of the entry when RSK "Done" is pressed
       
   308          * @return TBool returns whenther the entry is saved 
       
   309          */
       
   310         TBool HandleDoneL();
       
   311         
       
   312         /**
       
   313          * @brief Check for entry existence
       
   314          * @retur TEntryExistenceStatus returns the entry is modified by 
       
   315          *        external database change
       
   316          */
       
   317         TEntryExistenceStatus EntryStillExistsL();
       
   318         
       
   319         /** 
       
   320          * @brief Key callback function for deferred key event (for FEP).
       
   321          * @param a pointer of CCalenUnifiedEditor.
       
   322          * @return always EFalse.
       
   323          */
       
   324         static TInt KeyCallBack( TAny *aSelf );
       
   325         
       
   326         /**
       
   327          * @brief This function is called when a locale(or today) is changed.
       
   328          * @param aThisPtr Specified to be TCallBack()
       
   329          * @return EFalse
       
   330          */
       
   331         static TInt LocaleCallback( TAny* aThisPtr );
       
   332         
       
   333         /**
       
   334          * @brief Handles locale change notifications
       
   335          * @param aChange Holds the environment change information
       
   336          * @return TInt returns 0
       
   337          */
       
   338         TInt HandleLocaleChange( TInt aChange );
       
   339         
       
   340         /**
       
   341          * @brief Handles locale change notifications
       
   342          * @param aChange Holds the environment change information
       
   343          */
       
   344         void DoHandleLocaleChangeL( TInt aChange );
       
   345         
       
   346     public:
       
   347         
       
   348         /**
       
   349          * @brief Gets the iServices reference.
       
   350          */
       
   351         MCalenServices& GetServices();
       
   352         
       
   353         /**
       
   354          * @brief Inserts dialog line (form field) defined by aResourceId 
       
   355          *        and aControlId after existing dialog line aPrevControlId.
       
   356          * @resourceId dialog line resource
       
   357          * @aControlId ControlId of the dialog line to be inserted
       
   358          * @aPrevControlId Previous control id
       
   359          */ 
       
   360         void InsertFieldL( TInt aResourceId, TInt aControlId,
       
   361                             TInt aPrevControlId );
       
   362 
       
   363         /** 
       
   364          * @brief Check for field exists in unified editor
       
   365          * @aField focused controlid
       
   366          * @TBool returns ETrue if control exists otherwise EFalse
       
   367          */
       
   368         TBool HasField( TInt aField );
       
   369 
       
   370         /**
       
   371          * @brief Update form. You can force update of form with this,
       
   372          *        if you modify some of the field values dynamically.
       
   373          */
       
   374          void UpdateFormL();
       
   375 
       
   376         /**
       
   377          * @brief Copy of a given entry
       
   378          * @param aOther holds the source entry
       
   379          * @return CCalEntry returns target entry
       
   380          */
       
   381          static CCalEntry* CreateCopyL( CCalEntry& aOther );
       
   382         
       
   383         /**
       
   384          * @brief Access to the unified editor's fields
       
   385          * @return CCalenUnifiedEditorControl returns unified editor's fields
       
   386          */
       
   387         CCalenUnifiedEditorControl& EditorFields();
       
   388         
       
   389         /**
       
   390          * @brief Returns layout variant dependent maximum value for text editors.
       
   391          * @return TInt returns maximum editor length
       
   392          */
       
   393         TInt MaxTextEditorLength() const;
       
   394         
       
   395         /**
       
   396          * @brief Check if note editor is launched to create new entry
       
   397          * @return TBool returns ETrue if creating a new entry
       
   398          */
       
   399         TBool IsCreatingNewEntry() const;
       
   400         
       
   401         /**
       
   402          * @brief Gets unified editor's entry type
       
   403          * @return CCalEntry entry type of the unified editor
       
   404          */
       
   405         CCalEntry::TType GetEntryType();
       
   406         
       
   407         /**
       
   408          * @brief Sets the unified editor's entry type
       
   409          * @param aEntryType Holds the new entry type
       
   410          */
       
   411         void SetEntryType( CCalEntry::TType aEntryType );
       
   412 
       
   413         
       
   414         /**
       
   415          * @brief Access to the editor data handler
       
   416          * @returns CCalenEditorDataHandler editor data handler
       
   417          */
       
   418         CCalenEditorDataHandler& EditorDataHandler();
       
   419         
       
   420         /**
       
   421          * @brief Access to the edited editor data
       
   422          * @returns edited editor data
       
   423          */
       
   424         CCalenEntryUtil& Edited();
       
   425 
       
   426         /**
       
   427          * @brief Access to the original editor data
       
   428          * @returns CCalenEntryUtil returnd original editor data 
       
   429          */ 
       
   430         const CCalenEntryUtil& Original() const;
       
   431 
       
   432         /**
       
   433          * @brief Sets editor text
       
   434          * @param aCOntrolId Id of the editor text
       
   435          * @param aDes Text to be set to editor
       
   436          */
       
   437         void SetEditorTextL( TInt aControlId, const TDesC* aDes );
       
   438         
       
   439         /**
       
   440          * @brief Reads subject field from unified editor
       
   441          */
       
   442         void ReadSubjectFromEditorL();
       
   443         
       
   444         /**
       
   445          * @brief Reads "Place" item from unified editor
       
   446          */
       
   447         void ReadPlaceFromEditorL();
       
   448 
       
   449         /**
       
   450          * @brief For setting alarm field on or off
       
   451          * @param aOnOff For toggling on or off
       
   452          */
       
   453         void SetAlarmFieldOnOffL( TBool aOnOff );
       
   454         
       
   455         /**
       
   456          * @brief For setting AllDay filed Yes or No
       
   457          */
       
   458         void SetAllDayFieldL( TBool aYesNo );
       
   459         
       
   460         /**
       
   461          * @brief For getting Id of the focused control
       
   462          * @return TInt controlId of the focused control
       
   463          */
       
   464         TInt IdOfFocusedControl();
       
   465         
       
   466         /**
       
   467          * @brief Set attachment names to the editor if attachments
       
   468          *        exists for the entry being edited
       
   469          */
       
   470         void SetAttachmentNamesToEditorL();
       
   471         
       
   472         /**
       
   473          * Update CBA with corresponding MSK button.
       
   474          * This function is e.g. called from HandleControlEvent()
       
   475          * Will issue HandleControlStateChangeL() call.
       
   476          */
       
   477         void SetMskFromResourceL();
       
   478         
       
   479          /**
       
   480          * @brief Merges all the attachment names into a single string
       
   481          */
       
   482         void GetAttachmentNamesString( RPointerArray<HBufC>& aAttachmentNames,
       
   483                                         HBufC& aAttachmentNamesString );
       
   484 										
       
   485         /*
       
   486          * Verify if the collectionid exsists in the array of collecteids
       
   487          * leave is generated if collectionid is not found.
       
   488          * @param TCalCollectionId aColId to verified from the array of collecteids
       
   489          * @return void
       
   490          */
       
   491         void VerifyCollectionIdL(const TCalCollectionId aColId);
       
   492         
       
   493         /*
       
   494          * Return attachment names
       
   495          * @param aAttachmentNames names of the attachments.
       
   496          * @return HBufC 
       
   497          */
       
   498         void GetAttachmentNamesL(RPointerArray<HBufC>& aAttachmentNames);
       
   499         
       
   500         TBool iCheck;
       
   501     protected:
       
   502         /**
       
   503          * From CEikDialog
       
   504          * We will hit this event each time a line has changed in the form
       
   505          */
       
   506         void LineChangedL( TInt aControlId );
       
   507         
       
   508     private:        
       
   509         /**
       
   510          * @breif Checks if the Flash File System storage will fall below
       
   511          *        Critical Level. Warning will be displayed if storage
       
   512          *        is below Critical Level.
       
   513          * @return ETrue : Below critical level
       
   514          */
       
   515         TBool CheckSpaceBelowCriticalLevelL();
       
   516         
       
   517         /**
       
   518          * @brief Try to save note. Used in normal exit.
       
   519          * @return ETrue if note was saved
       
   520          */
       
   521         TBool TryToSaveNoteL();
       
   522         
       
   523         /**
       
   524          * @brief Common routine for saving note when forced exit like
       
   525          *        pressing end key/exit from FSW/power off key
       
   526          */
       
   527         void TryToSaveNoteOnForcedExitL();
       
   528         
       
   529         /**
       
   530          * @brief checks wether user has edited the db field.
       
   531          * updates the dbid into cenrep for the later use,
       
   532          * next time editor will show this db in the editor (bu default)
       
   533          */
       
   534         void ModifyDbFieldL();
       
   535         
       
   536         /**
       
   537          * @brief Try to save the enty with new entry type
       
   538          * @return Error value if entry is not saved
       
   539          */
       
   540         TInt TryToSaveEntryWithEntryChangeL( TBool aForcedExit);
       
   541         
       
   542         /**
       
   543          * @brief Calculate the start date/time of the entry being edited.
       
   544          *        Store the result in the passed arguments.
       
   545          * @param aNewInstanceStartDate Instance start time
       
   546          * @param aNewInstanceEndDate Instance end time
       
   547          */
       
   548         void CalculateNewInstanceStartAndEndDateL( TCalTime& aNewInstanceStartDate,
       
   549                                                    TCalTime& aNewInstanceEndDate );
       
   550         
       
   551         /**
       
   552          * @breif Fetch the current entry's parent from agenda. This should be used
       
   553          *        sparingly as it is expensive. It may be worth seeing if there
       
   554          *        is any performance improvement by fetching the parent from
       
   555          *        CCalenDefaultViewers and passing it through to the constructor of
       
   556          *        the editors and viewers, instead of fetching it internally to each
       
   557          *        viewer/editor.
       
   558          * @return referance to parent entry CCalEntry       
       
   559          */
       
   560         CCalEntry& ParentEntryL();
       
   561         
       
   562         /**
       
   563          * @brief Display S60 Calendar Note Editor specific error message
       
   564          *        for given aError.
       
   565          * @param aError : Flag of error.
       
   566          */
       
   567         void DisplayErrorMsgL(const TInt& aError);
       
   568         
       
   569         /**
       
   570          * @brief Launch the note dialog
       
   571          * @param resourceId Resource Id of the error type
       
   572          */
       
   573         void DisplayErrorMsgInNoteDlgL( TInt resourceId );
       
   574         
       
   575         /**
       
   576          * @brief Launch the repeat type dependent error message dialog
       
   577          */
       
   578         void DispalyErrorMsgByRepeatTypeL();
       
   579          
       
   580          /**
       
   581           * @brief Updates the user selected landmark details into 
       
   582           *        current meeting editor form 
       
   583           */
       
   584          void UpdateLocationInfoToFormL();
       
   585          
       
   586          /**
       
   587           * @brief Handles the case when user choose locaiton on
       
   588           *        top of already saved address
       
   589           * @param CPosLandMark Holds landmark
       
   590           */
       
   591          void HandleEntryWithGeoValueEditionL( CPosLandmark* landmark );
       
   592 		 
       
   593 	 	 /**
       
   594 		 * Handles the case when user choose location on top of invalidated address
       
   595 		 */ 
       
   596 	     void HandleEntryWithLocationEditionL(CPosLandmark* landmark);
       
   597           
       
   598          /**
       
   599           * @breif Stores landmark details and displays selected location details 
       
   600           *        on the currently shown editor form
       
   601           * @param CPosLandMark Holds landmark
       
   602           */
       
   603          void StoreLocationDetailsToEntryL( CPosLandmark* landmark );
       
   604           
       
   605          /**
       
   606           * @brief Function to query user whether to replace or keep 
       
   607           *        existing location details
       
   608           * @Param aLocationName Holds the new location name selected
       
   609           */
       
   610          TInt ShowLocationReplaceNoticeL( TPtrC aLocaitonName );
       
   611          
       
   612          /**
       
   613           * @brief Queries user whether to keep the exisiting coordianates or not
       
   614           */
       
   615          TInt ShowLocationChangeNoticeL();
       
   616          
       
   617          /**
       
   618 	     * Displays "Address Updated" transient notice to the user
       
   619 	     */
       
   620 	    void ShowAddressUpdatedNoticeL();
       
   621 		     
       
   622 	     /**
       
   623 	     * Checks if user has edited location field manually
       
   624 	     */
       
   625 	    void CheckManualEditionOfLocationL();
       
   626          
       
   627          /**
       
   628 		 * Adds Map icon onto the editor form
       
   629 		 */
       
   630 		void AddPictureL(TInt isNotFirstTime  = 1); 
       
   631          
       
   632          /**
       
   633           * @brief Update attachment info to editor whenever an file is selected 
       
   634           *        using fetch apis
       
   635           */
       
   636          void UpdateAttachmentInfoToEditorL();
       
   637          
       
   638          /**
       
   639           * @brief Sets the undeline for the attachment field's text
       
   640           * @param aUnderLine holds to make the underline visible or not
       
   641           *        EUnderLineOn for enabling the underline
       
   642           *        EUnderLineOff for disabling the underline    
       
   643           */
       
   644          void SetUnderLineForAttachmentL(TFontUnderline aUnderLine);
       
   645          
       
   646          /**
       
   647           * @brief Check for attachments in editor,if present save the attachment
       
   648           *        count which is used while saving the attachments to the calentry
       
   649           */
       
   650          void CheckForAttachmentsInEditorL();
       
   651          
       
   652          /**
       
   653           * @brief Check for whether attachments exists in edited entry
       
   654           * @returns ETrue if entry has attachments otherwise EFalse
       
   655           */
       
   656          TBool EntryHasAttachments();
       
   657          
       
   658          void GetAllCollectionidsL(RArray<TInt>& aCollectionIds);
       
   659 		  
       
   660          /**
       
   661           * @brief Hides Entry type, Calendar Field & RepetType Fields for 
       
   662           *        exceptional entry/single instance of recurrent entry
       
   663           *  
       
   664           */
       
   665          void HideFieldsForEditSingleInstanceL();
       
   666          
       
   667          static TInt AsyncProcessCommandL(TAny* aThisPtr); 
       
   668          
       
   669         
       
   670     private:
       
   671         /**
       
   672          * @var iEditedCalEntry
       
   673          * @brief Stores entry to be edited temporarily for construction sequence.
       
   674          *        This is passed to CCalenEntryUtilHandler and also copied to 
       
   675          *        iOriginalCalEntry  
       
   676          */
       
   677         CCalEntry& iEditedCalEntry;
       
   678         
       
   679         /**
       
   680          * @var iEntryUiInParams
       
   681          * @brief Input parameters for Editor Plugin
       
   682          */
       
   683         const TAgnEntryUiInParams& iEntryUiInParams;
       
   684         
       
   685         /**
       
   686          * @var iEntryUiCallback
       
   687          * @brief Editor Plugin callback (not used in default editors)
       
   688          */
       
   689         MAgnEntryUiCallback& iEntryUiCallback;
       
   690 
       
   691         /**
       
   692          * @var iEntryUiOutParams
       
   693          * @brief Output parameters for Editor Plugin
       
   694          */
       
   695         TAgnEntryUiOutParams& iEntryUiOutParams;
       
   696         
       
   697         /**
       
   698          * @var iRepeatType
       
   699          * @brief holds the repeat type
       
   700          */
       
   701         CalCommon::TRecurrenceRange iRepeatType;
       
   702 
       
   703         /**
       
   704          * @var iGlobalData
       
   705          * @brief Global data holds references to shared resources like CalEntryView,
       
   706          *        CalSession. Own. Release don't delete, because it's thread-wide
       
   707          *        singleton. 
       
   708          */
       
   709         CCalenGlobalData* iGlobalData;
       
   710         
       
   711         /**
       
   712          * @var iOriginalCalEntry
       
   713          * @brief Original entry. Copied from passed entry
       
   714          */
       
   715         CCalEntry* iOriginalCalEntry;
       
   716 
       
   717         /**
       
   718          * @var iFetchedEntries
       
   719          * @brief The array of entries returned from FetchL(), based on the  
       
   720          *        entry being edited. This allows retrieving of the parent entry      
       
   721          *        using ParentEntryL(), which should be used instead of direct  
       
   722          *        access to this array.
       
   723          */
       
   724         
       
   725         RPointerArray<CCalEntry> iFetchedEntries;
       
   726         
       
   727         /**
       
   728          * @var iEditorDataHandler
       
   729          * @brief Editor data handler. Handles mapping data between form fields
       
   730          *        and Symbian Calendar Interim API's CCalEntry.
       
   731          */
       
   732         CCalenEditorDataHandler* iEditorDataHandler;
       
   733         
       
   734         /**
       
   735          * @var iEntryUpdater
       
   736          * @brief CCalenEntryUpdater takes care of saving and updating entry 
       
   737          *        properly.
       
   738          */
       
   739         CCalenEntryUpdater* iEntryUpdater;
       
   740         
       
   741         /**
       
   742          * @var iNaviContainer
       
   743          * @brief access to navipane container
       
   744          */
       
   745         CAknNavigationControlContainer* iNaviContainer;
       
   746         
       
   747         /**
       
   748          * @var iServices
       
   749          * @brief access to McalenServices
       
   750          */
       
   751         MCalenServices* iServices;
       
   752         
       
   753         /**
       
   754          * @var iUnifiedEditorControl
       
   755          * @brief pointer to CCalenUnifiedEditorControl
       
   756          */
       
   757         CCalenUnifiedEditorControl* iUnifiedEditorControl;
       
   758         
       
   759         /**
       
   760          * @var iEntryType
       
   761          * @brief contains entry type
       
   762          */
       
   763         CCalEntry::TType iEntryType;
       
   764         
       
   765        
       
   766         /**
       
   767          * @var iHasChosenRepeatType
       
   768          */
       
   769         TBool iHasChosenRepeatType;
       
   770 
       
   771 		/**
       
   772          * @var iIgnoreFirstLocaleChange
       
   773          * @brief Ignore the first locale change so we don't rebuild for no reason
       
   774          */
       
   775         TBool iIgnoreFirstLocaleChange;
       
   776         
       
   777         /**
       
   778          * @var iCurrentDurationDay
       
   779          */
       
   780         TTimeIntervalDays iCurrentDurationDay;
       
   781         
       
   782         /**
       
   783          * @var iTimeStamp
       
   784          * @brief Used to check if the database has been modified while the editor
       
   785          *        is open
       
   786          */
       
   787         TTime iTimeStamp;
       
   788         
       
   789         /**
       
   790          * @var iTwoSeconds
       
   791          * @brief Represents two seconds(for checking last modified time of agenda)
       
   792          */
       
   793         const TTimeIntervalSeconds iTwoSeconds;
       
   794         
       
   795         /**
       
   796          * @var iLastDbChangeNotification
       
   797          */
       
   798         TTime iLastDbChangeNotification;
       
   799         
       
   800         /**
       
   801          * @var iIdle
       
   802          */
       
   803         CIdle* iIdle;
       
   804         
       
   805         /**
       
   806          * @var iLocaleChangeNotifier We could move this to Global data and share
       
   807          * @brief Locale update notifier class
       
   808          *        with the appui
       
   809          */
       
   810         CEnvironmentChangeNotifier* iLocaleChangeNotifier;
       
   811 
       
   812         
       
   813         /**
       
   814          * @iCollectionIds collection ids to identify calendar sessions.
       
   815          */
       
   816         RArray<TInt> iCollectionIds;
       
   817         
       
   818         /**
       
   819          * @var isReplaceLocation
       
   820          * @brief Flag to indicate whenter to replace the location or to append it
       
   821          */
       
   822         TBool isReplaceLocation;        
       
   823         
       
   824         CAsyncCallBack* iAsyncCallback; 
       
   825         
       
   826     };
       
   827 
       
   828 /**
       
   829 * Class defining Map icon picture, derived from CPicture
       
   830 */
       
   831 class CMapsIconPicture : public CPicture
       
   832     {
       
   833     public:
       
   834         /**
       
   835          * @brief C++ default Constructor
       
   836          * @param aService calendar services
       
   837          * @param aRect Holds rectangle
       
   838          */          
       
   839         CMapsIconPicture( MCalenServices& aServices, TRect aRect);
       
   840         
       
   841         /**
       
   842          * @brief Draw funtion to draw the map icon
       
   843          * @param aGc graphical context
       
   844          * @param aTopLeft Tpp left point
       
   845          * @param aClipRect clip rectangle
       
   846          * @param map graphics device map
       
   847          */
       
   848         void Draw( CGraphicsContext& aGc,
       
   849                    const TPoint& aTopLeft,
       
   850                    const TRect& aClipRect,
       
   851                    MGraphicsDeviceMap* aMap )const;
       
   852         
       
   853         /**
       
   854          * @brief Pure virtual from CPicture, intentionally empty.
       
   855          * @return aStream stream for writing
       
   856          */
       
   857         void ExternalizeL(RWriteStream& aStream)const;
       
   858         
       
   859         /**
       
   860          * @brief Convert size to twips
       
   861          * @param aSize holds original size
       
   862          */
       
   863         void GetOriginalSizeInTwips(TSize& aSize)const;
       
   864     
       
   865     protected:
       
   866         /**
       
   867          * @var iServices
       
   868          * @brief access to McalenServices
       
   869          */
       
   870         MCalenServices& iServices;
       
   871         
       
   872         /**
       
   873          * @var iRect
       
   874          */
       
   875         TRect iRect;
       
   876     };
       
   877 
       
   878 #endif // CALENUNFIEDEDITOR_H
       
   879 
       
   880 // End of File