24#include <com/sun/star/beans/PropertyAttribute.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/beans/NamedValue.hpp>
29#include <osl/mutex.hxx>
41#define PROPERTY_ID_HELPURL 1
42#define PROPERTY_ID_WINDOW 2
55 ,OPropertyContainer( GetBroadcastHelper() )
56 ,m_nCancelEvent( nullptr )
57 ,m_bExecuting( false )
62 PropertyAttribute::TRANSIENT,
68 PropertyAttribute::TRANSIENT | PropertyAttribute::READONLY,
98 if ( GetBroadcastHelper().bInDispose || GetBroadcastHelper().bDisposed )
99 throw DisposedException();
123 ::osl::MutexGuard aOwnGuard(
m_aMutex );
144 bool bDialogDying = _rSource.Source ==
m_xWindow;
147 if ( bDialogDying || bParentDying )
155 ::osl::MutexGuard aOwnGuard(
m_aMutex);
157 m_xDlg->response(RET_CANCEL);
166 OSL_FAIL(
"OCommonPicker::disposing: where did this come from?" );
173 Sequence< Property > aProps;
185 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper() );
190 OPropertyContainer::setFastPropertyValue_NoBroadcast(
nHandle, rValue);
205 SAL_WARN_IF( !
m_xDlg,
"fpicker.office",
"OCommonPicker::createPicker: invalid dialog returned!" );
225 OSL_ENSURE(
m_xWindow.is(),
"OCommonPicker::createFileDialog: invalid window component!" );
238 OSL_ENSURE(
m_xDialogParent.is() || !xVclDialog->GetParent(),
"OCommonPicker::createFileDialog: invalid window component (the parent this time)!");
290 return Sequence< OUString >();
317 return Sequence< OUString >();
351 ::osl::MutexGuard aOwnGuard(
m_aMutex );
356 ::osl::MutexGuard aOwnGuard(
m_aMutex );
369 ::osl::MutexGuard aGuard(
m_aMutex );
392 ::osl::MutexGuard aGuard(
m_aMutex );
393 m_nCancelEvent =
nullptr;
401 OSL_ENSURE( m_xDlg,
"OCommonPicker::OnCancelPicker: executing, but no dialog!" );
411 OUString sSettingName;
414 PropertyValue aPropArg;
418 const Any* pArguments = _rArguments.getConstArray();
419 const Any* pArgumentsEnd = _rArguments.getConstArray() + _rArguments.getLength();
420 for (
const Any* pArgument = pArguments;
421 pArgument != pArgumentsEnd;
425 if ( *pArgument >>= aPropArg )
427 if ( aPropArg.Name.isEmpty())
430 sSettingName = aPropArg.Name;
431 aSettingValue = aPropArg.Value;
433 else if ( *pArgument >>= aPairArg )
435 if ( aPairArg.Name.isEmpty())
438 sSettingName = aPairArg.Name;
439 aSettingValue = aPairArg.Value;
445 SAL_WARN(
"fpicker",
"OCommonPicker::initialize: unknown argument type at position "
446 << (pArguments - _rArguments.getConstArray()));
454 "OCommonPicker::initialize: unknown argument \""
463 if ( _rName ==
"ParentWindow" )
467 OSL_ENSURE(
m_xDialogParent.is(),
"OCommonPicker::implHandleInitializationArgument: invalid parent window given!" );
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
::cppu::IPropertyArrayHelper * getArrayHelper()
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
mutable::osl::Mutex m_aMutex
implements common functionality for the 2 UNO picker components
virtual void SAL_CALL setTitle(const OUString &_rTitle)
const ::cppu::OBroadcastHelper & GetBroadcastHelper() const
css::uno::Reference< css::lang::XComponent > m_xParentListenerAdapter
std::shared_ptr< SvtFileDialog_Base > m_xDlg
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual std::shared_ptr< SvtFileDialog_Base > implCreateDialog(weld::Window *pParent)=0
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedControlProperties(const OUString &aControlName) override
virtual css::uno::Any SAL_CALL getControlProperty(const OUString &aControlName, const OUString &aControlProperty) override
virtual sal_Bool SAL_CALL isControlPropertySupported(const OUString &aControlName, const OUString &aControlProperty) override
css::uno::Reference< css::awt::XWindow > m_xDialogParent
css::uno::Reference< css::lang::XComponent > m_xWindowListenerAdapter
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const css::uno::Any &_rValue) override
void stopWindowListening()
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL disposing() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedControls() override
virtual sal_Bool SAL_CALL isControlSupported(const OUString &aControlName) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void SAL_CALL setControlProperty(const OUString &aControlName, const OUString &aControlProperty, const css::uno::Any &aValue) override
css::uno::Reference< css::awt::XWindow > m_xWindow
virtual sal_Int16 SAL_CALL execute()
virtual void SAL_CALL cancel() override
virtual ~OCommonPicker() override
virtual sal_Int16 implExecutePicker()=0
virtual bool implHandleInitializationArgument(const OUString &_rName, const css::uno::Any &_rValue)
handle a single argument from the XInitialization::initialize method
ImplSVEvent * m_nCancelEvent
implements the XControlAccess, XControlInformation and XFilePickerControlAccess for the file picker
css::uno::Sequence< OUString > getSupportedControlProperties(std::u16string_view rControlName)
static bool isControlSupported(std::u16string_view rControlName)
void setHelpURL(weld::Widget *pControl, const OUString &rURL)
css::uno::Sequence< OUString > getSupportedControls() const
OUString getHelpURL(weld::Widget const *pControl) const
css::uno::Any getControlProperty(std::u16string_view rControlName, const OUString &rControlProperty)
void setControlProperty(std::u16string_view rControlName, const OUString &rControlProperty, const css::uno::Any &rValue)
bool isControlPropertySupported(std::u16string_view rControlName, const OUString &rControlProperty)
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
#define PROPERTY_ID_WINDOW
#define PROPERTY_ID_HELPURL
#define DBG_ASSERT(sCon, aError)
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
void disposeComponent(css::uno::Reference< TYPE > &_rxComp)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPL_LINK_NOARG(ComboBoxControl, SelectHdl, weld::ComboBox &, void)
::cppu::WeakComponentImplHelper< css::ui::dialogs::XControlAccess, css::ui::dialogs::XControlInformation, css::lang::XEventListener, css::util::XCancellable, css::lang::XInitialization > OCommonPicker_Base