OSDN Git Service

Automatically align underspecified tasks boundaries on project boundaries when possible.
[tjqt4port/tj2qt4.git] / taskjuggler / Project.h
1 /*
2  * Project.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
5  * by Chris Schlaeger <cs@kde.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of version 2 of the GNU General Public License as
9  * published by the Free Software Foundation.
10  *
11  * $Id$
12  */
13
14 #ifndef _Project_h_
15 #define _Project_h_
16
17 #include <qobject.h>
18 #include "config.h"
19 #include "VacationList.h"
20 #include "ScenarioList.h"
21 #include "TaskList.h"
22 #include "ShiftList.h"
23 #include "ResourceList.h"
24 #include "AccountList.h"
25 #include "QtReport.h"
26 #include "Journal.h"
27
28 class QStringList;
29 class QDomElement;
30
31 class ReportXML;
32 class Report;
33 class CustomAttributeDefinition;
34 class VacationInterval;
35 class UsageLimits;
36
37 /**
38  * The Project class is the root of the data tree of the application.
39  * Applications can use multiple Project objects. This is e. g. needed when
40  * the application needs to preserve the state prior to a scheduler run. The
41  * scheduler calculates the data in place, adding the calculated values to the
42  * existing data structures. Since the original data cannot be identified
43  * anymore the applications needs to make a copy of the project before calling
44  * the scheduler. For that purpose Project and all related sub-classes provide
45  * a copy constructor.
46  *
47  * @short The root class of all project related information.
48  * @author Chris Schlaeger <cs@kde.org>
49  */
50 class Project : public QObject
51 {
52     Q_OBJECT
53 public:
54     Project();
55     ~Project();
56
57     void addSourceFile(const QString& f);
58     QStringList getSourceFiles() const;
59     // Called to emit a signal with the currently processed file.
60     void setProgressInfo(const QString& i);
61     // Called to emit a signal with the current process of the scheduler.
62     void setProgressBar(int i, int of);
63     /**
64      * Projects have at least one ID, but can have multiple IDs. This usually
65      * happens when projects are composed of serveral sub-projects. Each sub
66      * projects brings its own unique ID. Each ID must be registered with the
67      * project by calling addId(). The most recently added ID is also the
68      * current ID. All subsequently added tasks are associtated with this
69      * project ID. So, you have to add at least one ID before you add any
70      * tasks.
71      */
72     bool addId(const QString& i, bool changeCurrentId = true);
73
74     /**
75      * Returns the first (default) ID of the project.
76      */
77     QString getId() const
78     {
79         return projectIDs.isEmpty() ? QString::null : projectIDs.first();
80     }
81     /**
82      * Returns the current project ID. If the project ID list is empty
83      * QString::null is returned.
84      */
85     QString getCurrentId() const
86     {
87         return currentId;
88     }
89     /**
90      * Returns a list of all registered project IDs.
91      */
92     QStringList getProjectIdList() const { return projectIDs; }
93     /**
94      * Returns true if the passed ID is a registered project ID.
95      */
96     bool isValidId(const QString& i) const
97     {
98         return projectIDs.findIndex(i) != -1;
99     }
100     /**
101      * Returns a string ID of the index of the passed ID in the project ID.
102      * The first ID in the list is returned as "A", the second as "B". The
103      * 27th is "AA" and so on.
104      */
105     QString getIdIndex(const QString& i) const;
106
107     /**
108      * Returns the number of supported scenarios.
109      */
110     int getMaxScenarios() const { return scenarioList.count(); }
111     /**
112      * Returns a pointer to the scenario.
113      * @param sc Index of the scenario in the project scenario list.
114      */
115     Scenario* getScenario(int sc) const;
116     /**
117      * Returns a pointer to the scenario with index sc.
118      * @param sc Index of the scenario in the project scenario list.
119      */
120     const QString& getScenarioId(int sc) const;
121     /**
122      * Returns the name of a scenario.
123      * @param sc Index of the scenario in the project scenario list.
124      */
125     const QString& getScenarioName(int sc) const;
126     /**
127      * Returns the index of the scenario. The index of the first item in the
128      * list is 1, not 0! If the scenario is unknown -1 is returned.
129      * @param id the ID of the scenario.
130      */
131     int getScenarioIndex(const QString& id) const;
132     /**
133      * Returns an interator for the list of defined scenarios.
134      */
135     ScenarioListIterator getScenarioIterator() const
136     {
137         return ScenarioListIterator(scenarioList);
138     }
139
140     /**
141      * Set the name of the project. The project name is mainly used for the
142      * reports.
143      */
144     void setName(const QString& n) { name = n; }
145     /**
146      * Returns the name of the project.
147      */
148     const QString& getName() const { return name; }
149
150     /**
151      * Set the version number of the project. This version is mainly used for
152      * reports.
153      */
154     void setVersion(const QString& v) { version = v; }
155     /**
156      * Returns the version number of the project.
157      */
158     const QString& getVersion() const { return version; }
159
160     /**
161      * Set the copyright information. This is a default text used for all
162      * reports.
163      */
164     void setCopyright(const QString& c) { copyright = c; }
165     /**
166      * Returns the copyright information of the project.
167      */
168     const QString& getCopyright() const { return copyright; }
169
170     /**
171      * Set the customer information for this project.
172      */
173     void setCustomer(const QString& c) { customer = c; }
174     /**
175      * Returns the customer information of the project.
176      */
177     const QString& getCustomer() const { return customer; }
178
179     /**
180      * Set the default priority for all top-level tasks. Normally this value
181      * is 500.
182      */
183     void setPriority(int p) { priority = p; }
184     /**
185      * Returns the default priority for all top-level tasks.
186      */
187     int getPriority() const { return priority; }
188
189     /**
190      * Set the start time of the project.
191      */
192     void setStart(time_t s) { start = s; }
193     /**
194      * Get the start time of the project.
195      */
196     time_t getStart() const { return start; }
197
198     /**
199      * Set the end time of the project. The specified second is still
200      * considered as within the project time frame.
201      */
202     void setEnd(time_t e) { end = e; }
203     /**
204      * Get the end time of the project.
205      */
206     time_t getEnd() const { return end; }
207
208     /**
209      * Set the date that TaskJuggler uses as current date for all
210      * computations. This mainly affects status reporting and the computation
211      * of the completion degree of tasks. */
212     void setNow(time_t n);
213     /**
214      * Get the date that TaskJuggler uses as current date.
215      */
216     time_t getNow() const { return now; }
217
218     /**
219      * Specifies whether TaskJuggler uses Sunday or Monday as first day of the
220      * week. Besides the calendar views this mainly affects the numbering of
221      * weeks. ISO 8601:1988 requires the week to start on Monday as most
222      * European countries use, but other Countries like the US use Sunday as
223      * first day of the week.
224      */
225     void setWeekStartsMonday(bool wsm) { weekStartsMonday = wsm; }
226     /**
227      * Get the setting for the first day of the week.
228      * @return true of weeks should start on Monday.
229      */
230     bool getWeekStartsMonday() const { return weekStartsMonday; }
231     /**
232      * Decides if containers which subtasks are all hidden should be
233      * drawn as normal tasks or not.
234      */
235     void setDrawEmptyContainersAsTasks(bool decat)
236     {
237         drawEmptyContainerAsTasks = decat;
238     }
239     /**
240      * @return true if containers which subtasks are all hidden should be
241      * drawn as normal tasks
242      */
243     bool getDrawEmptyContainersAsTasks() const
244     {
245          return drawEmptyContainerAsTasks;
246     }
247     /**
248      * Set the working hours of the specified weekday.
249      * @param day The day of the week. Independently of the weekStartsMonday
250      * setting TaskJuggler uses 0 for Sunday, 1 for Monday and so on.
251      * @param l The list of working intervals. The interval use seconds since
252      * midnight. As with all TaskJuggler intervals, the specified end value is
253      * not part of the interval. The interval ends one seconds earlier.
254      */
255     void setWorkingHours(int day, const QPtrList<Interval>& l);
256     /**
257      * Returns a constant list of working intervals for all week days.
258      */
259     const QPtrList<Interval>* const * getWorkingHours() const
260     {
261         return workingHours;
262     }
263     /**
264      * Returns the list of working intervals for the specified weekday.
265      * @param day Day of the week. 0 for Sunday, 1 for Monday and so on.
266      */
267     QPtrList<Interval>* getWorkingHours(int day) const
268     {
269         if (day < 0 || day > 6)
270             qFatal("day out of range");
271         return workingHours[day];
272     }
273     /**
274      * Returns an interator for the list of working intervals for the
275      * specified weekday.
276      * @param day Day of the week. 0 for Sunday, 1 for Monday and so on.
277      */
278     QPtrListIterator<Interval> getWorkingHoursIterator(int day) const
279     {
280         return QPtrListIterator<Interval>(*workingHours[day]);
281     }
282     /**
283      * If there is a working interval defined for this weekday and the
284      * day is not registered as a vacation day then it is a workday.
285      */
286     bool isWorkingDay(time_t d) const;
287
288     /**
289      * If date is contained in a vacation day or the date is outside
290      * of the defined working hours, false is returned. Otherwise true.
291      */
292     bool isWorkingTime(time_t d) const;
293
294     /**
295      * If the interval overlaps with a vacation day or the interval is outside
296      * of the defined working hours, false is returned. Otherwise true.
297      */
298     bool isWorkingTime(const Interval& iv) const;
299
300     /**
301      * Returns the number of working days that overlap with the specified
302      * interval.
303      */
304     int calcWorkingDays(const Interval& iv) const;
305
306     /**
307      * The daily working hours value is used to convert working hours into
308      * working days. It should be an avarage value of the specified
309      * workingHours for each week day. With this function you can set the
310      * value for the project.
311      */
312     void setDailyWorkingHours(double h) { dailyWorkingHours = h; }
313     /**
314      * Returns the specified daily working hours.
315      */
316     double getDailyWorkingHours() const { return dailyWorkingHours; }
317
318     /**
319      * The weekly working days value is used to convert working days into
320      * working weeks. It should match the number of working days specified
321      * with the workingHours. The value is derived from the yearlyWorkingDays
322      * setting. This function returns the value.
323      */
324     double getWeeklyWorkingDays() const
325     {
326         return yearlyWorkingDays / 52.1429;
327     }
328
329     /**
330      * The monthly working days value is used to convert working days into
331      * working month. It should reflect the workingHours settings and the
332      * vacation settings. The value is derived from the yearlyWorkingDays
333      * setting. This function returns the value.
334      */
335     double getMonthlyWorkingDays() const
336     {
337         return yearlyWorkingDays / 12;
338     }
339
340     /**
341      * The yearly working days value is used to convert working days into
342      * working years. The value should reflect the workingHours settings and
343      * the vacation settings. This function sets the value which also affects
344      * the monthly working days and the weekly working days.
345      */
346     void setYearlyWorkingDays(double wd) { yearlyWorkingDays = wd; }
347     /**
348      * Returns the specified number of working days per year.
349      */
350     double getYearlyWorkingDays() const { return yearlyWorkingDays; }
351
352     void setScheduleGranularity(ulong s) { scheduleGranularity = s; }
353     ulong getScheduleGranularity() const { return scheduleGranularity; }
354
355     void setAllowRedefinitions(bool ar) { allowRedefinitions = ar; }
356     bool getAllowRedefinitions() const { return allowRedefinitions; }
357
358     /**
359      * Add a vacation interval to the vacation list. These global vacations
360      * are meant for events like Christmas, Eastern or corporate hollidays.
361      * A day that overlaps any of the intervals in the list is considered to
362      * not be a working day. Vacation intervals may not overlap.
363      * @param n Name of the vacation.
364      * @param i The time interval the vacation lasts.
365      */
366     void addVacation(const QString& n, const Interval& i)
367     {
368         vacationList.add(n, i);
369     }
370     void addVacation(VacationInterval* vi)
371     {
372         vacationList.add(vi);
373     }
374     /**
375      * Returns true if the passed moment falls within any of the vacation
376      * intervals.
377      */
378     bool isVacation(time_t vd) const { return vacationList.isVacation(vd); }
379
380     /**
381      * Returns the name of the first vacation that the given date falls into.
382      * If no vacation is found QString::Null is returned.
383      */
384     const QString& vacationName(time_t vd) const
385     {
386         return vacationList.vacationName(vd);
387     }
388
389     /**
390      * Returns an iterator for the vacation list.
391      */
392     VacationList::Iterator getVacationListIterator() const
393     {
394         return VacationList::Iterator(vacationList);
395     }
396
397     /**
398      * This function is for library internal use only. Creating a Scenario
399      * object with the project as parameter will automatically add it to the
400      * scenario list of the project.
401      */
402     void addScenario(Scenario* r);
403     /**
404      * This function is for library internal use only. Deleting a Scenario
405      * will automatically delete it from the respective list of the
406      * project.
407      */
408     void deleteScenario(Scenario* s);
409
410     /**
411      * This function is for library internal use only. Creating a Task object
412      * with the project as parameter will automatically add it to the Task
413      * list of the project.
414      */
415     void addTask(Task* t);
416     /**
417      * This function is for library internal use only. Deleting a Task
418      * will automatically delete it from the respective list of the
419      * project.
420      */
421     void deleteTask(Task* t);
422     /**
423      * Returns a pointer to the Task with the specified ID. The ID must be an
424      * absolute ID of the form "foo.bar". If no Task with the ID exists 0 is
425      * returned.
426      */
427     Task* getTask(const QString& id) const
428     {
429         return taskList.getTask(id);
430     }
431     /**
432      * Returns the number of tasks of the project.
433      */
434     uint taskCount() const { return taskList.count(); }
435     /**
436      * Returns a copy of the Task list of the project.
437      */
438     TaskList getTaskList() const { return taskList; }
439     /**
440      * Returns an iterator that can be used to traverse the Task list. The
441      * Task list is a flat list of all tasks.
442      */
443     TaskListIterator getTaskListIterator() const
444     {
445         return TaskListIterator(taskList);
446     }
447     /**
448      * This function adds a new, user-defined attribute to the Task
449      * attributes. The @param id must be unique within the Task attributes
450      * namespace. @param cad is a pointer to the CustomAttributeDefinition
451      * object.
452      */
453     bool addTaskAttribute(const QString& id, CustomAttributeDefinition* cad);
454     /**
455      * Returns a pointer to the custom attribute object identified by @param id.
456      * If no attributes with the id exists, 0 is returned.
457      */
458     const CustomAttributeDefinition* getTaskAttribute(const QString& id) const;
459     /**
460      * Returns a read-only pointer to the dictionary that holds the pointers
461      * to user-defined attributes of Tasks.
462      */
463     const QDict<CustomAttributeDefinition>&
464         getTaskAttributeDict() const
465     {
466         return taskAttributes;
467     }
468
469     /**
470      * This function is for library internal use only. Creating a Resource
471      * object with the project as parameter will automatically add it to the
472      * resource list of the project.
473      */
474     void addResource(Resource* r);
475     /**
476      * This function is for library internal use only. Deleting a Resource
477      * will automatically delete it from the respective list of the
478      * project.
479      */
480     void deleteResource(Resource* r);
481     /**
482      * Returns a pointer to the Resource with the specified ID. The ID must
483      * not be an absolute ID since the Resource list has a flat namespace. If
484      * no Resource with the ID exists 0 is returned.
485      */
486     Resource* getResource(const QString& id) const
487     {
488         return resourceList.getResource(id);
489     }
490     /**
491      * Returns the number of resources in the Resource list.
492      */
493     uint resourceCount() const { return resourceList.count(); }
494     /**
495      * Returns a copy of the Resource list.
496      */
497     ResourceList getResourceList() const { return resourceList; }
498     /**
499      * Returns an iterator that can be used to traverse the Resource list. The
500      * Resource list is a flat list of all resources.
501      */
502     ResourceListIterator getResourceListIterator() const
503     {
504         return ResourceListIterator(resourceList);
505     }
506     /**
507      * This function adds a new, user-defined attribute to the Resource
508      * attributes. The @param id must be unique within the Resource attributes
509      * namespace. @param cad is a pointer to the CustomAttributeDefinition
510      * object.
511      */
512     bool addResourceAttribute(const QString& name,
513                               CustomAttributeDefinition* cad);
514     /**
515      * Returns a pointer to the custom attribute object identified by @param id.
516      * If no attributes with the id exists, 0 is returned.
517      */
518     const CustomAttributeDefinition* getResourceAttribute(const QString& id)
519         const;
520     /**
521      * Returns a read-only pointer to the dictionary that holds the pointers
522      * to user-defined attributes of Resources.
523      */
524     const QDict<CustomAttributeDefinition>&
525         getResourceAttributeDict() const
526     {
527         return resourceAttributes;
528     }
529
530     /**
531      * This function is for library internal use only. Creating an Account
532      * object with the project as parameter will automatically add it to the
533      * Account list of the project.
534      */
535     void addAccount(Account* a);
536     /**
537      * This function is for library internal use only. Deleting a Account
538      * will automatically delete it from the respective list of the
539      * project.
540      */
541     void deleteAccount(Account* a);
542     /**
543      * Returns a pointer to the Account with the specified ID. The ID may
544      * not be an absolute ID since the account list has a flat namespace. If
545      * no Account with the ID exists 0 is returned.
546      */
547     Account* getAccount(const QString& id) const
548     {
549         return accountList.getAccount(id);
550     }
551     /**
552      * Returns the number of accounts in the Account list.
553      */
554     uint accountCount() const { return accountList.count(); }
555     /**
556      * Returns a copy of the Account list.
557      */
558     AccountList getAccountList() const { return accountList; }
559     /**
560      * Returns an iterator that can be used to traverse the Account list. The
561      * Account list is a flat list of all accounts.
562      */
563     AccountListIterator getAccountListIterator() const
564     {
565         return AccountListIterator(accountList);
566     }
567     /**
568      * This function adds a new, user-defined attribute to the Account
569      * attributes. The @param id must be unique within the Account attributes
570      * namespace. @param cad is a pointer to the CustomAttributeDefinition
571      * object.
572      */
573     bool addAccountAttribute(const QString& name,
574                               CustomAttributeDefinition* cad);
575     /**
576      * Returns a pointer to the custom attribute object identified by @param id.
577      * If no attributes with the id exists, 0 is returned.
578      */
579     const CustomAttributeDefinition* getAccountAttribute(const QString& id)
580         const;
581     /**
582      * Returns a read-only pointer to the dictionary that holds the pointers
583      * to user-defined attributes of Accounts.
584      */
585     const QDict<CustomAttributeDefinition>&
586         getAccountAttributeDict() const
587     {
588         return accountAttributes;
589     }
590
591     /**
592      * This function is for library internal use only. Creating a Shift
593      * object with the project as parameter will automatically add it to the
594      * Shift list of the project.
595      */
596     void addShift(Shift* s);
597     /**
598      * This function is for library internal use only. Deleting a Shift
599      * will automatically delete it from the respective list of the
600      * project.
601      */
602     void deleteShift(Shift* s);
603     /**
604      * Returns a pointer to the Shift with the specified ID. The ID may
605      * not be an absolute ID since the Shift list has a flat namespace. If
606      * no Shift with the ID exists 0 is returned.
607      */
608     Shift* getShift(const QString& id) const
609     {
610         return shiftList.getShift(id);
611     }
612     /**
613      * Returns the number of shifts in the shift list.
614      */
615     uint shiftCount() const { return shiftList.count(); }
616     /**
617      * Returns a copy of the Shift list.
618      */
619     ShiftList getShiftList() const { return shiftList; }
620     /**
621      * Returns an iterator that can be used to traverse the Shift list. The
622      * Shift list is a flat list of all accounts.
623      */
624     ShiftListIterator getShiftListIterator() const
625     {
626         return ShiftListIterator(shiftList);
627     }
628
629     /**
630      * Set the minimum daily effort for resources. This value is not used for
631      * resource allocation. It is currently not used at all. In future
632      * versions TaskJuggler might spit out warnings for all resources that are
633      * not loaded to at least this value each day. The value is inherited by
634      * all resources that are created subsequent to this function call.
635      */
636     void setMinEffort(double m) { minEffort = m; }
637     /**
638      * Returns the default minimum effort value.
639      */
640     double getMinEffort() const { return minEffort; }
641
642     /**
643      * Set the maximum efforts for resources. This is the default value
644      * inherited by all resources created subsequent to this function call.  A
645      * resource is never loaded more each day, week, month etc. than the
646      * maximum effort value specified for the resource.
647      */
648     void setResourceLimits(UsageLimits* l);
649
650     /**
651      * Returns the default effort limits for resources.
652      */
653     const UsageLimits* getResourceLimits() const { return resourceLimits; }
654
655     /**
656      * Set the default daily cost rate for resources. This value is inherited
657      * by all resources created subsequent to this function call.
658      */
659     void setRate(double r) { rate = r; }
660     /**
661      * Return the default daily cost rate for resources.
662      */
663     double getRate() const { return rate; }
664
665     /**
666      * Set the currency unit for the project.
667      */
668     void setCurrency(const QString& s) { currency = s; }
669     /**
670      * Returns the currency unit setting.
671      */
672     const QString& getCurrency() const { return currency; }
673
674     /**
675      * Sets the number of decimal digits used for all currency values of the
676      * project.
677      */
678     void setCurrencyDigits(uint cd) { currencyFormat.setFracDigits(cd); }
679
680     /**
681      * Sets the default number format for load and other values.
682      */
683     void setNumberFormat(const RealFormat& rf) { numberFormat = rf; }
684     /**
685      * Returns the current default number format.
686      */
687     const RealFormat& getNumberFormat() const { return numberFormat; }
688
689     /**
690      * Sets the default currency format.
691      */
692     void setCurrencyFormat(const RealFormat& rf) { currencyFormat = rf; }
693     /**
694      * Returns the default currency format.
695      */
696     const RealFormat& getCurrencyFormat() const { return currencyFormat; }
697
698     /**
699      * Set the default time zone for the project.
700      */
701     bool setTimeZone(const QString& tz);
702     /**
703      * Returns the default time zone of the project;
704      */
705     const QString& getTimeZone() const { return timeZone; }
706
707     /**
708      * Sets the format used for timestamps in reports. It will be used as
709      * default for all subsequent report definitions. See the TaskJuggler
710      * manual for the format details.
711      */
712     void setShortTimeFormat(const QString& tf) { shortTimeFormat = tf; }
713     /**
714      * Returns the format for timestamps in reports.
715      */
716     const QString& getShortTimeFormat() const { return shortTimeFormat; }
717
718     /**
719      * Sets the format used for date stamps in reports. It will be used as
720      * default for all subsequent report definitions. See the TaskJuggler
721      * manual for the format details.
722      */
723     void setTimeFormat(const QString& tf) { timeFormat = tf; }
724     /**
725      * Returns the format for date stamps in reports.
726      */
727     const QString& getTimeFormat() const { return timeFormat; }
728
729     void addXMLReport(ReportXML *r ) { xmlreport = r; }
730
731     void addReport(Report* r)
732     {
733         reports.append(r);
734     }
735     Report* getReport(uint idx) const;
736     QPtrListIterator<Report> getReportListIterator() const;
737
738     void addAllowedFlag(QString flag)
739     {
740         if (!isAllowedFlag(flag))
741             allowedFlags.append(flag);
742     }
743     bool isAllowedFlag(const QString& flag) const
744     {
745         return allowedFlags.contains(flag) > 0;
746     }
747
748     const QStringList getAllowedFlags() const
749     {
750         return allowedFlags;
751     }
752
753     /**
754      * Converts working seconds to working days.
755      */
756     double convertToDailyLoad(long secs) const;
757
758     /**
759      * Adjust load for rounding errors.
760      */
761     double quantizeLoad(double load) const;
762
763     /**
764      * Converts load values (effort) to time slots.
765      */
766     long int convertToSlots(double effort) const;
767
768     void setMaxErrors(int me) { maxErrors = me; }
769
770     void addJournalEntry(JournalEntry* entry);
771
772     bool hasJournal() const { return !journal.isEmpty(); }
773
774     Journal::Iterator getJournalIterator() const;
775
776     /**
777      * Generate cross references between all data structures and run a
778      * consistency check. This function must be called after the project data
779      * tree has been contructed.
780      * @return Only if all tests were successful true is returned.
781      */
782     bool pass2(bool noDepCheck);
783
784     bool scheduleScenario(Scenario* sc);
785     void breakScheduling();
786     void completeBuffersAndIndices();
787     bool scheduleAllScenarios();
788     bool generateReports() const;
789
790     bool generateXMLReport() const;
791
792 signals:
793     void updateProgressInfo(const QString& i);
794     void updateProgressBar(int i, int of);
795
796 private:
797     void overlayScenario(int base, int sc);
798     void prepareScenario(int sc);
799     void finishScenario(int sc);
800
801     bool schedule(int sc);
802
803     bool checkSchedule(int sc) const;
804
805     /// The start date of the project
806     time_t start;
807     /// The end date of the project
808     time_t end;
809     /// The current date used in status calculations and reports.
810     time_t now;
811
812     bool allowRedefinitions;
813
814     /// True if week based calculations use Monday as first day of week.
815     bool weekStartsMonday;
816
817     /// True if containers w/o visible subtask should be drawn as normal tasks
818     bool drawEmptyContainerAsTasks;
819
820     /// The name of the Project
821     QString name;
822     /// The revision of the project description.
823     QString version;
824     /// Some legal words to please the boss.
825     QString copyright;
826
827     /// Some information about the customer of this project.
828     QString customer;
829
830     /// The default timezone of the project.
831     QString timeZone;
832     /**
833      * A format string in strftime(3) format that specifies the default time
834      * format for all time values TaskJuggler generates.
835      */
836     QString timeFormat;
837     /**
838      * A format string in strftime(3) format that specifies the time format
839      * for all daytime values (e. g. HH:MM).
840      */
841     QString shortTimeFormat;
842
843     /// The currency of used for all money values.
844     QString currency;
845     /// The number of fraction digits of all money values.
846     int currencyDigits;
847
848     // The default format used for printing load values and the like.
849     RealFormat numberFormat;
850     // The default format used for printing currency values.
851     RealFormat currencyFormat;
852
853     /**
854      * The default priority that will be inherited by all tasks. Sub tasks
855      * will inherit the priority of its parent task. */
856     int priority;
857
858     /// Default values for Resource variables (TODO: should be obsoleted!)
859     double minEffort;
860
861     /**
862      * The default resource usage limits.
863      */
864     UsageLimits* resourceLimits;
865
866     /**
867      * The default daily cost of a resource. The value is inherited to all
868      * resources but can be overridden.
869      */
870     double rate;
871
872     /* The average number of working hours per day. This factor is used
873      * when converting hours in working days. It should match the workingHours
874      * closely. */
875     double dailyWorkingHours;
876
877     /* The average number of working days per year. This factor is used when
878      * converting working days into years. It should match the defined working
879      * hours and vacation days. */
880     double yearlyWorkingDays;
881
882     /* The list of standard working or opening hours. These values will be
883      * inherited by the resources as default working hours. */
884     QPtrList<Interval>* workingHours[7];
885
886     /**
887      * The granularity of the scheduler in seconds. No intervals
888      * shorter than this time will be scheduled. */
889     ulong scheduleGranularity;
890
891     /**
892      * To avoid difficult to find typos in flag names all flags must
893      * be registered before they can be used. This variable contains
894      * the list of all registered flags. It is legal to declare a flag
895      * twice, so we can merge projects to a larger project. */
896     QStringList allowedFlags;
897
898     /**
899      * Each project has a unique ID but can have multiple other IDs as
900      * well. This happens usually when small projects are merged to a
901      * create a big project. Each task can be assigned to a different
902      * project ID but all IDs must be declared before they can be
903      * used. */
904     QStringList projectIDs;
905
906     QString currentId;
907
908     int maxErrors;
909
910     Journal journal;
911
912     VacationList vacationList;
913
914     ScenarioList scenarioList;
915     TaskList taskList;
916     ResourceList resourceList;
917     AccountList accountList;
918     ShiftList shiftList;
919
920     /**
921      * The following lists contain a deep copy of their unscheduled
922      * counterpart. They will be used to initialize the working lists before
923      * an optimizer run.
924      */
925     TaskList originalTaskList;
926     ResourceList originalResourceList;
927     AccountList originalAccountList;
928
929     QDict<CustomAttributeDefinition> taskAttributes;
930     QDict<CustomAttributeDefinition> resourceAttributes;
931     QDict<CustomAttributeDefinition> accountAttributes;
932
933     /* This is for version 1.0 XML reports and should be removed before the
934      * next major release. */
935     ReportXML* xmlreport;
936
937     QPtrList<Report> reports;
938     QStringList sourceFiles;
939
940     // This flag is raised to abort the scheduling.
941     bool breakFlag;
942 } ;
943
944 #endif