Correctly deallocate buffer
[TortoiseGit.git] / src / Utils / MiscUI / FileDlgEventHandler.h
blob9b0dd1dba60390cbb0941821154055f8f18fe386
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2010 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
20 #include <atlcom.h>
22 /**
23 * helper class for IFileDialogEvents and IFileDialogControlEvents.
24 * use this class as a base class so you only need to implement
25 * the methods you actually need and not all of them.
27 class CFileDlgEventHandler : public CComObjectRootEx<CComSingleThreadModel>,
28 public CComCoClass<CFileDlgEventHandler>,
29 public IFileDialogEvents,
30 public IFileDialogControlEvents
32 public:
33 CFileDlgEventHandler();
34 ~CFileDlgEventHandler();
36 BEGIN_COM_MAP(CFileDlgEventHandler)
37 COM_INTERFACE_ENTRY(IFileDialogEvents)
38 COM_INTERFACE_ENTRY(IFileDialogControlEvents)
39 END_COM_MAP()
41 // IFileDialogEvents
42 virtual STDMETHODIMP OnFileOk(IFileDialog* pfd);
43 virtual STDMETHODIMP OnFolderChanging(IFileDialog* pfd, IShellItem* psiFolder);
44 virtual STDMETHODIMP OnFolderChange(IFileDialog* pfd);
45 virtual STDMETHODIMP OnSelectionChange(IFileDialog* pfd);
46 virtual STDMETHODIMP OnShareViolation(IFileDialog* pfd, IShellItem* psi, FDE_SHAREVIOLATION_RESPONSE* pResponse);
47 virtual STDMETHODIMP OnTypeChange(IFileDialog* pfd);
48 virtual STDMETHODIMP OnOverwrite(IFileDialog* pfd, IShellItem* psi, FDE_OVERWRITE_RESPONSE* pResponse);
50 // IFileDialogControlEvents
51 virtual STDMETHODIMP OnItemSelected(IFileDialogCustomize* pfdc, DWORD dwIDCtl, DWORD dwIDItem);
52 virtual STDMETHODIMP OnButtonClicked(IFileDialogCustomize* pfdc, DWORD dwIDCtl);
53 virtual STDMETHODIMP OnCheckButtonToggled(IFileDialogCustomize* pfdc, DWORD dwIDCtl, BOOL bChecked);
54 virtual STDMETHODIMP OnControlActivating(IFileDialogCustomize* pfdc, DWORD dwIDCtl);