1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2007-2008 - TortoiseSVN
\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
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
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
22 * \ingroup TortoiseProc
\r
23 * Base class for all the settings property pages
\r
25 class ISettingsPropPage : public CPropertyPage
\r
27 DECLARE_DYNAMIC(ISettingsPropPage)
\r
29 // simple construction
\r
30 ISettingsPropPage();
\r
31 explicit ISettingsPropPage(UINT nIDTemplate, UINT nIDCaption = 0, DWORD dwSize = sizeof(PROPSHEETPAGE));
\r
32 explicit ISettingsPropPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0, DWORD dwSize = sizeof(PROPSHEETPAGE));
\r
34 // extended construction
\r
35 ISettingsPropPage(UINT nIDTemplate, UINT nIDCaption,
\r
36 UINT nIDHeaderTitle, UINT nIDHeaderSubTitle = 0, DWORD dwSize = sizeof(PROPSHEETPAGE));
\r
37 ISettingsPropPage(LPCTSTR lpszTemplateName, UINT nIDCaption,
\r
38 UINT nIDHeaderTitle, UINT nIDHeaderSubTitle = 0, DWORD dwSize = sizeof(PROPSHEETPAGE));
\r
40 virtual ~ISettingsPropPage();
\r
42 enum SettingsRestart
\r
50 * Returns the icon ID
\r
52 virtual UINT GetIconID() = 0;
\r
55 * Returns the restart code
\r
57 virtual SettingsRestart GetRestart() {return m_restart;}
\r
61 SettingsRestart m_restart;
\r
65 * Store the current value of a BOOL, DWORD or CString into the
\r
66 * respective CRegDWORD etc. and check for success.
\r
69 template<class T, class Reg>
\r
70 void Store (const T& value, Reg& registryKey)
\r
72 registryKey = value;
\r
73 if (registryKey.LastError != ERROR_SUCCESS)
\r
74 CMessageBox::Show (m_hWnd, registryKey.getErrorString(), _T("TortoiseSVN"), MB_ICONERROR);
\r