/*
 * ShiftSelectionList.h - TaskJuggler
 *
 * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@suse.de>
 *
 * 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: ShiftSelectionList.h 654 2004-03-13 14:57:34Z cs $
 */
#ifndef _ShiftSelectionList_h_
#define _ShiftSelectionList_h_

#include <time.h>

#include <qptrlist.h>

#include "ShiftSelection.h"

class Interval;

/**
 * @short Holds a list of shift selections.
 * @author Chris Schlaeger <cs@suse.de>
 */
class ShiftSelectionList : public QPtrList<ShiftSelection>
{
public:
    ShiftSelectionList() { }
    virtual ~ShiftSelectionList() { } 

    bool insert(ShiftSelection* s);

    bool isOnShift(const Interval& iv) const;

    bool isVacationDay(time_t day) const;

private:
    friend class ShiftSelection;
    virtual int compareItems(QCollection::Item i1, QCollection::Item i2);
};

/**
 * @short Iterator for ShiftSelectionList objects.
 * @author Chris Schlaeger <cs@suse.de>
 */
class ShiftSelectionListIterator : public QPtrListIterator<ShiftSelection>
{
public:
    ShiftSelectionListIterator(const ShiftSelectionList& s) :
        QPtrListIterator<ShiftSelection>(s) { }
    virtual ~ShiftSelectionListIterator() { }
} ;

#endif

