26#include <com/sun/star/frame/XTerminateListener.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
29#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
30#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
31#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
32#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
33#include <com/sun/star/uno/XComponentContext.hpp>
35#include <osl/conditn.hxx>
36#include <osl/mutex.hxx>
39#include <QtCore/QObject>
40#include <QtCore/QString>
41#include <QtCore/QStringList>
42#include <QtCore/QHash>
43#include <QtWidgets/QFileDialog>
52typedef ::cppu::WeakComponentImplHelper<
53 css::frame::XTerminateListener, css::lang::XInitialization, css::lang::XServiceInfo,
54 css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess,
55 css::ui::dialogs::XAsynchronousExecutableDialog, css::ui::dialogs::XFolderPicker2>
63 css::uno::Reference<css::uno::XComponentContext>
m_context;
65 css::uno::Reference<css::ui::dialogs::XFilePickerListener>
m_xListener;
90 explicit QtFilePicker(css::uno::Reference<css::uno::XComponentContext> context,
91 QFileDialog::FileMode,
bool bUseNative =
false);
96 const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener)
override;
98 const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener)
override;
101 virtual void SAL_CALL
appendFilter(
const OUString& rTitle,
const OUString& rFilter)
override;
106 virtual void SAL_CALL
108 const css::uno::Sequence<css::beans::StringPair>& rFilters)
override;
114 virtual void SAL_CALL
setTitle(
const OUString& rTitle)
override;
115 virtual sal_Int16 SAL_CALL
execute()
override;
119 virtual void SAL_CALL
120 startExecuteModal(
const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&)
override;
127 virtual css::uno::Sequence<OUString> SAL_CALL
getFiles()
override;
130 virtual void SAL_CALL
setValue(sal_Int16 nControlId, sal_Int16 nControlAction,
131 const css::uno::Any& rValue)
override;
132 virtual css::uno::Any SAL_CALL
getValue(sal_Int16 nControlId,
133 sal_Int16 nControlAction)
override;
135 virtual void SAL_CALL
setLabel(sal_Int16 nControlId,
const OUString& rLabel)
override;
136 virtual OUString SAL_CALL
getLabel(sal_Int16 nControlId)
override;
142 virtual void SAL_CALL
initialize(
const css::uno::Sequence<css::uno::Any>& rArguments)
override;
145 void SAL_CALL
disposing(
const css::lang::EventObject& rEvent)
override;
146 using cppu::WeakComponentImplHelperBase::disposing;
172 const css::uno::Any& rValue);
static css::uno::Any handleGetListValue(const QComboBox *pWidget, sal_Int16 nControlAction)
void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
void currentChanged(const QString &)
std::unique_ptr< QFileDialog > m_pFileDialog
the file picker dialog
virtual void addCustomControl(sal_Int16 controlId)
QStringList m_aNamedFilterList
to keep the original sequence
QHash< QString, QString > m_aTitleToFilterMap
virtual void SAL_CALL setDescription(const OUString &rDescription) override
osl::Mutex m_aHelperMutex
mutex used by the WeakComponentImplHelper
virtual void SAL_CALL appendFilter(const OUString &rTitle, const OUString &rFilter) override
virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString &rLabel) override
css::uno::Reference< css::ui::dialogs::XDialogClosedListener > m_xClosedListener
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
void filterSelected(const QString &)
virtual OUString SAL_CALL getDisplayDirectory() override
virtual OUString SAL_CALL getCurrentFilter() override
void setCustomControlWidgetLayout(QGridLayout *pLayout)
virtual ~QtFilePicker() override
virtual void SAL_CALL setValue(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any &rValue) override
QHash< QString, QString > m_aNamedFilterToExtensionMap
QtFilePicker(css::uno::Reference< css::uno::XComponentContext > context, QFileDialog::FileMode, bool bUseNative=false)
virtual OUString SAL_CALL getImplementationName() override
static void handleSetListValue(QComboBox *pQComboBox, sal_Int16 nAction, const css::uno::Any &rValue)
QtFilePicker & operator=(const QtFilePicker &)=delete
void SAL_CALL queryTermination(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL setCurrentFilter(const OUString &rTitle) override
virtual sal_Int16 SAL_CALL execute() override
virtual void SAL_CALL appendFilterGroup(const OUString &rGroupTitle, const css::uno::Sequence< css::beans::StringPair > &rFilters) override
virtual void SAL_CALL setDialogTitle(const OUString &) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
QWidget * m_pExtraControls
widget to contain extra custom controls
virtual void updateAutomaticFileExtension()
static QString getResString(TranslateId pRedId)
void SAL_CALL notifyTermination(const css::lang::EventObject &aEvent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setMultiSelectionMode(sal_Bool bMode) override
virtual void SAL_CALL cancel() override
virtual void SAL_CALL setTitle(const OUString &rTitle) override
virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override
QHash< sal_Int16, QWidget * > m_aCustomWidgetsMap
map of SAL control ID's to widget
virtual css::uno::Sequence< OUString > SAL_CALL getSelectedFiles() override
virtual void SAL_CALL startExecuteModal(const css::uno::Reference< css::ui::dialogs::XDialogClosedListener > &) override
virtual void SAL_CALL setDisplayDirectory(const OUString &rDirectory) override
virtual void SAL_CALL addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener) override
QtFilePicker(const QtFilePicker &)=delete
virtual css::uno::Any SAL_CALL getValue(sal_Int16 nControlId, sal_Int16 nControlAction) override
const bool m_bIsFolderPicker
css::uno::Reference< css::ui::dialogs::XFilePickerListener > m_xListener
virtual void SAL_CALL removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener > &xListener) override
virtual void SAL_CALL setDefaultName(const OUString &rName) override
virtual void SAL_CALL enableControl(sal_Int16 nControlId, sal_Bool bEnable) override
QGridLayout * m_pLayout
layout for extra custom controls
virtual OUString SAL_CALL getDirectory() override
virtual css::uno::Sequence< OUString > SAL_CALL getFiles() override
QWidget * m_pParentWidget
css::uno::Reference< css::uno::XComponentContext > m_context
::cppu::WeakComponentImplHelper< css::frame::XTerminateListener, css::lang::XInitialization, css::lang::XServiceInfo, css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess, css::ui::dialogs::XAsynchronousExecutableDialog, css::ui::dialogs::XFolderPicker2 > QtFilePicker_Base
#define VCLPLUG_QT_PUBLIC