OSDN Git Service

Add Expand Different Subfolders menu item (#1964)
[winmerge-jp/winmerge-jp.git] / Src / DirAdditionalPropertiesDlg.h
1 /** 
2  * @file  DirAdditionalPropertiesDlg.h
3  *
4  * @brief Declaration file for CDirAdditionalPropertiesDlg
5  */
6 #pragma once
7
8 #include <vector>
9 #include "TrDialogs.h"
10 #include "UnicodeString.h"
11
12 /////////////////////////////////////////////////////////////////////////////
13 // CDirAdditionalPropertiesDlg dialog
14
15 struct Node
16 {
17         String name;
18         String canonicalName;
19         String displayName;
20         bool selected;
21         HTREEITEM hItem;
22         std::list<Node> childNodes;
23 };
24
25 /**
26  * @brief A Dialog for choosing visible folder compare columns.
27  * This class implements a dialog for choosing visible columns in folder
28  * compare. Columns can be also re-ordered. There is one listview component
29  * which lists all available columns. Every column name has a checkbox with
30  * it. If the checkbox is checked, the column is visible.
31  *
32  * @note: Due to how columns handling code is implemented, hidden columns
33  * must be always be last in the list with order number -1.
34  * @todo: Allow hidden columns between visible columns.
35  */
36 class CDirAdditionalPropertiesDlg : public CTrDialog
37 {
38 // Public types
39 public:
40
41 // Construction
42 public:
43         explicit CDirAdditionalPropertiesDlg(const std::vector<String>& canonicalNames, CWnd* pParent = nullptr);   // standard constructor
44         const std::vector<String>& GetSelectedCanonicalNames() const { return m_canonicalNames; }
45
46 // Dialog Data
47         //{{AFX_DATA(CDirAdditionalPropertiesDlg)
48         enum { IDD = IDD_DIRADDITIONALPROPS };
49         CTreeCtrl m_treeProps;
50         CListCtrl m_listProps;
51         //}}AFX_DATA
52
53
54 // Overrides
55         // ClassWizard generated virtual function overrides
56         //{{AFX_VIRTUAL(CDirAdditionalPropertiesDlg)
57         protected:
58         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
59         //}}AFX_VIRTUAL
60
61 // Implementation methods
62 protected:
63         Node& MakeNode(Node& parentNode, const std::vector<StringView>& path, std::vector<StringView>::iterator it);
64         void LoadList();
65
66 // Implementation data
67 private:
68         std::vector<String> m_canonicalNames;
69         Node m_root;
70         // Generated message map functions
71         //{{AFX_MSG(CDirAdditionalPropertiesDlg)
72         virtual BOOL OnInitDialog() override;
73         virtual void OnOK() override;
74         afx_msg void OnAdd();
75         afx_msg void OnDelete(UINT nId);
76         afx_msg void OnDblClkTreeView(NMHDR* pNMHDR, LRESULT* pResult);
77         afx_msg void OnKeyDownTreeView(NMHDR* pNMHDR, LRESULT* pResult);
78         afx_msg void OnKeyDownListView(NMHDR* pNMHDR, LRESULT* pResult);
79         //}}AFX_MSG
80         DECLARE_MESSAGE_MAP()
81 };