calendarui/editors/inc/calenrepeatfield.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14  *  Description : Implementation of Repeat field of UnifiedEditor
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef __CALENREPEATFIELD_H__
       
    19 #define __CALENREPEATFIELD_H__
       
    20 
       
    21 // user includes
       
    22 #include "calenunifiededitor.h"
       
    23 
       
    24 // system includes
       
    25 #include <e32base.h>
       
    26 #include <badesca.h>
       
    27 #include <calcommon.h>
       
    28 
       
    29 // forward declaration
       
    30 class CCalEntry;
       
    31 class CAknQueryValueTextArray;
       
    32 class CAknQueryValueText;
       
    33 class TCalRRule;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Implements Synchronization field for Calendar Editors.
       
    39  */ 
       
    40 NONSHARABLE_CLASS( CCalenRepeatField ) : public CBase
       
    41     {
       
    42 public:
       
    43     
       
    44     /**
       
    45      * @brief 1st phase of Two-phased constructor
       
    46      */
       
    47     static CCalenRepeatField* NewL( CCalenUnifiedEditor& aUnifiedEditor );
       
    48     
       
    49     /**
       
    50      * @brief Destructor
       
    51      */
       
    52     virtual ~CCalenRepeatField();
       
    53 
       
    54 public:
       
    55     /**
       
    56      * @brief To read data from editor
       
    57      */
       
    58     void ReadDataFromFormL( TBool aContinueOnError );
       
    59     
       
    60     /**
       
    61      * @brief To update data form data
       
    62      */
       
    63     void SetDataToEditorL();
       
    64 
       
    65     /**
       
    66      * @brief Updates fields just before the form is shown.
       
    67      */
       
    68     void InitRepetFieldLayoutL();
       
    69     
       
    70     /**
       
    71      * @brief Handle repeat type change
       
    72      * @param aControlId
       
    73      */
       
    74     void HandleControlStateChangeL( TInt aControlId );
       
    75     
       
    76     /**
       
    77      * @brief Change focused field in form according to error type
       
    78      * @param aError
       
    79      */
       
    80     TBool HandleErrorL( const TInt& aError );
       
    81 
       
    82     /**
       
    83      * @brief Handle focus change from the repeat field
       
    84      */
       
    85     void PrepareForFocusTransitionL( TInt aFocusedId );
       
    86 
       
    87 public: // Repeat field specific
       
    88     /**
       
    89      * @brief Get form current repeat type
       
    90      * @retun TCalenRepeatIndex
       
    91      */
       
    92     TCalenRepeatIndex FormRepeatType();
       
    93 
       
    94     /**
       
    95      * @brief Ask the user of the repeat type when neccessary
       
    96      * @param aRepeatType
       
    97      * @return CCalenEditorDataHandle::TError
       
    98      */
       
    99     CCalenEditorDataHandler::TError AskRepeatingNoteQueriesL(
       
   100         CalCommon::TRecurrenceRange& aRepeatType);
       
   101 
       
   102 private:
       
   103 
       
   104     /**
       
   105      * @brief Get repeat date and time from form
       
   106      * @reurn repeatuntil field value in TTime format 
       
   107      */
       
   108     TTime FormRepeatUntilDateTimeL();
       
   109     
       
   110     /**
       
   111      * @brief Delete "Other" item from repeat field.
       
   112      *        It MUST be called in following case.
       
   113      *        1. Default repeat value is other then "Other".
       
   114      *        2. Repeat is changed from "Other" to another value.
       
   115      *        If "Other" item has already been deleted, nothing is executed.
       
   116      */
       
   117     void DeleteOtherItemFromRepeatField();
       
   118     
       
   119     /**
       
   120      * @brief To Notify the change in repeat choice change
       
   121      */
       
   122     void NotifyChangeRepeatChoiceL();
       
   123     
       
   124     /**
       
   125      * @brief Delete or insert item of "RepeatUntil" from form.
       
   126      * @param aDimmed, If ETrue delete RepeatUntil from form.
       
   127      *        EFalse insert RepeatUntil field to form.    
       
   128      */
       
   129     void SetRepeatUntilLineDimmedL( const TBool& aDimmed );
       
   130     
       
   131     /**
       
   132      * @brief Called when "Repeat" is updated from any repeat value
       
   133      *        to "Not Repeated".
       
   134      */
       
   135     void UpdateEndDateTimeFields();
       
   136     
       
   137     /**
       
   138      * @brief Check if the repeat query should be shown
       
   139      * @return TBool
       
   140      */
       
   141     TBool ShouldQueryRepeatTargetL();
       
   142     
       
   143     /**
       
   144      * @brief Query whether user want to edit This/all instances of repeat entry
       
   145      * @param referance to aRepeatType
       
   146      */
       
   147     CCalenEditorDataHandler::TError QueryRepeatTargetL(
       
   148         CalCommon::TRecurrenceRange& aRepeatType );
       
   149 
       
   150 private:
       
   151     /**
       
   152      * @brief C++ constructor
       
   153      * @param aUnifiedEditor referance to CCalenUnifiedEditor 
       
   154      */
       
   155     CCalenRepeatField( CCalenUnifiedEditor& aUnifiedEditor );
       
   156 
       
   157     /**
       
   158      * @brief 2nd phase of Two-Phased constructor
       
   159      */
       
   160     void ConstructL();
       
   161 
       
   162 private:
       
   163     /**
       
   164      * @var iUnifiedEditor
       
   165      * @brief referance to iUnifiedEditor
       
   166      */
       
   167     CCalenUnifiedEditor&        iUnifiedEditor;
       
   168     
       
   169     /**
       
   170      * @var iRepeatArrayText
       
   171      * @brief Array contian repeat text values  
       
   172      */
       
   173     CDesCArrayFlat*             iRepeatArrayText;
       
   174     
       
   175     /**
       
   176      * @var iRepeatArray
       
   177      * @brief Array contain Reapt field text list
       
   178      */
       
   179     CAknQueryValueTextArray*    iRepeatArray;
       
   180     
       
   181     /**
       
   182      * @var iRepeatTextValues
       
   183      */
       
   184     CAknQueryValueText*         iRepeatTextValues;
       
   185     };
       
   186 #endif