25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/util/VetoException.hpp>
35 using ::com::sun::star::uno::Reference;
36 using ::com::sun::star::uno::TypeClass_INTERFACE;
37 using ::com::sun::star::uno::TypeClass_STRING;
38 using ::com::sun::star::uno::XComponentContext;
39 using ::com::sun::star::inspection::XObjectInspectorModel;
40 using ::com::sun::star::uno::UNO_QUERY_THROW;
41 using ::com::sun::star::uno::Sequence;
42 using ::com::sun::star::uno::XInterface;
43 using ::com::sun::star::beans::XPropertySetInfo;
44 using ::com::sun::star::beans::XPropertySet;
45 using ::com::sun::star::beans::Property;
46 using ::com::sun::star::uno::Any;
47 using ::com::sun::star::lang::IllegalArgumentException;
48 using ::com::sun::star::uno::Type;
49 using ::com::sun::star::util::VetoException;
50 using ::com::sun::star::beans::PropertyVetoException;
51 using ::com::sun::star::uno::UNO_QUERY;
53 namespace PropertyAttribute = css::beans::PropertyAttribute;
60 OUString sImplementationName,
61 const css::uno::Sequence<OUString>& aSupportedServiceNames,
62 bool _bUseFormFormComponentHandlers )
63 :OPropertyBrowserController( _rxContext )
66 ,m_aSupportedServiceNames( aSupportedServiceNames )
68 osl_atomic_increment( &m_refCount );
70 Reference< XObjectInspectorModel >
xModel(
71 *(
new DefaultFormComponentInspectorModel( _bUseFormFormComponentHandlers )),
74 setInspectorModel( xModel );
76 osl_atomic_decrement( &m_refCount );
80 FormController::~FormController()
94 OPropertyBrowserController::getTypes());
104 return m_sImplementationName;
108 Sequence< OUString > SAL_CALL FormController::getSupportedServiceNames( )
110 Sequence< OUString > aSupported( m_aSupportedServiceNames );
111 aSupported.realloc( aSupported.getLength() + 1 );
112 aSupported.getArray()[ aSupported.getLength() - 1 ] =
"com.sun.star.inspection.ObjectInspector";
117 Reference< XPropertySetInfo > SAL_CALL FormController::getPropertySetInfo( )
119 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
125 return *getArrayHelper();
131 Sequence< Property > aProps{
134 static_cast<sal_Int32
>(OwnPropertyId::CURRENTPAGE),
136 PropertyAttribute::TRANSIENT
140 static_cast<sal_Int32
>(OwnPropertyId::INTROSPECTEDOBJECT),
142 PropertyAttribute::TRANSIENT | PropertyAttribute::CONSTRAINED
145 return new ::cppu::OPropertyArrayHelper( aProps );
149 sal_Bool SAL_CALL FormController::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle,
const Any& rValue )
153 case OwnPropertyId::INTROSPECTEDOBJECT:
154 if ( rValue.getValueTypeClass() != TypeClass_INTERFACE )
155 throw IllegalArgumentException();
157 case OwnPropertyId::CURRENTPAGE:
158 if ( rValue.getValueTypeClass() != TypeClass_STRING )
159 throw IllegalArgumentException();
165 getFastPropertyValue( rOldValue, nHandle );
166 rConvertedValue = rValue;
171 void SAL_CALL FormController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,
const Any& _rValue)
175 case OwnPropertyId::INTROSPECTEDOBJECT:
177 Reference< XObjectInspectorModel >
xModel( getInspectorModel() );
182 m_xCurrentInspectee.set( _rValue, UNO_QUERY );
183 Sequence< Reference< XInterface > > aObjects;
184 if ( m_xCurrentInspectee.is() )
186 aObjects = { m_xCurrentInspectee };
189 Reference< XObjectInspector > xInspector( *
this, UNO_QUERY_THROW );
190 xInspector->inspect( aObjects );
192 catch(
const VetoException& e )
194 throw PropertyVetoException( e.Message, e.Context );
199 case OwnPropertyId::CURRENTPAGE:
200 restoreViewData( _rValue );
208 void SAL_CALL FormController::getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle )
const
212 case OwnPropertyId::INTROSPECTEDOBJECT:
213 rValue <<= m_xCurrentInspectee;
216 case OwnPropertyId::CURRENTPAGE:
228extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
230 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any>
const&)
233 "org.openoffice.comp.extensions.FormController",
234 {
"com.sun.star.form.PropertyBrowserController" },
238extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
240 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any>
const&)
243 "org.openoffice.comp.extensions.DialogController",
244 {
"com.sun.star.awt.PropertyBrowserController" },
constexpr OUStringLiteral sImplementationName
a property handler for any virtual string properties
::cppu::OPropertySetHelper FormController_PropertyBase1
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_GET_IMPLEMENTATION_ID(DrawController)
Reference< XModel > xModel