OSDN Git Service

Add SYNC dialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / EditPropertiesDlg.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 "StandAloneDlg.h"\r
21 #include "SVNRev.h"\r
22 #include "ProjectProperties.h"\r
23 #include "Tooltip.h"\r
24 \r
25 /**\r
26  * \ingroup TortoiseProc\r
27  * dialog showing a list of properties of the files/folders specified with SetPathList().\r
28  */\r
29 class CEditPropertiesDlg : public CResizableStandAloneDialog\r
30 {\r
31         DECLARE_DYNAMIC(CEditPropertiesDlg)\r
32 \r
33 public:\r
34         CEditPropertiesDlg(CWnd* pParent = NULL);   // standard constructor\r
35         virtual ~CEditPropertiesDlg();\r
36 \r
37         void    SetPathList(const CTSVNPathList& pathlist) {m_pathlist = pathlist;}\r
38         void    SetRevision(const SVNRev& rev) {m_revision = rev;}\r
39         void    Refresh();\r
40         bool    HasChanged() {return m_bChanged;}\r
41 \r
42         void    SetProjectProperties(ProjectProperties * pProps) {m_pProjectProperties = pProps;}\r
43         void    SetUUID(const CString& sUUID) {m_sUUID = sUUID;}\r
44         void    RevProps(bool bRevProps = false) {m_bRevProps = bRevProps;}\r
45 \r
46 // Dialog Data\r
47         enum { IDD = IDD_EDITPROPERTIES };\r
48 \r
49 protected:\r
50         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
51         virtual BOOL OnInitDialog();\r
52         virtual void OnOK();\r
53         virtual void OnCancel();\r
54         virtual BOOL PreTranslateMessage(MSG* pMsg);\r
55         afx_msg void OnBnClickedHelp();\r
56         afx_msg void OnNMCustomdrawEditproplist(NMHDR *pNMHDR, LRESULT *pResult);\r
57         afx_msg void OnBnClickedRemoveProps();\r
58         afx_msg void OnBnClickedEditprops();\r
59         afx_msg void OnLvnItemchangedEditproplist(NMHDR *pNMHDR, LRESULT *pResult);\r
60         afx_msg void OnNMDblclkEditproplist(NMHDR *pNMHDR, LRESULT *pResult);\r
61         afx_msg void OnBnClickedSaveprop();\r
62         afx_msg void OnBnClickedAddprops();\r
63         afx_msg void OnBnClickedExport();\r
64         afx_msg void OnBnClickedImport();\r
65 \r
66         DECLARE_MESSAGE_MAP()\r
67 private:\r
68         static UINT PropsThreadEntry(LPVOID pVoid);\r
69         UINT PropsThread();\r
70         void EditProps(bool bAdd = false);\r
71 \r
72 protected:\r
73         class PropValue\r
74         {\r
75         public:\r
76                 PropValue(void) : count(0), allthesamevalue(true), isbinary(false) {};\r
77 \r
78                 std::string     value;\r
79                 stdstring       value_without_newlines;\r
80                 int                     count;\r
81                 bool            allthesamevalue;\r
82                 bool            isbinary;\r
83         };\r
84         CTSVNPathList   m_pathlist;\r
85         CListCtrl               m_propList;\r
86         BOOL                    m_bRecursive;\r
87         bool                    m_bChanged;\r
88         bool                    m_bRevProps;\r
89         volatile LONG   m_bThreadRunning;\r
90         std::map<stdstring, PropValue>  m_properties;\r
91         SVNRev                  m_revision;\r
92         CToolTips               m_tooltips;\r
93 \r
94         CString                 m_sUUID;\r
95         ProjectProperties *     m_pProjectProperties;\r
96 };\r