OSDN Git Service

Change Dir Structure to be same as TortoiseSVN'
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / RevisionGraph / ModificationOptions.h
diff --git a/src/TortoiseProc/RevisionGraph/ModificationOptions.h b/src/TortoiseProc/RevisionGraph/ModificationOptions.h
new file mode 100644 (file)
index 0000000..5ffe672
--- /dev/null
@@ -0,0 +1,77 @@
+// TortoiseSVN - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2003-2008 - TortoiseSVN\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#pragma once\r
+\r
+// include base classes\r
+\r
+#include "RevisionGraphOptions.h"\r
+\r
+/**\r
+* Extends the base interface with a method that has full\r
+* modifying access to a given visible graph.\r
+*/\r
+\r
+class IModificationOption : public IOrderedTraversalOption\r
+{\r
+public:\r
+\r
+    virtual void Apply (CVisibleGraph* graph, CVisibleGraphNode* node) = 0;\r
+};\r
+\r
+/**\r
+* Filtered sub-set of \ref CAllRevisionGraphOptions.\r
+* It applies all options in the order defined by their \ref priority.\r
+* The option instances may transform the graph any way they consider fit.\r
+*\r
+* Contains only \ref IModificationOption instances.\r
+*/\r
+\r
+class CModificationOptions : public CRevisionGraphOptionList\r
+{\r
+private:\r
+\r
+    std::vector<IModificationOption*> options;\r
+\r
+    /// apply a filter using differnt traversal orders\r
+\r
+    void TraverseFromRootCopiesFirst ( IModificationOption* option\r
+                                     , CVisibleGraph* graph\r
+                                     , CVisibleGraphNode* node);\r
+    void TraverseToRootCopiesFirst ( IModificationOption* option\r
+                                   , CVisibleGraph* graph\r
+                                   , CVisibleGraphNode* node);\r
+    void TraverseFromRootCopiesLast ( IModificationOption* option\r
+                                    , CVisibleGraph* graph\r
+                                    , CVisibleGraphNode* node);\r
+    void TraverseToRootCopiesLast ( IModificationOption* option\r
+                                  , CVisibleGraph* graph\r
+                                  , CVisibleGraphNode* node);\r
+\r
+public:\r
+\r
+    /// construction / destruction\r
+\r
+    CModificationOptions (const std::vector<IModificationOption*>& options);\r
+    virtual ~CModificationOptions() {}\r
+\r
+    /// apply all filters \r
+\r
+    void Apply (CVisibleGraph* graph);\r
+};\r
+\r