1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
/*
* TaskDependency.h - TaskJuggler
*
* Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
*
* 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: TaskDependency.h 1259 2006-01-31 12:04:00Z cs $
*/
#ifndef _TaskDependency_h_
#define _TaskDependency_h_
#include <qstring.h>
class Task;
/**
* Besides a reference to the dependent task it also stores information about
* a mininum required time gap to this task. The gap can be specified in
* calendar time (duration) or working time (length). If more than one gap
* criteria is specified all are honored.
*
* @short The class is used to store a dependency of a task.
* @see Task
* @author Chris Schlaeger <cs@kde.org>
*/
class TaskDependency
{
public:
TaskDependency(QString tri, int maxScenarios);
~TaskDependency();
const QString getTaskRefId() const { return taskRefId; }
void setTaskRef(const Task* tr) { taskRef = tr; }
const Task* getTaskRef() const { return taskRef; }
void setGapDuration(int sc, long d) { gapDuration[sc] = d; }
long getGapDuration(int sc) const;
long getGapDurationNR(int sc) const { return gapDuration[sc]; }
void setGapLength(int sc, long l) { gapLength[sc] = l; }
long getGapLength(int sc) const;
long getGapLengthNR(int sc) const { return gapLength[sc]; }
private:
TaskDependency() { } // Don't use this!
/**
* When we read in the project file, we don't know all functions yet. So
* we need to store the ID of the dependency and later resolve this to the
* pointer to the Task.
*/
QString taskRefId;
// The pointer to the dependent Task.
const Task* taskRef;
// Mininum required gap in calendar time.
long* gapDuration;
// Mininum required gap in working time.
long* gapLength;
} ;
#endif
|