23 #include <com/sun/star/awt/Toolkit.hpp>
24 #include <com/sun/star/awt/UnoControlDialog.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/view/XSelectionSupplier.hpp>
39 mxController( rxFrame->getController() ),
40 mxDialogModel(
mxContext->getServiceManager()->createInstanceWithContext(
41 "com.sun.star.awt.UnoControlDialogModel",
mxContext ), UNO_SET_THROW ),
42 mxDialogModelMultiPropertySet( mxDialogModel, UNO_QUERY_THROW ),
43 mxDialogModelMSF( mxDialogModel, UNO_QUERY_THROW ),
44 mxDialogModelNameContainer( mxDialogModel, UNO_QUERY_THROW ),
45 mxDialogModelNameAccess( mxDialogModel, UNO_QUERY_THROW ),
46 mxControlModel( mxDialogModel, UNO_QUERY_THROW ),
47 mxDialog( UnoControlDialog::
create(rxContext) ),
48 mxControl( mxDialog, UNO_QUERY_THROW ),
54 Reference< XWindow > xContainerWindow(
xFrame->getContainerWindow() );
55 Reference< XWindowPeer > xWindowPeer( xContainerWindow, UNO_QUERY_THROW );
58 Reference< XToolkit > xToolkit( Toolkit::create(
mxContext ), UNO_QUERY_THROW );
63 xWindowPeer.is() ? xWindowPeer : xToolkit->getDesktopWindow());
69 Reference<XComponent> xDialogComponent(
mxDialog, UNO_QUERY_THROW);
70 xDialogComponent->dispose();
89 Reference< XInterface > xControlModel;
93 Reference< XMultiPropertySet > xMultiPropSet( xControlModel, UNO_QUERY_THROW );
94 xMultiPropSet->setPropertyValues( rPropertyNames, rPropertyValues );
100 return xControlModel;
108 Reference< XInterface > xControl(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
109 Reference< XWindow > xWindow( xControl, UNO_QUERY_THROW );
110 xWindow->setVisible( bVisible );
121 Reference< XButton > xButton;
124 Reference< XInterface > xButtonModel(
insertControlModel(
"com.sun.star.awt.UnoControlButtonModel",
125 rName, rPropertyNames, rPropertyValues ) );
127 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
128 xButton.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
130 if ( xActionListener.is() )
132 xButton->addActionListener( xActionListener );
133 xButton->setActionCommand( rName );
146 Reference< XFixedText > xFixedText;
150 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
151 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
152 xFixedText.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
163 Reference< XCheckBox > xCheckBox;
167 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
168 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
169 xCheckBox.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
180 Reference< XControl > xControl;
184 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
185 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
186 xControl.set(
mxDialog->getControl( rName ), UNO_SET_THROW );
197 Reference< XComboBox > xControl;
201 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
202 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
203 xControl.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
214 Reference< XRadioButton > xControl;
218 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
219 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
220 xControl.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
231 Reference< XListBox > xControl;
235 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
236 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
237 xControl.set(
mxDialog->getControl( rName ), UNO_QUERY_THROW );
248 Reference< XControl > xControl;
252 rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
253 xPropertySet->setPropertyValue(
"Name",
Any( rName ) );
254 xControl.set(
mxDialog->getControl( rName ), UNO_SET_THROW );
270 xPropertySet->setPropertyValue( rPropertyName, rPropertyValue );
287 aRet = xPropertySet->getPropertyValue( rPropertyName );
void disableControl(const OUString &rControlName)
css::uno::Any getControlProperty(const OUString &rControlName, const OUString &rPropertyName)
css::uno::Reference< css::awt::XReschedule > mxReschedule
Reference< XFrame > xFrame
css::uno::Reference< css::awt::XListBox > insertListBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
css::uno::Reference< css::awt::XControl > insertImage(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
css::uno::Reference< css::awt::XControl > insertFormattedField(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
void setControlProperty(const OUString &rControlName, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
css::uno::Reference< css::awt::XUnoControlDialog > mxDialog
Reference< deployment::XPackageRegistry > create(Reference< deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, Reference< XComponentContext > const &xComponentContext)
css::uno::Reference< css::awt::XControlModel > mxControlModel
css::uno::Reference< css::awt::XFixedText > insertFixedText(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
css::uno::Reference< css::lang::XMultiServiceFactory > mxDialogModelMSF
void endExecute(bool bStatus)
css::uno::Reference< css::awt::XComboBox > insertComboBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
css::uno::Reference< css::awt::XRadioButton > insertRadioButton(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
void enableControl(const OUString &rControlName)
css::uno::Reference< css::container::XNameAccess > mxDialogModelNameAccess
css::uno::Reference< css::uno::XComponentContext > mxContext
UnoDialog(const css::uno::Reference< css::uno::XComponentContext > &rxMSF, css::uno::Reference< css::frame::XFrame > const &rxFrame)
css::uno::Reference< css::awt::XCheckBox > insertCheckBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
css::uno::Reference< css::frame::XController > mxController
css::uno::Reference< css::container::XNameContainer > mxDialogModelNameContainer
css::uno::Reference< css::awt::XControl > mxControl
css::uno::Reference< css::uno::XInterface > insertControlModel(const OUString &rServiceName, const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
void setVisible(const OUString &rName, bool bVisible)
bool m_bDetectedRangeSegmentation false
css::uno::Reference< css::awt::XButton > insertButton(const OUString &rName, const css::uno::Reference< css::awt::XActionListener > &xActionListener, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)