package com.smartgwt.client.widgets.calendar;

import java.util.Date;

/**
 * Called to determine the title for the overflow dialog shown when an overflow chip is
 * clicked in a day or week view.
 */
public abstract class EventOverflowDialogTitleCustomizer {

    private Calendar calendar;

    public void setCalendar(Calendar calendar) {
        this.calendar = calendar;
    }

    /**
     * Returns the Calendar that contains the overflow dialog.
     * @return the Calendar instance
     */
    public Calendar getCalendar() {
        return this.calendar;
    }

    /**
     * getEventOverflowDialogTitle() should be implemented and return the title string for
     * the overflow dialog.
     * @param events the hidden events in the overflow region
     * @param startDate start of the overflow region
     * @param endDate end of the overflow region
     * @param calendarView the view containing the overflow
     * @return title string for the dialog
     */
    public abstract String getEventOverflowDialogTitle(CalendarEvent[] events,
                                                       Date startDate, Date endDate,
                                                       CalendarView calendarView);
}
