LibreOffice Module forms (master) 1
|
#include <model.hxx>
Public Member Functions | |
Model () | |
create a new model with an empty, default instance More... | |
virtual | ~Model () noexcept override |
xforms::EvaluationContext | getEvaluationContext () |
css::uno::Reference< css::xml::dom::XDocument > | getForeignSchema () const |
void | setForeignSchema (const css::uno::Reference< css::xml::dom::XDocument > &) |
OUString | getSchemaRef () const |
void | setSchemaRef (const OUString &) |
css::uno::Reference< css::container::XNameContainer > | getNamespaces () const |
void | setNamespaces (const css::uno::Reference< css::container::XNameContainer > &) |
bool | getExternalData () const |
void | setExternalData (bool _bData) |
void | dbg_assertInvariant () const |
void | addMIP (void *pTag, const XNode_t &, const MIP &) |
void | removeMIPs (void const *pTag) |
MIP | queryMIP (const XNode_t &xNode) const |
query which MIPs apply to the given node More... | |
void | rebind () |
re-bind all bindings More... | |
void | deferNotifications (bool) |
call defer notifications on all bindings More... | |
bool | setSimpleContent (const XNode_t &, const OUString &) |
set a data value in the instance (also defers notifications) More... | |
void | loadInstance (sal_Int32 nInstance) |
load instance data More... | |
void | loadInstances () |
bool | isInitialized () const |
has model been initialized? More... | |
bool | isValid () const |
is model currently valid (for submission)? More... | |
virtual OUString SAL_CALL | getID () override |
virtual void SAL_CALL | setID (const OUString &sID) override |
virtual void SAL_CALL | initialize () override |
virtual void SAL_CALL | rebuild () override |
virtual void SAL_CALL | recalculate () override |
virtual void SAL_CALL | revalidate () override |
virtual void SAL_CALL | refresh () override |
virtual void SAL_CALL | submit (const OUString &sID) override |
virtual void SAL_CALL | submitWithInteraction (const OUString &id, const css::uno::Reference< css::task::XInteractionHandler > &_rxHandler) override |
virtual css::uno::Reference< css::xforms::XDataTypeRepository > SAL_CALL | getDataTypeRepository () override |
virtual css::uno::Reference< css::container::XSet > SAL_CALL | getInstances () override |
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL | getInstanceDocument (const OUString &) override |
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL | getDefaultInstance () override |
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL | createBinding () override |
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL | cloneBinding (const css::uno::Reference< css::beans::XPropertySet > &) override |
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL | getBinding (const OUString &) override |
virtual css::uno::Reference< css::container::XSet > SAL_CALL | getBindings () override |
virtual css::uno::Reference< css::xforms::XSubmission > SAL_CALL | createSubmission () override |
virtual css::uno::Reference< css::xforms::XSubmission > SAL_CALL | cloneSubmission (const css::uno::Reference< css::beans::XPropertySet > &) override |
virtual css::uno::Reference< css::xforms::XSubmission > SAL_CALL | getSubmission (const OUString &) override |
virtual css::uno::Reference< css::container::XSet > SAL_CALL | getSubmissions () override |
virtual css::uno::Any SAL_CALL | getPropertyValue (const OUString &p) override |
virtual void SAL_CALL | addPropertyChangeListener (const OUString &p1, const css::uno::Reference< css::beans::XPropertyChangeListener > &p2) override |
virtual void SAL_CALL | removePropertyChangeListener (const OUString &p1, const css::uno::Reference< css::beans::XPropertyChangeListener > &p2) override |
virtual void SAL_CALL | addVetoableChangeListener (const OUString &p1, const css::uno::Reference< css::beans::XVetoableChangeListener > &p2) override |
virtual void SAL_CALL | removeVetoableChangeListener (const OUString &p1, const css::uno::Reference< css::beans::XVetoableChangeListener > &p2) override |
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL | getPropertySetInfo () override |
virtual void SAL_CALL | setPropertyValue (const OUString &p1, const css::uno::Any &p2) override |
virtual OUString SAL_CALL | getDefaultServiceNameForNode (const css::uno::Reference< css::xml::dom::XNode > &xNode) override |
determine a reasonable control service for a given node (based on data type MIP assigned to the node) More... | |
virtual OUString SAL_CALL | getDefaultBindingExpressionForNode (const css::uno::Reference< css::xml::dom::XNode > &xNode) override |
call getDefaultBindingExpressionForNode with default evaluation context More... | |
OUString | getDefaultBindingExpressionForNode (const XNode_t &, const EvaluationContext &) |
determine a reasonable default binding expression for a given node and a given evaluation context More... | |
virtual OUString SAL_CALL | getNodeDisplayName (const css::uno::Reference< css::xml::dom::XNode > &, sal_Bool bDetail) override |
virtual OUString SAL_CALL | getNodeName (const css::uno::Reference< css::xml::dom::XNode > &) override |
virtual OUString SAL_CALL | getBindingName (const css::uno::Reference< ::css::beans::XPropertySet > &, sal_Bool bDetail) override |
virtual OUString SAL_CALL | getSubmissionName (const css::uno::Reference< ::css::beans::XPropertySet > &, sal_Bool bDetail) override |
virtual css::uno::Reference< ::css::beans::XPropertySet > SAL_CALL | cloneBindingAsGhost (const css::uno::Reference< ::css::beans::XPropertySet > &) override |
virtual void SAL_CALL | removeBindingIfUseless (const css::uno::Reference< ::css::beans::XPropertySet > &) override |
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL | newInstance (const OUString &sName, const OUString &sURL, sal_Bool bURLOnce) override |
virtual void SAL_CALL | renameInstance (const OUString &sFrom, const OUString &sTo, const OUString &sURL, sal_Bool bURLOnce) override |
virtual void SAL_CALL | removeInstance (const OUString &sName) override |
virtual css::uno::Reference< css::xforms::XModel > SAL_CALL | newModel (const css::uno::Reference< css::frame::XModel > &xComponent, const OUString &sName) override |
virtual void SAL_CALL | renameModel (const css::uno::Reference< css::frame::XModel > &xComponent, const OUString &sFrom, const OUString &sTo) override |
virtual void SAL_CALL | removeModel (const css::uno::Reference< css::frame::XModel > &xComponent, const OUString &sName) override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | createElement (const css::uno::Reference< ::css::xml::dom::XNode > &xParent, const OUString &sName) override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | createAttribute (const css::uno::Reference< ::css::xml::dom::XNode > &xParent, const OUString &sName) override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | renameNode (const css::uno::Reference< ::css::xml::dom::XNode > &xNode, const OUString &sName) override |
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL | getBindingForNode (const css::uno::Reference< css::xml::dom::XNode > &, sal_Bool bCreate) override |
virtual void SAL_CALL | removeBindingForNode (const css::uno::Reference< ::css::xml::dom::XNode > &) override |
virtual OUString SAL_CALL | getResultForExpression (const css::uno::Reference< css::beans::XPropertySet > &xBinding, sal_Bool bIsBindingExpression, const OUString &sExpression) override |
virtual sal_Bool SAL_CALL | isValidXMLName (const OUString &sName) override |
virtual sal_Bool SAL_CALL | isValidPrefixName (const OUString &sName) override |
virtual void SAL_CALL | setNodeValue (const css::uno::Reference< ::css::xml::dom::XNode > &xNode, const OUString &sValue) override |
virtual void SAL_CALL | update () override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () override |
OUString SAL_CALL | getImplementationName () override |
sal_Bool SAL_CALL | supportsService (OUString const &ServiceName) override |
css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
Private Types | |
typedef css::uno::Reference< css::xml::dom::XNode > | XNode_t |
typedef css::uno::Reference< css::beans::XPropertySet > | XPropertySet_t |
typedef std::multimap< XNode_t, std::pair< void *, MIP > > | MIPs_t |
Private Member Functions | |
void | initializePropertySet () |
is the data of this model to be considered an integral part of the document? More... | |
void | ensureAtLeastOneInstance () |
Private Attributes | |
OUString | msID |
rtl::Reference< BindingCollection > | mxBindings |
the model ID More... | |
rtl::Reference< SubmissionCollection > | mxSubmissions |
the bindings More... | |
rtl::Reference< InstanceCollection > | mxInstances |
the submissions More... | |
css::uno::Reference< css::xforms::XDataTypeRepository > | mxDataTypes |
the instance(s) More... | |
css::uno::Reference< css::xml::dom::XDocument > | mxForeignSchema |
the XSD data-types used More... | |
OUString | msSchemaRef |
the XSD-schema part we cannot More... | |
css::uno::Reference< css::container::XNameContainer > | mxNamespaces |
xforms:model/@schema attribute More... | |
MIPs_t | maMIPs |
namespaces for entire model More... | |
bool | mbInitialized |
map nodes to their MIPs More... | |
bool | mbExternalData |
has model been initialized ? More... | |
|
private |
|
private |
|
private |
Model::Model | ( | ) |
create a new model with an empty, default instance
Model default constructor; create empty model.
Definition at line 88 of file model.cxx.
References DBG_INVARIANT, initializePropertySet(), mbInitialized, mxBindings, and mxSubmissions.
Referenced by newModel().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
overridevirtual |
Definition at line 491 of file model.cxx.
References xforms::copy(), createBinding(), and DBG_INVARIANT.
Referenced by xforms::Binding::createClone().
|
overridevirtual |
Definition at line 363 of file model_ui.cxx.
References xforms::copy().
|
overridevirtual |
Definition at line 521 of file model.cxx.
References xforms::copy(), createSubmission(), and DBG_INVARIANT.
|
overridevirtual |
Definition at line 557 of file model_ui.cxx.
References isValidXMLName(), nCount, and sName.
|
overridevirtual |
|
overridevirtual |
Definition at line 544 of file model_ui.cxx.
References isValidXMLName(), and sName.
|
overridevirtual |
Definition at line 515 of file model.cxx.
References DBG_INVARIANT.
Referenced by cloneSubmission().
void Model::dbg_assertInvariant | ( | ) | const |
Definition at line 156 of file model.cxx.
References mxBindings, mxInstances, and mxSubmissions.
void Model::deferNotifications | ( | bool | bDefer | ) |
call defer notifications on all bindings
Definition at line 232 of file model.cxx.
References xforms::Binding::deferNotifications(), i, mxBindings, and nCount.
Referenced by setSimpleContent().
|
private |
Definition at line 77 of file model.cxx.
References mxInstances, and newInstance().
Referenced by getDefaultInstance(), and getInstanceDocument().
|
overridevirtual |
Definition at line 499 of file model.cxx.
References DBG_INVARIANT, mxBindings, and sId.
|
overridevirtual |
Definition at line 666 of file model_ui.cxx.
References getDefaultBindingExpressionForNode(), xforms::Binding::getXNodeList(), xforms::Binding::isSimpleBindingExpression(), mxBindings, and n.
|
overridevirtual |
Definition at line 336 of file model_ui.cxx.
|
overridevirtual |
Definition at line 505 of file model.cxx.
References DBG_INVARIANT, and mxBindings.
|
overridevirtual |
Definition at line 444 of file model.cxx.
References mxDataTypes.
|
overridevirtual |
call getDefaultBindingExpressionForNode with default evaluation context
Definition at line 250 of file model_ui.cxx.
References getDefaultBindingExpressionForNode(), and getEvaluationContext().
Referenced by getBindingForNode(), getDefaultBindingExpressionForNode(), and renameNode().
OUString Model::getDefaultBindingExpressionForNode | ( | const XNode_t & | xNode, |
const EvaluationContext & | rContext | ||
) |
determine a reasonable default binding expression for a given node and a given evaluation context
Definition at line 199 of file model_ui.cxx.
References aBuffer, lcl_OutInstance(), lcl_OutName(), lcl_OutPosition(), and xforms::EvaluationContext::mxContextNode.
|
overridevirtual |
Definition at line 472 of file model.cxx.
References DBG_ASSERT, ensureAtLeastOneInstance(), xforms::getInstanceData(), and mxInstances.
Referenced by getEvaluationContext(), getNodeDisplayName(), and lcl_OutInstance().
|
overridevirtual |
determine a reasonable control service for a given node (based on data type MIP assigned to the node)
Definition at line 71 of file model_ui.cxx.
References xforms::MIP::getTypeName(), mxDataTypes, and queryMIP().
EvaluationContext Model::getEvaluationContext | ( | ) |
Definition at line 109 of file model.cxx.
References getDefaultInstance(), and mxNamespaces.
Referenced by getDefaultBindingExpressionForNode(), and xforms::Binding::getEvaluationContext().
|
inline |
Definition at line 128 of file model.hxx.
References mbExternalData.
Referenced by initializePropertySet().
|
inline |
Definition at line 116 of file model.hxx.
References mxForeignSchema.
Referenced by initializePropertySet().
|
overridevirtual |
Definition at line 372 of file model.cxx.
References DBG_INVARIANT, and msID.
Referenced by xforms::Binding::getModelID(), and initializePropertySet().
|
overridevirtual |
Definition at line 461 of file model.cxx.
References ensureAtLeastOneInstance(), xforms::getInstanceData(), xforms::lcl_findInstance(), and mxInstances.
|
overridevirtual |
|
inline |
Definition at line 124 of file model.hxx.
References mxNamespaces.
Referenced by xforms::Binding::_getNamespaces(), xforms::Binding::_setNamespaces(), and initializePropertySet().
|
overridevirtual |
Definition at line 272 of file model_ui.cxx.
References aBuffer, xforms::Convert::collapseWhitespace(), getDefaultInstance(), lcl_isWhitespace(), lcl_OutInstance(), and lcl_OutName().
|
overridevirtual |
Definition at line 314 of file model_ui.cxx.
References aBuffer, and lcl_OutName().
|
inlineoverridevirtual |
Definition at line 243 of file model.hxx.
References PropertySetBase::getPropertySetInfo().
|
inlineoverridevirtual |
|
overridevirtual |
Definition at line 857 of file model_ui.cxx.
References aBuffer, xforms::ComputedExpression::evaluate(), xforms::Binding::getEvaluationContext(), xforms::Binding::getMIPEvaluationContexts(), xforms::ComputedExpression::getXPath(), lcl_serializeForDisplay(), and xforms::ComputedExpression::setExpression().
|
inline |
Definition at line 120 of file model.hxx.
References msSchemaRef.
Referenced by initializePropertySet().
|
overridevirtual |
Definition at line 530 of file model.cxx.
References DBG_INVARIANT, mxSubmissions, and sId.
|
overridevirtual |
Definition at line 355 of file model_ui.cxx.
|
overridevirtual |
Definition at line 539 of file model.cxx.
References DBG_INVARIANT, and mxSubmissions.
|
override |
|
overridevirtual |
Definition at line 384 of file model.cxx.
References DBG_ASSERT, loadInstances(), mbInitialized, and rebind().
Referenced by rebuild().
|
private |
is the data of this model to be considered an integral part of the document?
Definition at line 555 of file model.cxx.
References getExternalData(), getForeignSchema(), getID(), getNamespaces(), getSchemaRef(), HANDLE_ExternalData, HANDLE_ForeignSchema, HANDLE_ID, HANDLE_Namespaces, HANDLE_SchemaRef, setExternalData(), setForeignSchema(), setID(), setNamespaces(), and setSchemaRef().
Referenced by Model().
|
inline |
has model been initialized?
Definition at line 165 of file model.hxx.
References mbInitialized.
Referenced by xforms::Binding::isLive().
bool Model::isValid | ( | ) | const |
is model currently valid (for submission)?
Definition at line 355 of file model.cxx.
References i, xforms::Binding::isValid(), mxBindings, and nCount.
|
overridevirtual |
Definition at line 896 of file model_ui.cxx.
References isValidPrefixName(), and sName.
|
overridevirtual |
Definition at line 891 of file model_ui.cxx.
References isValidQName(), and sName.
Referenced by createAttribute(), and createElement().
void Model::loadInstance | ( | sal_Int32 | nInstance | ) |
load instance data
Definition at line 308 of file model.cxx.
References Exception, getDocumentBuilder(), xforms::getInstanceData(), mxInstances, sEmpty, and xforms::setInstanceData().
Referenced by loadInstances(), and newInstance().
void Model::loadInstances | ( | ) |
Definition at line 344 of file model.cxx.
References loadInstance(), and mxInstances.
Referenced by initialize().
|
overridevirtual |
Definition at line 389 of file model_ui.cxx.
References DBG_ASSERT, getDocumentBuilder(), loadInstance(), mxInstances, xforms::setInstanceData(), and sName.
Referenced by ensureAtLeastOneInstance().
|
overridevirtual |
Definition at line 497 of file model_ui.cxx.
References Any, lcl_getModels(), Model(), sName, and xModel.
query which MIPs apply to the given node
Definition at line 191 of file model.cxx.
References xforms::MIP::inherit(), xforms::MIP::join(), and maMIPs.
Referenced by cloneNodes(), getDefaultServiceNameForNode(), and xforms::Binding::valueModified().
void Model::rebind | ( | ) |
re-bind all bindings
Definition at line 217 of file model.cxx.
References i, mxBindings, nCount, and xforms::Binding::update().
Referenced by initialize(), rebuild(), recalculate(), and refresh().
|
overridevirtual |
Definition at line 396 of file model.cxx.
References initialize(), mbInitialized, and rebind().
Referenced by update().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Definition at line 722 of file model_ui.cxx.
|
overridevirtual |
Definition at line 379 of file model_ui.cxx.
References xforms::Binding::isUseful(), and mxBindings.
|
overridevirtual |
Definition at line 478 of file model_ui.cxx.
References xforms::lcl_findInstance(), mxInstances, nPos, and sName.
void Model::removeMIPs | ( | void const * | pTag | ) |
Definition at line 175 of file model.cxx.
References maMIPs.
Referenced by xforms::Binding::bind(), and xforms::Binding::clear().
|
overridevirtual |
Definition at line 533 of file model_ui.cxx.
References lcl_getModels(), and sName.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
overridevirtual |
Definition at line 438 of file model_ui.cxx.
References aSeq, xforms::lcl_findInstance(), lcl_findProp(), mxInstances, nLength, nPos, and u.
|
overridevirtual |
Definition at line 517 of file model_ui.cxx.
References Any, lcl_getModels(), and xModel.
|
overridevirtual |
Definition at line 581 of file model_ui.cxx.
References xforms::Binding::getBindingExpression(), getDefaultBindingExpressionForNode(), mxBindings, n, nLength, xforms::Binding::setBindingExpression(), and sName.
void Model::setExternalData | ( | bool | _bData | ) |
Definition at line 150 of file model.cxx.
References mbExternalData.
Referenced by initializePropertySet().
void Model::setForeignSchema | ( | const css::uno::Reference< css::xml::dom::XDocument > & | rDocument | ) |
Definition at line 131 of file model.cxx.
References mxForeignSchema.
Referenced by initializePropertySet().
|
overridevirtual |
Definition at line 378 of file model.cxx.
References DBG_INVARIANT, and msID.
Referenced by initializePropertySet().
void Model::setNamespaces | ( | const css::uno::Reference< css::container::XNameContainer > & | rNamespaces | ) |
Definition at line 143 of file model.cxx.
References mxNamespaces.
Referenced by initializePropertySet().
|
overridevirtual |
Definition at line 901 of file model_ui.cxx.
References setSimpleContent().
|
inlineoverridevirtual |
void Model::setSchemaRef | ( | const OUString & | rSchemaRef | ) |
Definition at line 137 of file model.cxx.
References msSchemaRef.
Referenced by initializePropertySet().
bool Model::setSimpleContent | ( | const XNode_t & | xConstNode, |
const OUString & | sValue | ||
) |
set a data value in the instance (also defers notifications)
Definition at line 245 of file model.cxx.
References deferNotifications().
Referenced by xforms::Binding::bind(), setNodeValue(), and xforms::Binding::setValue().
|
overridevirtual |
Definition at line 439 of file model.cxx.
References submitWithInteraction().
|
overridevirtual |
Definition at line 420 of file model.cxx.
References DBG_INVARIANT, xforms::Submission::getModelImpl(), mxSubmissions, and xforms::Submission::submitWithInteraction().
Referenced by submit().
|
override |
Definition at line 588 of file model.cxx.
References ServiceName, and cppu::supportsService().
|
overridevirtual |
|
private |
namespaces for entire model
Definition at line 97 of file model.hxx.
Referenced by addMIP(), queryMIP(), and removeMIPs().
|
private |
has model been initialized ?
Definition at line 100 of file model.hxx.
Referenced by getExternalData(), and setExternalData().
|
private |
map nodes to their MIPs
Definition at line 99 of file model.hxx.
Referenced by initialize(), isInitialized(), and rebuild().
|
private |
|
private |
the XSD-schema part we cannot
map onto data types
Definition at line 93 of file model.hxx.
Referenced by getSchemaRef(), and setSchemaRef().
|
private |
the model ID
Definition at line 86 of file model.hxx.
Referenced by dbg_assertInvariant(), deferNotifications(), getBinding(), getBindingForNode(), getBindings(), isValid(), Model(), rebind(), removeBindingIfUseless(), and renameNode().
|
private |
the instance(s)
Definition at line 90 of file model.hxx.
Referenced by getDataTypeRepository(), and getDefaultServiceNameForNode().
|
private |
the XSD data-types used
Definition at line 91 of file model.hxx.
Referenced by getForeignSchema(), and setForeignSchema().
|
private |
the submissions
Definition at line 88 of file model.hxx.
Referenced by dbg_assertInvariant(), ensureAtLeastOneInstance(), getDefaultInstance(), getInstanceDocument(), getInstances(), loadInstance(), loadInstances(), newInstance(), removeInstance(), and renameInstance().
|
private |
xforms:model/@schema attribute
Definition at line 95 of file model.hxx.
Referenced by getEvaluationContext(), getNamespaces(), and setNamespaces().
|
private |
the bindings
Definition at line 87 of file model.hxx.
Referenced by dbg_assertInvariant(), getSubmission(), getSubmissions(), Model(), and submitWithInteraction().