examples/ForumNokia/CalendarExample/inc/CalendarHelperEntry.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 
00006 #ifndef __CALHELPERENTRY_H__
00007 #define __CALHELPERENTRY_H__
00008 
00009 // CLASS DECLARATION
00010 
00011 #include "CalendarAPIexample.hrh"
00012 #include <e32base.h>
00013 
00014 class CCalEntry;
00015 class CCalInstance;
00016 class CCalAlarm;
00017 
00022 class CCalHelperEntry : public CBase
00023     {
00024 public: // Constructors and destructor
00028     static CCalHelperEntry* NewL(CCalEntry* aAnniv);
00029     static CCalHelperEntry* NewLC(CCalEntry* aAnniv);
00030 
00031     static CCalHelperEntry* NewL(CCalInstance* aAnniv);
00032     static CCalHelperEntry* NewLC(CCalInstance* aAnniv);
00033 
00037     ~CCalHelperEntry();
00038 
00039 public:
00040 
00047     CCalEntry* NewAnnivLC();
00048 
00058     void SaveValuesL();
00059 
00075     TBool SetValues(   const TDesC& aName,
00076                         const TDateTime& aDate,
00077                         const TBool& aAlarm,
00078                         const TDateTime& aAlarmTime,
00079                         const TInt& aSynchronizationMethod);
00080 
00081     // Getters
00082     TBuf<KMaxNameLength> Name() const;
00083     TDateTime Date() const;
00084     TBool Alarm() const;
00085     TDateTime AlarmTime() const;
00086     TInt SynchronizationMethod() const;
00087     CCalEntry* Anniv();
00088     TBool Modified() const;
00089     TBool DateHasChanged() const;
00090 
00091 private:
00095     CCalHelperEntry();
00096     void ConstructL(CCalEntry* aAnniv);
00097     void ConstructL(CCalInstance* aAnniv);
00098 
00104     CCalEntry* CreateAnnivL();
00105 
00112     void ResetTimeL(TDateTime& aDate) const;
00113 
00123     void GetDaysAndMinutesL(const TDateTime& aTime,
00124                                     const TDateTime& aFromTime,
00125                                     TTimeIntervalDays& aDays,
00126                                     TTimeIntervalMinutes& aMinutes) const;
00127 
00128 
00135     void SetName(const TDesC& aName);
00136     void SetDate(const TDateTime& aDate);
00137     void SetAlarm(const TBool& aAlarm);
00138     void SetSynchronizationMethod(const TInt& aSynchronizationMethod);
00139 
00140     void SaveValuesToAnnivL(CCalEntry* aAnniv);
00141 
00142 
00143 private: // data members
00144 
00145     TBuf<KMaxNameLength> iName;
00146     TDateTime iDate;
00147     CCalAlarm* iAlarmPtr;
00148     TBool iAlarm;
00149     TDateTime iAlarmTime;
00150     TInt iSynchronizationMethod;
00151     TTimeIntervalDays iAlarmDays;
00152     TTimeIntervalMinutes iAlarmMinutes;
00153     TBool iModified;
00154     TBool iDateModified;
00155 
00156     CCalEntry* iAnniv;
00157     CCalInstance* iInstance;
00158     };
00159 #endif //__CALHELPERENTRY_H__

Generated by  doxygen 1.6.2