LibreOffice Module fpicker (master)  1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
fpicker::win32::vista::VistaFilePickerEventHandler Class Reference

todo document me More...

#include <VistaFilePickerEventHandler.hxx>

Inheritance diagram for fpicker::win32::vista::VistaFilePickerEventHandler:
[legend]
Collaboration diagram for fpicker::win32::vista::VistaFilePickerEventHandler:
[legend]

Public Types

enum  EEventType {
  E_FILE_SELECTION_CHANGED,
  E_DIRECTORY_CHANGED,
  E_HELP_REQUESTED,
  E_CONTROL_STATE_CHANGED,
  E_DIALOG_SIZE_CHANGED
}
 

Public Member Functions

 VistaFilePickerEventHandler (IVistaFilePickerInternalNotify *pInternalNotify)
 
virtual ~VistaFilePickerEventHandler ()
 
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID rIID, void **ppObject) override
 
virtual ULONG STDMETHODCALLTYPE AddRef () override
 
virtual ULONG STDMETHODCALLTYPE Release () override
 
STDMETHODIMP OnFileOk (IFileDialog *pDialog) override
 
STDMETHODIMP OnFolderChanging (IFileDialog *pDialog, IShellItem *pFolder) override
 
STDMETHODIMP OnFolderChange (IFileDialog *pDialog) override
 
STDMETHODIMP OnSelectionChange (IFileDialog *pDialog) override
 
STDMETHODIMP OnShareViolation (IFileDialog *pDialog, IShellItem *pItem, FDE_SHAREVIOLATION_RESPONSE *pResponse) override
 
STDMETHODIMP OnTypeChange (IFileDialog *pDialog) override
 
STDMETHODIMP OnOverwrite (IFileDialog *pDialog, IShellItem *pItem, FDE_OVERWRITE_RESPONSE *pResponse) override
 
STDMETHODIMP OnItemSelected (IFileDialogCustomize *pCustomize, DWORD nIDCtl, DWORD nIDItem) override
 
STDMETHODIMP OnButtonClicked (IFileDialogCustomize *pCustomize, DWORD nIDCtl) override
 
STDMETHODIMP OnCheckButtonToggled (IFileDialogCustomize *pCustomize, DWORD nIDCtl, BOOL bChecked) override
 
STDMETHODIMP OnControlActivating (IFileDialogCustomize *pCustomize, DWORD nIDCtl) override
 
virtual void addFilePickerListener (const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener)
 
virtual void removeFilePickerListener (const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener)
 
void startListening (const TFileDialog &pBroadcaster)
 start listening for file picker events on the given file open dialog COM object. More...
 
void stopListening ()
 stop listening for file picker events on the internally cached dialog COM object. More...
 

Private Member Functions

void impl_sendEvent (EEventType eEventType,::sal_Int16 nControlID)
 

Private Attributes

oslInterlockedCount m_nRefCount
 ref count for AddRef/Release() More...
 
DWORD m_nListenerHandle
 unique handle for this listener provided by the broadcaster on registration time More...
 
TFileDialog m_pDialog
 cached file dialog instance (there we listen for events) More...
 
IVistaFilePickerInternalNotifym_pInternalNotify
 
::cppu::OMultiTypeInterfaceContainerHelper m_lListener
 used to inform file picker listener asynchronously. More...
 

Additional Inherited Members

- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

todo document me

Definition at line 45 of file VistaFilePickerEventHandler.hxx.

Member Enumeration Documentation

Enumerator
E_FILE_SELECTION_CHANGED 
E_DIRECTORY_CHANGED 
E_HELP_REQUESTED 
E_CONTROL_STATE_CHANGED 
E_DIALOG_SIZE_CHANGED 

Definition at line 145 of file VistaFilePickerEventHandler.hxx.

Constructor & Destructor Documentation

fpicker::win32::vista::VistaFilePickerEventHandler::VistaFilePickerEventHandler ( IVistaFilePickerInternalNotify pInternalNotify)
explicit

Definition at line 46 of file VistaFilePickerEventHandler.cxx.

References m_aMutex.

fpicker::win32::vista::VistaFilePickerEventHandler::~VistaFilePickerEventHandler ( )
virtual

Definition at line 56 of file VistaFilePickerEventHandler.cxx.

Member Function Documentation

void fpicker::win32::vista::VistaFilePickerEventHandler::addFilePickerListener ( const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &  xListener)
virtual
ULONG STDMETHODCALLTYPE fpicker::win32::vista::VistaFilePickerEventHandler::AddRef ( )
overridevirtual

Definition at line 85 of file VistaFilePickerEventHandler.cxx.

References m_nRefCount.

void fpicker::win32::vista::VistaFilePickerEventHandler::impl_sendEvent ( EEventType  eEventType,
::sal_Int16  nControlID 
)
private
STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnButtonClicked ( IFileDialogCustomize *  pCustomize,
DWORD  nIDCtl 
)
override

Definition at line 175 of file VistaFilePickerEventHandler.cxx.

References E_CONTROL_STATE_CHANGED, and impl_sendEvent().

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnCheckButtonToggled ( IFileDialogCustomize *  pCustomize,
DWORD  nIDCtl,
BOOL  bChecked 
)
override
STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnControlActivating ( IFileDialogCustomize *  pCustomize,
DWORD  nIDCtl 
)
override

