calendarui/views/inc/caleneditordata.h
branchRCL_3
changeset 66 bd7edf625bdd
parent 0 f979ecb2b13e
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     1 /*
       
     2 * Copyright (c) 2006 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:   CalenEditorData stores data from edited Symbian CCalEntry
       
    15 *                to format that match Calendar Editors fields. Editor fields
       
    16 *                update CalenEditorData.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef CALENEDITORDATA_H
       
    22 #define CALENEDITORDATA_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 #include <caltime.h>
       
    27 #include "CalenNoteDataUtil.h"
       
    28 #include <calentry.h>
       
    29 
       
    30 /**
       
    31  * CCalenEditorData contains edited data in exactly same format that editor 
       
    32  * fields show them. For example, alarm time is represented as alarm time,
       
    33  * not as offset to entry start time, like CalInterimApi represents it. 
       
    34  * 
       
    35  * This class or CCalenEditorDataHandler encapsulates rules how this data is 
       
    36  * then read from and write to CalInterimApi CCalEntry.
       
    37  *
       
    38  *  @lib CalenDefaultEditors
       
    39  *  @since S60 v3.0
       
    40  */
       
    41 class CCalenEditorData : public CBase
       
    42     {
       
    43 public:
       
    44     enum TTodoPriority
       
    45         {
       
    46         ETodoPriorityHigh = 1,
       
    47         ETodoPriorityNormal = 2,
       
    48         ETodoPriorityLow = 3
       
    49         };
       
    50 
       
    51     enum TSynchType
       
    52         {
       
    53         ESynchPrivate = 0,
       
    54         ESynchPublic, 
       
    55         ESynchNoSync
       
    56         };
       
    57 
       
    58 public:
       
    59     static CCalenEditorData* NewL( CCalEntry& aEntry, const TCalTime& aInstanceDateTime ); 
       
    60 
       
    61     virtual ~CCalenEditorData();
       
    62 
       
    63     // Getters
       
    64     const TDesC& Summary() const;
       
    65     const TDesC& Location() const;
       
    66     const TDesC& Description() const;
       
    67 
       
    68     const TTime& EventDateTime() const;
       
    69     const TTime& StartDateTime() const;
       
    70     const TTime& EndDateTime() const;
       
    71 
       
    72     TBool IsAlarmActivated() const;
       
    73     const TTime& AlarmDateTime() const;
       
    74 
       
    75     TCalenRepeatIndex RepeatType() const;
       
    76     const TTime& RepeatUntilDateTime() const;
       
    77 
       
    78     TTodoPriority Priority() const;
       
    79     TSynchType SynchType() const;
       
    80 
       
    81     // Setters
       
    82     void SetSummaryL( const TDesC& aSummary );
       
    83     void SetLocationL( const TDesC& aLocation );
       
    84     void SetDescriptionL( const TDesC& aDescription );
       
    85     /** 
       
    86      * Set description by passing in new description in HBufC. 
       
    87      * CCalenEditorData takes ownership of new description. This can
       
    88      * be used to save unnecessary copying when setting description
       
    89      * created by Notepad API:
       
    90      */
       
    91     void SetDescriptionTransferOwnershipL( HBufC* aDescription );
       
    92 
       
    93     void SetStartDateTimeL( const TTime& aStart );
       
    94     void SetEndDateTimeL( const TTime& aEnd );
       
    95 
       
    96     void SetEventDateL( const TTime& aDate );
       
    97 
       
    98     void SetAlarmOnL( const TTime& aTime );
       
    99     void SetAlarmOffL();
       
   100     void SetAlarmDateTimeL( const TTime& aTime );
       
   101 
       
   102     void SetNonRepeatingL();
       
   103     void SetRepeatingL(TCalenRepeatIndex aRepeatType, const TTime& aUntilDateTime );
       
   104     void SetRepeatUntilDateTimeL(const TTime& aTime); 
       
   105 
       
   106     void SetPriorityL(TTodoPriority aPriority);
       
   107     void SetSynchTypeL(TSynchType aSynchType);
       
   108 
       
   109     // To get iEntryType
       
   110     const CCalEntry::TType& EntryType() const;
       
   111     
       
   112     /*
       
   113     *To get iEntryStatus
       
   114     */
       
   115     const CCalEntry::TStatus& Status() const;
       
   116 
       
   117     // Utility functions 
       
   118     TBool IsRepeating() const;
       
   119 
       
   120 private:
       
   121     CCalenEditorData();
       
   122 
       
   123     void ConstructL(CCalEntry& aEntry, const TCalTime& aInstanceDateTime );
       
   124 
       
   125     void CopyDataFromEntryL( CCalEntry& aEntry, const TCalTime& aInstanceDateTime );
       
   126 
       
   127 private: // data
       
   128 
       
   129     /**
       
   130      * ?description_of_member
       
   131      */
       
   132     //?type ?member_name;
       
   133 
       
   134     /**
       
   135      * ?description_of_pointer_member
       
   136      * Own.  *** Write "Own" if this class owns the object pointed to; in
       
   137      other words, if this class is responsible for deleting it.
       
   138     */
       
   139     //?type* ?member_name;
       
   140 
       
   141     /**
       
   142      * ?description_of_pointer_member
       
   143      * Not own.  *** Write "Not own" if some other class owns this object.
       
   144      */
       
   145     //?type* ?member_name;
       
   146 
       
   147     /**
       
   148      * ?description_of_pointer_member
       
   149      * Own.
       
   150      */
       
   151     HBufC* iSummary;
       
   152 
       
   153     /**
       
   154      * ?description_of_pointer_member
       
   155      * Own.
       
   156      */
       
   157     HBufC* iLocation;
       
   158 
       
   159     /**
       
   160      * ?description_of_pointer_member
       
   161      * Own.
       
   162      */
       
   163     HBufC* iDescription;
       
   164 
       
   165     /**
       
   166      * ?description_of_member
       
   167      */
       
   168     TTime iStartDateTime;
       
   169 
       
   170     /**
       
   171      * ?description_of_member
       
   172      */
       
   173     TTime iEndDateTime;
       
   174 
       
   175     /**
       
   176      * ?description_of_member
       
   177      */
       
   178     TBool iIsAlarmActivated;
       
   179 
       
   180     /**
       
   181      * ?description_of_member
       
   182      */
       
   183     TTime iAlarmDateTime;
       
   184 
       
   185     /**
       
   186      * ?description_of_member
       
   187      */
       
   188     TCalenRepeatIndex iRepeatType;
       
   189 
       
   190     /**
       
   191      * ?description_of_member
       
   192      */
       
   193     TTime iRepeatUntilDateTime;
       
   194 
       
   195     /**
       
   196      * ?description_of_member
       
   197      */
       
   198     TTodoPriority iPriority;
       
   199 
       
   200     /**
       
   201      * ?description_of_member
       
   202      */
       
   203     TSynchType iSynchType;
       
   204 
       
   205     /**
       
   206      * Tells what type of entry does editor data referring to (i.e. Anniv, ToDo).
       
   207      * Set at construction. Used in DataHandler to force the correctness
       
   208      * of fields. (i.e. The rules to force the correctness of alarm fields
       
   209      * vary based on entry type)
       
   210      */    
       
   211     CCalEntry::TType iEntryType;
       
   212     
       
   213     /**
       
   214      * Tells the status values of the entry.
       
   215      */     
       
   216     CCalEntry::TStatus iEntryStatus;
       
   217     
       
   218     };
       
   219 
       
   220 #endif // CALENEDITORDATA_H