OSDN Git Service

Automatically align underspecified tasks boundaries on project boundaries when possible.
[tjqt4port/tj2qt4.git] / taskjuggler / ShiftSelection.h
1 /*
2  * ShiftSelection.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * $Id$
11  */
12 #ifndef _ShiftSelection_h_
13 #define _ShiftSelection_h_
14
15 #include "Shift.h"
16 #include "Interval.h"
17
18 class ShiftSelectionList;
19
20 /**
21  * @short Stores shift selection related information.
22  * @author Chris Schlaeger <cs@kde.org>
23  */
24 class ShiftSelection
25 {
26     friend class ShiftSelectionList;
27
28 public:
29     ShiftSelection(const Interval& p, Shift* s) :
30         period(new Interval(p)),
31         shift(s)
32     { }
33
34     ShiftSelection(Interval* p, Shift* s) :
35         period(p),
36         shift(s)
37     { }
38
39     ShiftSelection(const ShiftSelection& sl);
40
41     ~ShiftSelection()
42     {
43         delete period;
44     }
45
46     const Interval& getPeriod() const { return *period; }
47     Shift* getShift() const { return shift; }
48
49     bool isVacationDay(time_t day) const;
50
51 private:
52     Interval* period;
53     Shift* shift;
54 };
55
56 #endif
57