LibreOffice Module extensions (master) 1
Static Public Member Functions | Private Member Functions | List of all members
pcr::PropertyHandlerHelper Class Reference

#include <handlerhelper.hxx>

Static Public Member Functions

static void describePropertyLine (const css::beans::Property &_rProperty, css::inspection::LineDescriptor &_out_rDescriptor, const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory)
 helper for implementing XPropertyHandler::describePropertyLine in a generic way More...
 
static css::uno::Any convertToPropertyValue (const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::script::XTypeConverter > &_rxTypeConverter, const css::beans::Property &_rProperty, const css::uno::Any &_rControlValue)
 helper for implementing XPropertyHandler::convertToPropertyValue More...
 
static css::uno::Any convertToControlValue (const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::script::XTypeConverter > &_rxTypeConverter, const css::uno::Any &_rPropertyValue, const css::uno::Type &_rControlValueType)
 helper for implementing XPropertyHandler::convertToControlValue More...
 
static css::uno::Reference< css::inspection::XPropertyControl > createListBoxControl (const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, std::vector< OUString > &&_rInitialListEntries, bool _bReadOnlyControl, bool _bSorted)
 creates an <member scope="css::inspection">PropertyControlType::ListBox</member>-type control and fills it with initial values More...
 
static css::uno::Reference< css::inspection::XPropertyControl > createListBoxControl (const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, const TranslateId *pTransIds, size_t nElements, bool _bReadOnlyControl)
 creates an <member scope="css::inspection">PropertyControlType::ListBox</member>-type control and fills it with initial values. More...
 
static css::uno::Reference< css::inspection::XPropertyControl > createComboBoxControl (const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, std::vector< OUString > &&_rInitialListEntries, bool _bSorted)
 creates an <member scope="css::inspection">PropertyControlType::ComboBox</member>-type control and fills it with initial values More...
 
static css::uno::Reference< css::inspection::XPropertyControl > createNumericControl (const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, sal_Int16 _nDigits, const css::beans::Optional< double > &_rMinValue, const css::beans::Optional< double > &_rMaxValue)
 creates an <member scope="css::inspection">PropertyControlType::NumericField</member>-type control and initializes it More...
 
static void setContextDocumentModified (const css::uno::Reference< css::uno::XComponentContext > &_rContext)
 marks the document passed in our UNO context as modified More...
 
static css::uno::Reference< css::uno::XInterface > getContextDocument (const css::uno::Reference< css::uno::XComponentContext > &_rContext)
 
static css::uno::Reference< css::uno::XInterface > getContextDocument_throw (const css::uno::Reference< css::uno::XComponentContext > &_rContext)
 
static weld::WindowgetDialogParentFrame (const css::uno::Reference< css::uno::XComponentContext > &_rContext)
 gets the window of the ObjectInspector in which a property handler lives More...
 
static bool requiresReadOnlyControl (sal_Int16 _nPropertyAttributes)
 determines whether given PropertyAttributes require a to-be-created <type scope="css::inspection">XPropertyControl</type> to be read-only More...
 
static std::unique_ptr< weld::BuildermakeBuilder (const OUString &rUIFile, const css::uno::Reference< css::uno::XComponentContext > &rContext)
 
static void setBuilderParent (const css::uno::Reference< css::uno::XComponentContext > &rContext, weld::Widget *pParent)
 
static void clearBuilderParent (const css::uno::Reference< css::uno::XComponentContext > &rContext)
 

Private Member Functions

 PropertyHandlerHelper (const PropertyHandlerHelper &)=delete
 
PropertyHandlerHelperoperator= (const PropertyHandlerHelper &)=delete
 

Detailed Description

Definition at line 46 of file handlerhelper.hxx.

Constructor & Destructor Documentation

◆ PropertyHandlerHelper()

pcr::PropertyHandlerHelper::PropertyHandlerHelper ( const PropertyHandlerHelper )
privatedelete

Member Function Documentation

◆ clearBuilderParent()

void pcr::PropertyHandlerHelper::clearBuilderParent ( const css::uno::Reference< css::uno::XComponentContext > &  rContext)
static

