2 * ExpressionTreeFunction.h - TaskJuggler
4 * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
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.
12 #ifndef _ExpressionTreeFunction_h_
13 #define _ExpressionTreeFunction_h_
16 #include "qstringlist.h"
18 #include <Q3ValueList>
20 #include "taskjuggler.h"
22 class ExpressionTreeFunction;
27 typedef long (ExpressionTreeFunction::*ExpressionTreeFunctionLongPtr)
28 (ExpressionTree*, Operation* const ops[]) const;
30 class ExpressionTreeFunction
33 ExpressionTreeFunction(const QString& n, ExpressionTreeFunctionLongPtr f,
38 supportedCoreAttributes()
40 ~ExpressionTreeFunction() { }
42 const QString& getName() const { return name; }
43 int getArgumentCount() const { return args; }
45 void addSupportedCoreAttributes(CAType ca)
47 supportedCoreAttributes.append(ca);
49 bool checkCoreAttributesType(ExpressionTree* et);
51 long longCall(ExpressionTree* et, Operation* const ops[]) const;
53 long hasAssignments(ExpressionTree* et, Operation* const ops[]) const;
54 long isParentOf(ExpressionTree* et, Operation* const ops[]) const;
55 long isDependencyOf(ExpressionTree* et, Operation* const ops[]) const;
56 long isDescendantOf(ExpressionTree* et, Operation* const ops[]) const;
57 long isLeaf(ExpressionTree* et, Operation* const ops[]) const;
58 long treeLevel(ExpressionTree* et, Operation* const ops[]) const;
59 long isAccount(ExpressionTree* et, Operation* const ops[]) const;
60 long isAnAccount(ExpressionTree* et, Operation* const ops[]) const;
61 long isResource(ExpressionTree* et, Operation* const ops[]) const;
62 long isAResource(ExpressionTree* et, Operation* const ops[]) const;
63 long isMilestone(ExpressionTree* et, Operation* const ops[]) const;
64 long isTask(ExpressionTree* et, Operation* const ops[]) const;
65 long isATask(ExpressionTree* et, Operation* const ops[]) const;
66 long isSubTaskOf(ExpressionTree* et, Operation* const ops[]) const;
67 long isTaskOfProject(ExpressionTree* et, Operation* const ops[])
69 long startsBefore(ExpressionTree* et, Operation* const ops[]) const;
70 long startsAfter(ExpressionTree* et, Operation* const ops[]) const;
71 long endsBefore(ExpressionTree* et, Operation* const ops[]) const;
72 long endsAfter(ExpressionTree* et, Operation* const ops[]) const;
73 long isAllocated(ExpressionTree* et, Operation* const ops[]) const;
74 long isDutyOf(ExpressionTree* et, Operation* const ops[]) const;
75 long isAllocatedToProject(ExpressionTree* et, Operation* const ops[])
77 long isOnCriticalPath(ExpressionTree* et, Operation* const ops[]) const;
79 /* Deprecated functions */
80 long isTaskStatus(ExpressionTree* et, Operation* const ops[]) const;
81 long containsTask(ExpressionTree* et, Operation* const ops[]) const;
82 long isPlanAllocated(ExpressionTree* et, Operation* const ops[])
84 long isActualAllocated(ExpressionTree* et, Operation* const ops[])
88 const CoreAttributes* findCoreAttributes(const CoreAttributes* ca,
89 const QString& id) const;
92 ExpressionTreeFunctionLongPtr longFunc;
94 Q3ValueList<CAType> supportedCoreAttributes;