OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / src / Git / GitStatusListCtrl.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 #include "TGitPath.h"\r
21 #include "GitStatus.h"\r
22 #include "GitRev.h"\r
23 #include "GitConfig.h"\r
24 #include "Colors.h"\r
25 #include "XPTheme.h"\r
26 #include "CommonResource.h"\r
27 \r
28 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1)\r
29 \r
30 // these defines must be in the order the columns are inserted!\r
31 #define SVNSLC_COLFILENAME                      0x000000002\r
32 #define SVNSLC_COLEXT                           0x000000004\r
33 #define SVNSLC_COLSTATUS                        0x000000008\r
34 #define SVNSLC_COLTEXTSTATUS            0x000000010\r
35 #define SVNSLC_COLPROPSTATUS            0x000000020\r
36 #define SVNSLC_COLAUTHOR                        0x000000040\r
37 #define SVNSLC_COLREVISION                      0x000000080\r
38 #define SVNSLC_COLDATE                          0x000000100\r
39 #define SVNSLC_COLMODIFICATIONDATE      0x000000200\r
40 #define SVNSLC_COLADD                           0x000000400\r
41 #define SVNSLC_COLDEL                           0x000000800\r
42 #define SVNSLC_NUMCOLUMNS                       12\r
43 \r
44 //#define SVNSLC_COLREMOTESTATUS                0x000000010\r
45 //#define SVNSLC_COLREMOTETEXT          0x000000080\r
46 //#define SVNSLC_COLREMOTEPROP          0x000000100\r
47 //#define SVNSLC_COLURL                         0x000000200\r
48 //#define SVNSLC_COLLOCK                                0x000000400\r
49 //#define SVNSLC_COLLOCKCOMMENT         0x000000800\r
50 \r
51 //#define       SVNSLC_COLREMOTEREVISION        0x000004000\r
52 \r
53 //#define SVNSLC_COLSVNNEEDSLOCK                0x000010000\r
54 //#define SVNSLC_COLCOPYFROM                    0x000020000\r
55 \r
56                 \r
57 #define SVNSLC_SHOWUNVERSIONED  CTGitPath::LOGACTIONS_UNVER\r
58 #define SVNSLC_SHOWNORMAL               0x000000000\r
59 #define SVNSLC_SHOWMODIFIED             (CTGitPath::LOGACTIONS_MODIFIED)\r
60 #define SVNSLC_SHOWADDED                (CTGitPath::LOGACTIONS_ADDED|CTGitPath::LOGACTIONS_COPY)\r
61 #define SVNSLC_SHOWREMOVED              CTGitPath::LOGACTIONS_DELETED\r
62 #define SVNSLC_SHOWCONFLICTED   CTGitPath::LOGACTIONS_UNMERGED\r
63 #define SVNSLC_SHOWMISSING              0x00000000\r
64 #define SVNSLC_SHOWREPLACED             CTGitPath::LOGACTIONS_REPLACED\r
65 #define SVNSLC_SHOWMERGED               CTGitPath::LOGACTIONS_MERGED\r
66 #define SVNSLC_SHOWIGNORED              CTGitPath::LOGACTIONS_IGNORE\r
67 #define SVNSLC_SHOWOBSTRUCTED   0x00000000\r
68 #define SVNSLC_SHOWEXTERNAL             0x00000000\r
69 #define SVNSLC_SHOWINCOMPLETE   0x00000000\r
70 #define SVNSLC_SHOWINEXTERNALS  0x00000000\r
71 #define SVNSLC_SHOWREMOVEDANDPRESENT 0x00000000\r
72 #define SVNSLC_SHOWLOCKS                0x00000000\r
73 #define SVNSLC_SHOWDIRECTFILES  0x00000000\r
74 #define SVNSLC_SHOWDIRECTFOLDER 0x00000000\r
75 #define SVNSLC_SHOWEXTERNALFROMDIFFERENTREPO 0x00000000\r
76 #define SVNSLC_SHOWSWITCHED             0x00000000\r
77 #define SVNSLC_SHOWINCHANGELIST 0x00000000\r
78 \r
79 #define SVNSLC_SHOWDIRECTS              (SVNSLC_SHOWDIRECTFILES | SVNSLC_SHOWDIRECTFOLDER)\r
80 \r
81 \r
82 #define SVNSLC_SHOWVERSIONED (CTGitPath::LOGACTIONS_FORWORD|SVNSLC_SHOWNORMAL|SVNSLC_SHOWMODIFIED|\\r
83 SVNSLC_SHOWADDED|SVNSLC_SHOWREMOVED|SVNSLC_SHOWCONFLICTED|SVNSLC_SHOWMISSING|\\r
84 SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWIGNORED|SVNSLC_SHOWOBSTRUCTED|\\r
85 SVNSLC_SHOWEXTERNAL|SVNSLC_SHOWINCOMPLETE|SVNSLC_SHOWINEXTERNALS|\\r
86 SVNSLC_SHOWEXTERNALFROMDIFFERENTREPO)\r
87 \r
88 #define SVNSLC_SHOWVERSIONEDBUTNORMAL (SVNSLC_SHOWMODIFIED|SVNSLC_SHOWADDED|\\r
89 SVNSLC_SHOWREMOVED|SVNSLC_SHOWCONFLICTED|SVNSLC_SHOWMISSING|\\r
90 SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWIGNORED|SVNSLC_SHOWOBSTRUCTED|\\r
91 SVNSLC_SHOWEXTERNAL|SVNSLC_SHOWINCOMPLETE|SVNSLC_SHOWINEXTERNALS|\\r
92 SVNSLC_SHOWEXTERNALFROMDIFFERENTREPO)\r
93 \r
94 #define SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS (SVNSLC_SHOWMODIFIED|\\r
95 SVNSLC_SHOWADDED|SVNSLC_SHOWREMOVED|SVNSLC_SHOWCONFLICTED|SVNSLC_SHOWMISSING|\\r
96 SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWIGNORED|SVNSLC_SHOWOBSTRUCTED|\\r
97 SVNSLC_SHOWINCOMPLETE|SVNSLC_SHOWEXTERNAL|SVNSLC_SHOWINEXTERNALS)\r
98 \r
99 #define SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALS (SVNSLC_SHOWMODIFIED|\\r
100         SVNSLC_SHOWADDED|SVNSLC_SHOWREMOVED|SVNSLC_SHOWCONFLICTED|SVNSLC_SHOWMISSING|\\r
101         SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWIGNORED|SVNSLC_SHOWOBSTRUCTED|\\r
102         SVNSLC_SHOWINCOMPLETE)\r
103 \r
104 #define SVNSLC_SHOWALL (SVNSLC_SHOWVERSIONED|SVNSLC_SHOWUNVERSIONED)\r
105 \r
106 #define SVNSLC_POPALL                                   0xFFFFFFFFFFFFFFFF\r
107 #define SVNSLC_POPCOMPAREWITHBASE               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_COMPARE) \r
108 #define SVNSLC_POPCOMPARE                               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_COMPAREWC) \r
109 #define SVNSLC_POPGNUDIFF                               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_GNUDIFF1) \r
110 #define SVNSLC_POPREVERT                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_REVERT) \r
111 #define SVNSLC_POPUPDATE                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_UPDATE)\r
112 #define SVNSLC_POPSHOWLOG                               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_LOG)\r
113 #define SVNSLC_POPOPEN                                  CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_OPEN)\r
114 #define SVNSLC_POPDELETE                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_DELETE)\r
115 #define SVNSLC_POPADD                                   CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_ADD)\r
116 #define SVNSLC_POPIGNORE                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_IGNORE)\r
117 #define SVNSLC_POPCONFLICT                              CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_EDITCONFLICT)\r
118 #define SVNSLC_POPRESOLVE                               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_RESOLVECONFLICT)\r
119 #define SVNSLC_POPLOCK                                  CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_LOCK)\r
120 #define SVNSLC_POPUNLOCK                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_UNLOCK)\r
121 #define SVNSLC_POPUNLOCKFORCE                   CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_UNLOCKFORCE)\r
122 #define SVNSLC_POPEXPLORE                               CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_EXPLORE)\r
123 #define SVNSLC_POPCOMMIT                                CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_COMMIT)\r
124 #define SVNSLC_POPPROPERTIES                    CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_PROPERTIES)\r
125 #define SVNSLC_POPREPAIRMOVE                    CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_REPAIRMOVE)\r
126 #define SVNSLC_POPCHANGELISTS                   CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_CHECKGROUP)\r
127 #define SVNSLC_POPBLAME                                 CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDSVNLC_BLAME)\r
128 \r
129 #define SVNSLC_IGNORECHANGELIST                 _T("ignore-on-commit")\r
130 \r
131 // This gives up to 64 standard properties and menu entries\r
132 // plus 192 user-defined properties (should be plenty).\r
133 // User-defined properties will start at column SVNSLC_NUMCOLUMNS+1\r
134 // but in the registry, we will record them starting at SVNSLC_USERPROPCOLOFFSET.\r
135 \r
136 #define SVNSLC_USERPROPCOLOFFSET        0x40\r
137 #define SVNSLC_USERPROPCOLLIMIT         0xff\r
138 #define SVNSLC_MAXCOLUMNCOUNT           0xff\r
139 \r
140 // Supporting extreamly long user props makes no sense here --\r
141 // especially for binary properties. CString uses a pool allocator\r
142 // that works for up to 256 chars. Make sure we are well below that.\r
143 \r
144 #define SVNSLC_MAXUSERPROPLENGTH        0x70\r
145 \r
146 typedef int (__cdecl *GENERICCOMPAREFN)(const void * elem1, const void * elem2);\r
147 typedef CComCritSecLock<CComCriticalSection> Locker;\r
148 \r
149 class CGitStatusListCtrlDropTarget;\r
150 /**\r
151  * \ingroup SVN\r
152  * A List control, based on the MFC CListCtrl which shows a list of\r
153  * files with their Subversion status. The control also provides a context\r
154  * menu to do some Subversion tasks on the selected files.\r
155  *\r
156  * This is the main control used in many dialogs to show a list of files to\r
157  * work on.\r
158  */\r
159 class CGitStatusListCtrl :\r
160         public CListCtrl\r
161 {\r
162 public:\r
163         enum\r
164         {\r
165                 IDSVNLC_REVERT = 1,\r
166                 IDSVNLC_COMPARE,\r
167                 IDSVNLC_OPEN,   \r
168                 IDSVNLC_DELETE,\r
169                 IDSVNLC_IGNORE,\r
170                 IDSVNLC_GNUDIFF1                 ,\r
171                 IDSVNLC_UPDATE          ,\r
172                 IDSVNLC_LOG              ,\r
173                 IDSVNLC_EDITCONFLICT     ,\r
174                 IDSVNLC_IGNOREMASK          ,\r
175                 IDSVNLC_ADD                         ,\r
176                 IDSVNLC_RESOLVECONFLICT ,\r
177                 IDSVNLC_LOCK                    ,\r
178                 IDSVNLC_LOCKFORCE               ,\r
179                 IDSVNLC_UNLOCK                  ,\r
180                 IDSVNLC_UNLOCKFORCE             ,\r
181                 IDSVNLC_OPENWITH                ,\r
182                 IDSVNLC_EXPLORE                 ,\r
183                 IDSVNLC_RESOLVETHEIRS   ,\r
184                 IDSVNLC_RESOLVEMINE             ,\r
185                 IDSVNLC_REMOVE                  ,\r
186                 IDSVNLC_COMMIT                  ,\r
187                 IDSVNLC_PROPERTIES              ,\r
188                 IDSVNLC_COPY                    ,\r
189                 IDSVNLC_COPYEXT                 ,\r
190                 IDSVNLC_REPAIRMOVE              ,\r
191                 IDSVNLC_REMOVEFROMCS    ,\r
192                 IDSVNLC_CREATECS                ,\r
193                 IDSVNLC_CREATEIGNORECS  ,\r
194                 IDSVNLC_CHECKGROUP              ,\r
195                 IDSVNLC_UNCHECKGROUP    ,\r
196                 IDSVNLC_ADD_RECURSIVE   ,\r
197                 IDSVNLC_COMPAREWC               ,\r
198                 IDSVNLC_BLAME                   ,\r
199                 IDSVNLC_SAVEAS                  ,\r
200                 IDSVNLC_REVERTTOREV             ,\r
201                 IDSVNLC_VIEWREV                 ,\r
202                 IDSVNLC_FINDENTRY       ,\r
203                 IDSVNLC_COMPARETWO              ,\r
204                 IDSVNLC_GNUDIFF2                ,\r
205 // the IDSVNLC_MOVETOCS *must* be the last index, because it contains a dynamic submenu where \r
206 // the submenu items get command ID's sequent to this number\r
207                 IDSVNLC_MOVETOCS                ,\r
208         };\r
209         int GetColumnIndex(int colmask);\r
210         static inline unsigned __int64 GetContextMenuBit(int i){ return ((unsigned __int64 )0x1)<<i ;}\r
211         /**\r
212          * Sent to the parent window (using ::SendMessage) after a context menu\r
213          * command has finished if the item count has changed.\r
214          */\r
215         static const UINT SVNSLNM_ITEMCOUNTCHANGED;\r
216         /**\r
217          * Sent to the parent window (using ::SendMessage) when the control needs\r
218          * to be refreshed. Since this is done usually in the parent window using\r
219          * a thread, this message is used to tell the parent to do exactly that.\r
220          */\r
221         static const UINT SVNSLNM_NEEDSREFRESH;\r
222 \r
223         /**\r
224          * Sent to the parent window (using ::SendMessage) when the user drops\r
225          * files on the control. The LPARAM is a pointer to a TCHAR string\r
226          * containing the dropped path.\r
227          */\r
228         static const UINT SVNSLNM_ADDFILE;\r
229 \r
230         /**\r
231          * Sent to the parent window (using ::SendMessage) when the user checks/unchecks\r
232          * one or more items in the control. The WPARAM contains the number of\r
233          * checked items in the control.\r
234          */\r
235         static const UINT SVNSLNM_CHECKCHANGED;\r
236 \r
237         static const UINT SVNSLNM_ITEMCHANGED;\r
238 \r
239         CGitStatusListCtrl(void);\r
240         ~CGitStatusListCtrl(void);\r
241 \r
242         CString m_Rev1;\r
243         CString m_Rev2;\r
244 \r
245         /**\r
246          * \ingroup TortoiseProc\r
247          * Helper class for CGitStatusListCtrl which represents\r
248          * the data for each file shown.\r
249          */\r
250 #if 0\r
251         class FileEntry\r
252         {\r
253         public:\r
254                 FileEntry() : status(git_wc_status_unversioned)\r
255 //                      , copyfrom_rev(GIT_REV_ZERO)\r
256                         , last_commit_date(0)\r
257                         , last_commit_rev(GIT_REV_ZERO)\r
258 //                      , remoterev(GIT_REV_ZERO)\r
259                         , textstatus(git_wc_status_unversioned)\r
260                         , propstatus(git_wc_status_unversioned)\r
261 //                      , remotestatus(git_wc_status_unversioned)\r
262 //                      , remotetextstatus(git_wc_status_unversioned)\r
263 //                      , remotepropstatus(git_wc_status_unversioned)\r
264                         , copied(false)\r
265                         , switched(false)\r
266                         , checked(false)\r
267                         , inunversionedfolder(false)\r
268                         , inexternal(false)\r
269                         , differentrepo(false)\r
270                         , direct(false)\r
271                         , isfolder(false)\r
272                         , isNested(false)\r
273                         , Revision(GIT_REV_ZERO)\r
274                         , isConflicted(false)\r
275 //                      , present_props()\r
276                         , needslock(false)\r
277 ///                     , working_size(SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN)\r
278                         , keeplocal(false)\r
279 //                      , depth(git_depth_unknown)\r
280                 {\r
281                 }\r
282                 const CTGitPath& GetPath() const\r
283                 {\r
284                         return path;\r
285                 }\r
286                 const bool IsChecked() const\r
287                 {\r
288                         return checked;\r
289                 }\r
290                 CString GetRelativeGitPath() const\r
291                 {\r
292                         if (path.IsEquivalentTo(basepath))\r
293                                 return path.GetGitPathString();\r
294                         return path.GetGitPathString().Mid(basepath.GetGitPathString().GetLength()+1);\r
295                 }\r
296 //              const bool IsLocked() const\r
297 //              {\r
298 //                      return !(lock_token.IsEmpty() && lock_remotetoken.IsEmpty());\r
299 //              }\r
300 //              const bool HasNeedsLock() const\r
301 //              {\r
302 //                      return needslock;\r
303 //              }\r
304                 const bool IsFolder() const\r
305                 {\r
306                         return isfolder;\r
307                 }\r
308                 const bool IsInExternal() const\r
309                 {\r
310                         return inexternal;\r
311                 }\r
312                 const bool IsNested() const\r
313                 {\r
314                         return isNested;\r
315                 }\r
316                 const bool IsFromDifferentRepository() const\r
317                 {\r
318                         return differentrepo;\r
319                 }\r
320                 CString GetDisplayName() const\r
321                 {\r
322                         CString const& chopped = path.GetDisplayString(&basepath);\r
323                         if (!chopped.IsEmpty())\r
324                         {\r
325                                 return chopped;\r
326                         }\r
327                         else\r
328                         {\r
329                                 // "Display name" must not be empty.\r
330                                 return path.GetFileOrDirectoryName();\r
331                         }\r
332                 }\r
333                 CString GetChangeList() const\r
334                 {\r
335                         return changelist;\r
336                 }\r
337 //              CString GetURL() const\r
338 //              {\r
339 //                      return url;\r
340 //              }\r
341         public:\r
342                 git_wc_status_kind              status;                                 ///< local status\r
343                 git_wc_status_kind              textstatus;                             ///< local text status\r
344                 git_wc_status_kind              propstatus;                             ///< local property status\r
345                 \r
346         private:\r
347                 CTGitPath                               path;                                   ///< full path of the file\r
348                 CTGitPath                               basepath;                               ///< common ancestor path of all files\r
349                 \r
350                 CString                                 changelist;                             ///< the name of the changelist the item belongs to\r
351                 \r
352                 CString                                 last_commit_author;             ///< the author which last committed this item\r
353                 CTime                                   last_commit_date;               ///< the date when this item was last committed\r
354                 git_revnum_t                    last_commit_rev;                ///< the revision where this item was last committed\r
355                 \r
356                 git_revnum_t                    remoterev;                              ///< the revision in HEAD of the repository\r
357                 bool                                    copied;                                 ///< if the file/folder is added-with-history\r
358                 bool                                    switched;                               ///< if the file/folder is switched to another url\r
359                 bool                                    checked;                                ///< if the file is checked in the list control\r
360                 bool                                    inunversionedfolder;    ///< if the file is inside an unversioned folder\r
361                 bool                                    inexternal;                             ///< if the item is in an external folder\r
362                 bool                                    differentrepo;                  ///< if the item is from a different repository than the rest\r
363                 bool                                    direct;                                 ///< directly included (TRUE) or just a child of a folder\r
364                 bool                                    isfolder;                               ///< TRUE if entry refers to a folder\r
365                 bool                                    isNested;                               ///< TRUE if the folder from a different repository and/or path\r
366                 bool                                    isConflicted;                   ///< TRUE if a file entry is conflicted, i.e. if it has the conflicted paths set\r
367                 bool                                    needslock;                              ///< TRUE if the Git:needs-lock property is set\r
368                 git_revnum_t                    Revision;                               ///< the base revision\r
369 //              PropertyList                    present_props;                  ///< cacheable properties present in BASE\r
370                 bool                                    keeplocal;                              ///< Whether a local copy of this entry should be kept in the working copy after a deletion has been committed\r
371                 git_depth_t                             depth;                                  ///< the depth of this entry\r
372                 friend class CGitStatusListCtrl;\r
373                 friend class CGitStatusListCtrlDropTarget;\r
374         friend class CSorter;\r
375         };\r
376 #endif\r
377         /**\r
378          * \ingroup TortoiseProc\r
379          * Helper class for CGitStatusListCtrl that represents\r
380          * the columns visible and their order as well as \r
381      * persisting that data in the registry.\r
382      *\r
383      * It assigns logical index values to the (potential) columns:\r
384      * 0 .. GitSLC_NUMCOLUMNS-1 contain the standard attributes\r
385      * GitSLC_USERPROPCOLOFFSET .. GitSLC_MAXCOLUMNCOUNT are user props.\r
386      *\r
387      * The column vector contains the columns that are actually\r
388      * available in the control.\r
389      *\r
390      * Since the set of userprops may change from one WC to another,\r
391      * we also store the settings (width and order) for those\r
392      * userprops that are not used in this WC.\r
393      *\r
394      * A userprop is considered "in use", if the respective column\r
395      * is not hidden or if at least one item has this property set.\r
396          */\r
397         class ColumnManager\r
398         {\r
399     public:\r
400 \r
401         /// construction / destruction\r
402 \r
403         ColumnManager (CListCtrl* control) : control (control) {};\r
404         ~ColumnManager() {};\r
405 \r
406         /// registry access\r
407 \r
408         void ReadSettings (DWORD defaultColumns, const CString& containerName);\r
409         void WriteSettings() const;\r
410 \r
411         /// read column definitions\r
412 \r
413         int GetColumnCount() const;                     ///< total number of columns\r
414         bool IsVisible (int column) const;\r
415                 int GetInvisibleCount() const;\r
416         bool IsRelevant (int column) const;\r
417         bool IsUserProp (int column) const;\r
418         CString GetName (int column) const;\r
419         int GetWidth (int column, bool useDefaults = false) const;\r
420         int GetVisibleWidth (int column, bool useDefaults) const;\r
421 \r
422         /// switch columns on and off\r
423 \r
424         void SetVisible (int column, bool visible);\r
425 \r
426         /// tracking column modifications\r
427 \r
428         void ColumnMoved (int column, int position);\r
429         void ColumnResized (int column);\r
430 \r
431         /// call these to update the user-prop list\r
432         /// (will also auto-insert /-remove new list columns)\r
433 \r
434         //void UpdateUserPropList (const std::vector<FileEntry*>& files);\r
435         //void UpdateRelevance ( const std::vector<FileEntry*>& files\r
436          //                    , const std::vector<size_t>& visibleFiles);\r
437 \r
438         /// don't clutter the context menu with irrelevant prop info\r
439 \r
440         bool AnyUnusedProperties() const;\r
441         void RemoveUnusedProps();\r
442 \r
443         /// bring everything back to its "natural" order\r
444 \r
445         void ResetColumns (DWORD defaultColumns);\r
446 \r
447     private:\r
448 \r
449         /// initialization utilities\r
450 \r
451         void ParseUserPropSettings ( const CString& userPropList\r
452                                    , const CString& shownUserProps);\r
453         void ParseWidths (const CString& widths);\r
454         void SetStandardColumnVisibility (DWORD visibility);\r
455         void ParseColumnOrder (const CString& widths);\r
456         \r
457         /// map internal column order onto visible column order\r
458         /// (all invisibles in front)\r
459 \r
460         std::vector<int> GetGridColumnOrder();\r
461         void ApplyColumnOrder();\r
462 \r
463         /// utilities used when writing data to the registry\r
464 \r
465         DWORD GetSelectedStandardColumns() const;\r
466         CString GetUserPropList() const;\r
467         CString GetShownUserProps() const;\r
468         CString GetWidthString() const;\r
469         CString GetColumnOrderString() const;\r
470 \r
471         /// our parent control and its data\r
472 \r
473         CListCtrl* control;\r
474 \r
475         /// where to store in the registry\r
476 \r
477         CString registryPrefix;\r
478 \r
479         /// all columns in their "natural" order\r
480 \r
481         struct ColumnInfo\r
482         {\r
483             int index;          ///< is a user prop when < GitSLC_USERPROPCOLOFFSET\r
484             int width;\r
485             bool visible;\r
486             bool relevant;      ///< set to @a visible, if no *shown* item has that property\r
487         };\r
488 \r
489         std::vector<ColumnInfo> columns;\r
490 \r
491         /// user-defined properties\r
492 \r
493         struct UserProp\r
494         {\r
495             CString name;       ///< is a user prop when < GitSLC_USERPROPCOLOFFSET\r
496             int width;\r
497         };\r
498 \r
499         std::vector<UserProp> userProps;\r
500 \r
501         /// stored result from last UpdateUserPropList() call\r
502 \r
503         std::set<CString> itemProps;\r
504 \r
505         /// global column ordering including unused user props\r
506 \r
507         std::vector<int> columnOrder;\r
508 \r
509     };/**\r
510          * \ingroup TortoiseProc\r
511          * Simple utility class that defines the sort column order.\r
512          */\r
513     class CSorter\r
514     {\r
515     public:\r
516 \r
517         CSorter ( ColumnManager* columnManager\r
518                 , int sortedColumn\r
519                 , bool ascending);\r
520 \r
521         bool operator() ( const CTGitPath* entry1\r
522                         , const CTGitPath* entry2) const;\r
523 \r
524                 static int A2L(const CString &str)\r
525                 {\r
526                         if(str==_T("-"))\r
527                                 return -1;\r
528                         else\r
529                                 return _ttol(str);\r
530                 }\r
531 \r
532     private:\r
533 \r
534         ColumnManager* columnManager;\r
535         int sortedColumn;\r
536         bool ascending;\r
537     };\r
538 \r
539         /**\r
540          * Initializes the control, sets up the columns.\r
541          * \param dwColumns mask of columns to show. Use the GitSLC_COLxxx defines.\r
542          * \param sColumnInfoContainer Name of a registry key\r
543          *                             where the position and visibility of each column\r
544          *                             is saved and used from. If the registry key\r
545          *                             doesn't exist, the default order is used\r
546          *                             and dwColumns tells which columns are visible.\r
547          * \param dwContextMenus mask of context menus to be active, not all make sense for every use of this control.\r
548          *                       Use the GitSLC_POPxxx defines.\r
549          * \param bHasCheckboxes TRUE if the control should show check boxes on the left of each file entry.\r
550          */\r
551         void Init(DWORD dwColumns, const CString& sColumnInfoContainer, unsigned __int64 dwContextMenus = (SVNSLC_POPALL ^ SVNSLC_POPCOMMIT), bool bHasCheckboxes = true);\r
552         /**\r
553          * Sets a background image for the list control.\r
554          * The image is shown in the right bottom corner.\r
555          * \param nID the resource ID of the bitmap to use as the background\r
556          */\r
557         bool SetBackgroundImage(UINT nID);\r
558         /**\r
559          * Makes the 'ignore' context menu only ignore the files and not add the\r
560          * folder which gets the Git:ignore property changed to the list.\r
561          * This is needed e.g. for the Add-dialog, where the modified folder\r
562          * showing up would break the resulting "add" command.\r
563          */\r
564         void SetIgnoreRemoveOnly(bool bRemoveOnly = true) {m_bIgnoreRemoveOnly = bRemoveOnly;}\r
565         /**\r
566          * The unversioned items are by default shown after all other files in the list.\r
567          * If that behavior should be changed, set this value to false.\r
568          */\r
569         void PutUnversionedLast(bool bLast) {m_bUnversionedLast = bLast;}\r
570         /**\r
571          * Fetches the Subversion status of all files and stores the information\r
572          * about them in an internal array.\r
573          * \param sFilePath path to a file which contains a list of files and/or folders for which to\r
574          *                  fetch the status, separated by newlines.\r
575          * \param bUpdate TRUE if the remote status is requested too.\r
576          * \return TRUE on success.\r
577          */\r
578         BOOL GetStatus ( const CTGitPathList* pathList=NULL\r
579                    , bool bUpdate = false\r
580                    , bool bShowIgnores = false\r
581                                    , bool bShowUnRev=false\r
582                    , bool bShowUserProps = false);\r
583 \r
584         /**\r
585          * Populates the list control with the previously (with GetStatus) gathered status information.\r
586          * \param dwShow mask of file types to show. Use the GitSLC_SHOWxxx defines.\r
587          * \param dwCheck mask of file types to check. Use GitLC_SHOWxxx defines. Default (0) means 'use the entry's stored check status'\r
588          */\r
589         void Show(DWORD dwShow, DWORD dwCheck = 0, bool bShowFolders = true,BOOL updateStatusList=FALSE);\r
590         void Show(DWORD dwShow, const CTGitPathList& checkedList, bool bShowFolders = true);\r
591 \r
592         /**\r
593          * Copies the selected entries in the control to the clipboard. The entries\r
594          * are separated by newlines.\r
595          * \param dwCols the columns to copy. Each column is separated by a tab.\r
596          */\r
597         bool CopySelectedEntriesToClipboard(DWORD dwCols);\r
598 \r
599         /**\r
600          * If during the call to GetStatus() some Git:externals are found from different\r
601          * repositories than the first one checked, then this method returns TRUE.\r
602          */\r
603         BOOL HasExternalsFromDifferentRepos() const {return m_bHasExternalsFromDifferentRepos;}\r
604 \r
605         /**\r
606          * If during the call to GetStatus() some Git:externals are found then this method returns TRUE.\r
607          */\r
608         BOOL HasExternals() const {return m_bHasExternals;}\r
609 \r
610         /**\r
611          * If unversioned files are found (but not necessarily shown) TRUE is returned.\r
612          */\r
613         BOOL HasUnversionedItems() {return m_bHasUnversionedItems;}\r
614 \r
615         /**\r
616          * If there are any locks in the working copy, TRUE is returned\r
617          */\r
618         BOOL HasLocks() const {return m_bHasLocks;}\r
619 \r
620         /**\r
621          * If there are any change lists defined in the working copy, TRUE is returned\r
622          */\r
623         BOOL HasChangeLists() const {return m_bHasChangeLists;}\r
624 \r
625         /**\r
626          * Returns the file entry data for the list control index.\r
627          */\r
628         //CGitStatusListCtrl::FileEntry * GetListEntry(UINT_PTR index);\r
629 \r
630         /**\r
631          * Returns the file entry data for the specified path.\r
632          * \note The entry might not be shown in the list control.\r
633          */\r
634         //CGitStatusListCtrl::FileEntry * GetListEntry(const CTGitPath& path);\r
635 \r
636         /**\r
637          * Returns the index of the list control entry with the specified path,\r
638          * or -1 if the path is not in the list control.\r
639          */\r
640         int GetIndex(const CTGitPath& path);\r
641 \r
642         /**\r
643          * Returns the file entry data for the specified path in the list control.\r
644          */\r
645         //CGitStatusListCtrl::FileEntry * GetVisibleListEntry(const CTGitPath& path);\r
646 \r
647         /**\r
648          * Returns a String containing some statistics like number of modified, normal, deleted,...\r
649          * files.\r
650          */\r
651         CString GetStatisticsString();\r
652 \r
653         /**\r
654          * Set a static control which will be updated automatically with\r
655          * the number of selected and total files shown in the list control.\r
656          */\r
657         void SetStatLabel(CWnd * pStatLabel){m_pStatLabel = pStatLabel;};\r
658 \r
659         /**\r
660          * Set a tri-state checkbox which is updated automatically if the\r
661          * user checks/unchecks file entries in the list control to indicate\r
662          * if all files are checked, none are checked or some are checked.\r
663          */\r
664         void SetSelectButton(CButton * pButton) {m_pSelectButton = pButton;}\r
665 \r
666         /**\r
667          * Set a button which is de-/activated automatically. The button is\r
668          * only set active if at least one item is selected.\r
669          */\r
670         void SetConfirmButton(CButton * pButton) {m_pConfirmButton = pButton;}\r
671 \r
672         /**\r
673          * Select/unselect all entries in the list control.\r
674          * \param bSelect TRUE to check, FALSE to uncheck.\r
675          */\r
676         void SelectAll(bool bSelect, bool bIncludeNoCommits = false);\r
677 \r
678         /** Set a checkbox on an entry in the listbox\r
679          * Keeps the listctrl checked state and the FileEntry's checked flag in sync\r
680          */\r
681         void SetEntryCheck(CTGitPath* pEntry, int listboxIndex, bool bCheck);\r
682 \r
683         /** Write a list of the checked items' paths into a path list\r
684          */\r
685         void WriteCheckedNamesToPathList(CTGitPathList& pathList);\r
686 \r
687         /** fills in \a lMin and \a lMax with the lowest/highest revision of all\r
688          * files/folders in the working copy.\r
689          * \param bShownOnly if true, the min/max revisions are calculated only for shown items\r
690          * \param bCheckedOnly if true, the min/max revisions are calculated only for items \r
691          *                   which are checked.\r
692          * \remark Since an item can only be checked if it is visible/shown in the list control\r
693          *         bShownOnly is automatically set to true if bCheckedOnly is true\r
694          */\r
695         void GetMinMaxRevisions(git_revnum_t& rMin, git_revnum_t& rMax, bool bShownOnly, bool bCheckedOnly);\r
696 \r
697         /**\r
698          * Returns the parent directory of all entries in the control.\r
699          * if \a bStrict is set to false, then the paths passed to the control\r
700          * to fetch the status (in GetStatus()) are used if possible.\r
701          */\r
702         CString GetCommonDirectory(bool bStrict);\r
703 \r
704         /**\r
705          * Returns the parent url of all entries in the control.\r
706          * if \a bStrict is set to false, then the paths passed to the control\r
707          * to fetch the status (in GetStatus()) are used if possible.\r
708          */\r
709         CTGitPath GetCommonURL(bool bStrict);\r
710 \r
711         /**\r
712          * Sets a pointer to a boolean variable which is checked periodically\r
713          * during the status fetching. As soon as the variable changes to true,\r
714          * the operations stops.\r
715          */\r
716         void SetCancelBool(bool * pbCanceled) {m_pbCanceled = pbCanceled;}\r
717 \r
718         /**\r
719          * Sets the string shown in the control while the status is fetched.\r
720          * If not set, it defaults to "please wait..."\r
721          */\r
722         void SetBusyString(const CString& str) {m_sBusy = str;}\r
723         void SetBusyString(UINT id) {m_sBusy.LoadString(id);}\r
724 \r
725         /**\r
726          * Sets the string shown in the control if no items are shown. This\r
727          * can happen for example if there's nothing modified and the unversioned\r
728          * files aren't shown either, so there's nothing to commit.\r
729          * If not set, it defaults to "file list is empty".\r
730          */\r
731         void SetEmptyString(const CString& str) {m_sEmpty = str;}\r
732         void SetEmptyString(UINT id) {m_sEmpty.LoadString(id);}\r
733 \r
734         /**\r
735          * Determines if the control should recurse into unversioned folders\r
736          * when fetching the status. The default behavior is defined by the\r
737          * registry key HKCU\Software\TortoiseGit\UnversionedRecurse, which\r
738          * is read in the Init() method.\r
739          * If you want to change the behavior, call this method *after*\r
740          * calling Init().\r
741          */\r
742         void SetUnversionedRecurse(bool bUnversionedRecurse) {m_bUnversionedRecurse = bUnversionedRecurse;}\r
743 \r
744         /**\r
745          * Returns the number of selected items\r
746          */\r
747         LONG GetSelected(){return m_nSelected;};\r
748 \r
749         /**\r
750          * Enables dropping of files on the control.\r
751          */\r
752         bool EnableFileDrop();\r
753 \r
754         /**\r
755          * Checks if the path already exists in the list.\r
756          */\r
757         bool HasPath(const CTGitPath& path);\r
758         /**\r
759          * Checks if the path is shown/visible in the list control.\r
760          */\r
761         bool IsPathShown(const CTGitPath& path);\r
762         /**\r
763          * Forces the children to be checked when the parent folder is checked,\r
764          * and the parent folder to be unchecked if one of its children is unchecked.\r
765          */\r
766         void CheckChildrenWithParent(bool bCheck) {m_bCheckChildrenWithParent = bCheck;}\r
767 \r
768         /**\r
769          * Allows checking the items if change lists are present. If set to false,\r
770          * items are not checked if at least one changelist is available.\r
771          */\r
772         void CheckIfChangelistsArePresent(bool bCheck) {m_bCheckIfGroupsExist = bCheck;}\r
773         /**\r
774          * Returns the currently used show flags passed to the Show() method.\r
775          */\r
776         DWORD GetShowFlags() {return m_dwShow;}\r
777 public:\r
778         CString GetLastErrorMessage() {return m_sLastError;}\r
779 \r
780         void Block(BOOL block, BOOL blockUI) {m_bBlock = block; m_bBlockUI = blockUI;}\r
781 \r
782         LONG                                            m_nTargetCount;         ///< number of targets in the file passed to GetStatus()\r
783 \r
784         CString                                         m_sURL;                         ///< the URL of the target or "(multiple targets)"\r
785 \r
786         GitRev                                          m_HeadRev;                      ///< the HEAD revision of the repository if bUpdate was TRUE\r
787 \r
788         CString                                         m_sUUID;                        ///< the UUID of the associated repository\r
789 \r
790         BOOL                                            m_bIsRevertTheirMy;     ///< at rebase case, Their and My version is revert. \r
791 \r
792         DECLARE_MESSAGE_MAP()\r
793 \r
794 private:\r
795         void SaveColumnWidths(bool bSaveToRegistry = false);\r
796         void Sort();    ///< Sorts the control by columns\r
797         //void AddEntry(FileEntry * entry, WORD langID, int listIndex); ///< add an entry to the control\r
798         void RemoveListEntry(int index);        ///< removes an entry from the listcontrol and both arrays\r
799         bool BuildStatistics(); ///< build the statistics and correct the case of files/folders\r
800         void StartDiff(int fileindex);  ///< start the external diff program\r
801         void StartDiffWC(int fileindex);        ///< start the external diff program\r
802         void StartDiffTwo(int fileindex);\r
803         \r
804         enum\r
805         {\r
806                 NOTEPAD2,\r
807                 OPEN,\r
808                 OPEN_WITH,\r
809         };\r
810         void OpenFile(CTGitPath *path,int mode);\r
811 \r
812     /// fetch all user properties for all items\r
813     void FetchUserProperties();\r
814 \r
815         /// Process one line of the command file supplied to GetStatus\r
816         bool FetchStatusForSingleTarget(GitConfig& config, GitStatus& status, const CTGitPath& target, \r
817                 bool bFetchStatusFromRepository, CStringA& strCurrentRepositoryUUID, CTGitPathList& arExtPaths, \r
818                 bool bAllDirect, git_depth_t depth = git_depth_infinity, bool bShowIgnores = false);\r
819 \r
820         /// Create 'status' data for each item in an unversioned folder\r
821         void AddUnversionedFolder(const CTGitPath& strFolderName, const CTGitPath& strBasePath, GitConfig * config);\r
822 \r
823         /// Read the all the other status items which result from a single GetFirstStatus call\r
824         void ReadRemainingItemsStatus(GitStatus& status, const CTGitPath& strBasePath, CStringA& strCurrentRepositoryUUID, CTGitPathList& arExtPaths, GitConfig * config, bool bAllDirect);\r
825 \r
826         /// Clear the status vector (contains custodial pointers)\r
827         void ClearStatusArray();\r
828 \r
829         /// Sort predicate function - Compare the paths of two entries without regard to case\r
830         //static bool EntryPathCompareNoCase(const FileEntry* pEntry1, const FileEntry* pEntry2);\r
831 \r
832         /// Predicate used to build a list of only the versioned entries of the FileEntry array\r
833         //static bool IsEntryVersioned(const FileEntry* pEntry1);\r
834 \r
835         /// Look up the relevant show flags for a particular Git status value\r
836         DWORD GetShowFlagsFromGitStatus(git_wc_status_kind status);\r
837 \r
838         /// Build a FileEntry item and add it to the FileEntry array\r
839         //const FileEntry* AddNewFileEntry(\r
840         //      const git_wc_status2_t* pGitStatus,  // The return from the Git GetStatus functions\r
841         //      const CTGitPath& path,                          // The path of the item we're adding\r
842         //      const CTGitPath& basePath,                      // The base directory for this status build\r
843         //      bool bDirectItem,                                       // Was this item the first found by GetFirstFileStatus or by a subsequent GetNextFileStatus call\r
844         //      bool bInExternal,                                       // Are we in an 'external' folder\r
845         //      bool bEntryfromDifferentRepo            // if the entry is from a different repository\r
846         //      );\r
847 \r
848         /// Adjust the checkbox-state on all descendants of a specific item\r
849         //void SetCheckOnAllDescendentsOf(const FileEntry* parentEntry, bool bCheck);\r
850 \r
851         /// Build a path list of all the selected items in the list (NOTE - SELECTED, not CHECKED)\r
852         void FillListOfSelectedItemPaths(CTGitPathList& pathList, bool bNoIgnored = false);\r
853 \r
854         /// Enables/Disables group view and adds all groups to the list control.\r
855         /// If bForce is true, then group view is enabled and the 'null' group is added.\r
856         bool PrepareGroups(bool bForce = false);\r
857         /// Returns the group number to which the group header belongs\r
858         /// If the point is not over a group header, -1 is returned\r
859         int GetGroupFromPoint(POINT * ppt);\r
860         /// Returns the number of change lists the selection has\r
861         size_t GetNumberOfChangelistsInSelection();\r
862 \r
863         /// Puts the item to the corresponding group\r
864         bool SetItemGroup(int item, int groupindex);\r
865 \r
866         void CheckEntry(int index, int nListItems);\r
867         void UncheckEntry(int index, int nListItems);\r
868 \r
869         /// sends an GitSLNM_CHECKCHANGED notification to the parent\r
870         void NotifyCheck();\r
871 \r
872         int CellRectFromPoint(CPoint& point, RECT *cellrect, int *col) const;\r
873 \r
874         void OnContextMenuList(CWnd * pWnd, CPoint point);\r
875         void OnContextMenuGroup(CWnd * pWnd, CPoint point);\r
876         void OnContextMenuHeader(CWnd * pWnd, CPoint point);\r
877 \r
878         virtual void PreSubclassWindow();\r
879         virtual BOOL PreTranslateMessage(MSG* pMsg);\r
880         virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;\r
881         afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);\r
882         afx_msg BOOL OnToolTipText(UINT id, NMHDR *pNMHDR, LRESULT *pResult);\r
883         afx_msg void OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult);\r
884         afx_msg void OnLvnItemchanging(NMHDR *pNMHDR, LRESULT *pResult);\r
885         afx_msg BOOL OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult);\r
886     afx_msg void OnColumnResized(NMHDR *pNMHDR, LRESULT *pResult);\r
887     afx_msg void OnColumnMoved(NMHDR *pNMHDR, LRESULT *pResult);\r
888     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
889 \r
890         void CreateChangeList(const CString& name);\r
891 \r
892         afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult);\r
893         afx_msg void OnLvnGetInfoTip(NMHDR *pNMHDR, LRESULT *pResult);\r
894         afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);\r
895         afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);\r
896         afx_msg UINT OnGetDlgCode();\r
897         afx_msg void OnNMReturn(NMHDR *pNMHDR, LRESULT *pResult);\r
898         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);\r
899         afx_msg void OnPaint();\r
900         afx_msg void OnHdnBegintrack(NMHDR *pNMHDR, LRESULT *pResult);\r
901         afx_msg void OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult);\r
902         afx_msg void OnDestroy();\r
903 \r
904 \r
905         void FileSaveAs(CTGitPath *path);\r
906         int RevertSelectedItemToVersion();\r
907 \r
908 private:\r
909         bool *                                          m_pbCanceled;\r
910         bool                                        m_bAscending;               ///< sort direction\r
911         int                                             m_nSortedColumn;        ///< which column to sort\r
912         bool                                            m_bHasCheckboxes;\r
913         bool                                            m_bUnversionedLast;\r
914         bool                                            m_bHasExternalsFromDifferentRepos;\r
915         bool                                            m_bHasExternals;\r
916         BOOL                                            m_bHasUnversionedItems;\r
917         bool                                            m_bHasLocks;\r
918         bool                                            m_bHasChangeLists;\r
919         //typedef std::vector<FileEntry*> FileEntryVector;\r
920         //FileEntryVector                               m_arStatusArray;\r
921         std::vector<CTGitPath*>         m_arStatusArray;\r
922         std::vector<size_t>                     m_arListArray;\r
923         std::map<CString, int>      m_changelists;\r
924         bool                                            m_bHasIgnoreGroup;\r
925         //CTGitPathList                         m_ConflictFileList;\r
926         CTGitPathList                           m_StatusFileList;\r
927         CTGitPathList                           m_UnRevFileList;\r
928         CTGitPathList                           m_IgnoreFileList;\r
929         //CTGitPathList                         m_StatusUrlList;\r
930         CString                                         m_sLastError;\r
931 \r
932         LONG                                            m_nUnversioned;\r
933         LONG                                            m_nNormal;\r
934         LONG                                            m_nModified;\r
935         LONG                                            m_nAdded;\r
936         LONG                                            m_nDeleted;\r
937         LONG                                            m_nConflicted;\r
938         LONG                                            m_nTotal;\r
939         LONG                                            m_nSelected;\r
940 \r
941         DWORD                                           m_dwDefaultColumns;\r
942         DWORD                                           m_dwShow;\r
943         bool                                            m_bShowFolders;\r
944         bool                                            m_bShowIgnores;\r
945         bool                                            m_bUpdate;\r
946         unsigned __int64                        m_dwContextMenus;\r
947         BOOL                                            m_bBlock;\r
948         BOOL                                            m_bBlockUI;\r
949         bool                                            m_bBusy;\r
950         bool                                            m_bEmpty;\r
951         bool                                            m_bIgnoreRemoveOnly;\r
952         bool                                            m_bCheckIfGroupsExist;\r
953         bool                                            m_bFileDropsEnabled;\r
954         bool                                            m_bOwnDrag;\r
955 \r
956         int                                                     m_nIconFolder;\r
957 \r
958         CWnd *                                          m_pStatLabel;\r
959         CButton *                                       m_pSelectButton;\r
960         CButton *                                       m_pConfirmButton;\r
961         CColors                                         m_Colors;\r
962 \r
963         CString                                         m_sEmpty;\r
964         CString                                         m_sBusy;\r
965         CString                                         m_sNoPropValueText;\r
966 \r
967         bool                                            m_bUnversionedRecurse;\r
968 \r
969         bool                                            m_bCheckChildrenWithParent;\r
970         CGitStatusListCtrlDropTarget * m_pDropTarget;\r
971 \r
972     ColumnManager               m_ColumnManager;\r
973 \r
974         std::map<CString,bool>          m_mapFilenameToChecked; ///< Remember manually de-/selected items\r
975         CComCriticalSection                     m_critSec;\r
976 \r
977         friend class CGitStatusListCtrlDropTarget;\r
978 public:\r
979         enum\r
980         {\r
981                 FILELIST_MODIFY= 0x1,\r
982                 FILELIST_UNVER = 0x2,\r
983                 FILELIST_IGNORE =0x4\r
984         };\r
985 public:\r
986         int UpdateFileList(git_revnum_t hash,CTGitPathList *List=NULL);\r
987         int UpdateFileList(int mask, bool once=true,CTGitPathList *List=NULL);\r
988         int UpdateUnRevFileList(CTGitPathList *List=NULL);\r
989         int UpdateIgnoreFileList(CTGitPathList *List=NULL);\r
990         \r
991         int UpdateWithGitPathList(CTGitPathList &list);\r
992 \r
993         void AddEntry(CTGitPath* path, WORD langID, int ListIndex);\r
994         void Clear();\r
995         int m_FileLoaded;\r
996         git_revnum_t m_CurrentVersion;\r
997 public:\r
998         CXPTheme        m_Theme;\r
999 };\r
1000 \r
1001 #if 0\r
1002 class CGitStatusListCtrlDropTarget : public CIDropTarget\r
1003 {\r
1004 public:\r
1005         CGitStatusListCtrlDropTarget(CGitStatusListCtrl * pGitStatusListCtrl):CIDropTarget(pGitStatusListCtrl->m_hWnd){m_pGitStatusListCtrl = pGitStatusListCtrl;}\r
1006 \r
1007         virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD * /*pdwEffect*/, POINTL pt);\r
1008         virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect);\r
1009 private:\r
1010         CGitStatusListCtrl * m_pGitStatusListCtrl;\r
1011 };\r
1012 #endif