OSDN Git Service

Add TortoiseProc
[tortoisegit/TortoiseGitJp.git] / TortoiseProc / RevisionGraph / ModificationOptions.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2008 - TortoiseSVN\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #pragma once\r
20 \r
21 // include base classes\r
22 \r
23 #include "RevisionGraphOptions.h"\r
24 \r
25 /**\r
26 * Extends the base interface with a method that has full\r
27 * modifying access to a given visible graph.\r
28 */\r
29 \r
30 class IModificationOption : public IOrderedTraversalOption\r
31 {\r
32 public:\r
33 \r
34     virtual void Apply (CVisibleGraph* graph, CVisibleGraphNode* node) = 0;\r
35 };\r
36 \r
37 /**\r
38 * Filtered sub-set of \ref CAllRevisionGraphOptions.\r
39 * It applies all options in the order defined by their \ref priority.\r
40 * The option instances may transform the graph any way they consider fit.\r
41 *\r
42 * Contains only \ref IModificationOption instances.\r
43 */\r
44 \r
45 class CModificationOptions : public CRevisionGraphOptionList\r
46 {\r
47 private:\r
48 \r
49     std::vector<IModificationOption*> options;\r
50 \r
51     /// apply a filter using differnt traversal orders\r
52 \r
53     void TraverseFromRootCopiesFirst ( IModificationOption* option\r
54                                      , CVisibleGraph* graph\r
55                                      , CVisibleGraphNode* node);\r
56     void TraverseToRootCopiesFirst ( IModificationOption* option\r
57                                    , CVisibleGraph* graph\r
58                                    , CVisibleGraphNode* node);\r
59     void TraverseFromRootCopiesLast ( IModificationOption* option\r
60                                     , CVisibleGraph* graph\r
61                                     , CVisibleGraphNode* node);\r
62     void TraverseToRootCopiesLast ( IModificationOption* option\r
63                                   , CVisibleGraph* graph\r
64                                   , CVisibleGraphNode* node);\r
65 \r
66 public:\r
67 \r
68     /// construction / destruction\r
69 \r
70     CModificationOptions (const std::vector<IModificationOption*>& options);\r
71     virtual ~CModificationOptions() {}\r
72 \r
73     /// apply all filters \r
74 \r
75     void Apply (CVisibleGraph* graph);\r
76 };\r
77 \r