diff --git a/src/Context.cpp b/src/Context.cpp index ab5a8910c..f90dd984e 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -36,7 +36,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/src/Operation.h b/src/Operation.h index 485b422bd..82c2ea022 100644 --- a/src/Operation.h +++ b/src/Operation.h @@ -1,6 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2024, Tomas Babej, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,8 +25,8 @@ // //////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_OPERATIOn -#define INCLUDED_OPERATIOn +#ifndef INCLUDED_OPERATION +#define INCLUDED_OPERATION #include diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 08db87ddc..c49f513d6 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -33,13 +33,11 @@ #include #include #include -#include #include #include #include #include -#include #include #include diff --git a/src/TDB2.h b/src/TDB2.h index 89b5ae8e8..51669ab6d 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -27,7 +27,6 @@ #ifndef INCLUDED_TDB2 #define INCLUDED_TDB2 -#include #include #include diff --git a/src/TF2.cpp b/src/TF2.cpp index 6ab74c24d..0b78fe531 100644 --- a/src/TF2.cpp +++ b/src/TF2.cpp @@ -31,7 +31,9 @@ #include #include #include -#include +#ifdef PRODUCT_TASKWARRIOR +#include +#endif #include #include diff --git a/src/Task.cpp b/src/Task.cpp index a41f4d5ae..536f17a24 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -58,7 +58,8 @@ #include #include #include -#include +#include +#include #define APPROACHING_INFINITY 1000 // Close enough. This isn't rocket surgery. diff --git a/src/Variant.h b/src/Variant.h index 735779136..5634473b9 100644 --- a/src/Variant.h +++ b/src/Variant.h @@ -28,7 +28,6 @@ #define INCLUDED_VARIANT #include -#include #include diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index ce4cbaa2a..ad04e9811 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/columns/ColDepends.cpp b/src/columns/ColDepends.cpp index d0c77d0b3..446737d6d 100644 --- a/src/columns/ColDepends.cpp +++ b/src/columns/ColDepends.cpp @@ -30,13 +30,10 @@ #include #include #include -#include #include -#include #include #include -#include #include #define STRING_COLUMN_LABEL_DEP "Depends" diff --git a/src/columns/ColTags.cpp b/src/columns/ColTags.cpp index 50ccadf9e..2d0f278c0 100644 --- a/src/columns/ColTags.cpp +++ b/src/columns/ColTags.cpp @@ -32,8 +32,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index 429ac9480..f951083dc 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -29,8 +29,8 @@ #include #include +#include #include -#include //////////////////////////////////////////////////////////////////////////////// CmdAdd::CmdAdd() { diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index f5a193236..efee759ea 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index ac9e35ae9..0cdad990b 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index b05af87f3..b0045cab8 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index bf365d262..c3b021298 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/src/commands/CmdColor.cpp b/src/commands/CmdColor.cpp index 53e672df6..da17b9436 100644 --- a/src/commands/CmdColor.cpp +++ b/src/commands/CmdColor.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdColumns.cpp b/src/commands/CmdColumns.cpp index bf5e00f24..4a56e5d0f 100644 --- a/src/commands/CmdColumns.cpp +++ b/src/commands/CmdColumns.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdContext.cpp b/src/commands/CmdContext.cpp index 77bc3152d..37c89682f 100644 --- a/src/commands/CmdContext.cpp +++ b/src/commands/CmdContext.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/commands/CmdCount.cpp b/src/commands/CmdCount.cpp index 3c158c225..e25af8fde 100644 --- a/src/commands/CmdCount.cpp +++ b/src/commands/CmdCount.cpp @@ -30,7 +30,6 @@ #include #include #include -#include //////////////////////////////////////////////////////////////////////////////// CmdCount::CmdCount() { diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index 9babfe668..8bba6c902 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -34,15 +34,15 @@ #include #include #include +#include #include -#include +#include #include -#include +#include #include #include #include -#include #include #include diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index b3ac931cb..35b5c7ecf 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -30,8 +30,10 @@ #include #include #include +#include +#include #include -#include +#include #include #include diff --git a/src/commands/CmdDenotate.cpp b/src/commands/CmdDenotate.cpp index e8a43ad63..7293f8ace 100644 --- a/src/commands/CmdDenotate.cpp +++ b/src/commands/CmdDenotate.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdDone.cpp b/src/commands/CmdDone.cpp index d1ea64adb..deb10a0dc 100644 --- a/src/commands/CmdDone.cpp +++ b/src/commands/CmdDone.cpp @@ -30,8 +30,11 @@ #include #include #include +#include +#include #include -#include +#include +#include #include #include diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index b6a68854d..6ef1feb5d 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 92dcbc828..11cd8d937 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/src/commands/CmdExport.cpp b/src/commands/CmdExport.cpp index c697ff221..2924645dd 100644 --- a/src/commands/CmdExport.cpp +++ b/src/commands/CmdExport.cpp @@ -31,8 +31,9 @@ #include #include #include -#include +#include #include +#include //////////////////////////////////////////////////////////////////////////////// CmdExport::CmdExport() { diff --git a/src/commands/CmdGet.cpp b/src/commands/CmdGet.cpp index 2954e6848..ec7c8da0a 100644 --- a/src/commands/CmdGet.cpp +++ b/src/commands/CmdGet.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include //////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/CmdHistory.cpp b/src/commands/CmdHistory.cpp index 73788b01a..d379a89dd 100644 --- a/src/commands/CmdHistory.cpp +++ b/src/commands/CmdHistory.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdIDs.cpp b/src/commands/CmdIDs.cpp index 5782aaf63..aa6bc6921 100644 --- a/src/commands/CmdIDs.cpp +++ b/src/commands/CmdIDs.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index b805277b9..b3b3191fc 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -34,9 +34,9 @@ #include #include #include +#include #include -#include -#include +#include #include #include #include diff --git a/src/commands/CmdLog.cpp b/src/commands/CmdLog.cpp index 6263cf299..489001e0c 100644 --- a/src/commands/CmdLog.cpp +++ b/src/commands/CmdLog.cpp @@ -29,8 +29,8 @@ #include #include +#include #include -#include //////////////////////////////////////////////////////////////////////////////// CmdLog::CmdLog() { diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index 8a92fb802..a962ea10b 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -30,8 +30,9 @@ #include #include #include +#include #include -#include +#include #include #include diff --git a/src/commands/CmdNews.cpp b/src/commands/CmdNews.cpp index 6eeec1ba6..cbda073d5 100644 --- a/src/commands/CmdNews.cpp +++ b/src/commands/CmdNews.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index 1f148db48..afdf73025 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/commands/CmdProjects.cpp b/src/commands/CmdProjects.cpp index 612ba93ed..a74308757 100644 --- a/src/commands/CmdProjects.cpp +++ b/src/commands/CmdProjects.cpp @@ -32,10 +32,9 @@ #include #include #include -#include +#include #include -#include #include #include diff --git a/src/commands/CmdPurge.cpp b/src/commands/CmdPurge.cpp index e7374064e..d5b3c89fe 100644 --- a/src/commands/CmdPurge.cpp +++ b/src/commands/CmdPurge.cpp @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include #include //////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 60e4f1657..7d839e060 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/commands/CmdStart.cpp b/src/commands/CmdStart.cpp index 5216fab88..057b61fc5 100644 --- a/src/commands/CmdStart.cpp +++ b/src/commands/CmdStart.cpp @@ -30,8 +30,11 @@ #include #include #include +#include +#include #include -#include +#include +#include #include #include diff --git a/src/commands/CmdStats.cpp b/src/commands/CmdStats.cpp index 7639594d9..8b5860ea1 100644 --- a/src/commands/CmdStats.cpp +++ b/src/commands/CmdStats.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdStop.cpp b/src/commands/CmdStop.cpp index 1c2bf7596..9924c5a58 100644 --- a/src/commands/CmdStop.cpp +++ b/src/commands/CmdStop.cpp @@ -30,8 +30,10 @@ #include #include #include +#include +#include #include -#include +#include #include diff --git a/src/commands/CmdSummary.cpp b/src/commands/CmdSummary.cpp index 6bea3aae1..ca102638e 100644 --- a/src/commands/CmdSummary.cpp +++ b/src/commands/CmdSummary.cpp @@ -33,11 +33,10 @@ #include #include #include -#include +#include #include #include -#include #include #include diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp index 13b8d13c1..9ce0bd4e8 100644 --- a/src/commands/CmdTimesheet.cpp +++ b/src/commands/CmdTimesheet.cpp @@ -33,8 +33,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/src/commands/CmdUDAs.cpp b/src/commands/CmdUDAs.cpp index 78742ca0a..c2fb751a9 100644 --- a/src/commands/CmdUDAs.cpp +++ b/src/commands/CmdUDAs.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/commands/CmdUndo.cpp b/src/commands/CmdUndo.cpp index cf808f6a5..4c2e6b7f7 100644 --- a/src/commands/CmdUndo.cpp +++ b/src/commands/CmdUndo.cpp @@ -31,12 +31,11 @@ #include #include #include +#include #include #include -#include "shared.h" - //////////////////////////////////////////////////////////////////////////////// CmdUndo::CmdUndo() { _keyword = "undo"; diff --git a/src/commands/CmdUrgency.cpp b/src/commands/CmdUrgency.cpp index cbd1b45e3..40731c81c 100644 --- a/src/commands/CmdUrgency.cpp +++ b/src/commands/CmdUrgency.cpp @@ -32,8 +32,6 @@ #include #include #include -#include -#include #include diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index 366a10666..3e52a4389 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -50,9 +50,7 @@ #include #include #include -#include #include -#include #include #include diff --git a/src/dependency.cpp b/src/dependency.cpp index 8ac462aff..380c471cb 100644 --- a/src/dependency.cpp +++ b/src/dependency.cpp @@ -28,8 +28,8 @@ // cmake.h include header must come first #include +#include #include -#include #include #include diff --git a/src/dependency.h b/src/dependency.h new file mode 100644 index 000000000..66cfbd7a2 --- /dev/null +++ b/src/dependency.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_DEPENDENCY +#define INCLUDED_DEPENDENCY + +#include +// cmake.h include header must come first + +#include + +#define STRING_DEPEND_BLOCKED "Task {1} is blocked by:" +bool dependencyIsCircular(const Task& task); +void dependencyChainOnComplete(Task& task); +void dependencyChainOnStart(Task& task); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/feedback.cpp b/src/feedback.cpp index 0fc7b84fc..efd2302b4 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -31,8 +31,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/feedback.h b/src/feedback.h new file mode 100644 index 000000000..55b565c00 --- /dev/null +++ b/src/feedback.h @@ -0,0 +1,54 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_FEEDBACK +#define INCLUDED_FEEDBACK + +#include +// cmake.h include header must come first + +#include + +#include +#include + +std::string renderAttribute(const std::string& name, const std::string& value, + const std::string& format = ""); +void feedback_affected(const std::string& effect); +void feedback_affected(const std::string& effect, int quantity); +void feedback_affected(const std::string& effect, const Task& task); +void feedback_reserved_tags(const std::string& tag); +void feedback_special_tags(const Task& task, const std::string& tag); +void feedback_unblocked(const Task& task); +void feedback_backlog(); +std::string onProjectChange(Task& task, bool scope = true); +std::string onProjectChange(Task& task1, Task& task2); +std::string onExpiration(Task& task); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/legacy.h b/src/legacy.h new file mode 100644 index 000000000..9e3258079 --- /dev/null +++ b/src/legacy.h @@ -0,0 +1,44 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_LEGACY +#define INCLUDED_LEGACY + +#include +// cmake.h include header must come first + +#include + +void legacyColumnMap(std::string& name); +void legacySortColumnMap(std::string& name); +std::string legacyCheckForDeprecatedVariables(); +std::string legacyCheckForDeprecatedColumns(); +void legacyAttributeMap(std::string& name); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/main.h b/src/main.h deleted file mode 100644 index c08f159a7..000000000 --- a/src/main.h +++ /dev/null @@ -1,93 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// https://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDED_MAIN -#define INCLUDED_MAIN - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -// recur.cpp -void handleRecurrence(); -void handleUntil(); -std::optional checked_add_datetime(Datetime& base, time_t delta); -std::optional getNextRecurrence(Datetime&, std::string&); -bool generateDueDates(Task&, std::vector&); -void updateRecurrenceMask(Task&); - -// nag.cpp -void nag(std::vector&); - -// rules.cpp -void initializeColorRules(); -void autoColorize(Task&, Color&); -std::string colorizeHeader(const std::string&); -std::string colorizeFootnote(const std::string&); -std::string colorizeError(const std::string&); -std::string colorizeDebug(const std::string&); - -// dependency.cpp -bool dependencyIsCircular(const Task&); -void dependencyChainOnComplete(Task&); -void dependencyChainOnStart(Task&); - -// feedback.cpp -std::string renderAttribute(const std::string&, const std::string&, const std::string& format = ""); -void feedback_affected(const std::string&); -void feedback_affected(const std::string&, int); -void feedback_affected(const std::string&, const Task&); -void feedback_reserved_tags(const std::string&); -void feedback_special_tags(const Task&, const std::string&); -void feedback_unblocked(const Task&); -void feedback_backlog(); -std::string onProjectChange(Task&, bool scope = true); -std::string onProjectChange(Task&, Task&); -std::string onExpiration(Task&); - -// sort.cpp -void sort_tasks(std::vector&, std::vector&, const std::string&); -void sort_projects(std::list>& sorted, - std::map& allProjects); -void sort_projects(std::list>& sorted, - std::map& allProjects); - -// legacy.cpp -void legacyColumnMap(std::string&); -void legacySortColumnMap(std::string&); -std::string legacyCheckForDeprecatedVariables(); -std::string legacyCheckForDeprecatedColumns(); -void legacyAttributeMap(std::string&); - -#endif -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/nag.h b/src/nag.h new file mode 100644 index 000000000..6a8d2a1b5 --- /dev/null +++ b/src/nag.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_NAG +#define INCLUDED_NAG + +#include +// cmake.h include header must come first +#include + +#include + +//////////////////////////////////////////////////////////////////////////////// +// Generates a nag message when there are READY tasks of a higher urgency. +void nag(std::vector& tasks); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/recur.cpp b/src/recur.cpp index 857273926..482fc1060 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -31,9 +31,10 @@ #include #include #include +#include #include -#include #include +#include #include #include #include diff --git a/src/recur.h b/src/recur.h new file mode 100644 index 000000000..db0b6306d --- /dev/null +++ b/src/recur.h @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_RECUR +#define INCLUDED_RECUR + +#include +// cmake.h include header must come first + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +std::optional checked_add_datetime(Datetime& base, time_t delta); +void handleRecurrence(); +bool generateDueDates(Task& parent, std::vector& allDue); +std::optional getNextRecurrence(Datetime& current, std::string& period); +void updateRecurrenceMask(Task& task); +void handleUntil(); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/rules.cpp b/src/rules.cpp index 6843db465..21c46307d 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include static std::map gsColor; diff --git a/src/rules.h b/src/rules.h new file mode 100644 index 000000000..d0d8c7f85 --- /dev/null +++ b/src/rules.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_RULES +#define INCLUDED_RULES + +#include +// cmake.h include header must come first + +#include +#include +#include + +void initializeColorRules(); +void autoColorize(Task& task, Color& c); +std::string colorizeHeader(const std::string& input); +std::string colorizeFootnote(const std::string& input); +std::string colorizeError(const std::string& input); +std::string colorizeDebug(const std::string& input); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/sort.h b/src/sort.h new file mode 100644 index 000000000..6972f9c2e --- /dev/null +++ b/src/sort.h @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2025, Tomas Babej, Paul Beckingham, Federico Hernandez, +// Tobias Predel. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// https://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_SORT +#define INCLUDED_SORT + +#include +// cmake.h include header must come first + +#include + +#include +#include +#include +#include + +void sort_tasks(std::vector& data, std::vector& order, const std::string& keys); + +void sort_projects(std::list>& sorted, + std::map& allProjects); + +void sort_projects(std::list>& sorted, + std::map& allProjects); + +#endif + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/util.cpp b/src/util.cpp index 78174028b..ebbbf2191 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -34,8 +34,8 @@ #ifdef FREEBSD #define _WITH_GETLINE #endif +#include #include -#include #include #include #include diff --git a/test/col_test.cpp b/test/col_test.cpp index d2ffd378c..d6a8f5e1d 100644 --- a/test/col_test.cpp +++ b/test/col_test.cpp @@ -28,8 +28,6 @@ // cmake.h include header must come first #include -#include -#include #include //////////////////////////////////////////////////////////////////////////////// diff --git a/test/make_tc_task.cpp b/test/make_tc_task.cpp index b14560a8e..37f1d963f 100644 --- a/test/make_tc_task.cpp +++ b/test/make_tc_task.cpp @@ -28,16 +28,12 @@ // cmake.h include header must come first #include -#include #include #include #include #include #include -#include - -#include "format.h" namespace { diff --git a/test/t_test.cpp b/test/t_test.cpp index a7063b19f..f953914fd 100644 --- a/test/t_test.cpp +++ b/test/t_test.cpp @@ -27,10 +27,11 @@ #include // cmake.h include header must come first -#include #include #include +#include "Context.h" + //////////////////////////////////////////////////////////////////////////////// int TEST_NAME(int, char**) { UnitTest test(48); diff --git a/test/tdb2_test.cpp b/test/tdb2_test.cpp index 76a27cc33..f1baf2444 100644 --- a/test/tdb2_test.cpp +++ b/test/tdb2_test.cpp @@ -27,12 +27,10 @@ #include // cmake.h include header must come first -#include -#include #include #include -#include +#include "Context.h" namespace { diff --git a/test/tw_2689_test.cpp b/test/tw_2689_test.cpp index cbbad40f1..81610eeba 100644 --- a/test/tw_2689_test.cpp +++ b/test/tw_2689_test.cpp @@ -26,11 +26,9 @@ #include -#include // cmake.h include header must come first -#include -#include +#include #include //////////////////////////////////////////////////////////////////////////////// diff --git a/test/util_test.cpp b/test/util_test.cpp index 8e52a723a..43a9c9bcd 100644 --- a/test/util_test.cpp +++ b/test/util_test.cpp @@ -27,12 +27,11 @@ #include // cmake.h include header must come first -#include -#include +#include +#include #include #include -#include #include //////////////////////////////////////////////////////////////////////////////// diff --git a/test/view_test.cpp b/test/view_test.cpp index 51423e4db..09b0c774c 100644 --- a/test/view_test.cpp +++ b/test/view_test.cpp @@ -31,9 +31,8 @@ #include #include #include -#include +#include #include -#include #include #include