LibreOffice Module xmloff (master) 1
|
encapsulates functionality related to binding a form control to a spreadsheet cell More...
#include <formcellbinding.hxx>
Public Member Functions | |
FormCellBindingHelper (const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const css::uno::Reference< css::frame::XModel > &_rxDocument) | |
ctor More... | |
css::uno::Reference< css::form::binding::XValueBinding > | createCellBindingFromStringAddress (const OUString &_rAddress, bool _bUseIntegerBinding) const |
gets a cell binding for the given address @precond isCellBindingAllowed returns <TRUE> More... | |
css::uno::Reference< css::form::binding::XListEntrySource > | createCellListSourceFromStringAddress (const OUString &_rAddress) const |
gets a cell range list source binding for the given address More... | |
OUString | getStringAddressFromCellBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) const |
creates a string representation for the given value binding's address More... | |
OUString | getStringAddressFromCellListSource (const css::uno::Reference< css::form::binding::XListEntrySource > &_rxSource) const |
creates a string representation for the given list source's range address More... | |
css::uno::Reference< css::form::binding::XValueBinding > | getCurrentBinding () const |
returns the current binding of our control model, if any. More... | |
css::uno::Reference< css::form::binding::XListEntrySource > | getCurrentListSource () const |
returns the current external list source of the control model, if any More... | |
void | setBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) |
sets a new binding for our control model @precond the control model is bindable (which is implied by <member>isCellBindingAllowed</member> returning <TRUE>) More... | |
void | setListSource (const css::uno::Reference< css::form::binding::XListEntrySource > &_rxSource) |
sets a list source for our control model @precond the control model is a list sink (which is implied by <member>isListCellRangeAllowed</member> returning <TRUE>) More... | |
bool | isCellBindingAllowed () const |
checks whether it's possible to bind the control model to a spreadsheet cell More... | |
bool | isListCellRangeAllowed () const |
checks whether it's possible to bind the control model to a range of spreadsheet cells supplying the list entries More... | |
Static Public Member Functions | |
static bool | livesInSpreadsheetDocument (const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel) |
determines whether the given control model lives in a spreadsheet document More... | |
static bool | isCellBindingAllowed (const css::uno::Reference< css::frame::XModel > &_rxDocument) |
checks whether within the given document, it's possible to bind control models to spreadsheet cells More... | |
static bool | isListCellRangeAllowed (const css::uno::Reference< css::frame::XModel > &_rxDocument) |
checks whether within the given document, it's possible to bind the control model to a range of spreadsheet cells supplying the list entries More... | |
static bool | isCellBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) |
checks whether a given binding is a spreadsheet cell binding More... | |
static bool | isCellIntegerBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) |
checks whether a given binding is a spreadsheet cell binding, exchanging integer values More... | |
static bool | isCellRangeListSource (const css::uno::Reference< css::form::binding::XListEntrySource > &_rxSource) |
checks whether a given list source is a spreadsheet cell list source More... | |
Private Member Functions | |
bool | convertStringAddress (const OUString &_rAddressDescription, css::table::CellAddress &_rAddress) const |
creates an address object from a string representation of a cell address More... | |
bool | convertStringAddress (const OUString &_rAddressDescription, css::table::CellRangeAddress &_rAddress) const |
creates an address range object from a string representation of a cell range address More... | |
bool | isSpreadsheetDocumentWhichSupplies (const OUString &_rService) const |
determines if our document is a spreadsheet document, and can supply the given service More... | |
css::uno::Reference< css::uno::XInterface > | createDocumentDependentInstance (const OUString &_rService, const OUString &_rArgumentName, const css::uno::Any &_rArgumentValue) const |
uses the document (it's factory interface, respectively) to create a component instance More... | |
bool | doConvertAddressRepresentations (const OUString &_rInputProperty, const css::uno::Any &_rInputValue, const OUString &_rOutputProperty, css::uno::Any &_rOutputValue, bool _bIsRange) const |
converts an address representation into another one More... | |
Static Private Member Functions | |
static bool | isSpreadsheetDocumentWhichSupplies (const css::uno::Reference< css::sheet::XSpreadsheetDocument > &_rxDocument, const OUString &_rService) |
determines if our document is a spreadsheet document, and can supply the given service More... | |
static bool | doesComponentSupport (const css::uno::Reference< css::uno::XInterface > &_rxComponent, const OUString &_rService) |
checks whether a given component supports a given service More... | |
Private Attributes | |
css::uno::Reference< css::beans::XPropertySet > | m_xControlModel |
css::uno::Reference< css::sheet::XSpreadsheetDocument > | m_xDocument |
encapsulates functionality related to binding a form control to a spreadsheet cell
Definition at line 36 of file formcellbinding.hxx.
xmloff::FormCellBindingHelper::FormCellBindingHelper | ( | const css::uno::Reference< css::beans::XPropertySet > & | _rxControlModel, |
const css::uno::Reference< css::frame::XModel > & | _rxDocument | ||
) |
ctor
_rxControlModel | the control model which is or will be bound |
_rxDocument | the document. If this is <NULL>, the document will be obtained from the model itself by walk on up the chain of its ancestors. This parameter can be used if the control model is not (yet) part of a document model. |
Definition at line 94 of file formcellbinding.cxx.
References m_xControlModel, m_xDocument, and m_xDocument.
|
private |
creates an address object from a string representation of a cell address
Referenced by createCellBindingFromStringAddress(), and createCellListSourceFromStringAddress().
|
private |
creates an address range object from a string representation of a cell range address
Reference< XValueBinding > xmloff::FormCellBindingHelper::createCellBindingFromStringAddress | ( | const OUString & | _rAddress, |
bool | _bUseIntegerBinding | ||
) | const |
gets a cell binding for the given address @precond isCellBindingAllowed returns <TRUE>
Definition at line 138 of file formcellbinding.cxx.
References Any, convertStringAddress(), createDocumentDependentInstance(), m_xDocument, xmloff::PROPERTY_BOUND_CELL, xmloff::SERVICE_CELLVALUEBINDING, and xmloff::SERVICE_LISTINDEXCELLBINDING.
Reference< XListEntrySource > xmloff::FormCellBindingHelper::createCellListSourceFromStringAddress | ( | const OUString & | _rAddress | ) | const |
gets a cell range list source binding for the given address
Definition at line 159 of file formcellbinding.cxx.
References Any, convertStringAddress(), createDocumentDependentInstance(), xmloff::PROPERTY_LIST_CELL_RANGE, and xmloff::SERVICE_CELLRANGELISTSOURCE.
|
private |
uses the document (it's factory interface, respectively) to create a component instance
_rService | the service name |
_rArgumentName | the name of the single argument to pass during creation. May be empty, in this case no arguments are passed |
_rArgumentValue | the value of the instantiation argument. Not evaluated if <arg>_rArgumentName</arg> is empty. |
Definition at line 367 of file formcellbinding.cxx.
References Any, Exception, and m_xDocument.
Referenced by createCellBindingFromStringAddress(), createCellListSourceFromStringAddress(), and doConvertAddressRepresentations().
|
private |
converts an address representation into another one
_rInputProperty | the input property name for the conversion service |
_rInputValue | the input property value for the conversion service |
_rOutputProperty | the output property name for the conversion service |
_rOutputValue | the output property value for the conversion service |
_bIsRange | if <TRUE>, the RangeAddressConversion service will be used, else the AddressConversion service |
Definition at line 400 of file formcellbinding.cxx.
References Any, createDocumentDependentInstance(), Exception, xmloff::SERVICE_ADDRESS_CONVERSION, xmloff::SERVICE_RANGEADDRESS_CONVERSION, TOOLS_WARN_EXCEPTION, and xConverter.
Referenced by getStringAddressFromCellBinding(), and getStringAddressFromCellListSource().
|
staticprivate |
checks whether a given component supports a given service
Definition at line 326 of file formcellbinding.cxx.
Referenced by isCellBinding(), isCellIntegerBinding(), and isCellRangeListSource().
Reference< XValueBinding > xmloff::FormCellBindingHelper::getCurrentBinding | ( | ) | const |
returns the current binding of our control model, if any.
Definition at line 333 of file formcellbinding.cxx.
References m_xControlModel.
Reference< XListEntrySource > xmloff::FormCellBindingHelper::getCurrentListSource | ( | ) | const |
returns the current external list source of the control model, if any
Definition at line 342 of file formcellbinding.cxx.
References m_xControlModel, and xSink.
OUString xmloff::FormCellBindingHelper::getStringAddressFromCellBinding | ( | const css::uno::Reference< css::form::binding::XValueBinding > & | _rxBinding | ) | const |
creates a string representation for the given value binding's address
If the sheet of the bound cell is the same as the sheet which our control belongs to, then the sheet name is omitted in the resulting string representation.
@precond The binding is a valid cell binding, or <NULL>
Definition at line 177 of file formcellbinding.cxx.
References Any, doConvertAddressRepresentations(), Exception, isCellBinding(), xmloff::PROPERTY_ADDRESS, xmloff::PROPERTY_BOUND_CELL, xmloff::PROPERTY_FILE_REPRESENTATION, and TOOLS_WARN_EXCEPTION.
OUString xmloff::FormCellBindingHelper::getStringAddressFromCellListSource | ( | const css::uno::Reference< css::form::binding::XListEntrySource > & | _rxSource | ) | const |
creates a string representation for the given list source's range address
If the sheet of the cell range which acts as list source is the same as the sheet which our control belongs to, then the sheet name is omitted in the resulting string representation.
@precond The object is a valid cell range list source, or <NULL>
Definition at line 206 of file formcellbinding.cxx.
References Any, doConvertAddressRepresentations(), Exception, isCellRangeListSource(), xmloff::PROPERTY_ADDRESS, xmloff::PROPERTY_FILE_REPRESENTATION, xmloff::PROPERTY_LIST_CELL_RANGE, and TOOLS_WARN_EXCEPTION.
|
static |
checks whether a given binding is a spreadsheet cell binding
Definition at line 311 of file formcellbinding.cxx.
References doesComponentSupport(), and xmloff::SERVICE_CELLVALUEBINDING.
Referenced by xmloff::OControlExport::examine(), and getStringAddressFromCellBinding().
bool xmloff::FormCellBindingHelper::isCellBindingAllowed | ( | ) | const |
checks whether it's possible to bind the control model to a spreadsheet cell
Definition at line 288 of file formcellbinding.cxx.
References isSpreadsheetDocumentWhichSupplies(), m_xControlModel, and xmloff::SERVICE_CELLVALUEBINDING.
Referenced by xmloff::OFormLayerXMLImport_Impl::documentDone().
|
static |
checks whether within the given document, it's possible to bind control models to spreadsheet cells
|
static |
checks whether a given binding is a spreadsheet cell binding, exchanging integer values
Definition at line 316 of file formcellbinding.cxx.
References doesComponentSupport(), and xmloff::SERVICE_LISTINDEXCELLBINDING.
Referenced by xmloff::OControlExport::exportCellBindingAttributes().
|
static |
checks whether a given list source is a spreadsheet cell list source
Definition at line 321 of file formcellbinding.cxx.
References doesComponentSupport(), and xmloff::SERVICE_CELLRANGELISTSOURCE.
Referenced by xmloff::OControlExport::examine(), and getStringAddressFromCellListSource().
bool xmloff::FormCellBindingHelper::isListCellRangeAllowed | ( | ) | const |
checks whether it's possible to bind the control model to a range of spreadsheet cells supplying the list entries
Definition at line 275 of file formcellbinding.cxx.
References isSpreadsheetDocumentWhichSupplies(), m_xControlModel, xmloff::SERVICE_CELLRANGELISTSOURCE, and xSink.
Referenced by xmloff::OFormLayerXMLImport_Impl::documentDone().
|
static |
checks whether within the given document, it's possible to bind the control model to a range of spreadsheet cells supplying the list entries
|
staticprivate |
determines if our document is a spreadsheet document, and can supply the given service
|
private |
determines if our document is a spreadsheet document, and can supply the given service
Definition at line 262 of file formcellbinding.cxx.
References isSpreadsheetDocumentWhichSupplies(), and m_xDocument.
Referenced by isCellBindingAllowed(), isListCellRangeAllowed(), and isSpreadsheetDocumentWhichSupplies().
|
static |
determines whether the given control model lives in a spreadsheet document
If this method returns <FALSE>, you cannot instantiate a CellBindingHelper with this model, since then no of its functionality will be available.
Definition at line 105 of file formcellbinding.cxx.
Referenced by xmloff::OControlExport::examine().
void xmloff::FormCellBindingHelper::setBinding | ( | const css::uno::Reference< css::form::binding::XValueBinding > & | _rxBinding | ) |
sets a new binding for our control model @precond the control model is bindable (which is implied by <member>isCellBindingAllowed</member> returning <TRUE>)
Definition at line 351 of file formcellbinding.cxx.
References m_xControlModel.
void xmloff::FormCellBindingHelper::setListSource | ( | const css::uno::Reference< css::form::binding::XListEntrySource > & | _rxSource | ) |
sets a list source for our control model @precond the control model is a list sink (which is implied by <member>isListCellRangeAllowed</member> returning <TRUE>)
Definition at line 359 of file formcellbinding.cxx.
References m_xControlModel, and xSink.
|
private |
Definition at line 39 of file formcellbinding.hxx.
Referenced by FormCellBindingHelper(), getCurrentBinding(), getCurrentListSource(), isCellBindingAllowed(), isListCellRangeAllowed(), setBinding(), and setListSource().
|
private |
Definition at line 41 of file formcellbinding.hxx.
Referenced by createCellBindingFromStringAddress(), createDocumentDependentInstance(), FormCellBindingHelper(), and isSpreadsheetDocumentWhichSupplies().