26#include <com/sun/star/lang/XMultiServiceFactory.hpp>
27#include <com/sun/star/embed/XStorage.hpp>
28#include <com/sun/star/document/XDocumentRevisionListPersistence.hpp>
29#include <com/sun/star/util/RevisionTag.hpp>
30#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
31#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
33#include <osl/file.hxx>
46 , m_nListenerHandle (0 )
48 , m_pInternalNotify (pInternalNotify)
64 if ( rIID == IID_IUnknown )
65 *ppObject =
static_cast<IUnknown*
>(
static_cast<IFileDialogEvents*
>(
this));
67 if ( rIID == IID_IFileDialogEvents )
68 *ppObject =
static_cast<IFileDialogEvents*
>(
this);
70 if ( rIID == IID_IFileDialogControlEvents )
71 *ppObject =
static_cast<IFileDialogControlEvents*
>(
this);
73 if ( *ppObject !=
nullptr )
75 static_cast<IUnknown*
>(*ppObject)->AddRef();
131 FDE_SHAREVIOLATION_RESPONSE* )
141 HRESULT hResult = pDialog->GetFileTypeIndex( &nFileTypeIndex );
143 if ( hResult == S_OK )
155 FDE_OVERWRITE_RESPONSE* )
186 if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION)
239void doRequest(
Request& rRequest)
241 const ::sal_Int32 nEventID = rRequest.
getRequest();
245 if ( ! xListener.is())
248 css::ui::dialogs::FilePickerEvent
aEvent;
249 aEvent.ElementId = nControlID;
254 xListener->fileSelectionChanged(
aEvent);
258 xListener->directoryChanged(
aEvent);
262 xListener->helpRequested(
aEvent);
266 xListener->controlStateChanged(
aEvent);
270 xListener->dialogSizeChanged();
280 ::sal_Int16 nControlID)
291 css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener (
292 static_cast< css::ui::dialogs::XFilePickerListener*
>(pIterator.
next()));
302 catch(
const css::uno::RuntimeException&)
css::uno::XInterface * next()
bool hasMoreElements() const
OInterfaceContainerHelper2 * getContainer(const css::uno::Type &rKey) const
sal_Int32 removeInterface(const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &rxIFace)
sal_Int32 addInterface(const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &r)
virtual bool onFileTypeChanged(UINT nTypeIndex)=0
virtual void onDirectoryChanged()=0
virtual void onAutoExtensionChanged(bool bChecked)=0
void setArgument(const OUString &sName, const TArgumentType &aValue)
void setRequest(::sal_Int32 nRequest)
TArgumentType getArgumentOrDefault(const OUString &sName, const TArgumentType &aDefault)
oslInterlockedCount m_nRefCount
ref count for AddRef/Release()
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID rIID, void **ppObject) override
virtual void addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener)
virtual ULONG STDMETHODCALLTYPE Release() override
void stopListening()
stop listening for file picker events on the internally cached dialog COM object.
STDMETHODIMP OnItemSelected(IFileDialogCustomize *pCustomize, DWORD nIDCtl, DWORD nIDItem) override
virtual void removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener)
IVistaFilePickerInternalNotify * m_pInternalNotify
virtual ULONG STDMETHODCALLTYPE AddRef() override
STDMETHODIMP OnFileOk(IFileDialog *pDialog) override
STDMETHODIMP OnFolderChanging(IFileDialog *pDialog, IShellItem *pFolder) override
comphelper::OMultiTypeInterfaceContainerHelper2 m_lListener
used to inform file picker listener asynchronously.
STDMETHODIMP OnControlActivating(IFileDialogCustomize *pCustomize, DWORD nIDCtl) override
STDMETHODIMP OnButtonClicked(IFileDialogCustomize *pCustomize, DWORD nIDCtl) override
void startListening(const TFileDialog &pBroadcaster)
start listening for file picker events on the given file open dialog COM object.
@ E_CONTROL_STATE_CHANGED
@ E_FILE_SELECTION_CHANGED
virtual ~VistaFilePickerEventHandler()
STDMETHODIMP OnSelectionChange(IFileDialog *pDialog) override
TFileDialog m_pDialog
cached file dialog instance (there we listen for events)
STDMETHODIMP OnCheckButtonToggled(IFileDialogCustomize *pCustomize, DWORD nIDCtl, BOOL bChecked) override
DWORD m_nListenerHandle
unique handle for this listener provided by the broadcaster on registration time
STDMETHODIMP OnTypeChange(IFileDialog *pDialog) override
VistaFilePickerEventHandler(IVistaFilePickerInternalNotify *pInternalNotify)
STDMETHODIMP OnFolderChange(IFileDialog *pDialog) override
STDMETHODIMP OnShareViolation(IFileDialog *pDialog, IShellItem *pItem, FDE_SHAREVIOLATION_RESPONSE *pResponse) override
void impl_sendEvent(EEventType eEventType, ::sal_Int16 nControlID)
STDMETHODIMP OnOverwrite(IFileDialog *pDialog, IShellItem *pItem, FDE_OVERWRITE_RESPONSE *pResponse) override
const OUStringLiteral PROP_PICKER_LISTENER
sal::systools::COMReference< IFileDialog > TFileDialog
const OUStringLiteral PROP_CONTROL_ID
const wchar_t *typedef BOOL