24#include <osl/mutex.hxx>
26#include <com/sun/star/awt/MouseButton.hpp>
27#include <com/sun/star/beans/PropertyAttribute.hpp>
28#include <com/sun/star/form/FormComponentType.hpp>
29#include <property.hxx>
51 m_nClassId = FormComponentType::IMAGEBUTTON;
54OImageButtonModel::OImageButtonModel(
const OImageButtonModel* _pOriginal,
const Reference<XComponentContext>& _rxFactory)
55 :OClickableImageBaseModel( _pOriginal, _rxFactory )
57 implInitializeImageURL();
60css::uno::Reference< css::util::XCloneable > SAL_CALL OImageButtonModel::createClone()
63 pClone->clonedFrom(
this);
67OImageButtonModel::~OImageButtonModel()
72css::uno::Sequence<OUString> OImageButtonModel::getSupportedServiceNames()
74 css::uno::Sequence<OUString> aSupported = OClickableImageBaseModel::getSupportedServiceNames();
75 aSupported.realloc(aSupported.getLength() + 2);
77 OUString*pArray = aSupported.getArray();
83void OImageButtonModel::describeFixedProperties( Sequence< Property >& _rProps )
const
85 OClickableImageBaseModel::describeFixedProperties( _rProps );
86 sal_Int32 nOldCount = _rProps.getLength();
87 _rProps.realloc( nOldCount + 5);
88 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
94 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
97OUString OImageButtonModel::getServiceName()
102void OImageButtonModel::write(
const Reference<XObjectOutputStream>& _rxOutStream)
104 OControlModel::write(_rxOutStream);
107 _rxOutStream->writeShort(0x0003);
108 _rxOutStream->writeShort(
static_cast<sal_uInt16
>(m_eButtonType));
111 _rxOutStream << sTmp;
112 _rxOutStream << m_sTargetFrame;
113 writeHelpTextCompatibly(_rxOutStream);
116void OImageButtonModel::read(
const Reference<XObjectInputStream>& _rxInStream)
118 OControlModel::read(_rxInStream);
121 sal_uInt16
nVersion = _rxInStream->readShort();
127 m_eButtonType =
static_cast<FormButtonType
>(_rxInStream->readShort());
132 m_eButtonType =
static_cast<FormButtonType
>(_rxInStream->readShort());
133 _rxInStream >> m_sTargetURL;
134 _rxInStream >> m_sTargetFrame;
139 m_eButtonType =
static_cast<FormButtonType
>(_rxInStream->readShort());
140 _rxInStream >> m_sTargetURL;
141 _rxInStream >> m_sTargetFrame;
142 readHelpTextCompatibly(_rxInStream);
147 OSL_FAIL(
"OImageButtonModel::read : unknown version !");
148 m_eButtonType = FormButtonType_PUSH;
149 m_sTargetURL.clear();
150 m_sTargetFrame.clear();
156Sequence<Type> OImageButtonControl::_getTypes()
158 static Sequence<Type>
const aTypes =
159 concatSequences(OClickableImageBaseControl::_getTypes(), OImageButtonControl_BASE::getTypes());
163css::uno::Sequence<OUString> OImageButtonControl::getSupportedServiceNames()
165 css::uno::Sequence<OUString> aSupported = OClickableImageBaseControl::getSupportedServiceNames();
166 aSupported.realloc(aSupported.getLength() + 2);
168 OUString*pArray = aSupported.getArray();
174OImageButtonControl::OImageButtonControl(
const Reference<XComponentContext>& _rxFactory)
180 Reference< awt::XWindow > xComp;
183 xComp->addMouseListener(
static_cast< awt::XMouseListener*
>(
this ) );
192 if (!aReturn.hasValue())
202 if (e.Buttons != awt::MouseButton::LEFT)
205 ::osl::ClearableMutexGuard aGuard(
m_aMutex );
235extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
237 css::uno::Sequence<css::uno::Any>
const &)
242extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
244 css::uno::Sequence<css::uno::Any>
const &)
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
sal_Int32 getLength() const
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
oslInterlockedCount m_refCount
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
OImageProducerThread_Impl * getImageProducerThread()
retrieves (and if necessary creates) the image producer thread.
virtual void actionPerformed_Impl(bool bNotifyListener, const css::awt::MouseEvent &rEvt)
::comphelper::OInterfaceContainerHelper3< css::form::XApproveActionListener > m_aApproveActionListeners
css::uno::Reference< css::uno::XAggregation > m_xAggregate
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_TARGET_URL
constexpr OUStringLiteral PROPERTY_DISPATCHURLINTERNAL
constexpr OUStringLiteral PROPERTY_TARGET_FRAME
constexpr OUStringLiteral PROPERTY_BUTTONTYPE
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
bool query_aggregation(const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
ListBox is a bit confusing / different from other form components, so here are a few notes:
#define PROPERTY_ID_DISPATCHURLINTERNAL
#define PROPERTY_ID_TARGET_FRAME
#define PROPERTY_ID_TARGET_URL
#define PROPERTY_ID_BUTTONTYPE
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral VCL_CONTROLMODEL_IMAGEBUTTON
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_IMAGEBUTTON
constexpr OUStringLiteral FRM_COMPONENT_IMAGEBUTTON
constexpr OUStringLiteral FRM_SUN_CONTROL_IMAGEBUTTON
constexpr OUStringLiteral VCL_CONTROL_IMAGEBUTTON
constexpr OUStringLiteral FRM_SUN_COMPONENT_IMAGEBUTTON