Definition at line 305 of file handlerhelper.cxx.

Referenced by pcr::OPropertyEditor::~OPropertyEditor().

◆ convertToControlValue()

Any pcr::PropertyHandlerHelper::convertToControlValue ( const css::uno::Reference< css::uno::XComponentContext > &  _rxContext,
const css::uno::Reference< css::script::XTypeConverter > &  _rxTypeConverter,
const css::uno::Any &  _rPropertyValue,
const css::uno::Type &  _rControlValueType 
)
static

helper for implementing XPropertyHandler::convertToControlValue

Definition at line 210 of file handlerhelper.cxx.

References Any, Exception, and TOOLS_WARN_EXCEPTION.

◆ convertToPropertyValue()

Any pcr::PropertyHandlerHelper::convertToPropertyValue ( const css::uno::Reference< css::uno::XComponentContext > &  _rxContext,
const css::uno::Reference< css::script::XTypeConverter > &  _rxTypeConverter,
const css::beans::Property &  _rProperty,
const css::uno::Any &  _rControlValue 
)
static

helper for implementing XPropertyHandler::convertToPropertyValue

Definition at line 172 of file handlerhelper.cxx.

References Any, Exception, and TOOLS_WARN_EXCEPTION.

◆ createComboBoxControl()

Reference< XPropertyControl > pcr::PropertyHandlerHelper::createComboBoxControl ( const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory,
std::vector< OUString > &&  _rInitialListEntries,
bool  _bSorted 
)
static

creates an <member scope="css::inspection">PropertyControlType::ComboBox</member>-type control and fills it with initial values

Parameters
_rxControlFactoryA control factory. Must not be <NULL>.
_rInitialListEntriesthe initial values of the control
_bSorteddetermines whether the list entries should be sorted
Returns
the newly created control

Definition at line 149 of file handlerhelper.cxx.

Referenced by pcr::EFormsPropertyHandler::describePropertyLine().

◆ createListBoxControl() [1/2]

static css::uno::Reference< css::inspection::XPropertyControl > pcr::PropertyHandlerHelper::createListBoxControl ( const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory,
const TranslateId pTransIds,
size_t  nElements,
bool  _bReadOnlyControl 
)
static

creates an <member scope="css::inspection">PropertyControlType::ListBox</member>-type control and fills it with initial values.

Parameters
_rxControlFactoryA control factory. Must not be <NULL>.
pTransIdsthe initial translation ids for the value of the control
nElementsthe count of initial values of the control
_bReadOnlyControldetermines whether the control should be read-only
Returns
the newly created control

◆ createListBoxControl() [2/2]

static css::uno::Reference< css::inspection::XPropertyControl > pcr::PropertyHandlerHelper::createListBoxControl ( const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory,
std::vector< OUString > &&  _rInitialListEntries,
bool  _bReadOnlyControl,
bool  _bSorted 
)
static

creates an <member scope="css::inspection">PropertyControlType::ListBox</member>-type control and fills it with initial values

Parameters
_rxControlFactoryA control factory. Must not be <NULL>.
_rInitialListEntriesthe initial values of the control
_bReadOnlyControldetermines whether the control should be read-only
_bSorteddetermines whether the list entries should be sorted
Returns
the newly created control

Referenced by describePropertyLine(), pcr::EFormsPropertyHandler::describePropertyLine(), pcr::SubmissionPropertyHandler::describePropertyLine(), and pcr::XSDValidationPropertyHandler::describePropertyLine().

◆ createNumericControl()

Reference< XPropertyControl > pcr::PropertyHandlerHelper::createNumericControl ( const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory,
sal_Int16  _nDigits,
const css::beans::Optional< double > &  _rMinValue,
const css::beans::Optional< double > &  _rMaxValue 
)
static

creates an <member scope="css::inspection">PropertyControlType::NumericField</member>-type control and initializes it

Parameters
_rxControlFactoryA control factory. Must not be <NULL>.
_nDigitsnumber of decimal digits for the control (<member scope="css::inspection">XNumericControl::DecimalDigits</member>)
_rMinValueminimum value which can be entered in the control (<member scope="css::inspection">XNumericControl::MinValue</member>)
_rMaxValuemaximum value which can be entered in the control (<member scope="css::inspection">XNumericControl::MaxValue</member>)
Returns
the newly created control

