/*
 * ShiftSelection.h - TaskJuggler
 *
 * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * $Id: ShiftSelection.h 1259 2006-01-31 12:04:00Z cs $
 */
#ifndef _ShiftSelection_h_
#define _ShiftSelection_h_

#include <time.h>

class ShiftSelectionList;

#include "Shift.h"
#include "Interval.h"

/**
 * @short Stores shift selection related information.
 * @author Chris Schlaeger <cs@kde.org>
 */
class ShiftSelection
{
    friend class ShiftSelectionList;

public:
    ShiftSelection(const Interval& p, Shift* s) :
        period(new Interval(p)), shift(s) { }
    ShiftSelection(Interval* p, Shift* s) : period(p), shift(s) { }
    ShiftSelection(const ShiftSelection& sl);
    ~ShiftSelection()
    {
        delete period;
    }

    const Interval& getPeriod() const { return *period; }
    Shift* getShift() const { return shift; }

    bool isVacationDay(time_t day) const;

private:
    ShiftSelection() { period = 0; }

    Interval* period;
    Shift* shift;
};

#endif

