20#include <dlgedfac.hxx>
23#include <com/sun/star/container/XNameContainer.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/awt/ScrollBarOrientation.hpp>
26#include <com/sun/star/uno/XComponentContext.hpp>
50 static const uno::Reference<lang::XMultiServiceFactory> xDialogSFact = [] {
51 uno::Reference<lang::XMultiServiceFactory> xFact;
52 uno::Reference< uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
53 uno::Reference< container::XNameContainer > xC( xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.awt.UnoControlDialogModel", xContext ), uno::UNO_QUERY );
56 uno::Reference< lang::XMultiServiceFactory > xModFact( xC, uno::UNO_QUERY );
63 if( (aParams.nInventor == SdrInventor::BasicDialog) &&
64 (aParams.nObjIdentifier >= SdrObjKind::BasicDialogPushButton) &&
65 (aParams.nObjIdentifier <= SdrObjKind::BasicDialogFormHorizontalScroll) )
67 switch( aParams.nObjIdentifier )
69 case SdrObjKind::BasicDialogPushButton:
70 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlButtonModel", xDialogSFact );
72 case SdrObjKind::BasicDialogRadioButton:
73 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlRadioButtonModel", xDialogSFact );
75 case SdrObjKind::BasicDialogFormRadio:
76 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.RadioButton", xDialogSFact );
79 case SdrObjKind::BasicDialogCheckbox:
80 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlCheckBoxModel", xDialogSFact );
82 case SdrObjKind::BasicDialogFormCheck:
83 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.CheckBox", xDialogSFact );
86 case SdrObjKind::BasicDialogListbox:
87 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlListBoxModel", xDialogSFact );
89 case SdrObjKind::BasicDialogFormList:
90 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.ListBox", xDialogSFact );
93 case SdrObjKind::BasicDialogFormCombo:
94 case SdrObjKind::BasicDialogCombobox:
97 if ( aParams.nObjIdentifier == SdrObjKind::BasicDialogCombobox )
98 pNew =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlComboBoxModel", xDialogSFact );
101 pNew =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.ComboBox", xDialogSFact );
102 pNew->MakeDataAware(
mxModel );
107 uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY);
118 case SdrObjKind::BasicDialogGroupBox:
119 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlGroupBoxModel", xDialogSFact );
121 case SdrObjKind::BasicDialogEdit:
122 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlEditModel", xDialogSFact );
124 case SdrObjKind::BasicDialogFixedText:
125 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlFixedTextModel", xDialogSFact );
127 case SdrObjKind::BasicDialogImageControl:
128 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlImageControlModel", xDialogSFact );
130 case SdrObjKind::BasicDialogProgressbar:
131 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlProgressBarModel", xDialogSFact );
133 case SdrObjKind::BasicDialogHorizontalScrollbar:
134 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
136 case SdrObjKind::BasicDialogFormHorizontalScroll:
137 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.ScrollBar", xDialogSFact );
140 case SdrObjKind::BasicDialogFormVerticalScroll:
141 case SdrObjKind::BasicDialogVerticalScrollbar:
144 if ( aParams.nObjIdentifier == SdrObjKind::BasicDialogVerticalScrollbar )
145 pNew =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
148 pNew =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.ScrollBar", xDialogSFact );
149 pNew->MakeDataAware(
mxModel );
155 uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY);
165 case SdrObjKind::BasicDialogHorizontalFixedLine:
166 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact );
168 case SdrObjKind::BasicDialogVerticalFixedLine:
175 uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY);
185 case SdrObjKind::BasicDialogDateField:
186 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlDateFieldModel", xDialogSFact );
188 case SdrObjKind::BasicDialogTimeField:
189 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlTimeFieldModel", xDialogSFact );
191 case SdrObjKind::BasicDialogNumericField:
192 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlNumericFieldModel", xDialogSFact );
194 case SdrObjKind::BasicDialogCurencyField:
195 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlCurrencyFieldModel", xDialogSFact );
197 case SdrObjKind::BasicDialogFormattedField:
198 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlFormattedFieldModel", xDialogSFact );
200 case SdrObjKind::BasicDialogPatternField:
201 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlPatternFieldModel", xDialogSFact );
203 case SdrObjKind::BasicDialogFileControl:
204 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlFileControlModel", xDialogSFact );
206 case SdrObjKind::BasicDialogSpinButton:
207 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlSpinButtonModel", xDialogSFact );
209 case SdrObjKind::BasicDialogFormSpin:
210 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.form.component.SpinButton", xDialogSFact );
213 case SdrObjKind::BasicDialogTreeControl:
214 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.tree.TreeControlModel", xDialogSFact );
216 case SdrObjKind::BasicDialogGridControl:
217 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.grid.UnoControlGridModel", xDialogSFact );
219 case SdrObjKind::BasicDialogHyperlinkControl:
220 pNewObj =
new DlgEdObj(aParams.rSdrModel,
"com.sun.star.awt.UnoControlFixedHyperlinkModel", xDialogSFact );
css::uno::Reference< css::frame::XModel2 > mxModel
static void InsertMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
static void RemoveMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
DlgEdFactory(css::uno::Reference< css::frame::XModel > xModel)
~DlgEdFactory() COVERITY_NOEXCEPT_FALSE
#define LINK(Instance, Class, Member)
constexpr OUStringLiteral DLGED_PROP_ORIENTATION
IMPL_LINK(AccessibleDialogWindow, WindowEventListener, VclWindowEvent &, rEvent, void)
constexpr OUStringLiteral DLGED_PROP_DROPDOWN
Reference< XModel > xModel