diff -r f5050f1da672 -r 04becd199f91 javaextensions/pim/agnadapter/inc.s60/pimrepeatruleconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/agnadapter/inc.s60/pimrepeatruleconverter.h Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: PIM item repeat rule converter. + * +*/ + + +#ifndef PIMREPEATRULECONVERTER_H +#define PIMREPEATRULECONVERTER_H + +// INCLUDES +#include +#include +#include "mpimrepeatruledata.h" + +/** + * Event RepeatRuleConverter implementation. The class converts repeat rule + * between PIM framework and Agenda model. + */ +NONSHARABLE_CLASS(PIMRepeatRuleConverter) +{ +public: + + static CArrayFixFlat< TPIMDate>* DatesL( + const MPIMRepeatRuleData& aRepeatRuleData, + const TPIMDate& aStartDate, + const TPIMDate& aSubsetBeginning, + const TPIMDate& aSubsetEnding, + CArrayFixFlat< TPIMDate>& aExceptionDates, + const TPIMDate& aRepeatRuleEndDate, + const TPIMField& aRepeatRuleCount); + + static TBool IsValidAgendaDate(const TPIMDate& aDate); + + static TCalRRule ConvertSupportedRepeatToAgnL( + const MPIMRepeatRuleData& aSrcPimRRule, TPIMDate aStartDate); + + static void ConvertSupportedRepeatToPIML(MPIMRepeatRuleData& aDstPimRRule, + TCalRRule& aSrcAgnRRule); + + static TBool IsRepeatFieldPresentL(TPIMField aRepeatRuleField, + const MPIMRepeatRuleData& aRepeat); + + static TBool IsRepeatFieldPresentL(TPIMField aRepeatRuleField, + const CArrayFix& aRepeatFields); + +private: + + static TBool AddRepeatDateL( + const CArrayFix< TPIMField>& aFields, + TTime aDate, + TTime aSubsetBeginning, + TTime aSubsetEnding, + const TTime& aRepeatRuleEndDate, + const TInt aRepeatRuleCount, + CArrayFixFlat< TPIMDate>** aRepeatDates, + TInt* aCountIndex); + + static TBool CheckDaysInWeekL(const CArrayFix& aFields, + TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, + TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, + const TInt aRepeatRuleDayInWeek, + CArrayFixFlat** aRepeatDates, TInt* aCount); + + static TBool CheckDaysInWeekNoMonthChangeL( + const CArrayFix& aFields, TTime aDate, + TTime aSubsetBeginning, TTime aSubsetEnding, + TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, + const TInt aRepeatRuleDayInWeek, + CArrayFixFlat** aRepeatDates, TInt* aCount); + + static TBool CheckWeeksInMonthL(const CArrayFix& aFields, + TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, + TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, + const TInt aRepeatRuleWeekInMonth, const TInt aRepeatRuleDayInWeek, + CArrayFixFlat** aRepeatDates, TInt* aCount); + + static TBool CheckMonthsInYearL(const CArrayFix& aFields, + TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, + TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, + TInt aRepeatRuleWeekInMonth, TInt aRepeatRuleDayInWeek, + TInt aRepeatRuleMonthInYear, TInt aRepeatRuleDayInMonth, + CArrayFixFlat** aRepeatDates, TInt* aCount); + + static TBool CheckMonthL(const CArrayFix& aFields, TTime aDate, + TTime aSubsetBeginning, TTime aSubsetEnding, + TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, + TInt aRepeatRuleWeekInMonth, TInt aRepeatRuleDayInWeek, + TInt aRepeatRuleDayInMonth, CArrayFixFlat** aRepeatDates, + TInt* aCount); + + static void AddCommonRulesToAgnL(const MPIMRepeatRuleData& aSrcPimRRule, + const TTime& aSrcStartDate, TCalRRule& aDstAgnRRule); + +private: // Hidden constructor + + PIMRepeatRuleConverter() + {} + +}; + +#endif // PIMREPEATRULECONVERTER_H +// End of File