OSDN Git Service

Enable Sync Dialog Resize
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Blame.h
1 // TortoiseGit - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2008 - TortoiseGit\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 \r
20 #pragma once\r
21 #include "Git.h"\r
22 #include "ProgressDlg.h"\r
23 #include "GitRev.h"\r
24 #include "StdioFileT.h"\r
25 #include "GitStatus.h"\r
26 \r
27 class CTGitPath;\r
28 \r
29 /**\r
30  * \ingroup TortoiseProc\r
31  * Helper class to get the blame information for a file.\r
32  */\r
33 class CBlame  \r
34 {\r
35 public:\r
36         CBlame();\r
37         virtual ~CBlame();\r
38 \r
39         /**\r
40          * Determine for every line in a versioned file the author, revision of last change, date of last\r
41          * change. The result is saved to a temporary file.\n\r
42          * Since this operation takes a long time a progress dialog is shown if \a showprogress is set to TRUE\r
43          * \param startrev the starting revision of the operation\r
44          * \param endrev the revision to stop the operation\r
45          * \param pegrev the peg revision\r
46          * \param path the path to the file to determine the required information\r
47          * \return The path to the temporary file or an empty string in case of an error.\r
48          */\r
49         CString         BlameToTempFile(const CTGitPath& path, GitRev startrev, GitRev endrev, GitRev pegrev, CString& logfile, const CString& options, BOOL includemerge, BOOL showprogress, BOOL ignoremimetype);\r
50 \r
51         bool            BlameToFile(const CTGitPath& path, GitRev startrev, GitRev endrev, GitRev peg, const CTGitPath& tofile, const CString& options, BOOL ignoremimetype, BOOL includemerge);\r
52 private:\r
53         BOOL            BlameCallback(LONG linenumber, git_revnum_t revision, const CString& author, const CString& date,\r
54                                                                 git_revnum_t merged_revision, const CString& merged_author, const CString& merged_date, const CString& merged_path,\r
55                                                                 const CStringA& line);\r
56         BOOL            Cancel();\r
57 /*\r
58         BOOL            Notify(const CTGitPath& path, git_wc_notify_action_t action, \r
59                                                 git_node_kind_t kind, const CString& mime_type, \r
60                                                 git_wc_notify_state_t content_state, \r
61                                                 git_wc_notify_state_t prop_state, LONG rev,\r
62                                                 const git_lock_t * lock, git_wc_notify_lock_state_t lock_state,\r
63                                                 git_error_t * err, apr_pool_t * pool);\r
64                                                 */\r
65         //BOOL          Log(git_revnum_t rev, const CString& author, const CString& date, const CString& message, LogChangedPathArray * cpaths, apr_time_t time, int filechanges, BOOL copies, DWORD actions, BOOL haschildren);\r
66 private:\r
67         BOOL            m_bCancelled;                   ///< TRUE if the operation should be canceled\r
68         LONG            m_nCounter;                             ///< Counts the number of calls to the Cancel() callback (revisions?)\r
69         LONG            m_nHeadRev;                             ///< The HEAD revision of the file\r
70         bool            m_bNoLineNo;                    ///< if true, then the line number isn't written to the file\r
71         bool            m_bHasMerges;                   ///< If the blame has merge info, this is set to true\r
72 \r
73         CString         m_sSavePath;                    ///< Where to save the blame data\r
74         CStdioFileT     m_saveFile;                             ///< The file object to write to\r
75         CFile           m_saveLog;\r
76         CProgressDlg m_progressDlg;                     ///< The progress dialog shown during operation\r
77         LONG            m_lowestrev;\r
78         LONG            m_highestrev;\r
79 };\r