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

native implementation of the file picker on Vista and upcoming windows versions. More...

#include <VistaFilePickerImpl.hxx>

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

Public Types

enum  ERequest {
  E_NO_REQUEST,
  E_ADD_PICKER_LISTENER,
  E_REMOVE_PICKER_LISTENER,
  E_APPEND_FILTER,
  E_SET_CURRENT_FILTER,
  E_GET_CURRENT_FILTER,
  E_CREATE_OPEN_DIALOG,
  E_CREATE_SAVE_DIALOG,
  E_CREATE_FOLDER_PICKER,
  E_SET_MULTISELECTION_MODE,
  E_SET_TITLE,
  E_SET_FILENAME,
  E_GET_DIRECTORY,
  E_SET_DIRECTORY,
  E_SET_DEFAULT_NAME,
  E_GET_SELECTED_FILES,
  E_SHOW_DIALOG_MODAL,
  E_SET_CONTROL_VALUE,
  E_GET_CONTROL_VALUE,
  E_SET_CONTROL_LABEL,
  E_GET_CONTROL_LABEL,
  E_ENABLE_CONTROL,
  E_APPEND_FILTERGROUP
}
 used for marshalling requests. More...
 

Public Member Functions

 VistaFilePickerImpl ()
 
virtual ~VistaFilePickerImpl () override
 
virtual void before () override
 
virtual void doRequest (const RequestRef &rRequest) override
 
virtual void after () override
 
virtual void onAutoExtensionChanged (bool bChecked) override
 
virtual bool onFileTypeChanged (UINT nTypeIndex) override
 
virtual void onDirectoryChanged () override
 
- Public Member Functions inherited from fpicker::win32::vista::RequestHandler
virtual ~RequestHandler ()
 

Public Attributes

css::uno::Sequence< OUString > m_lItems
 

Private Types

enum  PickerDialog {
  PickerDialog::FileOpen,
  PickerDialog::FileSave,
  PickerDialog::Folder
}
 

Private Member Functions

OUString GetDirectory ()
 
void impl_sta_addFilePickerListener (const RequestRef &rRequest)
 implementation of request E_ADD_FILEPICKER_LISTENER More...
 
void impl_sta_removeFilePickerListener (const RequestRef &rRequest)
 implementation of request E_REMOVE_FILEPICKER_LISTENER More...
 
void impl_sta_appendFilter (const RequestRef &rRequest)
 implementation of request E_APPEND_FILTER More...
 
void impl_sta_appendFilterGroup (const RequestRef &rRequest)
 implementation of request E_APPEND_FILTERGROUP More...
 
void impl_sta_setCurrentFilter (const RequestRef &rRequest)
 implementation of request E_SET_CURRENT_FILTER More...
 
void impl_sta_getCurrentFilter (const RequestRef &rRequest)
 implementation of request E_GET_CURRENT_FILTER More...
 
void impl_sta_CreateOpenDialog (const RequestRef &rRequest)
 implementation of request E_CREATE_OPEN_DIALOG More...
 
void impl_sta_CreateSaveDialog (const RequestRef &rRequest)
 implementation of request E_CREATE_SAVE_DIALOG More...
 
void impl_sta_CreateFolderPicker (const RequestRef &rRequest)
 implementation of request E_CREATE_FOLDER_PICKER More...
 
void impl_sta_SetMultiSelectionMode (const RequestRef &rRequest)
 implementation of request E_SET_MULTISELECTION_MODE More...
 
void impl_sta_SetTitle (const RequestRef &rRequest)
 implementation of request E_SET_TITLE More...
 
void impl_sta_SetFileName (const RequestRef &rRequest)
 implementation of request E_SET_FILENAME More...
 
void impl_sta_SetDirectory (const RequestRef &rRequest)
 implementation of request E_SET_DIRECTORY More...
 
