/** encapsulates functionality related to binding a form control to a spreadsheet cell
*/ class CellBindingHelper final
{
css::uno::Reference< css::beans::XPropertySet >
m_xControlModel; // the model we work for
css::uno::Reference< css::sheet::XSpreadsheetDocument >
m_xDocument; // the document where the model lives
/** gets a cell binding for the given address @precond isCellBindingAllowedreturns<TRUE/>
*/
css::uno::Reference< css::form::binding::XValueBinding >
createCellBindingFromStringAddress( const OUString& _rAddress, bool _bSupportIntegerExchange
) const;
/** creates a cell binding (supporting integer exchange, if requested) for thegivenaddressobject
*/
css::uno::Reference< css::form::binding::XValueBinding >
createCellBindingFromAddress( const css::table::CellAddress& _rAddress, bool _bSupportIntegerExchange
) const;
/** gets a cell range list source binding for the given address
*/
css::uno::Reference< css::form::binding::XListEntrySource >
createCellListSourceFromStringAddress( const OUString& _rAddress ) const;
/** creates a string representation for the given value binding's address
/** returns the current binding of our control model, if any.
*/
css::uno::Reference< css::form::binding::XValueBinding >
getCurrentBinding( ) const;
/** returns the current external list source of the control model, if any
*/
css::uno::Reference< css::form::binding::XListEntrySource >
getCurrentListSource( ) const;
/** sets a new binding for our control model @precond thecontrolmodelisbindable(whichisimpliedby<member>isCellBindingAllowed</member> returning<TRUE/>)
*/ void setBinding( const css::uno::Reference< css::form::binding::XValueBinding >& _rxBinding
);
/** sets a list source for our control model @precond thecontrolmodelisalistsink(whichisimpliedby<member>isListCellRangeAllowed</member> returning<TRUE/>)
*/ void setListSource( const css::uno::Reference< css::form::binding::XListEntrySource >& _rxSource
);
/** checks whether it's possible to bind the control model to a spreadsheet cell
*/ bool isCellBindingAllowed( ) const;
/** checks whether it's possible to bind the control model to a spreadsheet cell, withexchangingintegervalues
*/ bool isCellIntegerBindingAllowed( ) const;
/** checks whether it's possible to bind the control model to range of spreadsheet cells supplyingthelistentries
*/ bool isListCellRangeAllowed( ) const;
/** checks whether a given binding is a spreadsheet cell binding
*/ staticbool isCellBinding( const css::uno::Reference< css::form::binding::XValueBinding >& _rxBinding
);
/** checks whether a given binding is a spreadsheet cell binding, exchanging integervalues
*/ staticbool isCellIntegerBinding( const css::uno::Reference< css::form::binding::XValueBinding >& _rxBinding
);
/** checks whether a given list source is a spreadsheet cell list source
*/ staticbool isCellRangeListSource( const css::uno::Reference< css::form::binding::XListEntrySource >& _rxSource
);
/** retrieves the index of the sheet which our control belongs to @returntheindexofthesheetwhichourcontrolbelongstoor-1,ifanerroroccurred
*/
sal_Int16 getControlSheetIndex(
css::uno::Reference< css::sheet::XSpreadsheet >& _out_rxSheet
) const;
private: /** creates an address object from a string representation of a cell address
*/ bool convertStringAddress( const OUString& _rAddressDescription,
css::table::CellAddress& /* [out] */ _rAddress
) const;
/** creates an address range object from a string representation of a cell range address
*/ bool convertStringAddress( const OUString& _rAddressDescription,
css::table::CellRangeAddress& /* [out] */ _rAddress
) const;
/** determines if our document is a spreadsheet document, *and* can supply thegivenservice
*/ bool isSpreadsheetDocumentWhichSupplies( const OUString& _rService ) const;
/** checks whether a given component supports a given service
*/ staticbool doesComponentSupport( const css::uno::Reference< css::uno::XInterface >& _rxComponent, const OUString& _rService
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.