OSDN Git Service

Fix Issue 22 Error deleting file from context menu if filename contains spaces
[tortoisegit/TortoiseGitJp.git] / src / TortoiseShell / SVNPropertyPage.h
1 // TortoiseGit - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2006 - Stefan Kueng\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 "ShellUpdater.h"\r
21 \r
22 #define ListView_GetItemTextEx(hwndLV, i, iSubItem_, __buf) \\r
23 { \\r
24   int nLen = 1024;\\r
25   int nRes;\\r
26   LV_ITEM _ms_lvi;\\r
27   _ms_lvi.iSubItem = iSubItem_;\\r
28   do\\r
29   {\\r
30         nLen += 2;\\r
31         _ms_lvi.cchTextMax = nLen;\\r
32     if (__buf)\\r
33                 delete[] __buf;\\r
34         __buf = new TCHAR[nLen];\\r
35         _ms_lvi.pszText = __buf;\\r
36     nRes  = (int)::SendMessage((hwndLV), LVM_GETITEMTEXT, (WPARAM)(i), (LPARAM)(LV_ITEM *)&_ms_lvi);\\r
37   } while (nRes == nLen-1);\\r
38 }\r
39 #define GetDlgItemTextEx(hwndDlg, _id, __buf) \\r
40 {\\r
41         int nLen = 1024;\\r
42         int nRes;\\r
43         do\\r
44         {\\r
45                 nLen *= 2;\\r
46                 if (__buf)\\r
47                         delete [] __buf;\\r
48                 __buf = new TCHAR[nLen];\\r
49                 nRes = GetDlgItemText(hwndDlg, _id, __buf, nLen);\\r
50         } while (nRes == nLen-1);\\r
51 }\r
52 \r
53 /**\r
54  * \ingroup TortoiseShell\r
55  * Displays and updates all controls on the property page. The property\r
56  * page itself is shown by explorer.\r
57  */\r
58 class CGitPropertyPage\r
59 {\r
60 public:\r
61         CGitPropertyPage(const std::vector<stdstring> &filenames);\r
62         virtual ~CGitPropertyPage();\r
63 \r
64         /**\r
65          * Sets the window handle.\r
66          * \param hwnd the handle.\r
67          */\r
68         virtual void SetHwnd(HWND hwnd);\r
69         /**\r
70          * Callback function which receives the window messages of the\r
71          * property page. See the Win32 API for PropertySheets for details.\r
72          */\r
73         virtual BOOL PageProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);\r
74 \r
75 protected:\r
76         /**\r
77          * Initializes the property page.\r
78          */\r
79         virtual void InitWorkfileView();\r
80         void Time64ToTimeString(__time64_t time, TCHAR * buf, size_t buflen);\r
81         \r
82         struct listproperty\r
83         {\r
84                 stdstring name;\r
85                 std::string value;\r
86                 int               count;\r
87         };\r
88         HWND m_hwnd;\r
89         std::vector<stdstring> filenames;\r
90         std::map<stdstring, std::string> propmap;\r
91         TCHAR stringtablebuffer[255];\r
92 };\r
93 \r
94 \r