OSDN Git Service

Remove some #ifdef _DEBUG blocks
[winmerge-jp/winmerge-jp.git] / Src / DirView.h
1 /////////////////////////////////////////////////////////////////////////////
2 //    WinMerge:  an interactive diff/merge utility
3 //    Copyright (C) 1997  Dean P. Grimm
4 //
5 //    This program is free software; you can redistribute it and/or modify
6 //    it under the terms of the GNU General Public License as published by
7 //    the Free Software Foundation; either version 2 of the License, or
8 //    (at your option) any later version.
9 //
10 //    This program is distributed in the hope that it will be useful,
11 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //    GNU General Public License for more details.
14 //
15 //    You should have received a copy of the GNU General Public License
16 //    along with this program; if not, write to the Free Software
17 //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //
19 /////////////////////////////////////////////////////////////////////////////
20 /**
21  *  @file DirView.h
22  *
23  *  @brief Declaration of class CDirView
24  */
25 #pragma once
26
27 /////////////////////////////////////////////////////////////////////////////
28 // CDirView view
29 #include <afxcview.h>
30 #include <map>
31 #include <memory>
32 #include "OptionsDiffColors.h"
33 #include "SortHeaderCtrl.h"
34 #include "UnicodeString.h"
35
36 class FileActionScript;
37
38 struct DIFFITEM;
39
40 typedef enum { eMain, eContext } eMenuType;
41 typedef enum { SELECTIONTYPE_NORMAL, SELECTIONTYPE_LEFT1LEFT2, SELECTIONTYPE_RIGHT1RIGHT2, SELECTIONTYPE_LEFT1RIGHT2, SELECTIONTYPE_LEFT2RIGHT1} SELECTIONTYPE;
42
43 class CDirDoc;
44 class CDirFrame;
45
46 class PackingInfo;
47 class PathContext;
48 class DirCompProgressBar;
49 class CompareStats;
50 struct DirColInfo;
51 class CLoadSaveCodepageDlg;
52 class CShellContextMenu;
53 class CDiffContext;
54
55 struct ViewCustomFlags
56 {
57         enum
58         {
59                 // We use extra bits so that no valid values are 0
60                 // and each set of flags is in a different hex digit
61                 // to make debugging easier
62                 // These can always be packed down in the future
63                 INVALID_CODE = 0,
64                 VISIBILITY = 0x3, VISIBLE = 0x1, HIDDEN = 0x2, EXPANDED = 0x4
65         };
66 };
67
68 typedef std::map<String, bool> DirViewTreeState;
69
70 /**
71  * @brief Position value for special items (..) in directory compare view.
72  */
73 const uintptr_t SPECIAL_ITEM_POS = (uintptr_t) - 1L;
74
75 /** Default column width in directory compare */
76 const UINT DefColumnWidth = 150;
77
78 /**
79  * @brief Directory compare results view.
80  *
81  * Directory compare view is list-view based, so it shows one result (for
82  * folder or file, commonly called as 'item') in one line. User can select
83  * visible columns, re-order columns, sort by column etc.
84  *
85  * Actual data is stored in CDiffContext in CDirDoc. Dircompare items and
86  * CDiffContext items are linked by storing POSITION of CDiffContext item
87  * as CDirView listitem key.
88  */
89 class CDirView : public CListView
90 {
91         friend struct FileCmpReport;
92         class DirItemEnumerator;
93         friend DirItemEnumerator;
94 protected:
95         CDirView();           // protected constructor used by dynamic creation
96         DECLARE_DYNCREATE(CDirView)
97
98 // Attributes
99 public:
100         CDirDoc* GetDocument(); // non-debug version is inline
101
102         // const version, for const methods to be able to call
103         const CDirDoc * GetDocument() const { return const_cast<CDirView *>(this)->GetDocument(); }
104
105 // Operations
106 public:
107         CDirFrame * GetParentFrame();
108
109         void StartCompare(CompareStats *pCompareStats);
110         void Redisplay();
111         void RedisplayChildren(uintptr_t diffpos, int level, UINT &index, int &alldiffs);
112         void UpdateResources();
113         void LoadColumnHeaderItems();
114         uintptr_t GetItemKey(int idx) const;
115         int GetItemIndex(uintptr_t key);
116         // for populating list
117         void DeleteAllDisplayItems();
118         void SetColumnWidths();
119         void SetFont(const LOGFONT & lf);
120
121         void SortColumnsAppropriately();
122
123         UINT GetSelectedCount() const;
124         int GetFirstSelectedInd();
125         DIFFITEM & GetNextSelectedInd(int &ind);
126         DIFFITEM & GetItemAt(int ind);
127         void AddParentFolderItem(bool bEnable);
128         void RefreshOptions();
129
130         LRESULT HandleMenuMessage(UINT message, WPARAM wParam, LPARAM lParam);
131
132 // Implementation types
133 private:
134         typedef enum { SIDE_LEFT = 1, SIDE_MIDDLE, SIDE_RIGHT } SIDE_TYPE;
135
136 // Implementation in DirActions.cpp
137 private:
138         bool GetSelectedDirNames(String& strLeft, String& strRight) const;
139         bool GetSelectedFileNames(String& strLeft, String& strRight) const;
140         String GetSelectedFileName(SIDE_TYPE stype) const;
141         void GetItemFileNames(int sel, String& strLeft, String& strRight) const;
142         void GetItemFileNames(int sel, PathContext * paths) const;
143         void FormatEncodingDialogDisplays(CLoadSaveCodepageDlg * dlg);
144         bool IsItemLeftOnly(int code);
145         bool IsItemRightOnly(int code);
146         bool IsItemCopyableToLeft(const DIFFITEM & di) const;
147         bool IsItemCopyableToRight(const DIFFITEM & di) const;
148         bool IsItemDeletableOnLeft(const DIFFITEM & di) const;
149         bool IsItemDeletableOnRight(const DIFFITEM & di) const;
150         bool IsItemDeletableOnBoth(const DIFFITEM & di) const;
151         bool IsItemOpenable(const DIFFITEM & di) const;
152         bool AreItemsOpenable(SELECTIONTYPE selectionType, const DIFFITEM & di1, const DIFFITEM & di2) const;
153         bool AreItemsOpenable(const DIFFITEM & di1, const DIFFITEM & di2, const DIFFITEM & di3) const;
154         bool IsItemOpenableOnLeft(const DIFFITEM & di) const;
155         bool IsItemOpenableOnRight(const DIFFITEM & di) const;
156         bool IsItemOpenableOnLeftWith(const DIFFITEM & di) const;
157         bool IsItemOpenableOnRightWith(const DIFFITEM & di) const;
158         bool IsItemCopyableToOnLeft(const DIFFITEM & di) const;
159         bool IsItemCopyableToOnRight(const DIFFITEM & di) const;
160         void DoCopyLeftToRight();
161         void DoCopyRightToLeft();
162         void DoDelLeft();
163         void DoDelRight();
164         void DoDelBoth();
165         void DoDelAll();
166         void DoCopyLeftTo();
167         void DoCopyRightTo();
168         void DoMoveLeftTo();
169         void DoMoveRightTo();
170         void DoOpen(SIDE_TYPE stype);
171         void DoOpenWith(SIDE_TYPE stype);
172         void DoOpenWithEditor(SIDE_TYPE stype);
173         void ApplyPluginPrediffSetting(int newsetting);
174         void ConfirmAndPerformActions(FileActionScript & actions, int selCount);
175         bool ConfirmActionList(const FileActionScript & actions, int selCount);
176         void PerformActionList(FileActionScript & actions);
177         void UpdateAfterFileScript(FileActionScript & actionList);
178         UINT MarkSelectedForRescan();
179         void DoFileEncodingDialog();
180         void DoUpdateFileEncodingDialog(CCmdUI* pCmdUI);
181         bool DoItemRename(const String& szNewItemName);
182         void DoCopyItemsToClipboard(int nIndex);
183         bool RenameOnSameDir(const String& szOldFileName, const String& szNewFileName);
184 // End DirActions.cpp
185         void ReflectGetdispinfo(NMLVDISPINFO *);
186
187 // Implementation in DirViewColHandler.cpp
188 public:
189         void UpdateColumnNames();
190         void SetColAlignments();
191         // class CompareState is used to pass parameters to the PFNLVCOMPARE callback function.
192         class CompareState
193         {
194         private:
195                 const CDirView *const pView;
196                 const CDiffContext *const pCtxt;
197                 const int sortCol;
198                 const bool bSortAscending;
199         public:
200                 CompareState(const CDirView *, int sortCol, bool bSortAscending);
201                 static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
202         } friend;
203         void UpdateDiffItemStatus(UINT nIdx);
204 private:
205         void InitiateSort();
206         void NameColumn(int id, int subitem);
207         int AddNewItem(int i, uintptr_t diffpos, int iImage, int iIndent);
208         bool IsDefaultSortAscending(int col) const;
209         int ColPhysToLog(int i) const { return m_invcolorder[i]; }
210         int ColLogToPhys(int i) const { return m_colorder[i]; } /**< -1 if not displayed */
211         String GetColDisplayName(int col) const;
212         String GetColDescription(int col) const;
213         int GetColLogCount() const;
214         void LoadColumnOrders();
215         void ClearColumnOrders();
216         void ResetColumnOrdering();
217         void MoveColumn(int psrc, int pdest);
218         String GetColRegValueNameBase(int col) const;
219         String ColGetTextToDisplay(const CDiffContext *pCtxt, int col, const DIFFITEM & di);
220         int ColSort(const CDiffContext *pCtxt, int col, const DIFFITEM & ldi, const DIFFITEM &rdi) const;
221 // End DirViewCols.cpp
222
223 // Implementation in DirViewColItems.cpp
224         int GetColDefaultOrder(int col) const;
225         const DirColInfo * DirViewColItems_GetDirColInfo(int col) const;
226         bool IsColById(int col, int id) const;
227         bool IsColName(int col) const;
228         bool IsColLmTime(int col) const;
229         bool IsColMmTime(int col) const;
230         bool IsColRmTime(int col) const;
231         bool IsColStatus(int col) const;
232         bool IsColStatusAbbr(int col) const;
233 // End DirViewColItems.cpp
234
235 private:
236
237 // Overrides
238         // ClassWizard generated virtual function overrides
239         //{{AFX_VIRTUAL(CDirView)
240 public:
241         virtual void OnInitialUpdate();
242 protected:
243         virtual BOOL PreTranslateMessage(MSG* pMsg);
244         virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
245         virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
246         virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
247         //}}AFX_VIRTUAL
248
249 // Implementation
250 protected:
251         virtual ~CDirView();
252         int GetFocusedItem();
253         int GetFirstDifferentItem();
254         int GetLastDifferentItem();
255         int GetColImage(const DIFFITEM & di) const;
256         int GetDefaultColImage() const;
257         int AddSpecialItems();
258         void GetCurrentColRegKeys(std::vector<String>& colKeys);
259         void WarnContentsChanged(const String & failedPath);
260         void OpenSpecialItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3);
261         bool OpenOneItem(uintptr_t pos1, DIFFITEM *pdi[3],
262                         PathContext &paths, int & sel1, bool & isDir, int nPane[3]);
263         bool OpenTwoItems(SELECTIONTYPE selectionType, uintptr_t pos1, uintptr_t pos2, DIFFITEM *pdi[3],
264                         PathContext &paths, int & sel1, int & sel2, bool & isDir, int nPane[3]);
265         bool OpenThreeItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3, DIFFITEM *pdi[3],
266                         PathContext &paths, int & sel1, int & sel2, int & sel3, bool & isDir, int nPane[3]);
267         bool CreateFoldersPair(DIFFITEM & di, bool side1, String &newFolder);
268
269 // Implementation data
270 protected:
271         CString GenerateReport();
272         CSortHeaderCtrl m_ctlSortHeader;
273         CImageList m_imageList;
274         CImageList m_imageState;
275         CListCtrl * m_pList;
276         int m_numcols;
277         int m_dispcols;
278         std::vector<int> m_colorder; /**< colorder[logical#]=physical# */
279         std::vector<int> m_invcolorder; /**< invcolorder[physical]=logical# */
280         bool m_bEscCloses; /**< Cached value for option for ESC closing window */
281         bool m_bExpandSubdirs;
282         CFont m_font; /**< User-selected font */
283         UINT m_nHiddenItems; /**< Count of items we have hidden */
284         bool m_bTreeMode; /**< TRUE if tree mode is on*/
285         std::unique_ptr<DirCompProgressBar> m_pCmpProgressBar;
286         clock_t m_compareStart; /**< Starting process time of the compare */
287         bool m_bUserCancelEdit; /**< TRUE if the user cancels rename */
288         String m_lastCopyFolder; /**< Last Copy To -target folder. */
289
290         int m_firstDiffItem;
291         int m_lastDiffItem;
292         bool m_bNeedSearchFirstDiffItem;
293         bool m_bNeedSearchLastDiffItem;
294         COLORSETTINGS m_cachedColors; /**< Cached color settings */
295
296         std::unique_ptr<CShellContextMenu> m_pShellContextMenuLeft; /**< Shell context menu for group of left files */
297         std::unique_ptr<CShellContextMenu> m_pShellContextMenuMiddle; /**< Shell context menu for group of middle files */
298         std::unique_ptr<CShellContextMenu> m_pShellContextMenuRight; /**< Shell context menu for group of right files */
299         HMENU m_hCurrentMenu; /**< Current shell context menu (either left or right) */
300         std::unique_ptr<DirViewTreeState> m_pSavedTreeState;
301
302         // Generated message map functions
303         afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
304         afx_msg void OnContextMenu(CWnd*, CPoint point);
305         //{{AFX_MSG(CDirView)
306         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
307         afx_msg void OnDirCopyRightToLeft();
308         afx_msg void OnCtxtDirCopyRightToLeft();
309         afx_msg void OnUpdateDirCopyRightToLeft(CCmdUI* pCmdUI);
310         afx_msg void OnDirCopyLeftToRight();
311         afx_msg void OnCtxtDirCopyLeftToRight();
312         afx_msg void OnUpdateDirCopyLeftToRight(CCmdUI* pCmdUI);
313         afx_msg void OnUpdateCtxtDirCopyRightToLeft(CCmdUI* pCmdUI);
314         afx_msg void OnUpdateCtxtDirCopyLeftToRight(CCmdUI* pCmdUI);
315         afx_msg void OnCtxtDirDelLeft();
316         afx_msg void OnUpdateCtxtDirDelLeft(CCmdUI* pCmdUI);
317         afx_msg void OnCtxtDirDelRight();
318         afx_msg void OnUpdateCtxtDirDelRight(CCmdUI* pCmdUI);
319         afx_msg void OnCtxtDirDelBoth();
320         afx_msg void OnUpdateCtxtDirDelBoth(CCmdUI* pCmdUI);
321         afx_msg void OnCtxtDirOpenLeft();
322         afx_msg void OnUpdateCtxtDirOpenLeft(CCmdUI* pCmdUI);
323         afx_msg void OnCtxtDirOpenLeftWith();
324         afx_msg void OnUpdateCtxtDirOpenLeftWith(CCmdUI* pCmdUI);
325         afx_msg void OnCtxtDirOpenRight();
326         afx_msg void OnUpdateCtxtDirOpenRight(CCmdUI* pCmdUI);
327         afx_msg void OnCtxtDirOpenRightWith();
328         afx_msg void OnUpdateCtxtDirOpenRightWith(CCmdUI* pCmdUI);
329         afx_msg void OnCtxtDirOpenRightWithEditor();
330         afx_msg void OnUpdateCtxtDirOpenRightWithEditor(CCmdUI* pCmdUI);
331         afx_msg void OnCtxtDirOpenLeftWithEditor();
332         afx_msg void OnUpdateCtxtDirOpenLeftWithEditor(CCmdUI* pCmdUI);
333         afx_msg void OnCtxtDirCopyLeftTo();
334         afx_msg void OnUpdateCtxtDirCopyLeftTo(CCmdUI* pCmdUI);
335         afx_msg void OnCtxtDirCopyRightTo();
336         afx_msg void OnUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI);
337         afx_msg void OnDestroy();
338         afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
339         afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
340         afx_msg void OnFirstdiff();
341         afx_msg void OnUpdateFirstdiff(CCmdUI* pCmdUI);
342         afx_msg void OnLastdiff();
343         afx_msg void OnUpdateLastdiff(CCmdUI* pCmdUI);
344         afx_msg void OnNextdiff();
345         afx_msg void OnUpdateNextdiff(CCmdUI* pCmdUI);
346         afx_msg void OnPrevdiff();
347         afx_msg void OnUpdatePrevdiff(CCmdUI* pCmdUI);
348         afx_msg void OnCurdiff();
349         afx_msg void OnUpdateCurdiff(CCmdUI* pCmdUI);
350         afx_msg void OnUpdateSave(CCmdUI* pCmdUI);
351         afx_msg LRESULT OnUpdateUIMessage(WPARAM wParam, LPARAM lParam);
352         afx_msg void OnRefresh();
353         afx_msg void OnUpdateRefresh(CCmdUI* pCmdUI);
354         afx_msg void OnTimer(UINT_PTR nIDEvent);
355         afx_msg void OnEditColumns();
356         afx_msg void OnLeftReadOnly();
357         afx_msg void OnUpdateLeftReadOnly(CCmdUI* pCmdUI);
358         afx_msg void OnMiddleReadOnly();
359         afx_msg void OnUpdateMiddleReadOnly(CCmdUI* pCmdUI);
360         afx_msg void OnRightReadOnly();
361         afx_msg void OnUpdateRightReadOnly(CCmdUI* pCmdUI);
362         afx_msg void OnUpdateStatusLeftRO(CCmdUI* pCmdUI);
363         afx_msg void OnUpdateStatusMiddleRO(CCmdUI* pCmdUI);
364         afx_msg void OnUpdateStatusRightRO(CCmdUI* pCmdUI);
365         afx_msg void OnCustomizeColumns();
366         afx_msg void OnCtxtOpenWithUnpacker();
367         afx_msg void OnUpdateCtxtOpenWithUnpacker(CCmdUI* pCmdUI);
368         afx_msg void OnToolsGenerateReport();
369         afx_msg void OnCtxtDirZipLeft();
370         afx_msg void OnCtxtDirZipRight();
371         afx_msg void OnCtxtDirZipBoth();
372         afx_msg void OnCtxtDirZipBothDiffsOnly();
373         template<SIDE_TYPE stype>
374         afx_msg void OnCtxtDirShellContextMenu();
375         afx_msg void OnUpdateCtxtDir(CCmdUI* pCmdUI);
376         afx_msg void OnSelectAll();
377         afx_msg void OnUpdateSelectAll(CCmdUI* pCmdUI);
378         afx_msg void OnPluginPredifferMode(UINT nID);
379         afx_msg void OnUpdatePluginPredifferMode(CCmdUI* pCmdUI);
380         afx_msg void OnCopyLeftPathnames();
381         afx_msg void OnCopyRightPathnames();
382         afx_msg void OnCopyBothPathnames();
383         afx_msg void OnCopyFilenames();
384         afx_msg void OnUpdateCopyFilenames(CCmdUI* pCmdUI);
385         afx_msg void OnCopyLeftToClipboard();
386         afx_msg void OnCopyRightToClipboard();
387         afx_msg void OnCopyBothToClipboard();
388         afx_msg void OnItemRename();
389         afx_msg void OnUpdateItemRename(CCmdUI* pCmdUI);
390         afx_msg void OnHideFilenames();
391         afx_msg void OnSize(UINT nType, int cx, int cy);
392         afx_msg void OnCtxtDirMoveLeftTo();
393         afx_msg void OnUpdateCtxtDirMoveLeftTo(CCmdUI* pCmdUI);
394         afx_msg void OnCtxtDirMoveRightTo();
395         afx_msg void OnUpdateCtxtDirMoveRightTo(CCmdUI* pCmdUI);
396         afx_msg void OnUpdateHideFilenames(CCmdUI* pCmdUI);
397         afx_msg void OnDelete();
398         afx_msg void OnUpdateDelete(CCmdUI* pCmdUI);
399         afx_msg void OnMarkedRescan();
400         afx_msg void OnUpdateStatusNum(CCmdUI* pCmdUI);
401         afx_msg void OnViewShowHiddenItems();
402         afx_msg void OnUpdateViewShowHiddenItems(CCmdUI* pCmdUI);
403         afx_msg void OnViewTreeMode();
404         afx_msg void OnUpdateViewTreeMode(CCmdUI* pCmdUI);
405         afx_msg void OnViewExpandAllSubdirs();
406         afx_msg void OnUpdateViewExpandAllSubdirs(CCmdUI* pCmdUI);
407         afx_msg void OnViewCollapseAllSubdirs();
408         afx_msg void OnUpdateViewCollapseAllSubdirs(CCmdUI* pCmdUI);
409         afx_msg void OnMergeCompare();
410         afx_msg void OnMergeCompareLeft1Left2();
411         afx_msg void OnMergeCompareRight1Right2();
412         afx_msg void OnMergeCompareLeft1Right2();
413         afx_msg void OnMergeCompareLeft2Right1();
414         afx_msg void OnMergeCompareXML();
415         afx_msg void OnMergeCompareHex();
416         afx_msg void OnUpdateMergeCompare(CCmdUI *pCmdUI);
417         afx_msg void OnUpdateMergeCompareLeft1Left2(CCmdUI *pCmdUI);
418         afx_msg void OnUpdateMergeCompareRight1Right2(CCmdUI *pCmdUI);
419         afx_msg void OnUpdateMergeCompareLeft1Right2(CCmdUI *pCmdUI);
420         afx_msg void OnUpdateMergeCompareLeft2Right1(CCmdUI *pCmdUI);
421         afx_msg void OnViewCompareStatistics();
422         afx_msg void OnFileEncoding();
423         afx_msg void OnUpdateFileEncoding(CCmdUI* pCmdUI);
424         afx_msg void OnHelp();
425         afx_msg void OnEditCopy();
426         afx_msg void OnEditCut();
427         afx_msg void OnEditPaste();
428         afx_msg void OnEditUndo();
429         afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
430         afx_msg void OnItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
431         afx_msg void OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
432         afx_msg void OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
433         afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
434         afx_msg void OnSearch();
435         afx_msg void OnExpandFolder();
436         afx_msg void OnCollapseFolder();
437         afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
438         afx_msg void OnBnClickedComparisonStop();
439         //}}AFX_MSG
440         DECLARE_MESSAGE_MAP()
441         BOOL OnHeaderBeginDrag(LPNMHEADER hdr, LRESULT* pResult);
442         BOOL OnHeaderEndDrag(LPNMHEADER hdr, LRESULT* pResult);
443
444 private:
445         void OpenSelection(SELECTIONTYPE selectionType = SELECTIONTYPE_NORMAL, PackingInfo * infoUnpacker = NULL);
446         void OpenSelectionHex();
447         bool GetSelectedItems(int * sel1, int * sel2, int * sel3);
448         void OpenParentDirectory();
449         void DoUpdateDirCopyRightToLeft(CCmdUI* pCmdUI, eMenuType menuType);
450         void DoUpdateDirCopyLeftToRight(CCmdUI* pCmdUI, eMenuType menuType);
451         void ModifyPopup(CMenu * pPopup, int nStringResource, int nMenuId, LPCTSTR szPath);
452         void DoUpdateCtxtDirDelLeft(CCmdUI* pCmdUI);
453         void DoUpdateCtxtDirDelRight(CCmdUI* pCmdUI);
454         void DoUpdateCtxtDirDelBoth(CCmdUI* pCmdUI);
455         void DoUpdateOpen(SELECTIONTYPE selectionType, CCmdUI* pCmdUI);
456         void DoUpdateOpenLeft(CCmdUI* pCmdUI);
457         void DoUpdateOpenRight(CCmdUI* pCmdUI);
458         void DoUpdateOpenLeftWith(CCmdUI* pCmdUI);
459         void DoUpdateOpenRightWith(CCmdUI* pCmdUI);
460         void DoUpdateDelete(CCmdUI* pCmdUI);
461         void DoUpdateCopyFilenames(CCmdUI* pCmdUI);
462         void DoUpdateCtxtDirCopyLeftTo(CCmdUI* pCmdUI);
463         void DoUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI);
464         void DoUpdateCtxtDirMoveLeftTo(CCmdUI* pCmdUI);
465         void DoUpdateCtxtDirMoveRightTo(CCmdUI* pCmdUI);
466         const DIFFITEM & GetDiffItem(int sel) const;
467         DIFFITEM & GetDiffItemRef(int sel);
468         int GetSingleSelectedItem() const;
469         bool IsItemNavigableDiff(const DIFFITEM & di) const;
470         void MoveFocus(int currentInd, int i, int selCount);
471         void SaveColumnWidths();
472         void SaveColumnOrders();
473         void FixReordering();
474         void HeaderContextMenu(CPoint point, int i);
475         void ListContextMenu(CPoint point, int i);
476         bool ListShellContextMenu(SIDE_TYPE side);
477         void ShowShellContextMenu(SIDE_TYPE side);
478         CShellContextMenu* GetCorrespondingShellContextMenu(HMENU hMenu) const;
479         void ReloadColumns();
480         void ResetColumnWidths();
481         bool IsLabelEdit() const;
482         bool IsItemSelectedSpecial() const;
483         void CollapseSubdir(int sel);
484         void ExpandSubdir(int sel, bool bRecursive = false);
485         void GetColors(int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText) const;
486         DirViewTreeState *SaveTreeState();
487         void RestoreTreeState(DirViewTreeState *pTreeState);
488         void PrepareDragData(String& filesForDroping);
489 };
490
491
492 #ifndef _DEBUG  // debug version in DirView.cpp
493 inline CDirDoc* CDirView::GetDocument()
494 { return (CDirDoc*)m_pDocument; }
495 #endif
496
497
498 String NumToStr(int n);
499
500
501 /////////////////////////////////////////////////////////////////////////////
502
503 //{{AFX_INSERT_LOCATION}}
504 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.