2 * CoreAttributes.h - TaskJuggler
4 * Copyright (c) 2001, 2002 by Chris Schlaeger <cs@suse.de>
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.
13 #ifndef _CoreAttributes_h_
14 #define _CoreAttributes_h_
23 class CoreAttributesList : public QPtrList<CoreAttributes>
26 CoreAttributesList() { sorting = Pointer; }
27 virtual ~CoreAttributesList();
29 enum SortCriteria { Pointer, TreeMode, NameUp, NameDown, FullNameUp,
30 FullNameDown, IdUp, IdDown, IndexUp, IndexDown,
31 StartUp, StartDown, EndUp, EndDown,
33 ResponsibleUp, ResponsibleDown,
34 MinEffortUp, MinEffortDown,
35 MaxEffortUp, MaxEffortDown,
37 KotrusIdUp, KotrusIdDown
40 void setSorting(SortCriteria s);
44 virtual int compareItems(QCollection::Item i1, QCollection::Item i2);
52 CoreAttributes(Project* p, const QString& i, const QString& n,
53 CoreAttributes* parent_) :
54 project(p), id(i), name(n), parent(parent_) { }
55 virtual ~CoreAttributes() { }
57 virtual char* getType() { return "CoreAttributes"; }
59 const QString& getId() const { return id; }
61 void setIndex(uint idx) { index = idx; }
62 uint getIndex() const { return index; }
64 void setSequenceNo(uint no) { sequenceNo = no; }
66 Project* getProject() { return project; }
68 void setName(const QString& n) { name = n; }
69 const QString& getName() const { return name; }
70 void getFullName(QString& fullName);
72 CoreAttributes* getParent() const { return parent; }
74 void addSub(CoreAttributes* c) { sub.append(c); }
75 virtual CoreAttributesList getSubList() const { return sub; }
77 void addFlag(QString flag) { flags.addFlag(flag); }
78 void clearFlag(const QString& flag) { flags.clearFlag(flag); }
79 bool hasFlag(const QString& flag) { return flags.hasFlag(flag); }
80 FlagList getFlagList() const { return flags; }
83 /// A pointer to access information that are global to the project.
86 /// An ID that must be unique within the attribute class.
89 /// An index number that must be unique within the attribute class.
92 /// The index of the task declaration.
95 /// A short description of the attribute.
98 /// Pointer to parent. If there is no parent the pointer is 0.
99 CoreAttributes* parent;
101 /// List of child attributes.
102 CoreAttributesList sub;
104 /// List of flags set for this attribute.
107 CoreAttributes() { } // Don't use this!