package com.smartgwt.client.widgets.calendar;

import java.util.Date;

/**
 * Called to determine the hover HTML shown when the user hovers over an overflow chip in a
 * day or week view.
 */
public abstract class EventOverflowHoverHTMLCustomizer {

    private Calendar calendar;

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

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

    /**
     * getEventOverflowHoverHTML() should be implemented and return the string of HTML to
     * display when hovering over an overflow chip.
     * @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 HTML to display in the hover
     */
    public abstract String getEventOverflowHoverHTML(CalendarEvent[] events,
                                                     Date startDate, Date endDate,
                                                     CalendarView calendarView);
}
