F:/KPlato/koffice/kplato/kptcommand.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002   Copyright (C) 2004, 2005 Dag Andersen <danders@get2net.dk>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation;
00007   version 2 of the License.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public License
00015   along with this library; see the file COPYING.LIB.  If not, write to
00016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017 * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KPTCOMMAND_H
00021 #define KPTCOMMAND_H
00022 
00023 #include <kcommand.h>
00024 
00025 #include "kptappointment.h"
00026 #include "kptnode.h"
00027 #include "kptduration.h"
00028 #include "kptpart.h"
00029 #include "kpttask.h"
00030 
00031 #include <QList>
00032 
00033 class QString;
00034 
00035 namespace KPlato
00036 {
00037 
00038 class Account;
00039 class Accounts;
00040 class Project;
00041 class Task;
00042 class Calendar;
00043 class CalendarDay;
00044 class Relation;
00045 class ResourceGroupRequest;
00046 class ResourceRequest;
00047 class ResourceGroup;
00048 class Resource;
00049 class Schedule;
00050 class StandardWorktime;
00051 
00052 class NamedCommand : public KNamedCommand
00053 {
00054 public:
00055     NamedCommand( Part *part, QString name )
00056             : KNamedCommand( name ), m_part( part )
00057     {}
00058 
00059     void setCommandType( int type );
00060 
00061 protected:
00062     void setSchDeleted();
00063     void setSchDeleted( bool state );
00064     void setSchScheduled();
00065     void setSchScheduled( bool state );
00066     void addSchScheduled( Schedule *sch );
00067     void addSchDeleted( Schedule *sch );
00068 
00069     QMap<Schedule*, bool> m_schedules;
00070 private:
00071     Part *m_part;
00072 };
00073 
00074 class CalendarAddCmd : public NamedCommand
00075 {
00076 public:
00077     CalendarAddCmd( Part *part, Project *project, Calendar *cal, QString name = 0 );
00078     void execute();
00079     void unexecute();
00080 
00081 private:
00082     Project *m_project;
00083     Calendar *m_cal;
00084     bool m_added;
00085 };
00086 
00087 class CalendarDeleteCmd : public NamedCommand
00088 {
00089 public:
00090     CalendarDeleteCmd( Part *part, Calendar *cal, QString name = 0 );
00091     void execute();
00092     void unexecute();
00093 
00094 private:
00095     Calendar *m_cal;
00096 };
00097 
00098 class CalendarModifyNameCmd : public NamedCommand
00099 {
00100 public:
00101     CalendarModifyNameCmd( Part *part, Calendar *cal, QString newvalue, QString name = 0 );
00102     void execute();
00103     void unexecute();
00104 
00105 private:
00106     Calendar *m_cal;
00107     QString m_newvalue;
00108     QString m_oldvalue;
00109 };
00110 
00111 class CalendarModifyParentCmd : public NamedCommand
00112 {
00113 public:
00114     CalendarModifyParentCmd( Part *part, Calendar *cal, Calendar *newvalue, QString name = 0 );
00115     void execute();
00116     void unexecute();
00117 
00118 private:
00119     Calendar *m_cal;
00120     Calendar *m_newvalue;
00121     Calendar *m_oldvalue;
00122 };
00123 
00124 class CalendarAddDayCmd : public NamedCommand
00125 {
00126 public:
00127     CalendarAddDayCmd( Part *part, Calendar *cal, CalendarDay *newvalue, QString name = 0 );
00128     ~CalendarAddDayCmd();
00129     void execute();
00130     void unexecute();
00131 
00132 protected:
00133     Calendar *m_cal;
00134     CalendarDay *m_newvalue;
00135     bool m_mine;
00136 };
00137 
00138 class CalendarRemoveDayCmd : public NamedCommand
00139 {
00140 public:
00141     CalendarRemoveDayCmd( Part *part, Calendar *cal, const QDate &day, QString name = 0 );
00142     void execute();
00143     void unexecute();
00144 
00145 protected:
00146     Calendar *m_cal;
00147     CalendarDay *m_value;
00148     bool m_mine;
00149 };
00150 
00151 class CalendarModifyDayCmd : public NamedCommand
00152 {
00153 public:
00154     CalendarModifyDayCmd( Part *part, Calendar *cal, CalendarDay *value, QString name = 0 );
00155     ~CalendarModifyDayCmd();
00156     void execute();
00157     void unexecute();
00158 
00159 private:
00160     Calendar *m_cal;
00161     CalendarDay *m_newvalue;
00162     CalendarDay *m_oldvalue;
00163     bool m_mine;
00164 };
00165 
00166 class CalendarModifyWeekdayCmd : public NamedCommand
00167 {
00168 public:
00169     CalendarModifyWeekdayCmd( Part *part, Calendar *cal, int weekday, CalendarDay *value, QString name = 0 );
00170     ~CalendarModifyWeekdayCmd();
00171     void execute();
00172     void unexecute();
00173 
00174 private:
00175     int m_weekday;
00176     Calendar *m_cal;
00177     CalendarDay *m_value;
00178     bool m_mine;
00179 };
00180 
00181 
00182 class NodeDeleteCmd : public NamedCommand
00183 {
00184 public:
00185     NodeDeleteCmd( Part *part, Node *node, QString name = 0 );
00186     ~NodeDeleteCmd();
00187     void execute();
00188     void unexecute();
00189 
00190 private:
00191     Node *m_node;
00192     Node *m_parent;
00193     Project *m_project;
00194     int m_index;
00195     bool m_mine;
00196     QList<Appointment*> m_appointments;
00197     KMacroCommand *m_cmd;
00198 };
00199 
00200 class TaskAddCmd : public NamedCommand
00201 {
00202 public:
00203     TaskAddCmd( Part *part, Project *project, Node *node, Node *after, QString name = 0 );
00204     ~TaskAddCmd();
00205     void execute();
00206     void unexecute();
00207 
00208 private:
00209     Project *m_project;
00210     Node *m_node;
00211     Node *m_after;
00212     bool m_added;
00213 };
00214 
00215 class SubtaskAddCmd : public NamedCommand
00216 {
00217 public:
00218     SubtaskAddCmd( Part *part, Project *project, Node *node, Node *parent, QString name = 0 );
00219     ~SubtaskAddCmd();
00220     void execute();
00221     void unexecute();
00222 
00223 private:
00224     Project *m_project;
00225     Node *m_node;
00226     Node *m_parent;
00227     bool m_added;
00228 };
00229 
00230 
00231 class NodeModifyNameCmd : public NamedCommand
00232 {
00233 public:
00234     NodeModifyNameCmd( Part *part, Node &node, QString nodename, QString name = 0 );
00235     void execute();
00236     void unexecute();
00237 
00238 private:
00239     Node &m_node;
00240     QString newName;
00241     QString oldName;
00242 };
00243 
00244 class NodeModifyLeaderCmd : public NamedCommand
00245 {
00246 public:
00247     NodeModifyLeaderCmd( Part *part, Node &node, QString leader, QString name = 0 );
00248     void execute();
00249     void unexecute();
00250 
00251 private:
00252     Node &m_node;
00253     QString newLeader;
00254     QString oldLeader;
00255 };
00256 
00257 class NodeModifyDescriptionCmd : public NamedCommand
00258 {
00259 public:
00260     NodeModifyDescriptionCmd( Part *part, Node &node, QString description, QString name = 0 );
00261     void execute();
00262     void unexecute();
00263 
00264 private:
00265     Node &m_node;
00266     QString newDescription;
00267     QString oldDescription;
00268 };
00269 
00270 class NodeModifyConstraintCmd : public NamedCommand
00271 {
00272 public:
00273     NodeModifyConstraintCmd( Part *part, Node &node, Node::ConstraintType c, QString name = 0 );
00274     void execute();
00275     void unexecute();
00276 
00277 private:
00278     Node &m_node;
00279     Node::ConstraintType newConstraint;
00280     Node::ConstraintType oldConstraint;
00281 
00282 };
00283 
00284 class NodeModifyConstraintStartTimeCmd : public NamedCommand
00285 {
00286 public:
00287     NodeModifyConstraintStartTimeCmd( Part *part, Node &node, QDateTime dt, QString name = 0 );
00288     void execute();
00289     void unexecute();
00290 
00291 private:
00292     Node &m_node;
00293     QDateTime newTime;
00294     QDateTime oldTime;
00295 
00296 };
00297 class NodeModifyConstraintEndTimeCmd : public NamedCommand
00298 {
00299 public:
00300     NodeModifyConstraintEndTimeCmd( Part *part, Node &node, QDateTime dt, QString name = 0 );
00301     void execute();
00302     void unexecute();
00303 
00304 private:
00305     Node &m_node;
00306     QDateTime newTime;
00307     QDateTime oldTime;
00308 
00309 };
00310 class NodeModifyStartTimeCmd : public NamedCommand
00311 {
00312 public:
00313     NodeModifyStartTimeCmd( Part *part, Node &node, QDateTime dt, QString name = 0 );
00314     void execute();
00315     void unexecute();
00316 
00317 private:
00318     Node &m_node;
00319     QDateTime newTime;
00320     QDateTime oldTime;
00321 };
00322 class NodeModifyEndTimeCmd : public NamedCommand
00323 {
00324 public:
00325     NodeModifyEndTimeCmd( Part *part, Node &node, QDateTime dt, QString name = 0 );
00326     void execute();
00327     void unexecute();
00328 
00329 private:
00330     Node &m_node;
00331     QDateTime newTime;
00332     QDateTime oldTime;
00333 };
00334 class NodeModifyIdCmd : public NamedCommand
00335 {
00336 public:
00337     NodeModifyIdCmd( Part *part, Node &node, QString id, QString name = 0 );
00338     void execute();
00339     void unexecute();
00340 
00341 private:
00342     Node &m_node;
00343     QString newId;
00344     QString oldId;
00345 };
00346 
00347 class NodeIndentCmd : public NamedCommand
00348 {
00349 public:
00350     NodeIndentCmd( Part *part, Node &node, QString name = 0 );
00351     void execute();
00352     void unexecute();
00353 
00354 private:
00355     Node &m_node;
00356     Node *m_oldparent, *m_newparent;
00357     int m_oldindex, m_newindex;
00358 };
00359 
00360 class NodeUnindentCmd : public NamedCommand
00361 {
00362 public:
00363     NodeUnindentCmd( Part *part, Node &node, QString name = 0 );
00364     void execute();
00365     void unexecute();
00366 
00367 private:
00368     Node &m_node;
00369     Node *m_oldparent, *m_newparent;
00370     int m_oldindex, m_newindex;
00371 };
00372 
00373 class NodeMoveUpCmd : public NamedCommand
00374 {
00375 public:
00376     NodeMoveUpCmd( Part *part, Node &node, QString name = 0 );
00377     void execute();
00378     void unexecute();
00379 
00380 private:
00381     Node &m_node;
00382     Project *m_project;
00383     bool m_moved;
00384 };
00385 
00386 class NodeMoveDownCmd : public NamedCommand
00387 {
00388 public:
00389     NodeMoveDownCmd( Part *part, Node &node, QString name = 0 );
00390     void execute();
00391     void unexecute();
00392 
00393 private:
00394     Node &m_node;
00395     Project *m_project;
00396     bool m_moved;
00397 };
00398 
00399 class AddRelationCmd : public NamedCommand
00400 {
00401 public:
00402     AddRelationCmd( Part *part, Relation *rel, QString name = 0 );
00403     ~AddRelationCmd();
00404     void execute();
00405     void unexecute();
00406 
00407 private:
00408     Relation *m_rel;
00409     bool m_taken;
00410 
00411 };
00412 
00413 class DeleteRelationCmd : public NamedCommand
00414 {
00415 public:
00416     DeleteRelationCmd( Part *part, Relation *rel, QString name = 0 );
00417     ~DeleteRelationCmd();
00418     void execute();
00419     void unexecute();
00420 
00421 private:
00422     Relation *m_rel;
00423     bool m_taken;
00424 
00425 };
00426 
00427 class ModifyRelationTypeCmd : public NamedCommand
00428 {
00429 public:
00430     ModifyRelationTypeCmd( Part *part, Relation *rel, Relation::Type type, QString name = 0 );
00431     void execute();
00432     void unexecute();
00433 
00434 private:
00435     Relation *m_rel;
00436     Relation::Type m_newtype;
00437     Relation::Type m_oldtype;
00438 
00439 };
00440 
00441 class ModifyRelationLagCmd : public NamedCommand
00442 {
00443 public:
00444     ModifyRelationLagCmd( Part *part, Relation *rel, Duration lag, QString name = 0 );
00445     void execute();
00446     void unexecute();
00447 
00448 private:
00449     Relation *m_rel;
00450     Duration m_newlag;
00451     Duration m_oldlag;
00452 
00453 };
00454 
00455 class AddResourceRequestCmd : public NamedCommand
00456 {
00457 public:
00458     AddResourceRequestCmd( Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name = 0 );
00459     ~AddResourceRequestCmd();
00460     void execute();
00461     void unexecute();
00462 
00463 private:
00464     ResourceGroupRequest *m_group;
00465     ResourceRequest *m_request;
00466     bool m_mine;
00467 
00468 };
00469 
00470 class RemoveResourceRequestCmd : public NamedCommand
00471 {
00472 public:
00473     RemoveResourceRequestCmd( Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name = 0 );
00474     ~RemoveResourceRequestCmd();
00475     void execute();
00476     void unexecute();
00477 
00478 private:
00479     ResourceGroupRequest *m_group;
00480     ResourceRequest *m_request;
00481     bool m_mine;
00482 
00483 };
00484 
00485 class ModifyEffortCmd : public NamedCommand
00486 {
00487 public:
00488     ModifyEffortCmd( Part *part, Node &node, Duration oldvalue, Duration newvalue, QString name = 0 );
00489     void execute();
00490     void unexecute();
00491 
00492 private:
00493     Effort *m_effort;
00494     Duration m_oldvalue, m_newvalue;
00495 
00496 };
00497 
00498 class EffortModifyOptimisticRatioCmd : public NamedCommand
00499 {
00500 public:
00501     EffortModifyOptimisticRatioCmd( Part *part, Node &node, int oldvalue, int newvalue, QString name = 0 );
00502     void execute();
00503     void unexecute();
00504 
00505 private:
00506     Effort *m_effort;
00507     int m_oldvalue, m_newvalue;
00508 
00509 };
00510 
00511 class EffortModifyPessimisticRatioCmd : public NamedCommand
00512 {
00513 public:
00514     EffortModifyPessimisticRatioCmd( Part *part, Node &node, int oldvalue, int newvalue, QString name = 0 );
00515     void execute();
00516     void unexecute();
00517 
00518 private:
00519     Effort *m_effort;
00520     int m_oldvalue, m_newvalue;
00521 
00522 };
00523 
00524 class ModifyEffortTypeCmd : public NamedCommand
00525 {
00526 public:
00527     ModifyEffortTypeCmd( Part *part, Node &node, int oldvalue, int newvalue, QString name = 0 );
00528     void execute();
00529     void unexecute();
00530 
00531 private:
00532     Effort *m_effort;
00533     int m_oldvalue, m_newvalue;
00534 
00535 };
00536 
00537 class EffortModifyRiskCmd : public NamedCommand
00538 {
00539 public:
00540     EffortModifyRiskCmd( Part *part, Node &node, int oldvalue, int newvalue, QString name = 0 );
00541     void execute();
00542     void unexecute();
00543 
00544 private:
00545     Effort *m_effort;
00546     int m_oldvalue, m_newvalue;
00547 
00548 };
00549 
00550 class AddResourceGroupRequestCmd : public NamedCommand
00551 {
00552 public:
00553     AddResourceGroupRequestCmd( Part *part, Task &task, ResourceGroupRequest *request, QString name = 0 );
00554     void execute();
00555     void unexecute();
00556 
00557 private:
00558     Task &m_task;
00559     ResourceGroupRequest *m_request;
00560     bool m_mine;
00561 };
00562 
00563 class RemoveResourceGroupRequestCmd : public NamedCommand
00564 {
00565 public:
00566     RemoveResourceGroupRequestCmd( Part *part, ResourceGroupRequest *request, QString name = 0 );
00567     RemoveResourceGroupRequestCmd( Part *part, Task &task, ResourceGroupRequest *request, QString name = 0 );
00568     void execute();
00569     void unexecute();
00570 
00571 private:
00572     Task &m_task;
00573     ResourceGroupRequest *m_request;
00574     bool m_mine;
00575 };
00576 
00577 class AddResourceCmd : public NamedCommand
00578 {
00579 public:
00580     AddResourceCmd( Part *part, ResourceGroup *group, Resource *resource, QString name = 0 );
00581     ~AddResourceCmd();
00582     void execute();
00583     void unexecute();
00584 
00585 protected:
00586 
00587     ResourceGroup *m_group;
00588     Resource *m_resource;
00589     bool m_mine;
00590 };
00591 
00592 class RemoveResourceCmd : public AddResourceCmd
00593 {
00594 public:
00595     RemoveResourceCmd( Part *part, ResourceGroup *group, Resource *resource, QString name = 0 );
00596     ~RemoveResourceCmd();
00597     void execute();
00598     void unexecute();
00599 
00600 private:
00601     QList<ResourceRequest*> m_requests;
00602     QList<Appointment*> m_appointments;
00603 };
00604 
00605 class ModifyResourceNameCmd : public NamedCommand
00606 {
00607 public:
00608     ModifyResourceNameCmd( Part *part, Resource *resource, QString value, QString name = 0 );
00609     void execute();
00610     void unexecute();
00611 
00612 private:
00613 
00614     Resource *m_resource;
00615     QString m_newvalue;
00616     QString m_oldvalue;
00617 };
00618 class ModifyResourceInitialsCmd : public NamedCommand
00619 {
00620 public:
00621     ModifyResourceInitialsCmd( Part *part, Resource *resource, QString value, QString name = 0 );
00622     void execute();
00623     void unexecute();
00624 
00625 private:
00626     Resource *m_resource;
00627     QString m_newvalue;
00628     QString m_oldvalue;
00629 };
00630 class ModifyResourceEmailCmd : public NamedCommand
00631 {
00632 public:
00633     ModifyResourceEmailCmd( Part *part, Resource *resource, QString value, QString name = 0 );
00634     void execute();
00635     void unexecute();
00636 
00637 private:
00638     Resource *m_resource;
00639     QString m_newvalue;
00640     QString m_oldvalue;
00641 };
00642 class ModifyResourceTypeCmd : public NamedCommand
00643 {
00644 public:
00645     ModifyResourceTypeCmd( Part *part, Resource *resource, int value, QString name = 0 );
00646     void execute();
00647     void unexecute();
00648 
00649 private:
00650     Resource *m_resource;
00651     int m_newvalue;
00652     int m_oldvalue;
00653 };
00654 
00655 class ModifyResourceUnitsCmd : public NamedCommand
00656 {
00657 public:
00658     ModifyResourceUnitsCmd( Part *part, Resource *resource, int value, QString name = 0 );
00659     void execute();
00660     void unexecute();
00661 
00662 private:
00663     Resource *m_resource;
00664     int m_newvalue;
00665     int m_oldvalue;
00666 };
00667 
00668 class ModifyResourceAvailableFromCmd : public NamedCommand
00669 {
00670 public:
00671     ModifyResourceAvailableFromCmd( Part *part, Resource *resource, DateTime value, QString name = 0 );
00672     void execute();
00673     void unexecute();
00674 
00675 private:
00676     Resource *m_resource;
00677     DateTime m_newvalue;
00678     DateTime m_oldvalue;
00679 };
00680 class ModifyResourceAvailableUntilCmd : public NamedCommand
00681 {
00682 public:
00683     ModifyResourceAvailableUntilCmd( Part *part, Resource *resource, DateTime value, QString name = 0 );
00684     void execute();
00685     void unexecute();
00686 
00687 private:
00688     Resource *m_resource;
00689     DateTime m_newvalue;
00690     DateTime m_oldvalue;
00691 };
00692 
00693 class ModifyResourceNormalRateCmd : public NamedCommand
00694 {
00695 public:
00696     ModifyResourceNormalRateCmd( Part *part, Resource *resource, double value, QString name = 0 );
00697     void execute();
00698     void unexecute();
00699 
00700 private:
00701     Resource *m_resource;
00702     double m_newvalue;
00703     double m_oldvalue;
00704 };
00705 class ModifyResourceOvertimeRateCmd : public NamedCommand
00706 {
00707 public:
00708     ModifyResourceOvertimeRateCmd( Part *part, Resource *resource, double value, QString name = 0 );
00709     void execute();
00710     void unexecute();
00711 
00712 private:
00713     Resource *m_resource;
00714     double m_newvalue;
00715     double m_oldvalue;
00716 };
00717 class ModifyResourceCalendarCmd : public NamedCommand
00718 {
00719 public:
00720     ModifyResourceCalendarCmd( Part *part, Resource *resource, Calendar *value, QString name = 0 );
00721     void execute();
00722     void unexecute();
00723 
00724 private:
00725     Resource *m_resource;
00726     Calendar *m_newvalue;
00727     Calendar *m_oldvalue;
00728 };
00729 
00730 class RemoveResourceGroupCmd : public NamedCommand
00731 {
00732 public:
00733     RemoveResourceGroupCmd( Part *part, ResourceGroup *group, QString name = 0 );
00734     ~RemoveResourceGroupCmd();
00735     void execute();
00736     void unexecute();
00737 
00738 protected:
00739 
00740     ResourceGroup *m_group;
00741     bool m_mine;
00742 };
00743 
00744 class AddResourceGroupCmd : public RemoveResourceGroupCmd
00745 {
00746 public:
00747     AddResourceGroupCmd( Part *part, ResourceGroup *group, QString name = 0 );
00748     void execute();
00749     void unexecute();
00750 };
00751 
00752 class ModifyResourceGroupNameCmd : public NamedCommand
00753 {
00754 public:
00755     ModifyResourceGroupNameCmd( Part *part, ResourceGroup *group, QString value, QString name = 0 );
00756     void execute();
00757     void unexecute();
00758 
00759 private:
00760     ResourceGroup *m_group;
00761     QString m_newvalue;
00762     QString m_oldvalue;
00763 };
00764 
00765 class TaskModifyProgressCmd : public NamedCommand
00766 {
00767 public:
00768     TaskModifyProgressCmd( Part *part, Task &task, struct Task::Progress &value, QString name = 0 );
00769     void execute();
00770     void unexecute();
00771 
00772 private:
00773     Task &m_task;
00774     struct Task::Progress m_newvalue;
00775     struct Task::Progress m_oldvalue;
00776 };
00777 
00778 class AddAccountCmd : public NamedCommand
00779 {
00780 public:
00781     AddAccountCmd( Part *part, Project &project, Account *account, Account *parent = 0, QString name = 0 );
00782     AddAccountCmd( Part *part, Project &project, Account *account, QString parent, QString name = 0 );
00783     ~AddAccountCmd();
00784     void execute();
00785     void unexecute();
00786 
00787 protected:
00788     bool m_mine;
00789 
00790 private:
00791     Project &m_project;
00792     Account *m_account;
00793     Account *m_parent;
00794     QString m_parentName;
00795 };
00796 
00797 class RemoveAccountCmd : public NamedCommand
00798 {
00799 public:
00800     RemoveAccountCmd( Part *part, Project &project, Account *account, QString name = 0 );
00801     ~RemoveAccountCmd();
00802     void execute();
00803     void unexecute();
00804 
00805 private:
00806     Project &m_project;
00807     Account *m_account;
00808     bool m_isDefault;
00809     bool m_mine;
00810 
00811 };
00812 
00813 class RenameAccountCmd : public NamedCommand
00814 {
00815 public:
00816     RenameAccountCmd( Part *part, Account *account, QString value, QString name = 0 );
00817     void execute();
00818     void unexecute();
00819 
00820 private:
00821     Account *m_account;
00822     QString m_oldvalue;
00823     QString m_newvalue;
00824 };
00825 
00826 class ModifyAccountDescriptionCmd : public NamedCommand
00827 {
00828 public:
00829     ModifyAccountDescriptionCmd( Part *part, Account *account, QString value, QString name = 0 );
00830     void execute();
00831     void unexecute();
00832 
00833 private:
00834     Account *m_account;
00835     QString m_oldvalue;
00836     QString m_newvalue;
00837 };
00838 
00839 class NodeModifyStartupCostCmd : public NamedCommand
00840 {
00841 public:
00842     NodeModifyStartupCostCmd( Part *part, Node &node, double value, QString name = 0 );
00843     void execute();
00844     void unexecute();
00845 
00846 private:
00847     Node &m_node;
00848     double m_oldvalue;
00849     double m_newvalue;
00850 };
00851 
00852 class NodeModifyShutdownCostCmd : public NamedCommand
00853 {
00854 public:
00855     NodeModifyShutdownCostCmd( Part *part, Node &node, double value, QString name = 0 );
00856     void execute();
00857     void unexecute();
00858 
00859 private:
00860     Node &m_node;
00861     double m_oldvalue;
00862     double m_newvalue;
00863 };
00864 
00865 class NodeModifyRunningAccountCmd : public NamedCommand
00866 {
00867 public:
00868     NodeModifyRunningAccountCmd( Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name = 0 );
00869     void execute();
00870     void unexecute();
00871 
00872 private:
00873     Node &m_node;
00874     Account *m_oldvalue;
00875     Account *m_newvalue;
00876 };
00877 
00878 class NodeModifyStartupAccountCmd : public NamedCommand
00879 {
00880 public:
00881     NodeModifyStartupAccountCmd( Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name = 0 );
00882     void execute();
00883     void unexecute();
00884 
00885 private:
00886     Node &m_node;
00887     Account *m_oldvalue;
00888     Account *m_newvalue;
00889 };
00890 
00891 class NodeModifyShutdownAccountCmd : public NamedCommand
00892 {
00893 public:
00894     NodeModifyShutdownAccountCmd( Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name = 0 );
00895     void execute();
00896     void unexecute();
00897 
00898 private:
00899     Node &m_node;
00900     Account *m_oldvalue;
00901     Account *m_newvalue;
00902 };
00903 
00904 class ModifyDefaultAccountCmd : public NamedCommand
00905 {
00906 public:
00907     ModifyDefaultAccountCmd( Part *part, Accounts &acc, Account *oldvalue, Account *newvalue, QString name = 0 );
00908     void execute();
00909     void unexecute();
00910 
00911 private:
00912     Accounts &m_accounts;
00913     Account *m_oldvalue;
00914     Account *m_newvalue;
00915 };
00916 
00917 class ProjectModifyConstraintCmd : public NamedCommand
00918 {
00919 public:
00920     ProjectModifyConstraintCmd( Part *part, Project &node, Node::ConstraintType c, QString name = 0 );
00921     void execute();
00922     void unexecute();
00923 
00924 private:
00925     Project &m_node;
00926     Node::ConstraintType newConstraint;
00927     Node::ConstraintType oldConstraint;
00928 
00929 };
00930 
00931 class ProjectModifyStartTimeCmd : public NamedCommand
00932 {
00933 public:
00934     ProjectModifyStartTimeCmd( Part *part, Project &node, QDateTime dt, QString name = 0 );
00935     void execute();
00936     void unexecute();
00937 
00938 private:
00939     Project &m_node;
00940     QDateTime newTime;
00941     QDateTime oldTime;
00942 
00943 };
00944 
00945 class ProjectModifyEndTimeCmd : public NamedCommand
00946 {
00947 public:
00948     ProjectModifyEndTimeCmd( Part *part, Project &project, QDateTime dt, QString name = 0 );
00949     void execute();
00950     void unexecute();
00951 
00952 private:
00953     Project &m_node;
00954     QDateTime newTime;
00955     QDateTime oldTime;
00956 
00957 };
00958 
00959 
00960 class CalculateProjectCmd : public NamedCommand
00961 {
00962 public:
00963     CalculateProjectCmd( Part *part, Project &project, QString tname, int type, QString name = 0 );
00964     void execute();
00965     void unexecute();
00966 
00967 private:
00968     Project &m_node;
00969     QString m_typename;
00970     int m_type;
00971     Schedule *newSchedule;
00972     Schedule *oldCurrent;
00973 };
00974 
00975 class RecalculateProjectCmd : public NamedCommand
00976 {
00977 public:
00978     RecalculateProjectCmd( Part *part, Project &project, Schedule &sch, QString name = 0 );
00979     void execute();
00980     void unexecute();
00981 
00982 private:
00983     Project &m_node;
00984     Schedule &oldSchedule;
00985     Schedule *newSchedule;
00986     bool oldDeleted;
00987     Schedule *oldCurrent;
00988 };
00989 
00990 class ModifyStandardWorktimeYearCmd : public NamedCommand
00991 {
00992 public:
00993     ModifyStandardWorktimeYearCmd( Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name = 0 );
00994     void execute();
00995     void unexecute();
00996 private:
00997     StandardWorktime *swt;
00998     double m_oldvalue;
00999     double m_newvalue;
01000 };
01001 
01002 class ModifyStandardWorktimeMonthCmd : public NamedCommand
01003 {
01004 public:
01005     ModifyStandardWorktimeMonthCmd( Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name = 0 );
01006     void execute();
01007     void unexecute();
01008 private:
01009     StandardWorktime *swt;
01010     double m_oldvalue;
01011     double m_newvalue;
01012 };
01013 
01014 class ModifyStandardWorktimeWeekCmd : public NamedCommand
01015 {
01016 public:
01017     ModifyStandardWorktimeWeekCmd( Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name = 0 );
01018     void execute();
01019     void unexecute();
01020 private:
01021     StandardWorktime *swt;
01022     double m_oldvalue;
01023     double m_newvalue;
01024 };
01025 
01026 class ModifyStandardWorktimeDayCmd : public NamedCommand
01027 {
01028 public:
01029     ModifyStandardWorktimeDayCmd( Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name = 0 );
01030     void execute();
01031     void unexecute();
01032 private:
01033     StandardWorktime *swt;
01034     double m_oldvalue;
01035     double m_newvalue;
01036 };
01037 
01038 
01039 }  //KPlato namespace
01040 
01041 #endif //COMMAND_H

Généré le Wed Nov 22 23:40:56 2006 pour KPlato par  doxygen 1.5.1-p1