cleanup: dropped a lot of unused code
[TortoiseGit.git] / src / TortoiseShell / GITPropertyPage.h
blobcbd9719e980bbbd67966701b79d8bf3316f2ec42
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2006 - Stefan Kueng
4 // Copyright (C) 2008-2011 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include "ShellUpdater.h"
23 #define ListView_GetItemTextEx(hwndLV, i, iSubItem_, __buf) \
24 { \
25 int nLen = 1024;\
26 int nRes;\
27 LV_ITEM _ms_lvi;\
28 _ms_lvi.iSubItem = iSubItem_;\
29 do\
31 nLen += 2;\
32 _ms_lvi.cchTextMax = nLen;\
33 if (__buf)\
34 delete[] __buf;\
35 __buf = new TCHAR[nLen];\
36 _ms_lvi.pszText = __buf;\
37 nRes = (int)::SendMessage((hwndLV), LVM_GETITEMTEXT, (WPARAM)(i), (LPARAM)(LV_ITEM *)&_ms_lvi);\
38 } while (nRes == nLen-1);\
40 #define GetDlgItemTextEx(hwndDlg, _id, __buf) \
42 int nLen = 1024;\
43 int nRes;\
44 do\
46 nLen *= 2;\
47 if (__buf)\
48 delete [] __buf;\
49 __buf = new TCHAR[nLen];\
50 nRes = GetDlgItemText(hwndDlg, _id, __buf, nLen);\
51 } while (nRes == nLen-1);\
54 /**
55 * \ingroup TortoiseShell
56 * Displays and updates all controls on the property page. The property
57 * page itself is shown by explorer.
59 class CGitPropertyPage
61 public:
62 CGitPropertyPage(const std::vector<stdstring> &filenames);
63 virtual ~CGitPropertyPage();
65 /**
66 * Sets the window handle.
67 * \param hwnd the handle.
69 virtual void SetHwnd(HWND hwnd);
70 /**
71 * Callback function which receives the window messages of the
72 * property page. See the Win32 API for PropertySheets for details.
74 virtual BOOL PageProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
76 protected:
77 /**
78 * Initializes the property page.
80 virtual void InitWorkfileView();
81 void Time64ToTimeString(__time64_t time, TCHAR * buf, size_t buflen);
82 void PageProcOnCommand(WPARAM wParam);
84 struct listproperty
86 stdstring name;
87 std::string value;
88 int count;
90 HWND m_hwnd;
91 std::vector<stdstring> filenames;
92 std::map<stdstring, std::string> propmap;
93 TCHAR stringtablebuffer[255];