10#include "incidenceeditor-ng.h"
12#include <KLocalizedString>
16class EventOrTodoDesktop;
19namespace IncidenceEditorNG
21class IncidenceDateTime;
25 RecurrenceTypeNone = 0,
28 RecurrenceTypeMonthly,
30 RecurrenceTypeUnknown,
31 RecurrenceTypeException
41 IncidenceRecurrence(IncidenceDateTime *dateTime, Ui::EventOrTodoDesktop *ui);
45 [[nodiscard]]
bool isDirty()
const override;
46 [[nodiscard]]
bool isValid()
const override;
48 void focusInvalidField()
override;
50 [[nodiscard]] RecurrenceType currentRecurrenceType()
const;
53 void recurrenceChanged(IncidenceEditorNG::RecurrenceType
type);
58 void handleDateTimeToggle();
59 void handleEndAfterOccurrencesChange(
int currentValue);
60 void handleExceptionDateChange(
const QDate ¤tDate);
61 void handleFrequencyChange();
62 void handleRecurrenceTypeChange(
int currentIndex);
63 void removeExceptions();
64 void updateRemoveExceptionButton();
65 void updateWeekDays(
const QDate &newStartDate);
66 void handleStartDateChange(
const QDate &);
74 [[nodiscard]] KLocalizedString subsOrdinal(
const KLocalizedString &text,
int number)
const;
79 [[nodiscard]]
short dayOfMonthFromStart()
const;
80 [[nodiscard]]
short dayOfMonthFromEnd()
const;
81 [[nodiscard]]
short dayOfYearFromStart()
const;
82 [[nodiscard]]
int duration()
const;
85 [[nodiscard]]
short monthWeekFromStart()
const;
86 [[nodiscard]]
short monthWeekFromEnd()
const;
90 [[nodiscard]] QString numberToString(
int number)
const;
91 void selectMonthlyItem(KCalendarCore::Recurrence *recurrence, ushort recurenceType);
92 void selectYearlyItem(KCalendarCore::Recurrence *recurrence, ushort recurenceType);
94 void setDuration(
int duration);
97 void setFrequency(
int freq);
98 void toggleRecurrenceWidgets(
int enable);
100 [[nodiscard]] QBitArray weekday()
const;
106 [[nodiscard]]
int weekdayCountForMonth(
const QDate &date)
const;
108 [[nodiscard]] QDate currentDate()
const;
111 Ui::EventOrTodoDesktop *
const mUi;
113 IncidenceDateTime *
const mDateTime;
118 int mMonthlyInitialType = -1;
119 int mYearlyInitialType = -1;
KCal Incidences are complicated objects.
KCalendarCore::IncidenceBase::IncidenceType type() const
Returns the type of the Incidence that is currently loaded.
virtual void load(const KCalendarCore::Incidence::Ptr &incidence)=0
Load the values of.
QSharedPointer< IncidenceT > incidence() const
Convenience method to get a pointer for a specific const Incidence Type.
virtual void save(const KCalendarCore::Incidence::Ptr &incidence)=0
Store the current values of the editor into.
QSharedPointer< Incidence > Ptr
QList< QDateTime > DateTimeList