calendarui/editors/inc/calenunifiededitorcontrol.h
changeset 0 f979ecb2b13e
child 5 42814f902fe6
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 Fields definition
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _CALENUNIFIEDEDITORCONTROL_H
       
    20 #define _CALENUNIFIEDEDITORCONTROL_H
       
    21 
       
    22 // system includes
       
    23 #include <calentry.h>
       
    24 
       
    25 // user includes
       
    26 #include "CalenEditorDataHandler.h"
       
    27 
       
    28 // forward declaration
       
    29 class CCalenUnifiedEditor;
       
    30 class CCalenEventTypeField;
       
    31 class CCalenReminderField;
       
    32 class CCalenRepeatField;
       
    33 class CCalenAllDayField;
       
    34 class CCalenPriorityField;
       
    35 class CCalenDbField;
       
    36 class CCalenDescription;
       
    37 class MCalenServices;
       
    38 
       
    39 /**
       
    40  * CCalenUnifiedEditorControl class declaration
       
    41  */
       
    42 NONSHARABLE_CLASS( CCalenUnifiedEditorControl ) : public CBase
       
    43     {
       
    44     public:
       
    45         /**
       
    46          * @brief Two phased constructor
       
    47          * @param reference to unified editor
       
    48          * @return returns unified editor fields
       
    49          */
       
    50         static CCalenUnifiedEditorControl* NewL(
       
    51                 CCalenUnifiedEditor& aUnifiedEditor,
       
    52                 MCalenServices& aServices );
       
    53         
       
    54         /**
       
    55          * @brief Destructor
       
    56          */
       
    57         virtual ~CCalenUnifiedEditorControl();
       
    58 
       
    59     private:
       
    60         
       
    61         /**
       
    62          * @brief Default constructor
       
    63          * @param reference to unified editor
       
    64          */
       
    65         CCalenUnifiedEditorControl( CCalenUnifiedEditor& aUnifiedEditor );
       
    66         
       
    67         /**
       
    68          * @brief Second phase construction
       
    69          */
       
    70         void ConstructL(MCalenServices& aServices);
       
    71 
       
    72     public:
       
    73         
       
    74         /**
       
    75          * @brief Initializes the dialog's controls before the dialog is sized and 
       
    76          *        layed out. Empty by default.
       
    77          */
       
    78         void MakeUnifiedEditorL();
       
    79         
       
    80         /**
       
    81          * @brief Set data to the collapsed unified editor
       
    82          */
       
    83         void SetDataToEditorL();
       
    84         
       
    85         /** 
       
    86          * @brief Set date of date editor aControlId in form to aTime 
       
    87          * @param aControlId control id of the date field
       
    88          * @param aTime holds the user entered time
       
    89          * @param aDoDraw ETrue for redraw other wise EFalse
       
    90          */ 
       
    91         void SetDateField( TInt aControlId, 
       
    92                            const TTime& aTime, 
       
    93                            TBool aDoDraw = ETrue );
       
    94 
       
    95         /**
       
    96          * @brief Sets Time in editor
       
    97          * @param aControlId control id of the date field
       
    98          * @param aTime holds the user entered time
       
    99          * @param aDoDraw ETrue for redraw other wise EFalse
       
   100          */ 
       
   101         void SetTimeField( TInt aControlId,
       
   102                            const TTime& aTime,
       
   103                            TBool aDoDraw = ETrue );
       
   104         
       
   105         /** 
       
   106          * @brief Set date of datetime editor aControlId in form to aTime 
       
   107          * @param aControlId control id of the date field
       
   108          * @param aTime holds the user entered time
       
   109          * @param aDoDraw ETrue for redraw other wise EFalse
       
   110          */ 
       
   111         void SetDateTimeField( TInt aControlId,
       
   112                                const TTime& aTime,
       
   113                                TBool aDoDraw = ETrue );
       
   114         
       
   115         /**
       
   116          * @brief Sets alarm field on or off
       
   117          * @param aOnOff ETrue for alarm field ON otherwise EFalse
       
   118          */
       
   119         void SetAlarmFieldOnOffL( TBool aOnOff );
       
   120         
       
   121         /**
       
   122          * @brief Check for whether alarm is activated or not
       
   123          * @return TBool returns ETrue for if alarm active otherwise EFalse
       
   124          */
       
   125         TBool IsAlarmActiveInForm();
       
   126         
       
   127         /**
       
   128          * @brief check alarm active based on the input
       
   129          * @param aActive ETrue for alarm "ON" otherwise EFalse for alarm "OFF"
       
   130          */
       
   131         void CheckAlarmActive( TBool aActive );
       
   132         
       
   133         /**
       
   134          * @brief check ALLDay field value.
       
   135          * @return TBool retunrns ETrue if AllDay field is 'Yes', else EFalse  
       
   136          */
       
   137         TBool IsAllDayEvent();
       
   138         
       
   139         /**
       
   140          * @brief Set AllDay field text value
       
   141          * @param aYesOrNo
       
   142          */
       
   143         void SetAllDayFieldL( TBool aYesOrNo );
       
   144         
       
   145         /**
       
   146          * @brief To set AllDay field value
       
   147          * @param aActive
       
   148          */
       
   149         void SetAllDayEvent( TBool aActive );
       
   150         
       
   151         /**
       
   152          * @brief Handles a state change in the control with id aControlId. 
       
   153          *        Empty by default.
       
   154          * @param aControlId holds the control id for which the state is changed
       
   155          */
       
   156         void HandleControlStateChangeL( TInt aControlId );
       
   157         
       
   158         /**
       
   159          * @brief Tries to change focus to the specified line. Fails if the line 
       
   160          *        ID is not valid. Calls @c PrepareForFocusTransitionL() before 
       
   161          *        focus is given to the line.
       
   162          * @param aFocusedId control id which is being focused
       
   163          */
       
   164         void PrepareForFocusTransitionL( TInt aFocusedId );
       
   165         
       
   166         /**
       
   167          * @brief Handles event type changed 
       
   168          * @param aNewEventType Holds the new event type selected in editor
       
   169          */
       
   170         void OnEventTypeChangedL( CCalEntry::TType aNewEventType );
       
   171     
       
   172         /**
       
   173          * @brief Reads editor data mainly for collapsed editor
       
   174          * @aContinueOnError used for handling forced exit of the editor
       
   175          */
       
   176         void ReadDataFromEditorL( TBool aContinueOnError );
       
   177         
       
   178         /**
       
   179          * @brief Reads subject field from editor
       
   180          */
       
   181         void ReadSubjectFromEditorL();
       
   182 
       
   183         /**
       
   184          * @brief Reads start date time from the editor
       
   185          * @param aContinueOnError used for handling forced exit of the editor
       
   186          */
       
   187         void ReadStartDateTimeFromEditorL( TBool aContinueOnError, TInt aFousedId=0 );
       
   188  
       
   189         /**
       
   190          * @brief Reads end date time from the editor
       
   191          * @param aContinueOnError used for handling forced exit of the editor
       
   192          */
       
   193         void ReadEndDateTimeFromEditorL( TBool aContinueOnError );
       
   194         
       
   195         /**
       
   196          * @brief Reads place field from editor
       
   197          * @param aContinueOnError used for handling forced exit of the editor
       
   198          */
       
   199         void ReadPlaceFieldFromEditorL( TBool aContinueOnError );
       
   200         
       
   201         /**
       
   202          * @brief Reads people field from editor
       
   203          * @param aContinueOnError used for handling forced exit of the editor
       
   204          */
       
   205         void ReadPeopleFieldFromEditorL( TBool aContinueOnError );
       
   206         
       
   207         /**
       
   208          * @brief Reads attachment field from editor
       
   209          * @param aContinueOnError used for handling forced exit of the editor
       
   210          */
       
   211         void ReadAttachmentFieldFromEditorL( TBool aContinueOnError );
       
   212         
       
   213         /**
       
   214          * @brief Reads description field from editor
       
   215          * @aContinueOnError used for handling forced exit of the editor
       
   216          */
       
   217         void ReadDescriptionFieldFromEditorL( TBool aContinueOnError );
       
   218         
       
   219         /**
       
   220          * @brief Update editor lines on environment change notifications
       
   221          */
       
   222         void UpdateLinesOnLocaleChangeL();
       
   223         
       
   224         /**
       
   225          * Reads the RRule and Rdates for the current CCalEntry.
       
   226          */
       
   227         void ReadRrule(TTime& startTime, TTime& endTime);
       
   228         
       
   229         /**
       
   230          * @brief Get start date time from editor
       
   231          * @return TTime holds the start time
       
   232          */
       
   233         TTime GetStartDateTimeL();
       
   234 
       
   235         /**
       
   236          * @brief Get end date time from editor
       
   237          * @return TTime holds the end time
       
   238          */
       
   239         TTime GetEndDateTimeL();
       
   240                 
       
   241         /**
       
   242          * @brief Reads time from editor
       
   243          * @param aControlId controld of the time field
       
   244          * @return TTime returns time
       
   245          */
       
   246         TTime ReadTimeField( TInt aControlId );
       
   247         
       
   248         /**
       
   249          * @brief Reads date from form in QHD resolution 
       
   250          * @param aControlId controld of the time field
       
   251          * @return TTime returns time
       
   252          */
       
   253         TTime ReadDateField( TInt aControlId );
       
   254         
       
   255         /**
       
   256          * @brief Access to the decription field
       
   257          * @return CCalenDescription returns reference to the decription field
       
   258          */
       
   259         CCalenDescription* Description();
       
   260         
       
   261         /**
       
   262          * @brief check repeat note querie required
       
   263          * @param aRepeatType
       
   264          */
       
   265         CCalenEditorDataHandler::TError AskRepeatingNoteQueriesL(
       
   266             CalCommon::TRecurrenceRange& aRepeatType );        
       
   267         
       
   268         
       
   269         TInt GetCalendarIndexForEntryL();
       
   270         
       
   271         const TDesC& GetCalendarNameForEntryL();
       
   272         
       
   273     private:
       
   274         
       
   275         /**
       
   276          * @brief Adds collapsed editor fields
       
   277          */
       
   278         void AddDefaultEditorL();
       
   279         
       
   280         /**
       
   281          * @brief Add collapsed note editor contents
       
   282          */
       
   283         void AddDefaultNoteEditorL();
       
   284         
       
   285         /**
       
   286          * @brief Add collapsed birthday editor contents
       
   287          */
       
   288         void AddDefaultBirthDayEditorL();
       
   289         
       
   290         /**
       
   291          * @brief Add collapsed meeting editor contents
       
   292          */
       
   293         void AddDefaultMeetingEditorL();
       
   294         
       
   295         /**
       
   296          * @brief Add collapsed todo editor contents
       
   297          */
       
   298         void AddDefaultTodoEditorL();
       
   299         
       
   300         /**
       
   301          * @brief Initialise default editor contents
       
   302          */
       
   303         void InitDefaultEditorsL();
       
   304         
       
   305         /**
       
   306          * @brief Delete previous entry type fields on selcting 
       
   307          *        the new entry type
       
   308          */
       
   309         void DeletePreviousEntryTypeFieldsL();
       
   310         
       
   311         /**
       
   312          * @brief Delete more information fields from unified editor
       
   313          * @param aPreviousEntryType
       
   314          */
       
   315         void DeleteExtendedEntryFields( CCalEntry::TType aPreviousEntryType );
       
   316         
       
   317         /**
       
   318          * @brief Add new entry type's editor fields
       
   319          * aParam aNewEventType new event type selected
       
   320          */
       
   321         void AddNewEntryTypeFieldsL( CCalEntry::TType aNewEventType );
       
   322         
       
   323         /*
       
   324          * @brief To update end time in editor
       
   325          */
       
   326         void UpdateEndTimeL();
       
   327         
       
   328         /**
       
   329          * @brief To to update meeting duration in iMeetingInterval Which is used
       
   330          *        in updating the EndTime of editor on StartTime change.
       
   331          */
       
   332         void UpdateMeetingDurationL();
       
   333         
       
   334     private:
       
   335  
       
   336         /**
       
   337          * @var iUnifiedEditor
       
   338          * @brief referance to CCalenUnifiedEditor
       
   339          */
       
   340         CCalenUnifiedEditor& iUnifiedEditor;
       
   341         
       
   342         /**
       
   343          * @var iEventTypeField
       
   344          * @brief To handle Event type field
       
   345          */
       
   346         CCalenEventTypeField* iEventTypeField;
       
   347         
       
   348         /**
       
   349          * @var iReminderField
       
   350          * @brief To handle Reminder field
       
   351          */
       
   352         CCalenReminderField* iReminderField;
       
   353         
       
   354         /**
       
   355          * @var iRepeatField
       
   356          * @brief To handle Repeat field
       
   357          */
       
   358         CCalenRepeatField* iRepeatField;
       
   359         
       
   360         /**
       
   361          * @var iAllDayField
       
   362          * @brief To handle AllDay field
       
   363          */
       
   364         CCalenAllDayField* iAllDayField;
       
   365         
       
   366         /**
       
   367          * @var iPriorityField
       
   368          * @brief To handle Note Priority field
       
   369          */
       
   370         CCalenPriorityField* iPriorityField;
       
   371         
       
   372         /**
       
   373          * @var iDbField
       
   374          * @brief To handle Db field
       
   375          */
       
   376         CCalenDbField* iDbField;
       
   377         
       
   378         /**
       
   379          * @var iDescription
       
   380          * @brief To handle Description field
       
   381          */
       
   382         CCalenDescription* iDescription;
       
   383         
       
   384         /**
       
   385          * @var iMeetingInterval
       
   386          * @brief To update end time as per Start time change
       
   387          */
       
   388         TTimeIntervalMinutes  iMeetingInterval;
       
   389         
       
   390     };
       
   391 
       
   392 #endif // _CALENUNIFIEDEDITORCONTROL_H