Definition at line 197 of file VistaFilePickerEventHandler.cxx.

References E_CONTROL_STATE_CHANGED, and impl_sendEvent().

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnFileOk ( IFileDialog *  pDialog)
override

Definition at line 101 of file VistaFilePickerEventHandler.cxx.

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnFolderChange ( IFileDialog *  pDialog)
override
STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnFolderChanging ( IFileDialog *  pDialog,
IShellItem *  pFolder 
)
override

Definition at line 107 of file VistaFilePickerEventHandler.cxx.

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnItemSelected ( IFileDialogCustomize *  pCustomize,
DWORD  nIDCtl,
DWORD  nIDItem 
)
override

Definition at line 163 of file VistaFilePickerEventHandler.cxx.

References E_CONTROL_STATE_CHANGED, and impl_sendEvent().

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnOverwrite ( IFileDialog *  pDialog,
IShellItem *  pItem,
FDE_OVERWRITE_RESPONSE *  pResponse 
)
override

Definition at line 155 of file VistaFilePickerEventHandler.cxx.

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnSelectionChange ( IFileDialog *  pDialog)
override

Definition at line 122 of file VistaFilePickerEventHandler.cxx.

References E_FILE_SELECTION_CHANGED, and impl_sendEvent().

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnShareViolation ( IFileDialog *  pDialog,
IShellItem *  pItem,
FDE_SHAREVIOLATION_RESPONSE *  pResponse 
)
override

Definition at line 129 of file VistaFilePickerEventHandler.cxx.

References E_CONTROL_STATE_CHANGED, and impl_sendEvent().

STDMETHODIMP fpicker::win32::vista::VistaFilePickerEventHandler::OnTypeChange ( IFileDialog *  pDialog)
override
HRESULT STDMETHODCALLTYPE fpicker::win32::vista::VistaFilePickerEventHandler::QueryInterface ( REFIID  rIID,
void **  ppObject 
)
overridevirtual

Definition at line 61 of file VistaFilePickerEventHandler.cxx.

ULONG STDMETHODCALLTYPE fpicker::win32::vista::VistaFilePickerEventHandler::Release ( )
overridevirtual

Definition at line 91 of file VistaFilePickerEventHandler.cxx.

References m_nRefCount.

void fpicker::win32::vista::VistaFilePickerEventHandler::removeFilePickerListener ( const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &  xListener)
virtual
void fpicker::win32::vista::VistaFilePickerEventHandler::startListening ( const TFileDialog pBroadcaster)

start listening for file picker events on the given file open dialog COM object.

The broadcaster will be cached internally so deregistration will be easy. Further all needed information is capsulated within this class (e.g. the listener handler). Nobody outside must know such information.

Nothing will happen if an inconsistent state will be detected (means: double registration will be ignored).

Parameters
pBroadcasterreference to the dialog, where we should start listening.

Definition at line 217 of file VistaFilePickerEventHandler.cxx.

References ComPtr< T_INTERFACE, P_IID, P_CLSID >::is(), m_nListenerHandle, and m_pDialog.

Referenced by fpicker::win32::vista::VistaFilePickerImpl::impl_sta_CreateDialog().

void fpicker::win32::vista::VistaFilePickerEventHandler::stopListening ( )

stop listening for file picker events on the internally cached dialog COM object.

The COM dialog provided on the startListening() call was cached internally. And now it's used to deregister this listener. Doing so the also internally cached listener handle is used. If listener was not already registered - nothing will happen.

Definition at line 227 of file VistaFilePickerEventHandler.cxx.

References ComPtr< T_INTERFACE, P_IID, P_CLSID >::is(), m_nListenerHandle, m_pDialog, and ComPtr< T_INTERFACE, P_IID, P_CLSID >::release().

Member Data Documentation

::cppu::OMultiTypeInterfaceContainerHelper fpicker::win32::vista::VistaFilePickerEventHandler::m_lListener
private

used to inform file picker listener asynchronously.

Those listener must be called asynchronously .. because every request will block the caller thread. Mostly that will be the main thread of the office. Further the global SolarMutex will be locked during this time. If we call our listener back now synchronously .. we will block on SolarMutex.acquire() forever .-))

Definition at line 186 of file VistaFilePickerEventHandler.hxx.

Referenced by addFilePickerListener(), impl_sendEvent(), and removeFilePickerListener().

DWORD fpicker::win32::vista::VistaFilePickerEventHandler::m_nListenerHandle
private

unique handle for this listener provided by the broadcaster on registration time

Definition at line 169 of file VistaFilePickerEventHandler.hxx.

Referenced by startListening(), and stopListening().

oslInterlockedCount fpicker::win32::vista::VistaFilePickerEventHandler::m_nRefCount
private

ref count for AddRef/Release()

Definition at line 165 of file VistaFilePickerEventHandler.hxx.

Referenced by AddRef(), and Release().

TFileDialog fpicker::win32::vista::VistaFilePickerEventHandler::m_pDialog
private

cached file dialog instance (there we listen for events)

Definition at line 173 of file VistaFilePickerEventHandler.hxx.

Referenced by startListening(), and stopListening().

IVistaFilePickerInternalNotify* fpicker::win32::vista::VistaFilePickerEventHandler::m_pInternalNotify
private

The documentation for this class was generated from the following files: