23#include <helper/property.hxx>
24#include <com/sun/star/awt/UnoControlDialogModelProvider.hpp>
25#include <com/sun/star/awt/tab/XTabPage.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/uno/XComponentContext.hpp>
60 return "stardiv.Toolkit.UnoControlTabPageModel";
65 css::uno::Sequence< OUString > aNames = ControlModelContainerBase::getSupportedServiceNames( );
66 aNames.realloc( aNames.getLength() + 1 );
67 aNames.getArray()[ aNames.getLength() - 1 ] =
"com.sun.star.awt.tab.UnoControlTabPageModel";
73 return "com.sun.star.awt.tab.UnoControlTabPageModel";
83 aAny <<= OUString(
"com.sun.star.awt.tab.UnoControlTabPage");
89 aAny <<= uno::Reference< XNameContainer >();
107 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo(
getInfoHelper() ) );
114 if ( rArguments.getLength() == 1 )
116 if ( !( rArguments[ 0 ] >>=
nPageId ))
117 throw lang::IllegalArgumentException();
120 else if ( rArguments.getLength() == 2 )
122 if ( !( rArguments[ 0 ] >>=
nPageId ))
123 throw lang::IllegalArgumentException();
126 if ( !( rArguments[ 1 ] >>= sURL ))
127 throw lang::IllegalArgumentException();
128 Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create(
m_xContext, sURL );
129 if ( xDialogModel.is() )
131 const Sequence< OUString> aNames = xDialogModel->getElementNames();
132 for(
const OUString& rName : aNames)
136 Any aElement(xDialogModel->getByName(rName));
137 xDialogModel->removeByName(rName);
142 Reference<XPropertySet> xDialogProp(xDialogModel,UNO_QUERY);
143 if ( xDialogProp.is() )
145 static constexpr OUStringLiteral s_sResourceResolver =
u"ResourceResolver";
146 setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver));
160 ,m_bWindowListener(false)
162 maComponentInfos.nWidth = 280;
163 maComponentInfos.nHeight = 400;
171 return "TabPageModel";
176 return "stardiv.Toolkit.UnoControlTabPage";
186 return {
"com.sun.star.awt.tab.UnoControlTabPage" };
193 lang::EventObject aEvt;
206 ImplUpdateResourceResolver();
210 Reference < tab::XTabPage > xTabPage( getPeer(), UNO_QUERY );
215 Reference< XWindowListener > xWL(
this);
216 addWindowListener( xWL );
231 DBG_ASSERT( pOutDev,
"Missing Default Device!" );
232 if ( !pOutDev || mbSizeModified )
236 ::Size aAppFontSize( e.Width, e.Height );
238 Reference< XControl > xDialogControl( *
this, UNO_QUERY_THROW );
239 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
240 OSL_ENSURE( xDialogDevice.is(),
"UnoDialogControl::windowResized: no peer, but a windowResized event?" );
241 if ( xDialogDevice.is() )
243 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
244 aAppFontSize.
AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
245 aAppFontSize.
AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
252 mbSizeModified =
true;
254 Sequence< OUString > aProps{
"Height",
"Width" };
255 Sequence< Any > aValues{
Any(aAppFontSize.
Height()),
Any(aAppFontSize.
Width()) };
257 ImplSetPropertyValues( aProps, aValues,
true );
258 mbSizeModified =
false;
265 DBG_ASSERT( pOutDev,
"Missing Default Device!" );
266 if ( !pOutDev || mbPosModified )
275 mbPosModified =
true;
276 Sequence< OUString > aProps{
"PositionX",
"PositionY" };
279 ImplSetPropertyValues( aProps, aValues,
true );
280 mbPosModified =
false;
288extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
290 css::uno::XComponentContext *context,
291 css::uno::Sequence<css::uno::Any>
const &)
296extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
298 css::uno::XComponentContext *context,
299 css::uno::Sequence<css::uno::Any>
const &)
Reference< XComponentContext > m_xContext
static OutputDevice * GetDefaultDevice()
void SAL_CALL dispose() override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const
OUString SAL_CALL getImplementationName() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
OUString SAL_CALL getServiceName() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
UnoControlTabPageModel(css::uno::Reference< css::uno::XComponentContext > const &i_factory)
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString GetComponentServiceName() const override
virtual ~UnoControlTabPage() override
void SAL_CALL dispose() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
UnoControlTabPage(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
#define DBG_ASSERT(sCon, aError)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
const OUString & GetPropertyName(sal_uInt16 nPropertyId)
#define BASEPROPERTY_HSCROLL
#define BASEPROPERTY_TITLE
#define BASEPROPERTY_HELPURL
#define BASEPROPERTY_SCROLLWIDTH
#define BASEPROPERTY_IMAGEURL
#define BASEPROPERTY_DEFAULTCONTROL
#define BASEPROPERTY_SCROLLLEFT
#define BASEPROPERTY_VSCROLL
#define BASEPROPERTY_SCROLLHEIGHT
#define BASEPROPERTY_HELPTEXT
#define BASEPROPERTY_SCROLLTOP
#define BASEPROPERTY_USERFORMCONTAINEES
::Size ImplMapPixelToAppFont(OutputDevice const *pOutDev, const ::Size &aSize)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlTabPage_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlTabPageModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)