OSDN Git Service

Enable Clean Up and Show log at GitStatusListCtrl
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / ILogReceiver.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2007-2007 - 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 ///////////////////////////////////////////////////////////////\r
22 // temporarily used to disambiguate LogChangedPath definitions\r
23 ///////////////////////////////////////////////////////////////\r
24 \r
25 #ifndef __ILOGRECEIVER_H__\r
26 #define __ILOGRECEIVER_H__\r
27 #endif\r
28 \r
29 ///////////////////////////////////////////////////////////////\r
30 // required includes\r
31 ///////////////////////////////////////////////////////////////\r
32 \r
33 //#include "svn_types.h"\r
34 \r
35 \r
36 /**\r
37  * data structure to accommodate the change list.\r
38  */\r
39 struct LogChangedPath\r
40 {\r
41         CString sPath;\r
42 //      CString sCopyFromPath;\r
43         CString lCopyFromRev;\r
44         DWORD action;\r
45 \r
46         /// returns the action as a string\r
47         const CString& GetAction() const;\r
48 \r
49 private:\r
50 \r
51         /// cached return value of GetAction()\r
52         mutable CString actionAsString;\r
53 };\r
54 \r
55 \r
56 \r
57 /// auto-deleting extension of MFC Arrays for pointer arrays\r
58 \r
59 template<class T>\r
60 class CAutoArray : public CArray<T*,T*>\r
61 {\r
62 public:\r
63 \r
64     // default and copy construction\r
65 \r
66     CAutoArray() \r
67     {\r
68     }\r
69 \r
70     CAutoArray (const CAutoArray& rhs)\r
71     {\r
72         Copy (rhs);\r
73     }\r
74 \r
75     // destruction deletes members\r
76 \r
77     ~CAutoArray()\r
78     {\r
79             for (INT_PTR i = 0, count = GetCount(); i < count; ++i)\r
80                     delete GetAt (i);\r
81     }\r
82 };\r
83 \r
84 typedef CAutoArray<LogChangedPath> LogChangedPathArray;\r
85 \r
86 /**\r
87  * standard revision properties\r
88  */\r
89 \r
90 struct StandardRevProps\r
91 {\r
92     CString author;\r
93 //    apr_time_t timeStamp;\r
94     CString message;\r
95 };\r
96 \r
97 /**\r
98  * data structure to accommodate the list of user-defined revision properties.\r
99  */\r
100 struct UserRevProp\r
101 {\r
102         CString name;\r
103         CString value;\r
104 };\r
105 \r
106 typedef CAutoArray<UserRevProp> UserRevPropArray;\r
107 \r
108 \r
109 /**\r
110  * Interface for receiving log information. It will be used as a callback\r
111  * in ILogQuery::Log().\r
112  *\r
113  * To cancel the log and/or indicate errors, throw an SVNError exception.\r
114  */\r
115 class ILogReceiver\r
116 {\r
117 public:\r
118 \r
119         /// call-back for every revision found\r
120         /// (called at most once per revision)\r
121     ///\r
122     /// the implementation may modify but not delete()\r
123     /// the data containers passed to it\r
124     ///\r
125     /// any pointer may be NULL\r
126         ///\r
127         /// may throw a SVNError to cancel the log\r
128 \r
129         virtual void ReceiveLog ( LogChangedPathArray* changes\r
130                                                         , CString rev\r
131                             , const StandardRevProps* stdRevProps\r
132                             , UserRevPropArray* userRevProps\r
133                             , bool mergesFollow) = 0;\r
134 };\r