void impl_sta_GetDirectory (const RequestRef &rRequest)
 implementation of request E_GET_DIRECTORY More...
 
void impl_sta_SetDefaultName (const RequestRef &rRequest)
 implementation of request E_SET_DEFAULT_NAME More...
 
void impl_sta_getSelectedFiles (const RequestRef &rRequest)
 implementation of request E_GET_SELECTED_FILES More...
 
void impl_sta_ShowDialogModal (const RequestRef &rRequest)
 implementation of request E_SHOW_DIALOG_MODAL More...
 
void impl_sta_SetControlValue (const RequestRef &rRequest)
 implementation of request E_SET_CONTROL_VALUE More...
 
void impl_sta_GetControlValue (const RequestRef &rRequest)
 implementation of request E_GET_CONTROL_VALUE More...
 
void impl_sta_SetControlLabel (const RequestRef &rRequest)
 implementation of request E_SET_CONTROL_LABEL More...
 
void impl_sta_EnableControl (const RequestRef &rRequest)
 implementation of request E_ENABLE_CONTROL More...
 
void impl_sta_enableFeatures (::sal_Int32 nFeatures,::sal_Int32 nTemplate)
 create all needed (optional!) UI controls addressed by the field nFeatures. More...
 
TFileDialogCustomize impl_getCustomizeInterface ()
 returns an interface, which can be used to customize the internally used COM dialog. More...
 
TFileDialog impl_getBaseDialogInterface ()
 
void impl_sta_setFiltersOnDialog ()
 fill filter list of internal used dialog. More...
 
void impl_SetDefaultExtension (const OUString &currentFilter)
 
void impl_sta_CreateDialog (const RequestRef &rRequest, PickerDialog eType, DWORD nOrFlags)
 

Static Private Member Functions

static void impl_sta_GetControlLabel (const RequestRef &rRequest)
 implementation of request E_GET_CONTROL_LABEL More...
 

Private Attributes

TFileOpenDialog m_iDialogOpen
 COM object representing a file open dialog. More...
 
TFileSaveDialog m_iDialogSave
 COM object representing a file save dialog. More...
 
TFolderPickerDialog m_iFolderPicker
 COM object representing a folder picker dialog. More...
 
HRESULT m_hLastResult
 knows the return state of the last COM call More...
 
CFilterContainer m_lFilters
 
TFileDialogEvents m_iEventHandler
 help us to handle dialog events and provide them to interested office listener. More...
 
bool m_bInExecute
 
bool m_bWasExecuted
 
HWND m_hParentWindow
 
OUString m_sDirectory
 
OUString m_sFilename
 
int mnNbCallCoInitializeExForReinit
 
- Private Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Additional Inherited Members

- Protected Member Functions inherited from fpicker::win32::vista::IVistaFilePickerInternalNotify
 ~IVistaFilePickerInternalNotify ()
 

Detailed Description

native implementation of the file picker on Vista and upcoming windows versions.

This dialog uses COM internally. Further it marshall every request so it will be executed within its own STA thread !

Definition at line 91 of file VistaFilePickerImpl.hxx.

Member Enumeration Documentation

used for marshalling requests.

Will be used to map requests to the right implementations.

Enumerator
E_NO_REQUEST 
E_ADD_PICKER_LISTENER 
E_REMOVE_PICKER_LISTENER 
E_APPEND_FILTER 
E_SET_CURRENT_FILTER 
E_GET_CURRENT_FILTER 
E_CREATE_OPEN_DIALOG 
E_CREATE_SAVE_DIALOG 
E_CREATE_FOLDER_PICKER 
E_SET_MULTISELECTION_MODE 
E_SET_TITLE 
E_SET_FILENAME 
E_GET_DIRECTORY 
E_SET_DIRECTORY 
E_SET_DEFAULT_NAME 
E_GET_SELECTED_FILES 
E_SHOW_DIALOG_MODAL 
E_SET_CONTROL_VALUE 
E_GET_CONTROL_VALUE 
E_SET_CONTROL_LABEL 
E_GET_CONTROL_LABEL 
E_ENABLE_CONTROL 
E_APPEND_FILTERGROUP 

Definition at line 102 of file VistaFilePickerImpl.hxx.

Enumerator
FileOpen 
FileSave 
Folder 

Definition at line 281 of file VistaFilePickerImpl.hxx.

Constructor & Destructor Documentation

fpicker::win32::vista::VistaFilePickerImpl::VistaFilePickerImpl ( )

Definition at line 181 of file VistaFilePickerImpl.cxx.

fpicker::win32::vista::VistaFilePickerImpl::~VistaFilePickerImpl ( )
overridevirtual

Definition at line 198 of file VistaFilePickerImpl.cxx.

Member Function Documentation

void fpicker::win32::vista::VistaFilePickerImpl::after ( )
overridevirtual
void fpicker::win32::vista::VistaFilePickerImpl::before ( )
overridevirtual
void fpicker::win32::vista::VistaFilePickerImpl::doRequest ( const RequestRef rRequest)
overridevirtual
OUString fpicker::win32::vista::VistaFilePickerImpl::GetDirectory ( )
private
TFileDialog fpicker::win32::vista::VistaFilePickerImpl::impl_getBaseDialogInterface ( )
private
TFileDialogCustomize fpicker::win32::vista::VistaFilePickerImpl::impl_getCustomizeInterface ( )
private

returns an interface, which can be used to customize the internally used COM dialog.

Because we use two member (open/save dialog) internally, this method ask the current active one for its customization interface.

Returns
the customization interface for the current used dialog. Must not be null.

Definition at line 1071 of file VistaFilePickerImpl.cxx.

References aLock, ComPtr< T_INTERFACE, P_IID, P_CLSID >::is(), cppu::BaseMutex::m_aMutex, m_iDialogOpen, m_iDialogSave, m_iFolderPicker, and ComPtr< T_INTERFACE, P_IID, P_CLSID >::query().

Referenced by impl_sta_EnableControl(), impl_sta_enableFeatures(), impl_sta_GetControlValue(), impl_sta_SetControlLabel(), impl_sta_SetControlValue(), impl_sta_SetDefaultName(), impl_sta_setFiltersOnDialog(), and impl_sta_ShowDialogModal().

void fpicker::win32::vista::VistaFilePickerImpl::impl_SetDefaultExtension ( const OUString &  currentFilter)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_addFilePickerListener ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_appendFilter ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_appendFilterGroup ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_CreateDialog ( const RequestRef rRequest,
PickerDialog  eType,
DWORD  nOrFlags 
)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_CreateFolderPicker ( const RequestRef rRequest)
private

implementation of request E_CREATE_FOLDER_PICKER

Definition at line 527 of file VistaFilePickerImpl.cxx.

References Folder, and impl_sta_CreateDialog().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_CreateOpenDialog ( const RequestRef rRequest)
private

implementation of request E_CREATE_OPEN_DIALOG

Definition at line 507 of file VistaFilePickerImpl.cxx.

References FileOpen, and impl_sta_CreateDialog().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_CreateSaveDialog ( const RequestRef rRequest)
private

implementation of request E_CREATE_SAVE_DIALOG

Definition at line 517 of file VistaFilePickerImpl.cxx.

References FileSave, and impl_sta_CreateDialog().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_EnableControl ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_enableFeatures ( ::sal_Int32  nFeatures,
::sal_Int32  nTemplate 
)
private

create all needed (optional!) UI controls addressed by the field nFeatures.

The given number nFeatures is used as a flag field. Use const values FEATURE_XXX to address it.

Internal new controls will be added to the dialog. Every control can be accessed by its own control id. Those control ID must be one of the const set css::ui::dialogs::ExtendedFilePickerElementIds.

See also
setControlValue()
getControlValue()
setControlLabel()
getControlLabel()
enableControl()
Parameters
nFeaturesflag field(!) knows all features which must be enabled.

Definition at line 551 of file VistaFilePickerImpl.cxx.

References fpicker::win32::vista::CLIENTID_FILEDIALOG_OPTIONS, fpicker::win32::vista::CLIENTID_FILEDIALOG_SIMPLE, fpicker::win32::vista::CLIENTID_FILEOPEN_LINK, fpicker::win32::vista::CLIENTID_FILEOPEN_LINK_ANCHOR, fpicker::win32::vista::CLIENTID_FILEOPEN_LINK_TEMPLATE, fpicker::win32::vista::CLIENTID_FILEOPEN_PLAY, fpicker::win32::vista::CLIENTID_FILESAVE_PASSWORD, fpicker::win32::vista::CLIENTID_FILESAVE_SELECTION, fpicker::win32::vista::CLIENTID_FILESAVE_TEMPLATE, fpicker::win32::vista::FEATURE_AUTOEXTENSION, fpicker::win32::vista::FEATURE_FILTEROPTIONS, fpicker::win32::vista::FEATURE_GPGPASSWORD, fpicker::win32::vista::FEATURE_IMAGEANCHOR, fpicker::win32::vista::FEATURE_IMAGETEMPLATE, fpicker::win32::vista::FEATURE_LINK, fpicker::win32::vista::FEATURE_PASSWORD, fpicker::win32::vista::FEATURE_PLAY, fpicker::win32::vista::FEATURE_READONLY, fpicker::win32::vista::FEATURE_SELECTION, fpicker::win32::vista::FEATURE_TEMPLATE, fpicker::win32::vista::FEATURE_VERSION, FpsResId(), impl_getBaseDialogInterface(), impl_getCustomizeInterface(), nControlId, and fpicker::win32::vista::setLabelToControl().

Referenced by impl_sta_CreateDialog().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_GetControlLabel ( const RequestRef rRequest)
staticprivate

implementation of request E_GET_CONTROL_LABEL

Definition at line 1240 of file VistaFilePickerImpl.cxx.

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_GetControlValue ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_getCurrentFilter ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_GetDirectory ( const RequestRef rRequest)
private

implementation of request E_GET_DIRECTORY

Definition at line 786 of file VistaFilePickerImpl.cxx.

References GetDirectory(), m_sDirectory, and fpicker::win32::vista::PROP_DIRECTORY().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_getSelectedFiles ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_removeFilePickerListener ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetControlLabel ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetControlValue ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_setCurrentFilter ( const RequestRef rRequest)
private

implementation of request E_SET_CURRENT_FILTER

Definition at line 395 of file VistaFilePickerImpl.cxx.

References aLock, cppu::BaseMutex::m_aMutex, m_lFilters, fpicker::win32::vista::PROP_FILTER_TITLE(), and CFilterContainer::setCurrentFilter().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetDefaultName ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetDirectory ( const RequestRef rRequest)
private

implementation of request E_SET_DIRECTORY

Definition at line 749 of file VistaFilePickerImpl.cxx.

References aLock, impl_getBaseDialogInterface(), cppu::BaseMutex::m_aMutex, m_bInExecute, m_sDirectory, and fpicker::win32::vista::PROP_DIRECTORY().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetFileName ( const RequestRef rRequest)
private

implementation of request E_SET_FILENAME

Definition at line 735 of file VistaFilePickerImpl.cxx.

References aLock, impl_getBaseDialogInterface(), cppu::BaseMutex::m_aMutex, and fpicker::win32::vista::PROP_FILENAME().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_setFiltersOnDialog ( )
private
void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetMultiSelectionMode ( const RequestRef rRequest)
private

implementation of request E_SET_MULTISELECTION_MODE

Definition at line 699 of file VistaFilePickerImpl.cxx.

References aLock, impl_getBaseDialogInterface(), cppu::BaseMutex::m_aMutex, m_hLastResult, and fpicker::win32::vista::PROP_MULTISELECTION_MODE().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_SetTitle ( const RequestRef rRequest)
private

implementation of request E_SET_TITLE

Definition at line 721 of file VistaFilePickerImpl.cxx.

References aLock, impl_getBaseDialogInterface(), cppu::BaseMutex::m_aMutex, and fpicker::win32::vista::PROP_TITLE().

Referenced by doRequest().

void fpicker::win32::vista::VistaFilePickerImpl::impl_sta_ShowDialogModal ( const RequestRef rRequest)
private
void fpicker::win32::vista::VistaFilePickerImpl::onAutoExtensionChanged ( bool  bChecked)
overridevirtual
void fpicker::win32::vista::VistaFilePickerImpl::onDirectoryChanged ( )
overridevirtual
bool fpicker::win32::vista::VistaFilePickerImpl::onFileTypeChanged ( UINT  nTypeIndex)
overridevirtual

Member Data Documentation

bool fpicker::win32::vista::VistaFilePickerImpl::m_bInExecute
private
bool fpicker::win32::vista::VistaFilePickerImpl::m_bWasExecuted
private

Definition at line 320 of file VistaFilePickerImpl.hxx.

Referenced by impl_sta_GetControlValue(), and impl_sta_ShowDialogModal().

HRESULT fpicker::win32::vista::VistaFilePickerImpl::m_hLastResult
private

knows the return state of the last COM call

Definition at line 304 of file VistaFilePickerImpl.hxx.

Referenced by before(), impl_sta_CreateDialog(), and impl_sta_SetMultiSelectionMode().

HWND fpicker::win32::vista::VistaFilePickerImpl::m_hParentWindow
private

Definition at line 323 of file VistaFilePickerImpl.hxx.

Referenced by impl_sta_CreateDialog(), and impl_sta_ShowDialogModal().

TFileOpenDialog fpicker::win32::vista::VistaFilePickerImpl::m_iDialogOpen
private
TFileSaveDialog fpicker::win32::vista::VistaFilePickerImpl::m_iDialogSave
private
TFileDialogEvents fpicker::win32::vista::VistaFilePickerImpl::m_iEventHandler
private

help us to handle dialog events and provide them to interested office listener.

Definition at line 314 of file VistaFilePickerImpl.hxx.

Referenced by impl_sta_addFilePickerListener(), impl_sta_CreateDialog(), and impl_sta_removeFilePickerListener().

TFolderPickerDialog fpicker::win32::vista::VistaFilePickerImpl::m_iFolderPicker
private

COM object representing a folder picker dialog.

Definition at line 300 of file VistaFilePickerImpl.hxx.

Referenced by impl_getBaseDialogInterface(), impl_getCustomizeInterface(), impl_sta_CreateDialog(), impl_sta_getSelectedFiles(), and impl_sta_ShowDialogModal().

CFilterContainer fpicker::win32::vista::VistaFilePickerImpl::m_lFilters
private
css::uno::Sequence< OUString > fpicker::win32::vista::VistaFilePickerImpl::m_lItems

Definition at line 98 of file VistaFilePickerImpl.hxx.

Referenced by impl_sta_GetControlValue(), and impl_sta_SetControlValue().

OUString fpicker::win32::vista::VistaFilePickerImpl::m_sDirectory
private
OUString fpicker::win32::vista::VistaFilePickerImpl::m_sFilename
private

Definition at line 329 of file VistaFilePickerImpl.hxx.

Referenced by impl_sta_SetDefaultName(), and impl_sta_ShowDialogModal().

int fpicker::win32::vista::VistaFilePickerImpl::mnNbCallCoInitializeExForReinit
private

Definition at line 332 of file VistaFilePickerImpl.hxx.

Referenced by after(), and before().


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