24#include <com/sun/star/awt/XWindow.hpp>
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/util/AliasProgrammaticPair.hpp>
27#include <com/sun/star/sdbc/XDataSource.hpp>
34#define UNODIALOG_PROPERTY_ID_ALIASES 100
35constexpr OUStringLiteral UNODIALOG_PROPERTY_ALIASES =
u"FieldMapping";
37 using namespace css::uno;
38 using namespace css::lang;
39 using namespace css::util;
40 using namespace css::beans;
41 using namespace css::sdbc;
43 class OAddressBookSourceDialogUno
50 OUString m_sDataSourceName;
65 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper()
override;
74 virtual std::unique_ptr<weld::DialogController>
createDialog(
const css::uno::Reference<css::awt::XWindow>& rParent)
override;
76 virtual void implInitialize(
const css::uno::Any& _rValue)
override;
92 return css::uno::Sequence<sal_Int8>();
96 OUString SAL_CALL OAddressBookSourceDialogUno::getImplementationName()
98 return "com.sun.star.comp.svtools.OAddressBookSourceDialogUno";
102 css::uno::Sequence<OUString> SAL_CALL OAddressBookSourceDialogUno::getSupportedServiceNames()
104 return {
"com.sun.star.ui.AddressBookSourceDialog" };
116 return *getArrayHelper();
122 describeProperties(aProps);
123 return new ::cppu::OPropertyArrayHelper(aProps);
126 void OAddressBookSourceDialogUno::executedDialog(sal_Int16 _nExecutionResult)
128 OGenericUnoDialog::executedDialog(_nExecutionResult);
130 if ( _nExecutionResult && m_xDialog )
134 void SAL_CALL OAddressBookSourceDialogUno::initialize(
const Sequence< Any >& rArguments)
136 if( rArguments.getLength() == 5 )
140 OUString sDataSourceName;
143 if ( (rArguments[0] >>= xParentWindow)
144 && (rArguments[1] >>= xDataSource)
145 && (rArguments[2] >>= sDataSourceName)
146 && (rArguments[3] >>= sCommand)
147 && (rArguments[4] >>= sTitle) )
153 {
"ParentWindow",
Any(xParentWindow)},
154 {
"DataSource",
Any(xDataSource)},
155 {
"DataSourceName",
Any(sDataSourceName)},
156 {
"Command",
Any(sCommand)},
157 {
"Title",
Any(sTitle)}
159 OGenericUnoDialog::initialize(aArguments);
163 OGenericUnoDialog::initialize(rArguments);
166 void OAddressBookSourceDialogUno::implInitialize(
const css::uno::Any& _rValue)
169 if (_rValue >>= aVal)
171 if (aVal.Name ==
"DataSource")
174 OSL_ENSURE( bSuccess,
"OAddressBookSourceDialogUno::implInitialize: invalid type for DataSource!" );
178 if (aVal.Name ==
"DataSourceName")
180 bool bSuccess = aVal.Value >>= m_sDataSourceName;
181 OSL_ENSURE( bSuccess,
"OAddressBookSourceDialogUno::implInitialize: invalid type for DataSourceName!" );
185 if (aVal.Name ==
"Command")
187 bool bSuccess = aVal.Value >>= m_sTable;
188 OSL_ENSURE( bSuccess,
"OAddressBookSourceDialogUno::implInitialize: invalid type for Command!" );
193 OGenericUnoDialog::implInitialize( _rValue );
196 std::unique_ptr<weld::DialogController> OAddressBookSourceDialogUno::createDialog(
const css::uno::Reference<css::awt::XWindow>& rParent)
200 return std::make_unique<AddressBookSourceDialog>(pParent, m_aContext, m_xDataSource, m_sDataSourceName, m_sTable,
m_aAliases);
201 return std::make_unique<AddressBookSourceDialog>(pParent, m_aContext);
205extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
207 css::uno::XComponentContext * context,
208 css::uno::Sequence<css::uno::Any>
const &)
210 return cppu::acquire(
new OAddressBookSourceDialogUno(context));
MapString2String m_aAliases
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
#define UNODIALOG_PROPERTY_ID_ALIASES
Reference< XExecutableDialog > m_xDialog
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const=0
abstract base class for implementing UNO objects representing dialogs (com.sun.star....
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override=0
virtual std::unique_ptr< weld::DialogController > createDialog(const css::uno::Reference< css::awt::XWindow > &rParent)=0
create the concrete dialog instance.
virtual void executedDialog(sal_Int16)
called after the dialog has been executed
virtual OUString SAL_CALL getImplementationName() override=0
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override=0
virtual void implInitialize(const css::uno::Any &_rValue)
smaller form of <method>initialize</method>.
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Reference< XDataSource > m_xDataSource
Sequence< PropertyValue > aArguments
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)