24#include <com/sun/star/inspection/XObjectInspectorUI.hpp>
25#include <com/sun/star/lang/NullPointerException.hpp>
65 return "com.sun.star.comp.extensions.EditPropertyHandler";
71 return {
"com.sun.star.form.inspection.EditPropertyHandler" };
77 ::osl::MutexGuard aGuard(
m_aMutex );
87 bool bHasVScroll =
false;
89 bool bHasHScroll =
false;
92 aReturn <<= static_cast<sal_Int32>( ( bHasVScroll ? 2 : 0 ) + ( bHasHScroll ? 1 : 0 ) );
98 TextType nTextType = TextType::SINGLELINE;
99 bool bRichText =
false;
102 nTextType = TextType::RICHTEXT;
105 bool bMultiLine =
false;
108 nTextType = TextType::MULTILINE;
110 nTextType = TextType::SINGLELINE;
112 aReturn <<= static_cast<sal_Int32>(nTextType);
118 OSL_FAIL(
"EditPropertyHandler::getPropertyValue: cannot handle this property!" );
133 ::osl::MutexGuard aGuard(
m_aMutex );
142 sal_Int32 nScrollbars = 0;
143 _rValue >>= nScrollbars;
145 bool bHasVScroll = 0 != ( nScrollbars & 2 );
146 bool bHasHScroll = 0 != ( nScrollbars & 1 );
155 bool bMultiLine =
false;
156 bool bRichText =
false;
157 sal_Int32 nTextType =
static_cast<sal_Int32
>(TextType::SINGLELINE);
158 OSL_VERIFY( _rValue >>= nTextType );
159 switch (
static_cast<TextType
>(nTextType) )
161 case TextType::SINGLELINE: bMultiLine = bRichText =
false;
break;
162 case TextType::MULTILINE: bMultiLine =
true; bRichText =
false;
break;
163 case TextType::RICHTEXT: bMultiLine =
true; bRichText =
true;
break;
165 OSL_FAIL(
"EditPropertyHandler::setPropertyValue: invalid text type!" );
174 OSL_FAIL(
"EditPropertyHandler::setPropertyValue: cannot handle this id!" );
187 Reference< XPropertySetInfo > xPSI;
200 Reference< XPropertySetInfo > xPSI;
221 return Sequence< Property >();
228 ::osl::MutexGuard aGuard(
m_aMutex );
229 std::vector< OUString > aSuperseded;
240 if ( aSuperseded.empty() )
241 return Sequence< OUString >();
248 ::osl::MutexGuard aGuard(
m_aMutex );
249 std::vector< OUString > aInterestingActuatingProps;
259 if ( !_rxInspectorUI.is() )
260 throw NullPointerException();
262 ::osl::MutexGuard aGuard(
m_aMutex );
264 switch ( nActuatingPropId )
268 sal_Int32 nTextTypeInt =
static_cast<sal_Int32
>(TextType::SINGLELINE);
271 TextType nTextType =
static_cast<TextType
>(nTextTypeInt);
274 _rxInspectorUI->enablePropertyUI(
PROPERTY_WORDBREAK, nTextType == TextType::RICHTEXT );
276 _rxInspectorUI->enablePropertyUI(
PROPERTY_ECHO_CHAR, nTextType == TextType::SINGLELINE );
277 _rxInspectorUI->enablePropertyUI(
PROPERTY_FONT, nTextType != TextType::RICHTEXT );
278 _rxInspectorUI->enablePropertyUI(
PROPERTY_ALIGN, nTextType != TextType::RICHTEXT );
284 _rxInspectorUI->showCategory(
"Data", nTextType != TextType::RICHTEXT );
290 bool bIsMultiline =
false;
291 _rNewValue >>= bIsMultiline;
300 OSL_FAIL(
"EditPropertyHandler::actuatingPropertyChanged: cannot handle this id!" );
307extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
309 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any>
const&)
PropertiesInfo aProperties
mutable::osl::Mutex m_aMutex
a property handler for any virtual string properties
bool implHaveBothScrollBarProperties() const
virtual void SAL_CALL setPropertyValue(const OUString &_rPropertyName, const css::uno::Any &_rValue) override
virtual void SAL_CALL actuatingPropertyChanged(const OUString &_rActuatingPropertyName, const css::uno::Any &_rNewValue, const css::uno::Any &_rOldValue, const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxInspectorUI, sal_Bool) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &_rPropertyName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~EditPropertyHandler() override
bool implHaveTextTypeProperty() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties() override
virtual css::uno::Sequence< css::beans::Property > doDescribeSupportedProperties() const override
EditPropertyHandler(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties() override
PropertyHandler implementation which additionally supports XServiceInfo.
bool impl_isSupportedProperty_nothrow(PropertyId _nPropId) const
determines whether a given property id is part of our supported properties
PropertyId impl_getPropertyId_throwUnknownProperty(const OUString &_rPropertyName) const
retrieves the property id for a given property name
void addInt32PropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs=0) const
adds a description for the given int32 property to the given property vector
css::uno::Reference< css::beans::XPropertySet > m_xComponent
the component we're inspecting
PropertyId impl_getPropertyId_throwRuntime(const OUString &_rPropertyName) const
retrieves the property id for a given property name
#define TOOLS_WARN_EXCEPTION(area, stream)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * extensions_propctrlr_EditPropertyHandler_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
a property handler for any virtual string properties