2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-06-28 10:17:00 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 08:31:54 +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:31:54 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:31:54 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-06-28 10:17:00 +00:00
|
|
|
*
|
2008-04-11 08:31:54 +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:31:54 +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:31:54 +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
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 16:53:35 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_fpicker.hxx"
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// includes
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2003-03-25 17:05:07 +00:00
|
|
|
#include <tchar.h>
|
2001-06-28 10:17:00 +00:00
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
|
|
|
#include <cppuhelper/interfacecontainer.h>
|
|
|
|
#include <osl/diagnose.h>
|
|
|
|
|
|
|
|
#include "filepicker.hxx"
|
2002-03-28 07:57:33 +00:00
|
|
|
#include "WinFileOpenImpl.hxx"
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
#include "FPServiceInfo.hxx"
|
|
|
|
#include "..\misc\WinImplHelper.hxx"
|
|
|
|
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
|
2002-03-21 06:33:32 +00:00
|
|
|
#include "filepickereventnotification.hxx"
|
|
|
|
|
2007-11-19 15:26:07 +00:00
|
|
|
#include <comphelper/sequenceasvector.hxx>
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// namespace directives
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
using namespace com::sun::star;
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star::ui::dialogs;
|
|
|
|
using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// defines
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2003-03-25 17:05:07 +00:00
|
|
|
#define FILE_PICKER_DLL_NAME TEXT("fps.dll")
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// helper functions
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
2002-11-26 08:21:59 +00:00
|
|
|
// controling event notifications
|
|
|
|
const bool STARTUP_SUSPENDED = true;
|
|
|
|
const bool STARTUP_ALIVE = false;
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence<rtl::OUString> aRet(2);
|
|
|
|
aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
|
|
|
|
aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
|
2001-06-28 10:17:00 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) :
|
2007-11-19 15:26:07 +00:00
|
|
|
cppu::WeakComponentImplHelper10<
|
2001-06-28 10:17:00 +00:00
|
|
|
XFilterManager,
|
2001-10-16 13:03:12 +00:00
|
|
|
XFilterGroupManager,
|
2001-06-28 10:17:00 +00:00
|
|
|
XFilePickerControlAccess,
|
|
|
|
XFilePickerNotifier,
|
|
|
|
XFilePreview,
|
2007-11-19 15:26:07 +00:00
|
|
|
XFilePicker2,
|
2002-03-28 07:57:33 +00:00
|
|
|
lang::XInitialization,
|
|
|
|
util::XCancellable,
|
|
|
|
lang::XEventListener,
|
|
|
|
lang::XServiceInfo>(m_rbHelperMtx),
|
|
|
|
m_xServiceMgr(xServiceMgr),
|
2002-02-21 13:46:49 +00:00
|
|
|
m_aAsyncEventNotifier(rBHelper)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2003-03-25 17:05:07 +00:00
|
|
|
HINSTANCE hInstance = GetModuleHandle(FILE_PICKER_DLL_NAME);
|
2001-08-03 12:59:06 +00:00
|
|
|
OSL_POSTCOND( hInstance, "The name of the service dll must have changed" );
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
// create a default FileOpen dialog without any additional ui elements
|
2001-08-03 12:59:06 +00:00
|
|
|
m_pImpl = std::auto_ptr< CWinFileOpenImpl >(
|
|
|
|
new CWinFileOpenImpl(
|
|
|
|
this,
|
|
|
|
true,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
hInstance ) );
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// XFPEventListenerManager
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
|
|
|
if ( rBHelper.bDisposed )
|
2002-03-28 07:57:33 +00:00
|
|
|
throw lang::DisposedException(
|
|
|
|
rtl::OUString::createFromAscii( "object is already disposed" ),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast< XFilePicker2* >( this ) );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
if ( !rBHelper.bInDispose && !rBHelper.bDisposed )
|
|
|
|
rBHelper.aLC.addInterface( getCppuType( &xListener ), xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener )
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
|
|
|
if ( rBHelper.bDisposed )
|
2002-03-28 07:57:33 +00:00
|
|
|
throw lang::DisposedException(
|
|
|
|
rtl::OUString::createFromAscii( "object is already disposed" ),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast< XFilePicker2* >( this ) );
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
rBHelper.aLC.removeInterface( getCppuType( &xListener ), xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------
|
|
|
|
// XEventListener
|
|
|
|
// -------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::disposing(const lang::EventObject& aEvent) throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Reference<XFilePickerListener> xFilePickerListener(aEvent.Source, ::com::sun::star::uno::UNO_QUERY);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
2002-03-21 06:33:32 +00:00
|
|
|
if (xFilePickerListener.is())
|
|
|
|
removeFilePickerListener(xFilePickerListener);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this));
|
2002-03-21 06:33:32 +00:00
|
|
|
m_aAsyncEventNotifier.notifyEvent(
|
|
|
|
new CFilePickerParamEventNotification(&XFilePickerListener::fileSelectionChanged,aEvent));
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this));
|
2002-03-21 06:33:32 +00:00
|
|
|
m_aAsyncEventNotifier.notifyEvent(
|
|
|
|
new CFilePickerParamEventNotification(&XFilePickerListener::directoryChanged,aEvent));
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
2002-02-21 13:46:49 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent)
|
2002-02-21 13:46:49 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this));
|
2002-03-21 06:33:32 +00:00
|
|
|
m_aAsyncEventNotifier.notifyEvent(
|
|
|
|
new CFilePickerParamEventNotification(&XFilePickerListener::controlStateChanged,aEvent));
|
2002-02-21 13:46:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::dialogSizeChanged()
|
2002-02-21 13:46:49 +00:00
|
|
|
{
|
2002-03-21 06:33:32 +00:00
|
|
|
m_aAsyncEventNotifier.notifyEvent(
|
|
|
|
new CFilePickerEventNotification(&XFilePickerListener::dialogSizeChanged));
|
2002-02-21 13:46:49 +00:00
|
|
|
}
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
2001-08-06 06:34:48 +00:00
|
|
|
// If there are more then one listener the return value of the last one wins
|
2001-06-28 10:17:00 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString aHelpText;
|
2001-08-06 06:34:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
::cppu::OInterfaceContainerHelper* pICHelper =
|
|
|
|
rBHelper.getContainer( getCppuType((uno::Reference<XFilePickerListener>*)0));
|
|
|
|
|
|
|
|
if (pICHelper)
|
2001-08-06 06:34:48 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
::cppu::OInterfaceIteratorHelper iter(*pICHelper);
|
2001-08-06 06:34:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
while(iter.hasMoreElements())
|
2001-08-06 06:34:48 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
try
|
2001-08-06 06:34:48 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
/*
|
|
|
|
if there are multiple listeners responding
|
|
|
|
to this notification the next response
|
|
|
|
overwrittes the one before if it is not empty
|
|
|
|
*/
|
|
|
|
|
|
|
|
rtl::OUString temp;
|
2001-08-06 06:34:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Reference<XFilePickerListener> xFPListener(iter.next(), uno::UNO_QUERY);
|
|
|
|
if (xFPListener.is())
|
2001-08-06 06:34:48 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
temp = xFPListener->helpRequested(aEvent);
|
|
|
|
if (temp.getLength())
|
|
|
|
aHelpText = temp;
|
2001-08-06 06:34:48 +00:00
|
|
|
}
|
2002-03-28 07:57:33 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
catch(uno::RuntimeException&)
|
|
|
|
{
|
|
|
|
OSL_ENSURE( false, "RuntimeException during event dispatching" );
|
2001-08-06 06:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return aHelpText;
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
2002-11-26 08:21:59 +00:00
|
|
|
//-------------------------------------
|
|
|
|
//
|
|
|
|
//-------------------------------------
|
|
|
|
|
|
|
|
bool CFilePicker::startupEventNotification(bool bStartupSuspended)
|
|
|
|
{
|
|
|
|
return m_aAsyncEventNotifier.startup(bStartupSuspended);
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------
|
|
|
|
//
|
|
|
|
//-------------------------------------
|
|
|
|
|
|
|
|
void CFilePicker::shutdownEventNotification()
|
|
|
|
{
|
|
|
|
m_aAsyncEventNotifier.shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------
|
|
|
|
//
|
|
|
|
//-------------------------------------
|
|
|
|
|
|
|
|
void CFilePicker::suspendEventNotification()
|
|
|
|
{
|
|
|
|
m_aAsyncEventNotifier.suspend();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------
|
|
|
|
//
|
|
|
|
//-------------------------------------
|
|
|
|
|
|
|
|
void CFilePicker::resumeEventNotification()
|
|
|
|
{
|
|
|
|
m_aAsyncEventNotifier.resume();
|
|
|
|
}
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// XFilePicker functions
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setMultiSelectionMode(bMode);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setTitle(const rtl::OUString& aTitle) throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setTitle(aTitle);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter)
|
|
|
|
throw(lang::IllegalArgumentException, uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->appendFilter(aTitle, aFilter);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle)
|
|
|
|
throw(lang::IllegalArgumentException, uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setCurrentFilter(aTitle);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getCurrentFilter();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters)
|
|
|
|
throw (lang::IllegalArgumentException, uno::RuntimeException)
|
2001-10-16 13:03:12 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->appendFilterGroup(sGroupTitle, aFilters);
|
2001-10-16 13:03:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName)
|
2007-03-26 12:18:37 +00:00
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setDefaultName(aName);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory)
|
|
|
|
throw(lang::IllegalArgumentException, uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setDisplayDirectory(aDirectory);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getDisplayDirectory();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getFiles();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
2007-11-19 15:26:07 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
|
|
|
|
const uno::Sequence< ::rtl::OUString > lSource = m_pImpl->getFiles();
|
|
|
|
const ::sal_Int32 c = lSource.getLength();
|
|
|
|
if (c < 2)
|
|
|
|
return lSource;
|
|
|
|
|
|
|
|
const ::rtl::OUString sPath = lSource[0];
|
|
|
|
::comphelper::SequenceAsVector< ::rtl::OUString > lTarget;
|
|
|
|
::sal_Int32 i = 1;
|
|
|
|
for (i=1; i<c; ++i)
|
|
|
|
{
|
|
|
|
const ::rtl::OUString sFile = lSource[i];
|
|
|
|
if (sFile.indexOf ('/') > 0)
|
|
|
|
{
|
|
|
|
// a) file contains own path !
|
|
|
|
lTarget.push_back(sFile);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// b) file is relative to given path
|
|
|
|
::rtl::OUStringBuffer sFull(256);
|
|
|
|
|
|
|
|
sFull.append (sPath);
|
|
|
|
sFull.appendAscii("/" );
|
|
|
|
sFull.append (sFile);
|
|
|
|
|
|
|
|
lTarget.push_back(sFull.makeStringAndClear());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return lTarget.getAsConstList();
|
|
|
|
}
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-02-21 13:46:49 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
|
|
|
|
2002-02-22 08:59:31 +00:00
|
|
|
sal_Int16 ret;
|
2002-02-21 13:46:49 +00:00
|
|
|
|
2002-11-26 08:21:59 +00:00
|
|
|
if (startupEventNotification(STARTUP_SUSPENDED))
|
2002-02-21 13:46:49 +00:00
|
|
|
{
|
|
|
|
// we should not block in this call else
|
|
|
|
// in the case of an event the client can't
|
|
|
|
// call another function an we run into a
|
|
|
|
// deadlock !!!!!
|
|
|
|
ret = m_pImpl->execute( );
|
|
|
|
|
2002-11-26 08:21:59 +00:00
|
|
|
shutdownEventNotification();
|
2002-02-21 13:46:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
OSL_ENSURE(sal_False, "Could not start event notifier thread!");
|
2002-02-22 08:59:31 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
throw uno::RuntimeException(
|
|
|
|
rtl::OUString::createFromAscii("Error executing dialog"),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast<XFilePicker2*>(this));
|
2002-02-21 13:46:49 +00:00
|
|
|
}
|
2001-06-28 10:17:00 +00:00
|
|
|
|
2002-02-21 13:46:49 +00:00
|
|
|
return ret;
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// XFilePicker functions
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue)
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setValue(aControlId, aControlAction, aValue);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction)
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getValue(aControlId, aControlAction);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable)
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
|
|
|
OSL_ASSERT( 0 != m_pImpl.get( ) );
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard( m_aMutex );
|
2001-06-28 10:17:00 +00:00
|
|
|
m_pImpl->enableControl( aControlId, bEnable );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& aLabel)
|
|
|
|
throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setLabel(aControlId, aLabel);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId)
|
|
|
|
throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getLabel(aControlId);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getSupportedImageFormats();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getTargetColorDepth();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getAvailableWidth();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getAvailableHeight();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage)
|
|
|
|
throw (lang::IllegalArgumentException, uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->setImage(aImageFormat, aImage);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->setShowState(bShowState);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(0 != m_pImpl.get());
|
2001-10-04 10:11:48 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
return m_pImpl->getShowState();
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
|
|
|
|
throw( uno::Exception, uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
|
|
|
// parameter checking
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Any aAny;
|
2001-08-10 11:14:02 +00:00
|
|
|
if ( 0 == aArguments.getLength( ) )
|
2002-03-28 07:57:33 +00:00
|
|
|
throw lang::IllegalArgumentException(
|
|
|
|
rtl::OUString::createFromAscii( "no arguments" ),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast<XFilePicker2*>(this), 1);
|
2001-08-10 11:14:02 +00:00
|
|
|
|
|
|
|
aAny = aArguments[0];
|
|
|
|
|
|
|
|
if ( (aAny.getValueType() != ::getCppuType((sal_Int16*)0)) &&
|
|
|
|
(aAny.getValueType() != ::getCppuType((sal_Int8*)0)) )
|
2002-03-28 07:57:33 +00:00
|
|
|
throw lang::IllegalArgumentException(
|
|
|
|
rtl::OUString::createFromAscii("invalid argument type"),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast<XFilePicker2*>(this), 1);
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
sal_Int16 templateId = -1;
|
|
|
|
aAny >>= templateId;
|
|
|
|
|
|
|
|
sal_Bool bFileOpenDialog = sal_True;
|
|
|
|
sal_uInt32 winResTemplateId = 0;
|
2002-03-21 06:33:32 +00:00
|
|
|
sal_Bool bIsWin2000 = IsWindows2000Platform();
|
2001-06-28 10:17:00 +00:00
|
|
|
|
|
|
|
switch ( templateId )
|
|
|
|
{
|
|
|
|
case FILEOPEN_SIMPLE:
|
|
|
|
bFileOpenDialog = sal_True;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILESAVE_SIMPLE:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILESAVE_AUTOEXTENSION_PASSWORD:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILESAVE_AUTOEXTENSION_SELECTION:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_AUTOEXT_SELECTION_BOX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILESAVE_AUTOEXTENSION_TEMPLATE:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILEOPEN_PLAY:
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_PLAY_PUSHBUTTON;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_PLAY_PUSHBUTTON;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILEOPEN_READONLY_VERSION:
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID;
|
|
|
|
break;
|
|
|
|
|
2001-07-02 07:09:14 +00:00
|
|
|
case FILEOPEN_LINK_PREVIEW:
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
|
|
|
|
break;
|
|
|
|
|
2001-08-24 07:58:17 +00:00
|
|
|
case FILESAVE_AUTOEXTENSION:
|
|
|
|
bFileOpenDialog = sal_False;
|
|
|
|
if ( bIsWin2000 )
|
|
|
|
winResTemplateId = TMPL2000_FILESAVE_AUTOEXT;
|
|
|
|
else
|
|
|
|
winResTemplateId = TMPL95_FILESAVE_AUTOEXT;
|
|
|
|
break;
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
default:
|
2002-03-28 07:57:33 +00:00
|
|
|
throw lang::IllegalArgumentException(
|
|
|
|
rtl::OUString::createFromAscii( "Unknown template" ),
|
2007-11-19 15:26:07 +00:00
|
|
|
static_cast< XFilePicker2* >( this ),
|
2001-06-28 10:17:00 +00:00
|
|
|
1 );
|
|
|
|
}
|
|
|
|
|
2003-03-25 17:05:07 +00:00
|
|
|
HINSTANCE hInstance = GetModuleHandle( FILE_PICKER_DLL_NAME );
|
2001-06-28 10:17:00 +00:00
|
|
|
OSL_POSTCOND( hInstance, "The name of the service dll must have changed" );
|
|
|
|
|
|
|
|
// create a new impl-class here based on the
|
|
|
|
// given string, if the given string is empty
|
|
|
|
// we do nothing
|
|
|
|
m_pImpl = std::auto_ptr< CWinFileOpenImpl >(
|
|
|
|
new CWinFileOpenImpl(
|
|
|
|
this,
|
|
|
|
bFileOpenDialog,
|
|
|
|
0,
|
|
|
|
winResTemplateId,
|
|
|
|
hInstance ) );
|
|
|
|
}
|
|
|
|
|
2001-10-09 05:57:38 +00:00
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
void SAL_CALL CFilePicker::cancel()
|
2007-03-26 12:18:37 +00:00
|
|
|
throw(uno::RuntimeException)
|
2001-10-09 05:57:38 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
OSL_ASSERT(m_pImpl.get());
|
2001-10-09 05:57:38 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
m_pImpl->cancel();
|
2001-10-09 05:57:38 +00:00
|
|
|
}
|
|
|
|
|
2001-06-28 10:17:00 +00:00
|
|
|
// -------------------------------------------------
|
|
|
|
// XServiceInfo
|
|
|
|
// -------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
rtl::OUString SAL_CALL CFilePicker::getImplementationName()
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
return rtl::OUString::createFromAscii(FILE_PICKER_IMPL_NAME);
|
2001-06-28 10:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------
|
|
|
|
// XServiceInfo
|
|
|
|
// -------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName)
|
|
|
|
throw(uno::RuntimeException )
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence <rtl::OUString> SupportedServicesNames = FilePicker_getSupportedServiceNames();
|
2001-06-28 10:17:00 +00:00
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
for (sal_Int32 n = SupportedServicesNames.getLength(); n--;)
|
2001-06-28 10:17:00 +00:00
|
|
|
if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
|
|
|
|
return sal_True;
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------
|
|
|
|
// XServiceInfo
|
|
|
|
// -------------------------------------------------
|
|
|
|
|
2002-03-28 07:57:33 +00:00
|
|
|
uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames()
|
|
|
|
throw(uno::RuntimeException)
|
2001-06-28 10:17:00 +00:00
|
|
|
{
|
|
|
|
return FilePicker_getSupportedServiceNames();
|
2003-10-06 14:52:13 +00:00
|
|
|
}
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|