OSDN Git Service

0d56ad77060cb3cdaeb719ae7241227983d825b0
[tjqt4port/tj2qt4.git] / taskjuggler / VacationList.h
1 /*
2  * ProjectFile.cpp - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002 by Chris Schlaeger <cs@suse.de>
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
13 #ifndef _VacationList_h_
14 #define _VacationList_h_
15
16 #include "time.h"
17
18 #include <qlist.h>
19 #include <qstring.h>
20
21 #include "Interval.h"
22
23 class VacationInterval : public Interval
24 {
25 public:
26         VacationInterval() { }
27
28         VacationInterval(const QString& n, time_t s, time_t e)
29                 : Interval(s, e), name(n) { }
30         virtual ~VacationInterval() { }
31
32         const QString& getName() const { return name; }
33
34 private:
35         QString name;
36 } ;
37
38 class VacationList : public QList<VacationInterval>
39 {
40 public:
41         VacationList() { setAutoDelete(TRUE); }
42         ~VacationList() {}
43
44         void add(const QString& name, time_t start, time_t end)
45         {
46                 inSort(new VacationInterval(name, start, end));
47         }
48         bool isVacation(time_t date);
49
50 protected:
51         virtual int compareItems(QCollection::Item i1, QCollection::Item i2);
52 } ;
53
54 #endif