Definition at line 156 of file handlerhelper.cxx.

Referenced by pcr::XSDValidationPropertyHandler::describePropertyLine().

◆ describePropertyLine()

void pcr::PropertyHandlerHelper::describePropertyLine ( const css::beans::Property &  _rProperty,
css::inspection::LineDescriptor &  _out_rDescriptor,
const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory 
)
static

helper for implementing XPropertyHandler::describePropertyLine in a generic way

Definition at line 56 of file handlerhelper.cxx.

References createListBoxControl(), requiresReadOnlyControl(), and SAL_N_ELEMENTS.

◆ getContextDocument()

Reference< XInterface > pcr::PropertyHandlerHelper::getContextDocument ( const css::uno::Reference< css::uno::XComponentContext > &  _rContext)
static

Definition at line 254 of file handlerhelper.cxx.

References Exception, getContextDocument_throw(), and TOOLS_WARN_EXCEPTION.

◆ getContextDocument_throw()

Reference< XInterface > pcr::PropertyHandlerHelper::getContextDocument_throw ( const css::uno::Reference< css::uno::XComponentContext > &  _rContext)
static
Exceptions
css::uno::RuntimeException

Definition at line 268 of file handlerhelper.cxx.

References Any.

Referenced by getContextDocument(), and setContextDocumentModified().

◆ getDialogParentFrame()

weld::Window * pcr::PropertyHandlerHelper::getDialogParentFrame ( const css::uno::Reference< css::uno::XComponentContext > &  _rContext)
static

gets the window of the ObjectInspector in which a property handler lives

The method looks up a value called "DialogParentWindow" in the given UNO component context, queries it for XWindow, and returns the respective weld::Window*. If either of those steps fails, this is asserted in a non-product version, and silently ignore otherwise.

Parameters
_rContextthe component context which was used to create the component calling this method

Definition at line 276 of file handlerhelper.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and Application::GetFrameWeld().

Referenced by pcr::OPropertyBrowserController::createPropertyControl().

◆ makeBuilder()

std::unique_ptr< weld::Builder > pcr::PropertyHandlerHelper::makeBuilder ( const OUString &  rUIFile,
const css::uno::Reference< css::uno::XComponentContext > &  rContext 
)
static

◆ operator=()

PropertyHandlerHelper & pcr::PropertyHandlerHelper::operator= ( const PropertyHandlerHelper )
privatedelete

◆ requiresReadOnlyControl()

static bool pcr::PropertyHandlerHelper::requiresReadOnlyControl ( sal_Int16  _nPropertyAttributes)
inlinestatic

determines whether given PropertyAttributes require a to-be-created <type scope="css::inspection">XPropertyControl</type> to be read-only

Parameters
_nPropertyAttributesthe attributes of the property which should be reflected by a to-be-created <type scope="css::inspection">XPropertyControl</type>

Definition at line 211 of file handlerhelper.hxx.

Referenced by describePropertyLine().

◆ setBuilderParent()

void pcr::PropertyHandlerHelper::setBuilderParent ( const css::uno::Reference< css::uno::XComponentContext > &  rContext,
weld::Widget pParent 
)
static

Definition at line 298 of file handlerhelper.cxx.

References Any.

Referenced by pcr::OPropertyEditor::OPropertyEditor().

◆ setContextDocumentModified()

void pcr::PropertyHandlerHelper::setContextDocumentModified ( const css::uno::Reference< css::uno::XComponentContext > &  _rContext)
static

marks the document passed in our UNO context as modified

The method looks up a value called "ContextDocument" in the given UNO component context, queries it for the ->css::util::XModifiable interface, and calls its setModified method. If either of those steps fails, this is asserted in a non-product version, and silently ignore otherwise.

Parameters
_rContextthe component context which was used to create the component calling this method

Definition at line 241 of file handlerhelper.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and getContextDocument_throw().


The documentation for this class was generated from the following files: