convert FilePicker flags to scoped enum

and merged into the other flags variable.

Change-Id: I23ed21936b9de1537a06168de04530b9fb6bcff1
Reviewed-on: https://gerrit.libreoffice.org/24889
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2016-05-11 14:07:54 +02:00 committed by Noel Grandin
parent e809b97b63
commit c2f912b51e
11 changed files with 76 additions and 110 deletions

View File

@ -226,69 +226,59 @@ IMPL_LINK_TYPED( SvtFilePicker, DialogClosedHdl, Dialog&, rDlg, void )
// SvtFilePicker // SvtFilePicker
WinBits SvtFilePicker::getWinBits( PickerExtraBits& rExtraBits ) PickerFlags SvtFilePicker::getPickerFlags()
{ {
// set the winbits for creating the filedialog // set the winbits for creating the filedialog
WinBits nBits = 0L; PickerFlags nBits = PickerFlags::NONE;
rExtraBits = PickerExtraBits::NONE;
// set the standard bits according to the service name // set the standard bits according to the service name
if ( m_nServiceType == TemplateDescription::FILEOPEN_SIMPLE ) if ( m_nServiceType == TemplateDescription::FILEOPEN_SIMPLE )
{ {
nBits = WB_OPEN; nBits = PickerFlags::Open;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_SIMPLE ) else if ( m_nServiceType == TemplateDescription::FILESAVE_SIMPLE )
{ {
nBits = WB_SAVEAS; nBits = PickerFlags::SaveAs;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION ) else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION )
{ {
nBits = WB_SAVEAS; nBits = PickerFlags::SaveAs | PickerFlags::AutoExtension;
rExtraBits = PickerExtraBits::AutoExtension;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD ) else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD )
{ {
nBits = WB_SAVEAS | SFXWB_PASSWORD; nBits = PickerFlags::SaveAs | PickerFlags::Password | PickerFlags::AutoExtension;
rExtraBits = PickerExtraBits::AutoExtension;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS ) else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS )
{ {
nBits = WB_SAVEAS | SFXWB_PASSWORD; nBits = PickerFlags::SaveAs | PickerFlags::Password | PickerFlags::AutoExtension | PickerFlags::FilterOptions;
rExtraBits = PickerExtraBits::AutoExtension | PickerExtraBits::FilterOptions;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE ) else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE )
{ {
nBits = WB_SAVEAS; nBits = PickerFlags::SaveAs | PickerFlags::AutoExtension | PickerFlags::Templates;
rExtraBits = PickerExtraBits::AutoExtension | PickerExtraBits::Templates;
} }
else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION ) else if ( m_nServiceType == TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION )
{ {
nBits = WB_SAVEAS; nBits = PickerFlags::SaveAs | PickerFlags::AutoExtension | PickerFlags::Selection;
rExtraBits = PickerExtraBits::AutoExtension | PickerExtraBits::Selection;
} }
else if ( m_nServiceType == TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE ) else if ( m_nServiceType == TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE )
{ {
nBits = WB_OPEN; nBits = PickerFlags::Open | PickerFlags::InsertAsLink | PickerFlags::ShowPreview | PickerFlags::ImageTemplate;
rExtraBits = PickerExtraBits::InsertAsLink | PickerExtraBits::ShowPreview | PickerExtraBits::ImageTemplate;
} }
else if ( m_nServiceType == TemplateDescription::FILEOPEN_PLAY ) else if ( m_nServiceType == TemplateDescription::FILEOPEN_PLAY )
{ {
nBits = WB_OPEN; nBits = PickerFlags::Open | PickerFlags::PlayButton;
rExtraBits = PickerExtraBits::PlayButton;
} }
else if ( m_nServiceType == TemplateDescription::FILEOPEN_READONLY_VERSION ) else if ( m_nServiceType == TemplateDescription::FILEOPEN_READONLY_VERSION )
{ {
nBits = WB_OPEN | SFXWB_READONLY; nBits = PickerFlags::Open | PickerFlags::ReadOnly | PickerFlags::ShowVersions;
rExtraBits = PickerExtraBits::ShowVersions;
} }
else if ( m_nServiceType == TemplateDescription::FILEOPEN_LINK_PREVIEW ) else if ( m_nServiceType == TemplateDescription::FILEOPEN_LINK_PREVIEW )
{ {
nBits = WB_OPEN; nBits = PickerFlags::Open | PickerFlags::InsertAsLink | PickerFlags::ShowPreview;
rExtraBits = PickerExtraBits::InsertAsLink | PickerExtraBits::ShowPreview;
} }
if ( m_bMultiSelection && ( ( nBits & WB_OPEN ) == WB_OPEN ) ) if ( m_bMultiSelection && ( nBits & PickerFlags::Open ) )
nBits |= SFXWB_MULTISELECTION; nBits |= PickerFlags::MultiSelection;
return nBits; return nBits;
} }
@ -448,10 +438,9 @@ sal_Int16 SvtFilePicker::implExecutePicker( )
VclPtr<SvtFileDialog_Base> SvtFilePicker::implCreateDialog( vcl::Window* _pParent ) VclPtr<SvtFileDialog_Base> SvtFilePicker::implCreateDialog( vcl::Window* _pParent )
{ {
PickerExtraBits nExtraBits; PickerFlags nBits = getPickerFlags();
WinBits nBits = getWinBits( nExtraBits );
VclPtrInstance<SvtFileDialog> dialog( _pParent, nBits, nExtraBits ); VclPtrInstance<SvtFileDialog> dialog( _pParent, nBits );
// Set StandardDir if present // Set StandardDir if present
if ( !m_aStandardDir.isEmpty()) if ( !m_aStandardDir.isEmpty())
@ -1146,10 +1135,9 @@ SvtRemoteFilePicker::SvtRemoteFilePicker()
VclPtr<SvtFileDialog_Base> SvtRemoteFilePicker::implCreateDialog( vcl::Window* _pParent ) VclPtr<SvtFileDialog_Base> SvtRemoteFilePicker::implCreateDialog( vcl::Window* _pParent )
{ {
PickerExtraBits nExtraBits; PickerFlags nBits = getPickerFlags();
WinBits nBits = getWinBits( nExtraBits );
VclPtrInstance<RemoteFilesDialog> dialog( _pParent, nBits); // TODO: extrabits VclPtrInstance<RemoteFilesDialog> dialog( _pParent, nBits);
// Set StandardDir if present // Set StandardDir if present
if ( !m_aStandardDir.isEmpty()) if ( !m_aStandardDir.isEmpty())

View File

@ -39,7 +39,7 @@
class Dialog; class Dialog;
struct FilterEntry; struct FilterEntry;
struct ElementEntry_Impl; struct ElementEntry_Impl;
enum class PickerExtraBits; enum class PickerFlags;
typedef ::std::list< FilterEntry > FilterList; // can be maintained more effectively typedef ::std::list< FilterEntry > FilterList; // can be maintained more effectively
typedef ::std::list < ElementEntry_Impl > ElementList; typedef ::std::list < ElementEntry_Impl > ElementList;
@ -212,7 +212,7 @@ protected:
) override; ) override;
protected: protected:
WinBits getWinBits( PickerExtraBits& rExtraBits ); PickerFlags getPickerFlags();
virtual void notify( sal_Int16 _nEventId, sal_Int16 _nControlId ) override; virtual void notify( sal_Int16 _nEventId, sal_Int16 _nControlId ) override;
bool FilterNameExists( const OUString& rTitle ); bool FilterNameExists( const OUString& rTitle );

View File

@ -69,7 +69,7 @@ void SAL_CALL SvtFolderPicker::startExecuteModal( const Reference< css::ui::dial
VclPtr<SvtFileDialog_Base> SvtFolderPicker::implCreateDialog( vcl::Window* _pParent ) VclPtr<SvtFileDialog_Base> SvtFolderPicker::implCreateDialog( vcl::Window* _pParent )
{ {
return VclPtr<SvtFileDialog>::Create( _pParent, SFXWB_PATHDIALOG ); return VclPtr<SvtFileDialog>::Create( _pParent, PickerFlags::PathDialog );
} }
sal_Int16 SvtFolderPicker::implExecutePicker( ) sal_Int16 SvtFolderPicker::implExecutePicker( )

View File

@ -168,7 +168,7 @@ class FileViewContainer : public vcl::Window
} }
}; };
RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, PickerFlags nBits )
: SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" )
, m_xContext( comphelper::getProcessComponentContext() ) , m_xContext( comphelper::getProcessComponentContext() )
, m_xMasterPasswd( PasswordContainer::create( m_xContext ) ) , m_xMasterPasswd( PasswordContainer::create( m_xContext ) )
@ -189,9 +189,9 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
get( m_pListView_btn, "list_view" ); get( m_pListView_btn, "list_view" );
get( m_pIconView_btn, "icon_view" ); get( m_pIconView_btn, "icon_view" );
m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN; m_eMode = ( nBits & PickerFlags::SaveAs ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN;
m_eType = ( nBits & WB_PATH ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG; m_eType = ( nBits & PickerFlags::PathDialog ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG;
m_bMultiselection = ( nBits & SFXWB_MULTISELECTION ) != 0; m_bMultiselection = bool( nBits & PickerFlags::MultiSelection );
m_bIsUpdated = false; m_bIsUpdated = false;
m_bIsConnected = false; m_bIsConnected = false;
m_bServiceChanged = false; m_bServiceChanged = false;

View File

@ -70,7 +70,7 @@ class FileViewContainer;
class RemoteFilesDialog : public SvtFileDialog_Base class RemoteFilesDialog : public SvtFileDialog_Base
{ {
public: public:
RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ); RemoteFilesDialog( vcl::Window* pParent, PickerFlags nBits );
virtual ~RemoteFilesDialog(); virtual ~RemoteFilesDialog();
virtual void dispose() override; virtual void dispose() override;

View File

@ -35,27 +35,26 @@ class SvtFileView;
class SvtFileDialogFilter_Impl; class SvtFileDialogFilter_Impl;
#define SFXWB_INSERT ( 0x04000000L | WB_OPEN ) enum class PickerFlags {
#define SFXWB_PASSWORD WB_PASSWORD NONE = 0x000000,
#define SFXWB_READONLY WB_READONLY AutoExtension = 0x000001,
#define SFXWB_PATHDIALOG WB_PATH FilterOptions = 0x000002,
#define SFXWB_CLASSPATH ( 0x08000000L | SFXWB_PATHDIALOG ) ShowVersions = 0x000004,
#define SFXWB_MULTISELECTION 0x20000000L // activate Multiselection InsertAsLink = 0x000008,
ShowPreview = 0x000010,
enum class PickerExtraBits { Templates = 0x000020,
NONE = 0x0000, PlayButton = 0x000040,
AutoExtension = 0x0001, Selection = 0x000080,
FilterOptions = 0x0002, ImageTemplate = 0x000100,
ShowVersions = 0x0004, PathDialog = 0x000200,
InsertAsLink = 0x0008, Open = 0x000400,
ShowPreview = 0x0010, SaveAs = 0x000800,
Templates = 0x0020, Password = 0x001000,
PlayButton = 0x0040, ReadOnly = 0x002000,
Selection = 0x0080, MultiSelection = 0x004000,
ImageTemplate = 0x0100
}; };
namespace o3tl { namespace o3tl {
template<> struct typed_flags<PickerExtraBits> : is_typed_flags<PickerExtraBits, 0x01ff> {}; template<> struct typed_flags<PickerFlags> : is_typed_flags<PickerFlags, 0x007fff> {};
} }
#define FILEDIALOG_FILTER_ALL "*.*" #define FILEDIALOG_FILTER_ALL "*.*"

View File

@ -295,8 +295,7 @@ namespace
SvtFileDialog::SvtFileDialog SvtFileDialog::SvtFileDialog
( (
vcl::Window* _pParent, vcl::Window* _pParent,
WinBits nBits, PickerFlags nBits
PickerExtraBits nExtraBits
) : ) :
SvtFileDialog_Base( _pParent, "ExplorerFileDialog", "fps/ui/explorerfiledialog.ui" ) SvtFileDialog_Base( _pParent, "ExplorerFileDialog", "fps/ui/explorerfiledialog.ui" )
@ -309,8 +308,8 @@ SvtFileDialog::SvtFileDialog
,_pPrevBmp( nullptr ) ,_pPrevBmp( nullptr )
,_pFileView( nullptr ) ,_pFileView( nullptr )
,_pFileNotifier( nullptr ) ,_pFileNotifier( nullptr )
,_pImp( new SvtExpFileDlg_Impl( nBits ) ) ,_pImp( new SvtExpFileDlg_Impl )
,_nExtraBits( nExtraBits ) ,_nPickerFlags( nBits )
,_bIsInExecute( false ) ,_bIsInExecute( false )
,m_bInExecuteAsync( false ) ,m_bInExecuteAsync( false )
,m_bHasFilename( false ) ,m_bHasFilename( false )
@ -320,25 +319,6 @@ SvtFileDialog::SvtFileDialog
} }
SvtFileDialog::SvtFileDialog ( vcl::Window* _pParent, WinBits nBits )
:SvtFileDialog_Base( _pParent, "ExplorerFileDialog", "fps/ui/explorerfiledialog.ui" )
,_pCbReadOnly( nullptr )
,_pCbLinkBox( nullptr)
,_pCbPreviewBox( nullptr )
,_pCbSelection( nullptr )
,_pPbPlay( nullptr )
,_pPrevWin( nullptr )
,_pPrevBmp( nullptr )
,_pFileView( nullptr )
,_pFileNotifier( nullptr )
,_pImp( new SvtExpFileDlg_Impl( nBits ) )
,_nExtraBits( PickerExtraBits::NONE )
,_bIsInExecute( false )
,m_bHasFilename( false )
{
Init_Impl( nBits );
}
class CustomContainer : public vcl::Window class CustomContainer : public vcl::Window
{ {
enum FocusState enum FocusState
@ -551,7 +531,7 @@ void SvtFileDialog::dispose()
void SvtFileDialog::Init_Impl void SvtFileDialog::Init_Impl
( (
WinBits nStyle PickerFlags nStyle
) )
{ {
get(_pCbReadOnly, "readonly"); get(_pCbReadOnly, "readonly");
@ -592,10 +572,10 @@ void SvtFileDialog::Init_Impl
_pImp->_pBtnUp->Show(); _pImp->_pBtnUp->Show();
_pImp->_nStyle = nStyle; _pImp->_nStyle = nStyle;
_pImp->_eMode = ( nStyle & WB_SAVEAS ) ? FILEDLG_MODE_SAVE : FILEDLG_MODE_OPEN; _pImp->_eMode = ( nStyle & PickerFlags::SaveAs ) ? FILEDLG_MODE_SAVE : FILEDLG_MODE_OPEN;
_pImp->_eDlgType = FILEDLG_TYPE_FILEDLG; _pImp->_eDlgType = FILEDLG_TYPE_FILEDLG;
if ( ( nStyle & SFXWB_PATHDIALOG ) == SFXWB_PATHDIALOG ) if ( nStyle & PickerFlags::PathDialog )
_pImp->_eDlgType = FILEDLG_TYPE_PATHDLG; _pImp->_eDlgType = FILEDLG_TYPE_PATHDLG;
// Set the directory for the "back to the default dir" button // Set the directory for the "back to the default dir" button
@ -619,7 +599,7 @@ void SvtFileDialog::Init_Impl
_pImp->_pBtnUp->SetAccessibleName( _pImp->_pBtnUp->GetQuickHelpText() ); _pImp->_pBtnUp->SetAccessibleName( _pImp->_pBtnUp->GetQuickHelpText() );
_pImp->_pBtnNewFolder->SetAccessibleName( _pImp->_pBtnNewFolder->GetQuickHelpText() ); _pImp->_pBtnNewFolder->SetAccessibleName( _pImp->_pBtnNewFolder->GetQuickHelpText() );
if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION ) if ( nStyle & PickerFlags::MultiSelection )
_pImp->_bMultiSelection = true; _pImp->_bMultiSelection = true;
_pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container"))); _pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container")));
@ -645,7 +625,7 @@ void SvtFileDialog::Init_Impl
Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) ); Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
_pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg ); _pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg );
if ( nStyle & SFXWB_READONLY ) if ( nStyle & PickerFlags::ReadOnly )
{ {
_pCbReadOnly->SetHelpId( HID_FILEOPEN_READONLY ); _pCbReadOnly->SetHelpId( HID_FILEOPEN_READONLY );
_pCbReadOnly->SetText( SvtResId( STR_SVT_FILEPICKER_READONLY ) ); _pCbReadOnly->SetText( SvtResId( STR_SVT_FILEPICKER_READONLY ) );
@ -653,7 +633,7 @@ void SvtFileDialog::Init_Impl
_pCbReadOnly->Show(); _pCbReadOnly->Show();
} }
if ( nStyle & SFXWB_PASSWORD ) if ( nStyle & PickerFlags::Password )
{ {
_pImp->_pCbPassword->SetText( SvtResId( STR_SVT_FILEPICKER_PASSWORD ) ); _pImp->_pCbPassword->SetText( SvtResId( STR_SVT_FILEPICKER_PASSWORD ) );
_pImp->_pCbPassword->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); _pImp->_pCbPassword->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) );
@ -669,13 +649,13 @@ void SvtFileDialog::Init_Impl
sal_uInt16 nResId = STR_EXPLORERFILE_OPEN; sal_uInt16 nResId = STR_EXPLORERFILE_OPEN;
sal_uInt16 nButtonResId = 0; sal_uInt16 nButtonResId = 0;
if ( nStyle & WB_SAVEAS ) if ( nStyle & PickerFlags::SaveAs )
{ {
nResId = STR_EXPLORERFILE_SAVE; nResId = STR_EXPLORERFILE_SAVE;
nButtonResId = STR_EXPLORERFILE_BUTTONSAVE; nButtonResId = STR_EXPLORERFILE_BUTTONSAVE;
} }
if ( ( nStyle & SFXWB_PATHDIALOG ) == SFXWB_PATHDIALOG ) if ( nStyle & PickerFlags::PathDialog )
{ {
_pImp->_pFtFileName->SetText( SvtResId( STR_PATHNAME ) ); _pImp->_pFtFileName->SetText( SvtResId( STR_PATHNAME ) );
nResId = STR_PATHSELECT; nResId = STR_PATHSELECT;
@ -713,7 +693,7 @@ void SvtFileDialog::Init_Impl
_pImp->_aFilterTimer.SetTimeout( TRAVELFILTER_TIMEOUT ); _pImp->_aFilterTimer.SetTimeout( TRAVELFILTER_TIMEOUT );
_pImp->_aFilterTimer.SetTimeoutHdl( LINK( this, SvtFileDialog, FilterSelectTimerHdl_Impl ) ); _pImp->_aFilterTimer.SetTimeoutHdl( LINK( this, SvtFileDialog, FilterSelectTimerHdl_Impl ) );
if ( WB_SAVEAS & nStyle ) if ( PickerFlags::SaveAs & nStyle )
{ {
// different help ids if in save-as mode // different help ids if in save-as mode
SetHelpId( HID_FILESAVE_DIALOG ); SetHelpId( HID_FILESAVE_DIALOG );
@ -1874,7 +1854,7 @@ short SvtFileDialog::PrepareExecute()
} }
} }
if ( ( _pImp->_nStyle & WB_SAVEAS ) && m_bHasFilename ) if ( ( _pImp->_nStyle & PickerFlags::SaveAs ) && m_bHasFilename )
// when doing a save-as, we do not want the handler to handle "this file does not exist" messages // when doing a save-as, we do not want the handler to handle "this file does not exist" messages
// - finally we're going to save that file, aren't we? // - finally we're going to save that file, aren't we?
m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST); m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST);
@ -1906,7 +1886,7 @@ short SvtFileDialog::PrepareExecute()
_aPath = implGetInitialURL( _aPath, GetStandardDir() ); _aPath = implGetInitialURL( _aPath, GetStandardDir() );
if ( _pImp->_nStyle & WB_SAVEAS && !m_bHasFilename ) if ( _pImp->_nStyle & PickerFlags::SaveAs && !m_bHasFilename )
// when doing a save-as, we do not want the handler to handle "this file does not exist" messages // when doing a save-as, we do not want the handler to handle "this file does not exist" messages
// - finally we're going to save that file, aren't we? // - finally we're going to save that file, aren't we?
m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST); m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST);
@ -2469,7 +2449,7 @@ void SvtFileDialog::enableControl( sal_Int16 _nControlId, bool _bEnable )
void SvtFileDialog::AddControls_Impl( ) void SvtFileDialog::AddControls_Impl( )
{ {
// create the "insert as link" checkbox, if needed // create the "insert as link" checkbox, if needed
if ( _nExtraBits & PickerExtraBits::InsertAsLink ) if ( _nPickerFlags & PickerFlags::InsertAsLink )
{ {
_pCbLinkBox ->SetText( SvtResId( STR_SVT_FILEPICKER_INSERT_AS_LINK ) ); _pCbLinkBox ->SetText( SvtResId( STR_SVT_FILEPICKER_INSERT_AS_LINK ) );
_pCbLinkBox ->SetHelpId( HID_FILEDLG_LINK_CB ); _pCbLinkBox ->SetHelpId( HID_FILEDLG_LINK_CB );
@ -2478,7 +2458,7 @@ void SvtFileDialog::AddControls_Impl( )
} }
// create the "show preview" checkbox ( and the preview window, too ), if needed // create the "show preview" checkbox ( and the preview window, too ), if needed
if ( _nExtraBits & PickerExtraBits::ShowPreview ) if ( _nPickerFlags & PickerFlags::ShowPreview )
{ {
_pImp->_aIniKey = "ImportGraphicDialog"; _pImp->_aIniKey = "ImportGraphicDialog";
// because the "<All Formats> (*.bmp,*...)" entry is to wide, // because the "<All Formats> (*.bmp,*...)" entry is to wide,
@ -2502,7 +2482,7 @@ void SvtFileDialog::AddControls_Impl( )
_pPrevBmp->SetAccessibleName(SVT_RESSTR(STR_PREVIEW)); _pPrevBmp->SetAccessibleName(SVT_RESSTR(STR_PREVIEW));
} }
if ( _nExtraBits & PickerExtraBits::AutoExtension ) if ( _nPickerFlags & PickerFlags::AutoExtension )
{ {
_pImp->_pCbAutoExtension->SetText( SvtResId( STR_SVT_FILEPICKER_AUTO_EXTENSION ) ); _pImp->_pCbAutoExtension->SetText( SvtResId( STR_SVT_FILEPICKER_AUTO_EXTENSION ) );
_pImp->_pCbAutoExtension->Check(); _pImp->_pCbAutoExtension->Check();
@ -2510,21 +2490,21 @@ void SvtFileDialog::AddControls_Impl( )
_pImp->_pCbAutoExtension->Show(); _pImp->_pCbAutoExtension->Show();
} }
if ( _nExtraBits & PickerExtraBits::FilterOptions ) if ( _nPickerFlags & PickerFlags::FilterOptions )
{ {
_pImp->_pCbOptions->SetText( SvtResId( STR_SVT_FILEPICKER_FILTER_OPTIONS ) ); _pImp->_pCbOptions->SetText( SvtResId( STR_SVT_FILEPICKER_FILTER_OPTIONS ) );
_pImp->_pCbOptions->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); _pImp->_pCbOptions->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) );
_pImp->_pCbOptions->Show(); _pImp->_pCbOptions->Show();
} }
if ( _nExtraBits & PickerExtraBits::Selection ) if ( _nPickerFlags & PickerFlags::Selection )
{ {
_pCbSelection->SetText( SvtResId( STR_SVT_FILEPICKER_SELECTION ) ); _pCbSelection->SetText( SvtResId( STR_SVT_FILEPICKER_SELECTION ) );
_pCbSelection->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); _pCbSelection->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) );
_pCbSelection->Show(); _pCbSelection->Show();
} }
if ( _nExtraBits & PickerExtraBits::PlayButton ) if ( _nPickerFlags & PickerFlags::PlayButton )
{ {
_pPbPlay->SetText( SvtResId( STR_SVT_FILEPICKER_PLAY ) ); _pPbPlay->SetText( SvtResId( STR_SVT_FILEPICKER_PLAY ) );
_pPbPlay->SetHelpId( HID_FILESAVE_DOPLAY ); _pPbPlay->SetHelpId( HID_FILESAVE_DOPLAY );
@ -2532,7 +2512,7 @@ void SvtFileDialog::AddControls_Impl( )
_pPbPlay->Show(); _pPbPlay->Show();
} }
if ( _nExtraBits & PickerExtraBits::ShowVersions ) if ( _nPickerFlags & PickerFlags::ShowVersions )
{ {
_pImp->_pFtFileVersion->SetText( SvtResId( STR_SVT_FILEPICKER_VERSION ) ); _pImp->_pFtFileVersion->SetText( SvtResId( STR_SVT_FILEPICKER_VERSION ) );
_pImp->_pFtFileVersion->Show(); _pImp->_pFtFileVersion->Show();
@ -2540,7 +2520,7 @@ void SvtFileDialog::AddControls_Impl( )
_pImp->_pLbFileVersion->SetHelpId( HID_FILEOPEN_VERSION ); _pImp->_pLbFileVersion->SetHelpId( HID_FILEOPEN_VERSION );
_pImp->_pLbFileVersion->Show(); _pImp->_pLbFileVersion->Show();
} }
else if ( _nExtraBits & PickerExtraBits::Templates ) else if ( _nPickerFlags & PickerFlags::Templates )
{ {
_pImp->_pFtTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_TEMPLATES ) ); _pImp->_pFtTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_TEMPLATES ) );
_pImp->_pFtTemplates->Show(); _pImp->_pFtTemplates->Show();
@ -2551,7 +2531,7 @@ void SvtFileDialog::AddControls_Impl( )
// is set in the "Templates mode". This was hidden in the previous implementation. // is set in the "Templates mode". This was hidden in the previous implementation.
// Shouldn't this be a more meaningfull help id. // Shouldn't this be a more meaningfull help id.
} }
else if ( _nExtraBits & PickerExtraBits::ImageTemplate ) else if ( _nPickerFlags & PickerFlags::ImageTemplate )
{ {
_pImp->_pFtImageTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_IMAGE_TEMPLATE ) ); _pImp->_pFtImageTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_IMAGE_TEMPLATE ) );
_pImp->_pFtImageTemplates->Show(); _pImp->_pFtImageTemplates->Show();

