OSDN Git Service

fix compile problem
[tjqt4port/tj2qt4.git] / taskjuggler / Shift.h
1 /*
2  * Shift.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
5  * by Chris Schlaeger <cs@kde.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of version 2 of the GNU General Public License as
9  * published by the Free Software Foundation.
10  *
11  * $Id$
12  */
13 #ifndef _Shift_h_
14 #define _Shift_h_
15
16 #include <time.h>
17
18 #include <q3ptrlist.h>
19
20 #include "CoreAttributes.h"
21
22 class Interval;
23 class ShiftListIterator;
24
25 /**
26  * @short Stores all shift related information.
27  * @author Chris Schlaeger <cs@kde.org>
28  */
29 class Shift : public CoreAttributes
30 {
31 public:
32     Shift(Project* prj, const QString& i, const QString& n, Shift* p,
33           const QString& df = QString::null, uint dl = 0);
34     virtual ~Shift();
35
36     virtual CAType getType() const { return CA_Shift; }
37
38     Shift* getParent() const { return static_cast<Shift*>(parent); }
39
40     ShiftListIterator getSubListIterator() const;
41
42     void inheritValues();
43
44     void setWorkingHours(int day, const Q3PtrList<Interval>& l);
45
46     Q3PtrList<Interval>* getWorkingHours(int day) const
47     {
48         return workingHours[day];
49     }
50     const Q3PtrList<Interval>* const * getWorkingHours() const
51     {
52         return workingHours;
53     }
54
55     bool isOnShift(const Interval& iv) const;
56
57     bool isVacationDay(time_t day) const;
58
59 private:
60     Q3PtrList<Interval>* workingHours[7];
61 };
62
63 #endif
64