OSDN Git Service

Automatically align underspecified tasks boundaries on project boundaries when possible.
[tjqt4port/tj2qt4.git] / taskjuggler / TaskList.h
1 /*
2  * TaskList.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 _TaskList_h_
13 #define _TaskList_h_
14
15 #include "CoreAttributesList.h"
16
17 class QString;
18 class Task;
19
20 /**
21  * @short The class stores a list of tasks.
22  * @see Task
23  * @author Chris Schlaeger <cs@kde.org>
24  */
25 class TaskList : public virtual CoreAttributesList
26 {
27 public:
28     TaskList() :
29         CoreAttributesList(),
30         sortScenario(0)
31     {
32         sorting[0] = CoreAttributesList::TreeMode;
33         sorting[1] = CoreAttributesList::StartUp;
34         sorting[2] = CoreAttributesList::EndUp;
35     }
36
37     TaskList(const TaskList& tl) :
38         CoreAttributesList(tl),
39         sortScenario(tl.sortScenario)
40     { }
41
42     virtual ~TaskList() { }
43
44     Task* getTask(const QString& id) const;
45
46     static bool isSupportedSortingCriteria(int sc);
47
48     virtual int compareItemsLevel(CoreAttributes* c1, CoreAttributes* c2,
49                                   int level);
50
51     void setSortScenario(int sc) { sortScenario = sc; }
52
53 protected:
54     int sortScenario;
55 } ;
56
57 /**
58  * @short Iterator class for TaskList objects.
59  * @see TaskList
60  * @author Chris Schlaeger <cs@kde.org>
61  */
62 class TaskListIterator : public virtual CoreAttributesListIterator
63 {
64 public:
65     TaskListIterator(const CoreAttributesList& l) :
66         CoreAttributesListIterator(l) { }
67     virtual ~TaskListIterator() { }
68     Task* operator*() { return static_cast<Task*>(get()); }
69 } ;
70
71 #endif
72