View File

@ -66,7 +66,7 @@ private:
VclPtr<Splitter> _pSplitter; VclPtr<Splitter> _pSplitter;
::svt::IFilePickerListener* _pFileNotifier; ::svt::IFilePickerListener* _pFileNotifier;
SvtExpFileDlg_Impl* _pImp; SvtExpFileDlg_Impl* _pImp;
PickerExtraBits _nExtraBits; PickerFlags _nPickerFlags;
bool _bIsInExecute : 1; bool _bIsInExecute : 1;
ImageList m_aImages; ImageList m_aImages;
@ -100,7 +100,7 @@ private:
DECL_LINK_TYPED( Split_Hdl, Splitter*, void ); DECL_LINK_TYPED( Split_Hdl, Splitter*, void );
void OpenHdl_Impl(void* pVoid); void OpenHdl_Impl(void* pVoid);
void Init_Impl( WinBits nBits ); void Init_Impl( PickerFlags nBits );
/** find a filter with the given wildcard /** find a filter with the given wildcard
@param _rFilter @param _rFilter
the wildcard pattern to look for in the filter list the wildcard pattern to look for in the filter list
@ -159,8 +159,7 @@ protected:
short PrepareExecute(); short PrepareExecute();
public: public:
SvtFileDialog( vcl::Window* _pParent, WinBits nBits, PickerExtraBits nExtraBits ); SvtFileDialog( vcl::Window* _pParent, PickerFlags nBits );
SvtFileDialog( vcl::Window* _pParent, WinBits nBits );
virtual ~SvtFileDialog(); virtual ~SvtFileDialog();
virtual void dispose() override; virtual void dispose() override;

View File

@ -203,7 +203,7 @@ Size SvtUpButton_Impl::GetOptimalSize() const
} }
// SvtExpFileDlg_Impl // SvtExpFileDlg_Impl
SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) : SvtExpFileDlg_Impl::SvtExpFileDlg_Impl() :
_pCurFilter ( nullptr ), _pCurFilter ( nullptr ),
_pUserFilter ( nullptr ), _pUserFilter ( nullptr ),
@ -230,7 +230,7 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
_pBtnConnectToServer( nullptr ), _pBtnConnectToServer( nullptr ),
_eMode ( FILEDLG_MODE_OPEN ), _eMode ( FILEDLG_MODE_OPEN ),
_eDlgType ( FILEDLG_TYPE_FILEDLG ), _eDlgType ( FILEDLG_TYPE_FILEDLG ),
_nStyle ( 0 ), _nStyle ( PickerFlags::NONE ),
_bDoubleClick ( false ), _bDoubleClick ( false ),
m_bNeedDelayedFilterExecute ( false ), m_bNeedDelayedFilterExecute ( false ),
_pDefaultFilter ( nullptr ), _pDefaultFilter ( nullptr ),

View File

@ -154,7 +154,7 @@ public:
SvtFileDlgMode _eMode; SvtFileDlgMode _eMode;
SvtFileDlgType _eDlgType; SvtFileDlgType _eDlgType;
WinBits _nStyle; PickerFlags _nStyle;
OUString _aStdDir; OUString _aStdDir;
@ -175,7 +175,7 @@ public:
// remember sizes // remember sizes
OUString _aIniKey; OUString _aIniKey;
explicit SvtExpFileDlg_Impl( WinBits nBits ); explicit SvtExpFileDlg_Impl();
~SvtExpFileDlg_Impl(); ~SvtExpFileDlg_Impl();

View File

@ -167,7 +167,7 @@ IMPL_LINK_TYPED( MyWin, Test, PushButton*, pBtn, void )
printf("Test\n"); printf("Test\n");
if ( pBtn == &aOKBtn ) if ( pBtn == &aOKBtn )
{ {
ScopedVclPtrInstance<SvtFileDialog> pDlg(this,SFXWB_PATHDIALOG); ScopedVclPtrInstance<SvtFileDialog> pDlg(this, PickerFlags::PathDialog);
pDlg->Execute(); pDlg->Execute();
printf("ok\n"); printf("ok\n");
} }