calendarui/editors/inc/calenunifiededitor.h
changeset 0 f979ecb2b13e
child 12 38571fd2a704
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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     private:
       
   271         /**
       
   272          * @brief Insert Send menu item if needed.
       
   273          * @param : Menu pane where send menu is inserted
       
   274          */
       
   275         void TryInsertSendMenuL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   276         
       
   277         /**
       
   278          * @brief Handles "Cancel" menu command for discarding the user changes.
       
   279          */
       
   280         void OnCmdCancelL();
       
   281 
       
   282         /**
       
   283          * @brief Handles "Delete" command for deleting the notr
       
   284          */
       
   285         void OnCmdDeleteNoteL();
       
   286         
       
   287         /**
       
   288          * @brief Handles send command
       
   289          * @param aCommandId Holds ECalenSend command
       
   290          */
       
   291         void OnCmdSendL( TInt aCommandId );
       
   292 
       
   293         /**
       
   294          * @brief Handles "Help" command.
       
   295          */
       
   296         void OnCmdHelpL();
       
   297 
       
   298         /**
       
   299          * @brief Handles "Exit" command.
       
   300          */
       
   301         void OnCmdExitL();
       
   302         
       
   303         /**
       
   304          * @brief Delete note from Calendar.
       
   305          * @param aIsViaDeleteMenu : ETrue if via "Delete" menu.
       
   306          * @return ETrue if note is deleted.
       
   307          */
       
   308         void TryToDeleteNoteL( TBool aIsViaDeleteMenu );
       
   309         
       
   310         /**
       
   311          * @brief Close form without further actions. Needed when note is deleted.
       
   312          */
       
   313         void CloseFormWithoutActionsL();
       
   314         
       
   315         /**
       
   316          * @brief Handles saving of the entry when RSK "Done" is pressed
       
   317          * @return TBool returns whenther the entry is saved 
       
   318          */
       
   319         TBool HandleDoneL();
       
   320         
       
   321         /**
       
   322          * @brief Check for entry existence
       
   323          * @retur TEntryExistenceStatus returns the entry is modified by 
       
   324          *        external database change
       
   325          */
       
   326         TEntryExistenceStatus EntryStillExistsL();
       
   327         
       
   328         /** 
       
   329          * @brief Key callback function for deferred key event (for FEP).
       
   330          * @param a pointer of CCalenUnifiedEditor.
       
   331          * @return always EFalse.
       
   332          */
       
   333         static TInt KeyCallBack( TAny *aSelf );
       
   334         
       
   335         /**
       
   336          * @brief This function is called when a locale(or today) is changed.
       
   337          * @param aThisPtr Specified to be TCallBack()
       
   338          * @return EFalse
       
   339          */
       
   340         static TInt LocaleCallback( TAny* aThisPtr );
       
   341         
       
   342         /**
       
   343          * @brief Handles locale change notifications
       
   344          * @param aChange Holds the environment change information
       
   345          * @return TInt returns 0
       
   346          */
       
   347         TInt HandleLocaleChange( TInt aChange );
       
   348         
       
   349         /**
       
   350          * @brief Handles locale change notifications
       
   351          * @param aChange Holds the environment change information
       
   352          */
       
   353         void DoHandleLocaleChangeL( TInt aChange );
       
   354         
       
   355     public:
       
   356         
       
   357         /**
       
   358          * @brief Inserts dialog line (form field) defined by aResourceId 
       
   359          *        and aControlId after existing dialog line aPrevControlId.
       
   360          * @resourceId dialog line resource
       
   361          * @aControlId ControlId of the dialog line to be inserted
       
   362          * @aPrevControlId Previous control id
       
   363          */ 
       
   364         void InsertFieldL( TInt aResourceId, TInt aControlId,
       
   365                             TInt aPrevControlId );
       
   366 
       
   367         /** 
       
   368          * @brief Check for field exists in unified editor
       
   369          * @aField focused controlid
       
   370          * @TBool returns ETrue if control exists otherwise EFalse
       
   371          */
       
   372         TBool HasField( TInt aField );
       
   373 
       
   374         /**
       
   375          * @brief Update form. You can force update of form with this,
       
   376          *        if you modify some of the field values dynamically.
       
   377          */
       
   378          void UpdateFormL();
       
   379 
       
   380         /**
       
   381          * @brief Copy of a given entry
       
   382          * @param aOther holds the source entry
       
   383          * @return CCalEntry returns target entry
       
   384          */
       
   385          static CCalEntry* CreateCopyL( CCalEntry& aOther );
       
   386         
       
   387         /**
       
   388          * @brief Access to the unified editor's fields
       
   389          * @return CCalenUnifiedEditorControl returns unified editor's fields
       
   390          */
       
   391         CCalenUnifiedEditorControl& EditorFields();
       
   392         
       
   393         /**
       
   394          * @brief Returns layout variant dependent maximum value for text editors.
       
   395          * @return TInt returns maximum editor length
       
   396          */
       
   397         TInt MaxTextEditorLength() const;
       
   398         
       
   399         /**
       
   400          * @brief Check if note editor is launched to create new entry
       
   401          * @return TBool returns ETrue if creating a new entry
       
   402          */
       
   403         TBool IsCreatingNewEntry() const;
       
   404         
       
   405         /**
       
   406          * @brief Gets unified editor's entry type
       
   407          * @return CCalEntry entry type of the unified editor
       
   408          */
       
   409         CCalEntry::TType GetEntryType();
       
   410         
       
   411         /**
       
   412          * @brief Sets the unified editor's entry type
       
   413          * @param aEntryType Holds the new entry type
       
   414          */
       
   415         void SetEntryType( CCalEntry::TType aEntryType );
       
   416 
       
   417         
       
   418         /**
       
   419          * @brief Access to the editor data handler
       
   420          * @returns CCalenEditorDataHandler editor data handler
       
   421          */
       
   422         CCalenEditorDataHandler& EditorDataHandler();
       
   423         
       
   424         /**
       
   425          * @brief Access to the edited editor data
       
   426          * @returns edited editor data
       
   427          */
       
   428         CCalenEntryUtil& Edited();
       
   429 
       
   430         /**
       
   431          * @brief Access to the original editor data
       
   432          * @returns CCalenEntryUtil returnd original editor data 
       
   433          */ 
       
   434         const CCalenEntryUtil& Original() const;
       
   435 
       
   436         /**
       
   437          * @brief Sets editor text
       
   438          * @param aCOntrolId Id of the editor text
       
   439          * @param aDes Text to be set to editor
       
   440          */
       
   441         void SetEditorTextL( TInt aControlId, const TDesC* aDes );
       
   442         
       
   443         /**
       
   444          * @brief Reads subject field from unified editor
       
   445          */
       
   446         void ReadSubjectFromEditorL();
       
   447         
       
   448         /**
       
   449          * @brief Reads "Place" item from unified editor
       
   450          */
       
   451         void ReadPlaceFromEditorL();
       
   452 
       
   453         /**
       
   454          * @brief For setting alarm field on or off
       
   455          * @param aOnOff For toggling on or off
       
   456          */
       
   457         void SetAlarmFieldOnOffL( TBool aOnOff );
       
   458         
       
   459         /**
       
   460          * @brief For setting AllDay filed Yes or No
       
   461          */
       
   462         void SetAllDayFieldL( TBool aYesNo );
       
   463         
       
   464         /**
       
   465          * @brief For getting Id of the focused control
       
   466          * @return TInt controlId of the focused control
       
   467          */
       
   468         TInt IdOfFocusedControl();
       
   469         
       
   470         /**
       
   471          * @brief Set attachment names to the editor if attachments
       
   472          *        exists for the entry being edited
       
   473          */
       
   474         void SetAttachmentNamesToEditorL();
       
   475         
       
   476         /**
       
   477          * Update CBA with corresponding MSK button.
       
   478          * This function is e.g. called from HandleControlEvent()
       
   479          * Will issue HandleControlStateChangeL() call.
       
   480          */
       
   481         void SetMskFromResourceL();
       
   482         
       
   483          /**
       
   484          * @brief Merges all the attachment names into a single string
       
   485          */
       
   486         void GetAttachmentNamesString( RPointerArray<HBufC>& aAttachmentNames,
       
   487                                         HBufC& aAttachmentNamesString );
       
   488 										
       
   489         /*
       
   490          * Verify if the collectionid exsists in the array of collecteids
       
   491          * leave is generated if collectionid is not found.
       
   492          * @param TCalCollectionId aColId to verified from the array of collecteids
       
   493          * @return void
       
   494          */
       
   495         void VerifyCollectionIdL(const TCalCollectionId aColId);
       
   496         
       
   497     protected:
       
   498         /**
       
   499          * From CEikDialog
       
   500          * We will hit this event each time a line has changed in the form
       
   501          */
       
   502         void LineChangedL( TInt aControlId );
       
   503         
       
   504     private:        
       
   505         /**
       
   506          * @breif Checks if the Flash File System storage will fall below
       
   507          *        Critical Level. Warning will be displayed if storage
       
   508          *        is below Critical Level.
       
   509          * @return ETrue : Below critical level
       
   510          */
       
   511         TBool CheckSpaceBelowCriticalLevelL();
       
   512         
       
   513         /**
       
   514          * @brief Try to save note. Used in normal exit.
       
   515          * @return ETrue if note was saved
       
   516          */
       
   517         TBool TryToSaveNoteL();
       
   518         
       
   519         /**
       
   520          * @brief Common routine for saving note when forced exit like
       
   521          *        pressing end key/exit from FSW/power off key
       
   522          */
       
   523         void TryToSaveNoteOnForcedExitL();
       
   524         
       
   525         /**
       
   526          * @brief checks wether user has edited the db field.
       
   527          * updates the dbid into cenrep for the later use,
       
   528          * next time editor will show this db in the editor (bu default)
       
   529          */
       
   530         void ModifyDbField();
       
   531         
       
   532         /**
       
   533          * @brief Try to save the enty with new entry type
       
   534          * @return Error value if entry is not saved
       
   535          */
       
   536         TInt TryToSaveEntryWithEntryChangeL( TBool aForcedExit);
       
   537         
       
   538         /**
       
   539          * @brief Calculate the start date/time of the entry being edited.
       
   540          *        Store the result in the passed arguments.
       
   541          * @param aNewInstanceStartDate Instance start time
       
   542          * @param aNewInstanceEndDate Instance end time
       
   543          */
       
   544         void CalculateNewInstanceStartAndEndDateL( TCalTime& aNewInstanceStartDate,
       
   545                                                    TCalTime& aNewInstanceEndDate );
       
   546         
       
   547         /**
       
   548          * @breif Fetch the current entry's parent from agenda. This should be used
       
   549          *        sparingly as it is expensive. It may be worth seeing if there
       
   550          *        is any performance improvement by fetching the parent from
       
   551          *        CCalenDefaultViewers and passing it through to the constructor of
       
   552          *        the editors and viewers, instead of fetching it internally to each
       
   553          *        viewer/editor.
       
   554          * @return referance to parent entry CCalEntry       
       
   555          */
       
   556         CCalEntry& ParentEntryL();
       
   557         
       
   558         /**
       
   559          * @brief Display S60 Calendar Note Editor specific error message
       
   560          *        for given aError.
       
   561          * @param aError : Flag of error.
       
   562          */
       
   563         void DisplayErrorMsgL(const TInt& aError);
       
   564         
       
   565         /**
       
   566          * @brief Launch the note dialog
       
   567          * @param resourceId Resource Id of the error type
       
   568          */
       
   569         void DisplayErrorMsgInNoteDlgL( TInt resourceId );
       
   570         
       
   571         /**
       
   572          * @brief Launch the repeat type dependent error message dialog
       
   573          */
       
   574         void DispalyErrorMsgByRepeatTypeL();
       
   575          
       
   576          /**
       
   577           * @brief Updates the user selected landmark details into 
       
   578           *        current meeting editor form 
       
   579           */
       
   580          void UpdateLocationInfoToFormL();
       
   581          
       
   582          /**
       
   583           * @brief Handles the case when user choose locaiton on
       
   584           *        top of already saved address
       
   585           * @param CPosLandMark Holds landmark
       
   586           */
       
   587          void HandleEntryWithGeoValueEditionL( CPosLandmark* landmark );
       
   588 		 
       
   589 	 	 /**
       
   590 		 * Handles the case when user choose location on top of invalidated address
       
   591 		 */ 
       
   592 	     void HandleEntryWithLocationEditionL(CPosLandmark* landmark);
       
   593           
       
   594          /**
       
   595           * @breif Stores landmark details and displays selected location details 
       
   596           *        on the currently shown editor form
       
   597           * @param CPosLandMark Holds landmark
       
   598           */
       
   599          void StoreLocationDetailsToEntryL( CPosLandmark* landmark );
       
   600           
       
   601          /**
       
   602           * @brief Function to query user whether to replace or keep 
       
   603           *        existing location details
       
   604           * @Param aLocationName Holds the new location name selected
       
   605           */
       
   606          TInt ShowLocationReplaceNoticeL( TPtrC aLocaitonName );
       
   607          
       
   608          /**
       
   609           * @brief Queries user whether to keep the exisiting coordianates or not
       
   610           */
       
   611          TInt ShowLocationChangeNoticeL();
       
   612          
       
   613          /**
       
   614 	     * Displays "Address Updated" transient notice to the user
       
   615 	     */
       
   616 	    void ShowAddressUpdatedNoticeL();
       
   617 		     
       
   618 	     /**
       
   619 	     * Checks if user has edited location field manually
       
   620 	     */
       
   621 	    void CheckManualEditionOfLocationL();
       
   622          
       
   623          /**
       
   624 		 * Adds Map icon onto the editor form
       
   625 		 */
       
   626 		void AddPictureL(TInt isNotFirstTime  = 1); 
       
   627          
       
   628          /**
       
   629           * @brief Update attachment info to editor whenever an file is selected 
       
   630           *        using fetch apis
       
   631           */
       
   632          void UpdateAttachmentInfoToEditorL();
       
   633          
       
   634          /**
       
   635           * @brief Sets the undeline for the attachment field's text
       
   636           * @param aUnderLine holds to make the underline visible or not
       
   637           *        EUnderLineOn for enabling the underline
       
   638           *        EUnderLineOff for disabling the underline    
       
   639           */
       
   640          void SetUnderLineForAttachmentL(TFontUnderline aUnderLine);
       
   641          
       
   642          /**
       
   643           * @brief Check for attachments in editor,if present save the attachment
       
   644           *        count which is used while saving the attachments to the calentry
       
   645           */
       
   646          void CheckForAttachmentsInEditorL();
       
   647          
       
   648          /**
       
   649           * @brief Check for whether attachments exists in edited entry
       
   650           * @returns ETrue if entry has attachments otherwise EFalse
       
   651           */
       
   652          TBool EntryHasAttachments();
       
   653          
       
   654          void GetAllCollectionidsL(RArray<TInt>& aCollectionIds);
       
   655 		  
       
   656          /**
       
   657           * @brief Hides Entry type, Calendar Field & RepetType Fields for 
       
   658           *        exceptional entry/single instance of recurrent entry
       
   659           *  
       
   660           */
       
   661          void HideFieldsForEditSingleInstance();
       
   662 
       
   663     private:
       
   664         /**
       
   665          * @var iEditedCalEntry
       
   666          * @brief Stores entry to be edited temporarily for construction sequence.
       
   667          *        This is passed to CCalenEntryUtilHandler and also copied to 
       
   668          *        iOriginalCalEntry  
       
   669          */
       
   670         CCalEntry& iEditedCalEntry;
       
   671         
       
   672         /**
       
   673          * @var iEntryUiInParams
       
   674          * @brief Input parameters for Editor Plugin
       
   675          */
       
   676         const TAgnEntryUiInParams& iEntryUiInParams;
       
   677         
       
   678         /**
       
   679          * @var iEntryUiCallback
       
   680          * @brief Editor Plugin callback (not used in default editors)
       
   681          */
       
   682         MAgnEntryUiCallback& iEntryUiCallback;
       
   683 
       
   684         /**
       
   685          * @var iEntryUiOutParams
       
   686          * @brief Output parameters for Editor Plugin
       
   687          */
       
   688         TAgnEntryUiOutParams& iEntryUiOutParams;
       
   689         
       
   690         /**
       
   691          * @var iRepeatType
       
   692          * @brief holds the repeat type
       
   693          */
       
   694         CalCommon::TRecurrenceRange iRepeatType;
       
   695 
       
   696         /**
       
   697          * @var iGlobalData
       
   698          * @brief Global data holds references to shared resources like CalEntryView,
       
   699          *        CalSession. Own. Release don't delete, because it's thread-wide
       
   700          *        singleton. 
       
   701          */
       
   702         CCalenGlobalData* iGlobalData;
       
   703         
       
   704         /**
       
   705          * @var iOriginalCalEntry
       
   706          * @brief Original entry. Copied from passed entry
       
   707          */
       
   708         CCalEntry* iOriginalCalEntry;
       
   709 
       
   710         /**
       
   711          * @var iFetchedEntries
       
   712          * @brief The array of entries returned from FetchL(), based on the  
       
   713          *        entry being edited. This allows retrieving of the parent entry      
       
   714          *        using ParentEntryL(), which should be used instead of direct  
       
   715          *        access to this array.
       
   716          */
       
   717         
       
   718         RPointerArray<CCalEntry> iFetchedEntries;
       
   719         
       
   720         /**
       
   721          * @var iEditorDataHandler
       
   722          * @brief Editor data handler. Handles mapping data between form fields
       
   723          *        and Symbian Calendar Interim API's CCalEntry.
       
   724          */
       
   725         CCalenEditorDataHandler* iEditorDataHandler;
       
   726         
       
   727         /**
       
   728          * @var iEntryUpdater
       
   729          * @brief CCalenEntryUpdater takes care of saving and updating entry 
       
   730          *        properly.
       
   731          */
       
   732         CCalenEntryUpdater* iEntryUpdater;
       
   733         
       
   734         /**
       
   735          * @var iNaviContainer
       
   736          * @brief access to navipane container
       
   737          */
       
   738         CAknNavigationControlContainer* iNaviContainer;
       
   739         
       
   740         /**
       
   741          * @var iServices
       
   742          * @brief access to McalenServices
       
   743          */
       
   744         MCalenServices* iServices;
       
   745         
       
   746         /**
       
   747          * @var iUnifiedEditorControl
       
   748          * @brief pointer to CCalenUnifiedEditorControl
       
   749          */
       
   750         CCalenUnifiedEditorControl* iUnifiedEditorControl;
       
   751         
       
   752         /**
       
   753          * @var iEntryType
       
   754          * @brief contains entry type
       
   755          */
       
   756         CCalEntry::TType iEntryType;
       
   757         
       
   758        
       
   759         /**
       
   760          * @var iHasChosenRepeatType
       
   761          */
       
   762         TBool iHasChosenRepeatType;
       
   763 
       
   764 		/**
       
   765          * @var iIgnoreFirstLocaleChange
       
   766          * @brief Ignore the first locale change so we don't rebuild for no reason
       
   767          */
       
   768         TBool iIgnoreFirstLocaleChange;
       
   769         
       
   770         /**
       
   771          * @var iCurrentDurationDay
       
   772          */
       
   773         TTimeIntervalDays iCurrentDurationDay;
       
   774         
       
   775         /**
       
   776          * @var iTimeStamp
       
   777          * @brief Used to check if the database has been modified while the editor
       
   778          *        is open
       
   779          */
       
   780         TTime iTimeStamp;
       
   781         
       
   782         /**
       
   783          * @var iTwoSeconds
       
   784          * @brief Represents two seconds(for checking last modified time of agenda)
       
   785          */
       
   786         const TTimeIntervalSeconds iTwoSeconds;
       
   787         
       
   788         /**
       
   789          * @var iLastDbChangeNotification
       
   790          */
       
   791         TTime iLastDbChangeNotification;
       
   792         
       
   793         /**
       
   794          * @var iIdle
       
   795          */
       
   796         CIdle* iIdle;
       
   797         
       
   798         /**
       
   799          * @var iLocaleChangeNotifier We could move this to Global data and share
       
   800          * @brief Locale update notifier class
       
   801          *        with the appui
       
   802          */
       
   803         CEnvironmentChangeNotifier* iLocaleChangeNotifier;
       
   804 
       
   805         
       
   806         /**
       
   807          * @iCollectionIds collection ids to identify calendar sessions.
       
   808          */
       
   809         RArray<TInt> iCollectionIds;
       
   810         
       
   811         /**
       
   812          * @var isReplaceLocation
       
   813          * @brief Flag to indicate whenter to replace the location or to append it
       
   814          */
       
   815         TBool isReplaceLocation;
       
   816     };
       
   817 
       
   818 /**
       
   819 * Class defining Map icon picture, derived from CPicture
       
   820 */
       
   821 class CMapsIconPicture : public CPicture
       
   822     {
       
   823     public:
       
   824         /**
       
   825          * @brief C++ default Constructor
       
   826          * @param aService calendar services
       
   827          * @param aRect Holds rectangle
       
   828          */          
       
   829         CMapsIconPicture( MCalenServices& aServices, TRect aRect);
       
   830         
       
   831         /**
       
   832          * @brief Draw funtion to draw the map icon
       
   833          * @param aGc graphical context
       
   834          * @param aTopLeft Tpp left point
       
   835          * @param aClipRect clip rectangle
       
   836          * @param map graphics device map
       
   837          */
       
   838         void Draw( CGraphicsContext& aGc,
       
   839                    const TPoint& aTopLeft,
       
   840                    const TRect& aClipRect,
       
   841                    MGraphicsDeviceMap* aMap )const;
       
   842         
       
   843         /**
       
   844          * @brief Pure virtual from CPicture, intentionally empty.
       
   845          * @return aStream stream for writing
       
   846          */
       
   847         void ExternalizeL(RWriteStream& aStream)const;
       
   848         
       
   849         /**
       
   850          * @brief Convert size to twips
       
   851          * @param aSize holds original size
       
   852          */
       
   853         void GetOriginalSizeInTwips(TSize& aSize)const;
       
   854     
       
   855     protected:
       
   856         /**
       
   857          * @var iServices
       
   858          * @brief access to McalenServices
       
   859          */
       
   860         MCalenServices& iServices;
       
   861         
       
   862         /**
       
   863          * @var iRect
       
   864          */
       
   865         TRect iRect;
       
   866     };
       
   867 
       
   868 #endif // CALENUNFIEDEDITOR_H
       
   869 
       
   870 // End of File