2001-06-28 10:17:00 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:35:43 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _WINFILEOPENIMPL_HXX_
|
|
|
|
#define _WINFILEOPENIMPL_HXX_
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// includes
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
|
|
|
|
#include <com/sun/star/ui/dialogs/FilePickerEvent.hpp>
|
2001-10-16 13:03:12 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
|
2001-06-28 10:17:00 +00:00
|
|
|
#include "FilterContainer.hxx"
|
|
|
|
#include "FileOpenDlg.hxx"
|
2002-03-21 06:37:13 +00:00
|
|
|
#include "previewadapter.hxx"
|
2001-08-03 13:07:53 +00:00
|
|
|
#include "helppopupwindow.hxx"
|
2002-03-21 06:37:13 +00:00
|
|
|
#include "customcontrol.hxx"
|
|
|
|
#include "customcontrolfactory.hxx"
|
2007-07-03 12:57:47 +00:00
|
|
|
#include "..\misc\resourceprovider.hxx"
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
#include <utility>
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
2001-10-09 05:57:38 +00:00
|
|
|
#include <osl/conditn.hxx>
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// deklarations
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// forward declaration
|
|
|
|
class CFilePicker;
|
2001-08-10 11:24:27 +00:00
|
|
|
class CFilePickerState;
|
|
|
|
class CExecuteFilePickerState;
|
|
|
|
class CNonExecuteFilePickerState;
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
class CWinFileOpenImpl : public CFileOpenDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CWinFileOpenImpl(
|
|
|
|
CFilePicker* aFilePicker,
|
|
|
|
sal_Bool bFileOpenDialog = sal_True,
|
|
|
|
sal_uInt32 dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
|
|
|
sal_uInt32 dwTemplateId = 0,
|
|
|
|
HINSTANCE hInstance = 0 );
|
|
|
|
|
|
|
|
virtual ~CWinFileOpenImpl( );
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
// XExecutableDialog
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
virtual sal_Int16 SAL_CALL execute( ) throw( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
// XFilePicker
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName )
|
|
|
|
throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
|
|
|
|
throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) throw ( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
// XFilterManager
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle, const ::rtl::OUString& aFilter )
|
|
|
|
throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle )
|
|
|
|
throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getCurrentFilter( )
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
2001-10-16 13:03:12 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
// XFilterGroupManager
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters )
|
|
|
|
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
2001-07-02 07:09:57 +00:00
|
|
|
// XFilePickerControlAccess
|
2001-06-28 10:17:00 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue )
|
2001-07-02 07:09:57 +00:00
|
|
|
throw( ::com::sun::star::uno::RuntimeException );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction )
|
2001-07-02 07:09:57 +00:00
|
|
|
throw( ::com::sun::star::uno::RuntimeException );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable )
|
2001-07-02 07:09:57 +00:00
|
|
|
throw( ::com::sun::star::uno::RuntimeException );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel )
|
2001-07-02 07:09:57 +00:00
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId )
|
2001-07-02 07:09:57 +00:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
//------------------------------------------------
|
|
|
|
// XFilePreview
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Int32 SAL_CALL getTargetColorDepth( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Int32 SAL_CALL getAvailableWidth( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Int32 SAL_CALL getAvailableHeight( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage )
|
|
|
|
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL getShowState( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2002-03-21 06:37:13 +00:00
|
|
|
//------------------------------------------------
|
|
|
|
// XCancelable
|
|
|
|
//------------------------------------------------
|
|
|
|
|
2001-10-09 05:57:38 +00:00
|
|
|
virtual void SAL_CALL cancel( );
|
|
|
|
|
2002-03-21 06:37:13 +00:00
|
|
|
//------------------------------------------------
|
|
|
|
// Implementation details
|
|
|
|
//------------------------------------------------
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
protected:
|
|
|
|
sal_Int16 SAL_CALL getFocused( );
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
virtual bool SAL_CALL preModal( );
|
2001-06-28 10:17:00 +00:00
|
|
|
virtual void SAL_CALL postModal( sal_Int16 nDialogResult );
|
|
|
|
|
|
|
|
virtual sal_uInt32 SAL_CALL onFileOk();
|
|
|
|
virtual void SAL_CALL onSelChanged( HWND hwndListBox );
|
|
|
|
|
|
|
|
// only called back if OFN_EXPLORER is set
|
|
|
|
virtual void SAL_CALL onInitDone();
|
|
|
|
virtual void SAL_CALL onFolderChanged();
|
|
|
|
virtual void SAL_CALL onTypeChanged( sal_uInt32 nFilterIndex );
|
|
|
|
|
|
|
|
// call base class method first when overloading
|
2006-10-12 09:49:31 +00:00
|
|
|
virtual void SAL_CALL onInitDialog( HWND hwndDlg );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
virtual sal_uInt32 SAL_CALL onCtrlCommand( HWND hwndDlg, sal_uInt16 ctrlId, sal_uInt16 notifyCode );
|
|
|
|
|
2002-03-21 06:37:13 +00:00
|
|
|
|
2006-10-12 09:49:31 +00:00
|
|
|
void onWMSize();
|
|
|
|
void onWMShow(BOOL bShow);
|
|
|
|
void onWMWindowPosChanged();
|
|
|
|
void onCustomControlHelpRequest(LPHELPINFO lphi);
|
2002-03-21 06:37:13 +00:00
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
private:
|
2001-10-16 13:03:12 +00:00
|
|
|
inline void SAL_CALL appendFilterGroupSeparator( );
|
|
|
|
|
2002-03-21 06:37:13 +00:00
|
|
|
inline sal_Bool SAL_CALL IsCustomControlHelpRequested(LPHELPINFO lphi) const;
|
|
|
|
|
2005-02-16 14:35:01 +00:00
|
|
|
void EnlargeStdControlLabels() const;
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
// initialize all controls from cache
|
2001-08-10 11:24:27 +00:00
|
|
|
void SAL_CALL InitControlLabel( HWND hWnd );
|
2002-03-21 06:37:13 +00:00
|
|
|
void SAL_CALL InitCustomControlContainer(HWND hCustomControl);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
// save the control state
|
2003-03-25 17:05:07 +00:00
|
|
|
void SAL_CALL CacheControlState(HWND hWnd);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
2003-03-25 17:05:07 +00:00
|
|
|
void SAL_CALL SetDefaultExtension();
|
|
|
|
void SAL_CALL InitialSetDefaultName();
|
2001-07-09 11:58:25 +00:00
|
|
|
|
2003-03-25 17:05:07 +00:00
|
|
|
static LRESULT CALLBACK SubClassFunc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
static BOOL CALLBACK EnumChildWndProc( HWND hWnd, LPARAM lParam );
|
|
|
|
|
|
|
|
private:
|
2002-03-21 06:37:13 +00:00
|
|
|
std::auto_ptr<CFilterContainer> m_filterContainer;
|
|
|
|
std::auto_ptr<CPreviewAdapter> m_Preview;
|
|
|
|
std::auto_ptr<CCustomControlFactory> m_CustomControlFactory;
|
|
|
|
std::auto_ptr<CCustomControl> m_CustomControls;
|
|
|
|
CFilePicker* m_FilePicker;
|
2003-03-25 17:05:07 +00:00
|
|
|
WNDPROC m_pfnOldDlgProc;
|
2002-03-21 06:37:13 +00:00
|
|
|
rtl::OUString m_defaultName;
|
|
|
|
sal_Bool m_bInitialSelChanged;
|
|
|
|
CHelpPopupWindow m_HelpPopupWindow;
|
|
|
|
CFilePickerState* m_FilePickerState;
|
|
|
|
CExecuteFilePickerState* m_ExecuteFilePickerState;
|
|
|
|
CNonExecuteFilePickerState* m_NonExecuteFilePickerState;
|
2007-07-03 12:57:47 +00:00
|
|
|
CResourceProvider m_ResProvider;
|
2001-06-28 10:17:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|