﻿/*
 * Ext Scheduler v1.5 beta
 * Copyright(c) 2009-2010 Mats Bryntse Consulting
 * mats@ext-scheduler.com
 * http://www.ext-scheduler.com/license.html
 *
 */
 
Ext.ns('Sch.ViewBehaviour');

/**
 * @class Sch.ViewBehaviour.Base
 * @extends Object
 * <p>This class encapsulates functionality that is specific to this view type. It is meant as an abstract base class to be extended by an implementing class.
 * The scheduler panel delegates its view specific behaviour to this class (or any subclass).
 * </p>
 * @constructor
 * @param {Sch.SchedulerPanel} scheduler the scheduler panel
 */
Sch.ViewBehaviour.Base = function (scheduler) {
    this.grid = scheduler;
    Ext.getBody().addClass(this.cssClass);
};

Ext.apply(Sch.ViewBehaviour.Base.prototype, {
    
    /**
     * @cfg {String} cssClass a CSS class added to the body element, which allows you to style tooltips/events/resize-proxies differently in different views.      */
    cssClass : '',
    
    /**
     * @cfg {String} dateFormat format for how dates should be displayed in this view type
     */
    dateFormat : 'Y-m-d',
    
    /**
     * @cfg {Int} timeResolution The time resolution in minutes for this view type. Times displayed will be rounded to this number.
     */
    timeResolution : 60,
    
    /**
     * The destructor function called before the scheduler changes views
     */
    destroy : function() {
        Ext.getBody().removeClass(this.cssClass);
    }
});