xref: /aoo42x/main/forms/source/xforms/binding.hxx (revision 2d785d7e)
1*2d785d7eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2d785d7eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2d785d7eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2d785d7eSAndrew Rist  * distributed with this work for additional information
6*2d785d7eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2d785d7eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2d785d7eSAndrew Rist  * "License"); you may not use this file except in compliance
9*2d785d7eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2d785d7eSAndrew Rist  *
11*2d785d7eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2d785d7eSAndrew Rist  *
13*2d785d7eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2d785d7eSAndrew Rist  * software distributed under the License is distributed on an
15*2d785d7eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2d785d7eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2d785d7eSAndrew Rist  * specific language governing permissions and limitations
18*2d785d7eSAndrew Rist  * under the License.
19*2d785d7eSAndrew Rist  *
20*2d785d7eSAndrew Rist  *************************************************************/
21*2d785d7eSAndrew Rist 
22*2d785d7eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _BINDING_HXX
25cdf0e10cSrcweir #define _BINDING_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // forward declaractions
30cdf0e10cSrcweir namespace xforms
31cdf0e10cSrcweir {
32cdf0e10cSrcweir     class Model;
33cdf0e10cSrcweir     class EvaluationContext;
34cdf0e10cSrcweir }
35cdf0e10cSrcweir namespace com { namespace sun { namespace star {
36cdf0e10cSrcweir     namespace xml {
37cdf0e10cSrcweir         namespace xpath { class XXPathAPI; }
38cdf0e10cSrcweir         namespace dom
39cdf0e10cSrcweir         {
40cdf0e10cSrcweir             class XNode;
41cdf0e10cSrcweir             class XNodeList;
42cdf0e10cSrcweir         }
43cdf0e10cSrcweir     }
44cdf0e10cSrcweir     namespace container { class XNameContainer; }
45cdf0e10cSrcweir     namespace xforms { class XModel; }
46cdf0e10cSrcweir     namespace xsd { class XDataType; }
47cdf0e10cSrcweir } } }
48cdf0e10cSrcweir 
49cdf0e10cSrcweir // includes for parent classes
50cdf0e10cSrcweir #include <cppuhelper/implbase8.hxx>
51cdf0e10cSrcweir #include <propertysetbase.hxx>
52cdf0e10cSrcweir #include <com/sun/star/form/binding/XValueBinding.hpp>
53cdf0e10cSrcweir #include <com/sun/star/form/binding/XListEntrySource.hpp>
54cdf0e10cSrcweir #include <com/sun/star/form/validation/XValidator.hpp>
55cdf0e10cSrcweir #include <com/sun/star/util/XModifyBroadcaster.hpp>
56cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
57cdf0e10cSrcweir #include <com/sun/star/xml/dom/events/XEventListener.hpp>
58cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
59cdf0e10cSrcweir #include <com/sun/star/util/XCloneable.hpp>
60cdf0e10cSrcweir 
61cdf0e10cSrcweir // includes for member variables
62cdf0e10cSrcweir #include "pathexpression.hxx"
63cdf0e10cSrcweir #include "boolexpression.hxx"
64cdf0e10cSrcweir #include "mip.hxx"
65cdf0e10cSrcweir #include <rtl/ustring.hxx>
66cdf0e10cSrcweir #include <vector>
67cdf0e10cSrcweir #include <memory> // auto_ptr
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
71cdf0e10cSrcweir namespace xforms
72cdf0e10cSrcweir {
73cdf0e10cSrcweir 
74cdf0e10cSrcweir /** An XForms Binding. Contains:
75cdf0e10cSrcweir  *  # a connection to its model
76cdf0e10cSrcweir  *  # an ID
77cdf0e10cSrcweir  *  # an binding expression
78cdf0e10cSrcweir  *  # model item properties
79cdf0e10cSrcweir  *  # (NOT YET IMPLEMENTED) child bindings (sequence of)
80cdf0e10cSrcweir  *
81cdf0e10cSrcweir  * See http://www.w3.org/TR/xforms/ for more information.
82cdf0e10cSrcweir  */
83cdf0e10cSrcweir 
84cdf0e10cSrcweir typedef cppu::ImplInheritanceHelper8<
85cdf0e10cSrcweir     PropertySetBase,
86cdf0e10cSrcweir     com::sun::star::form::binding::XValueBinding,
87cdf0e10cSrcweir     com::sun::star::form::binding::XListEntrySource,
88cdf0e10cSrcweir     com::sun::star::form::validation::XValidator,
89cdf0e10cSrcweir     com::sun::star::util::XModifyBroadcaster,
90cdf0e10cSrcweir     com::sun::star::container::XNamed,
91cdf0e10cSrcweir     com::sun::star::xml::dom::events::XEventListener,
92cdf0e10cSrcweir     com::sun::star::lang::XUnoTunnel,
93cdf0e10cSrcweir     com::sun::star::util::XCloneable
94cdf0e10cSrcweir > Binding_t;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir class Binding : public Binding_t
97cdf0e10cSrcweir {
98cdf0e10cSrcweir public:
99cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xforms::XModel> Model_t;
100cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::util::XModifyListener> XModifyListener_t;
101cdf0e10cSrcweir     typedef std::vector<XModifyListener_t> ModifyListeners_t;
102cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::form::validation::XValidityConstraintListener> XValidityConstraintListener_t;
103cdf0e10cSrcweir     typedef std::vector<XValidityConstraintListener_t> XValidityConstraintListeners_t;
104cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::form::binding::XListEntryListener> XListEntryListener_t;
105cdf0e10cSrcweir     typedef std::vector<XListEntryListener_t> XListEntryListeners_t;
106cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> XNameContainer_t;
107cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> XNode_t;
108cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xml::dom::XNodeList> XNodeList_t;
109cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::util::XCloneable> XCloneable_t;
110cdf0e10cSrcweir     typedef com::sun::star::uno::Sequence<sal_Int8> IntSequence_t;
111cdf0e10cSrcweir     typedef com::sun::star::uno::Sequence<rtl::OUString> StringSequence_t;
112cdf0e10cSrcweir     typedef std::vector<MIP> MIPs_t;
113cdf0e10cSrcweir     typedef std::vector<XNode_t> XNodes_t;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 
117cdf0e10cSrcweir private:
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     /// the Model to which this Binding belongs; may be NULL
120cdf0e10cSrcweir     Model_t mxModel;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     /// binding-ID. A document-wide unique ID for this binding element.
123cdf0e10cSrcweir     rtl::OUString msBindingID;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     /// an XPath-expression to be instantiated on the data instance
126cdf0e10cSrcweir     PathExpression maBindingExpression;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     /// an XPath-expression to determine read-only status
129cdf0e10cSrcweir     BoolExpression maReadonly;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     /// an XPath-expression to determine relevance
132cdf0e10cSrcweir     BoolExpression maRelevant;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     /// an XPath-expression to determine if item is required
135cdf0e10cSrcweir     BoolExpression maRequired;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     /// an XPath-expression to determine if item is valid
138cdf0e10cSrcweir     BoolExpression maConstraint;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     /// user-readable explanation of the constraint
141cdf0e10cSrcweir     rtl::OUString msExplainConstraint;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     /// an XPath-expression to calculate values
144cdf0e10cSrcweir     ComputedExpression maCalculate;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     /// the XML namespaces used for XML names/XPath-expressions in this binding
147cdf0e10cSrcweir     XNameContainer_t mxNamespaces;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir     /// a type name
150cdf0e10cSrcweir     rtl::OUString msTypeName;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     /// modify listeners
153cdf0e10cSrcweir     ModifyListeners_t maModifyListeners;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     /// list entry listener
156cdf0e10cSrcweir     XListEntryListeners_t maListEntryListeners;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     /// validity listeners;
159cdf0e10cSrcweir     XValidityConstraintListeners_t maValidityListeners;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     /// nodes on which we are listening for events
162cdf0e10cSrcweir     XNodes_t maEventNodes;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     /// the current MIP object for the first node we are bound to
165cdf0e10cSrcweir     MIP maMIP;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     /// flag to detect recursions in calculate
168cdf0e10cSrcweir     bool mbInCalculate;
169cdf0e10cSrcweir 
170cdf0e10cSrcweir     // flags to manage deferred notifications:
171cdf0e10cSrcweir     /// if >0, valueModified() and bindingModified() will only set flags
172cdf0e10cSrcweir     sal_Int32 mnDeferModifyNotifications;
173cdf0e10cSrcweir     bool mbValueModified;   /// if true, valueModified needs to be called
174cdf0e10cSrcweir     bool mbBindingModified; /// if true, bindingModified needs to be called
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 
177cdf0e10cSrcweir     void initializePropertySet();
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 
180cdf0e10cSrcweir public:
181cdf0e10cSrcweir     Binding();
182cdf0e10cSrcweir     virtual ~Binding() throw();
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     //
185cdf0e10cSrcweir     // property methods: get/set value
186cdf0e10cSrcweir     //
187cdf0e10cSrcweir 
188cdf0e10cSrcweir     Model_t getModel() const;   /// get XForms model
189cdf0e10cSrcweir     void _setModel( const Model_t& ); /// set XForms model (only called by Model)
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     rtl::OUString getModelID() const;   /// get ID of XForms model
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     rtl::OUString getBindingID() const;         /// get ID for this binding
195cdf0e10cSrcweir     void setBindingID( const rtl::OUString& );  /// set ID for this binding
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     rtl::OUString getBindingExpression() const; /// get binding expression
198cdf0e10cSrcweir     void setBindingExpression( const rtl::OUString& );  /// set binding exp.
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     // MIPs (model item properties)
201cdf0e10cSrcweir 
202cdf0e10cSrcweir     rtl::OUString getReadonlyExpression() const;         /// get read-only MIP
203cdf0e10cSrcweir     void setReadonlyExpression( const rtl::OUString& );  /// set read-only MIP
204cdf0e10cSrcweir 
205cdf0e10cSrcweir     rtl::OUString getRelevantExpression() const;         /// get relevant MIP
206cdf0e10cSrcweir     void setRelevantExpression( const rtl::OUString& );  /// set relevant MIP
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     rtl::OUString getRequiredExpression() const;         /// get required MIP
209cdf0e10cSrcweir     void setRequiredExpression( const rtl::OUString& );  /// set required MIP
210cdf0e10cSrcweir 
211cdf0e10cSrcweir     rtl::OUString getConstraintExpression() const;       /// get constraint MIP
212cdf0e10cSrcweir     void setConstraintExpression( const rtl::OUString& );/// set constraint MIP
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     rtl::OUString getCalculateExpression() const;        /// get calculate MIP
215cdf0e10cSrcweir     void setCalculateExpression( const rtl::OUString& ); /// set calculate MIP
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     rtl::OUString getType() const;         /// get type name MIP (static)
218cdf0e10cSrcweir     void setType( const rtl::OUString& );  /// set type name MIP (static)
219cdf0e10cSrcweir 
220cdf0e10cSrcweir     // a binding expression can only be interpreted with respect to
221cdf0e10cSrcweir     // suitable namespace declarations. We collect those in the model and in a binding.
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     // access to a binding's namespace
224cdf0e10cSrcweir     // (set-method only changes local namespaces (but may add to model))
225cdf0e10cSrcweir     XNameContainer_t getBindingNamespaces() const;  /// set binding namespaces
226cdf0e10cSrcweir     void setBindingNamespaces( const XNameContainer_t& ); /// get binding nmsp.
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     // access to the model's namespaces
229cdf0e10cSrcweir     // (set-method changes model's namespaces (unless a local one is present))
230cdf0e10cSrcweir     XNameContainer_t getModelNamespaces() const;  /// set model namespaces
231cdf0e10cSrcweir     void setModelNamespaces( const XNameContainer_t& ); /// get model nmsp.
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     // read-only properties that map MIPs to control data source properties
235cdf0e10cSrcweir     bool getReadOnly() const;       // MIP readonly
236cdf0e10cSrcweir     bool getRelevant() const;       // MIP relevant
237cdf0e10cSrcweir     bool getExternalData() const;   // mapped from model's ExternalData property
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     // missing binding properties:
241cdf0e10cSrcweir     // - type (static; default: xsd:string)
242cdf0e10cSrcweir     // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
243cdf0e10cSrcweir     // - p3ptype (static; no default)
244cdf0e10cSrcweir 
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     /// get this binding's context node
249cdf0e10cSrcweir     xforms::EvaluationContext getEvaluationContext() const;
250cdf0e10cSrcweir 
251cdf0e10cSrcweir     /// get evalation contexts for this binding's MIPs
252cdf0e10cSrcweir     std::vector<xforms::EvaluationContext> getMIPEvaluationContexts();
253cdf0e10cSrcweir 
254cdf0e10cSrcweir     /// get nodeset the bind is bound to
255cdf0e10cSrcweir     XNodeList_t getXNodeList();
256cdf0e10cSrcweir 
257cdf0e10cSrcweir     /// heuristically determine whether this binding is simple binding
258cdf0e10cSrcweir     /// (here: simple binding == does not depend on other parts of the
259cdf0e10cSrcweir     ///                          instance, it's not a 'dynamic' binding)
260cdf0e10cSrcweir     bool isSimpleBinding() const;
261cdf0e10cSrcweir 
262cdf0e10cSrcweir     /// heuristically determine whether this binding's binding
263cdf0e10cSrcweir     /// expression is simple
264cdf0e10cSrcweir     bool isSimpleBindingExpression() const;
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     /// update this binding (e.g. called by model for refresh )
267cdf0e10cSrcweir     void update();
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     /// prevent change notifications being sent to controls
270cdf0e10cSrcweir     void deferNotifications( bool );
271cdf0e10cSrcweir 
272cdf0e10cSrcweir     /// is this binding valid? (are constraint, type and required MIPs ok?)
273cdf0e10cSrcweir     bool isValid();
274cdf0e10cSrcweir 
275cdf0e10cSrcweir     /// determine whether this binding currently performs a useful
276cdf0e10cSrcweir     /// function, r whether is may be discarded
277cdf0e10cSrcweir     bool isUseful();
278cdf0e10cSrcweir 
279cdf0e10cSrcweir     /// explain why binding is invalid
280cdf0e10cSrcweir     rtl::OUString explainInvalid();
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 
283cdf0e10cSrcweir     // the ID for XUnoTunnel calls
284cdf0e10cSrcweir     static IntSequence_t getUnoTunnelID();
285cdf0e10cSrcweir     static Binding* getBinding( const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& );
286cdf0e10cSrcweir 
287cdf0e10cSrcweir     //
288cdf0e10cSrcweir     // class-scoped typedef for easy-to-read UNO interfaces
289cdf0e10cSrcweir     //
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     // basic types
292cdf0e10cSrcweir     typedef com::sun::star::uno::Any Any_t;
293cdf0e10cSrcweir     typedef com::sun::star::uno::Sequence<com::sun::star::uno::Type> Sequence_Type_t;
294cdf0e10cSrcweir     typedef com::sun::star::uno::Type Type_t;
295cdf0e10cSrcweir 
296cdf0e10cSrcweir     // reference types
297cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> XPropertyChangeListener_t;
298cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> XPropertySetInfo_t;
299cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener> XVetoableChangeListener_t;
300cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xml::xpath::XXPathAPI> XXPathAPI_t;
301cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xml::dom::events::XEvent> XEvent_t;
302cdf0e10cSrcweir     typedef com::sun::star::uno::Reference<com::sun::star::xsd::XDataType> XDataType_t;
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     // exceptions
305cdf0e10cSrcweir     typedef com::sun::star::beans::PropertyVetoException PropertyVetoException_t;
306cdf0e10cSrcweir     typedef com::sun::star::beans::UnknownPropertyException UnknownPropertyException_t;
307cdf0e10cSrcweir     typedef com::sun::star::lang::IllegalArgumentException IllegalArgumentException_t;
308cdf0e10cSrcweir     typedef com::sun::star::lang::NoSupportException NoSupportException_t;
309cdf0e10cSrcweir     typedef com::sun::star::lang::WrappedTargetException WrappedTargetException_t;
310cdf0e10cSrcweir     typedef com::sun::star::uno::RuntimeException RuntimeException_t;
311cdf0e10cSrcweir     typedef com::sun::star::form::binding::IncompatibleTypesException IncompatibleTypesException_t;
312cdf0e10cSrcweir     typedef com::sun::star::form::binding::InvalidBindingStateException InvalidBindingStateException_t;
313cdf0e10cSrcweir     typedef com::sun::star::lang::NullPointerException NullPointerException_t;
314cdf0e10cSrcweir     typedef com::sun::star::lang::IndexOutOfBoundsException IndexOutOfBoundsException_t;
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 
318cdf0e10cSrcweir private:
319cdf0e10cSrcweir     /// check whether object is live, and throw suitable exception if not
320cdf0e10cSrcweir     /// (to be used be API methods before acting on the object)
321cdf0e10cSrcweir     void checkLive() throw( RuntimeException_t );
322cdf0e10cSrcweir 
323cdf0e10cSrcweir     /// check whether binding has a model, and throw exception if not
324cdf0e10cSrcweir     /// (to be used be API methods before acting on the object)
325cdf0e10cSrcweir     void checkModel() throw( RuntimeException_t );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir     /// determine whether object is live
328cdf0e10cSrcweir     /// live: has model, and model has been initialized
329cdf0e10cSrcweir     bool isLive() const;
330cdf0e10cSrcweir 
331cdf0e10cSrcweir     /// get the model implementation
332cdf0e10cSrcweir     xforms::Model* getModelImpl() const;
333cdf0e10cSrcweir     xforms::Model* getModelImpl( const Model_t& xModel ) const;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir     /// get MIP evaluation contexts
336cdf0e10cSrcweir     /// (only valid if control has already been bound)
337cdf0e10cSrcweir     std::vector<xforms::EvaluationContext> _getMIPEvaluationContexts() const;
338cdf0e10cSrcweir 
339cdf0e10cSrcweir     /// bind this binding, and pre-compute the affected nodes
340cdf0e10cSrcweir     void bind( bool bForceRebind = false );
341cdf0e10cSrcweir 
342cdf0e10cSrcweir     /// the binding value has been changed:
343cdf0e10cSrcweir     ///   trigger a modified event on all modified listeners
344cdf0e10cSrcweir     void valueModified();
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     /// the binding itself has changed:
347cdf0e10cSrcweir     ///   force rebind, then call valueModified()
348cdf0e10cSrcweir     void bindingModified();
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 
351cdf0e10cSrcweir     /// register the event listeners for
352cdf0e10cSrcweir     void registerListeners();
353cdf0e10cSrcweir 
354cdf0e10cSrcweir     /// set MIPs defined by this binding on MIP item
355cdf0e10cSrcweir     MIP getLocalMIP() const;
356cdf0e10cSrcweir 
357cdf0e10cSrcweir     /// get the data type that applies to this binding
358cdf0e10cSrcweir     XDataType_t getDataType();
359cdf0e10cSrcweir 
360cdf0e10cSrcweir     /// determine whether binding is valid according to the given data type
361cdf0e10cSrcweir     bool isValid_DataType();
362cdf0e10cSrcweir 
363cdf0e10cSrcweir     /// explain validity of binding with respect to the given data type
364cdf0e10cSrcweir     rtl::OUString explainInvalid_DataType();
365cdf0e10cSrcweir 
366cdf0e10cSrcweir     /// 'clear' this binding - remove all listeners, etc.
367cdf0e10cSrcweir     void clear();
368cdf0e10cSrcweir 
369cdf0e10cSrcweir 	/// distribute MIPs from current node recursively to childs
370cdf0e10cSrcweir 	void distributeMIP( const XNode_t &rxNode );
371cdf0e10cSrcweir 
372cdf0e10cSrcweir     /// implement get*Namespaces()
373cdf0e10cSrcweir     XNameContainer_t _getNamespaces() const;
374cdf0e10cSrcweir 
375cdf0e10cSrcweir     /// implement set*Namespaces()
376cdf0e10cSrcweir     void _setNamespaces( const XNameContainer_t&, bool bBinding );
377cdf0e10cSrcweir 
378cdf0e10cSrcweir     /// set a useful default binding ID (if none is set)
379cdf0e10cSrcweir     void _checkBindingID();
380cdf0e10cSrcweir 
381cdf0e10cSrcweir public:
382cdf0e10cSrcweir     /// for debugging purposes only: get the MIPs defined by this binding
383cdf0e10cSrcweir     const MIP* _getMIP();
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 
388cdf0e10cSrcweir 
389cdf0e10cSrcweir     //
390cdf0e10cSrcweir     // XValueBinding:
391cdf0e10cSrcweir     //
392cdf0e10cSrcweir 
393cdf0e10cSrcweir public:
394cdf0e10cSrcweir 
395cdf0e10cSrcweir     virtual Sequence_Type_t SAL_CALL getSupportedValueTypes()
396cdf0e10cSrcweir         throw( RuntimeException_t );
397cdf0e10cSrcweir 
398cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsType( const Type_t& aType )
399cdf0e10cSrcweir         throw( RuntimeException_t );
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     virtual Any_t SAL_CALL getValue( const Type_t& aType )
402cdf0e10cSrcweir         throw( IncompatibleTypesException_t,
403cdf0e10cSrcweir                RuntimeException_t );
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     virtual void SAL_CALL setValue( const Any_t& aValue )
406cdf0e10cSrcweir         throw( IncompatibleTypesException_t,
407cdf0e10cSrcweir                InvalidBindingStateException_t,
408cdf0e10cSrcweir                NoSupportException_t,
409cdf0e10cSrcweir                RuntimeException_t );
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 
412cdf0e10cSrcweir 
413cdf0e10cSrcweir     //
414cdf0e10cSrcweir     // XListEntry Source
415cdf0e10cSrcweir     //
416cdf0e10cSrcweir 
417cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getListEntryCount()
418cdf0e10cSrcweir         throw( RuntimeException_t );
419cdf0e10cSrcweir 
420cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getListEntry( sal_Int32 nPosition )
421cdf0e10cSrcweir         throw( IndexOutOfBoundsException_t,
422cdf0e10cSrcweir                RuntimeException_t );
423cdf0e10cSrcweir 
424cdf0e10cSrcweir     virtual StringSequence_t SAL_CALL getAllListEntries()
425cdf0e10cSrcweir         throw( RuntimeException_t );
426cdf0e10cSrcweir 
427cdf0e10cSrcweir     virtual void SAL_CALL addListEntryListener( const XListEntryListener_t& )
428cdf0e10cSrcweir         throw( NullPointerException_t,
429cdf0e10cSrcweir                RuntimeException_t );
430cdf0e10cSrcweir 
431cdf0e10cSrcweir     virtual void SAL_CALL removeListEntryListener( const XListEntryListener_t&)
432cdf0e10cSrcweir         throw( NullPointerException_t,
433cdf0e10cSrcweir                RuntimeException_t );
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 
436cdf0e10cSrcweir 
437cdf0e10cSrcweir     //
438cdf0e10cSrcweir     // XValidator:
439cdf0e10cSrcweir     //
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isValid(
442cdf0e10cSrcweir         const Any_t& )
443cdf0e10cSrcweir         throw( RuntimeException_t );
444cdf0e10cSrcweir 
445cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL explainInvalid(
446cdf0e10cSrcweir         const Any_t& )
447cdf0e10cSrcweir         throw( RuntimeException_t );
448cdf0e10cSrcweir 
449cdf0e10cSrcweir     virtual void SAL_CALL addValidityConstraintListener(
450cdf0e10cSrcweir         const XValidityConstraintListener_t& xListener )
451cdf0e10cSrcweir         throw( NullPointerException_t,
452cdf0e10cSrcweir                RuntimeException_t );
453cdf0e10cSrcweir 
454cdf0e10cSrcweir     virtual void SAL_CALL removeValidityConstraintListener(
455cdf0e10cSrcweir         const XValidityConstraintListener_t& xListener )
456cdf0e10cSrcweir         throw( NullPointerException_t,
457cdf0e10cSrcweir                RuntimeException_t );
458cdf0e10cSrcweir 
459cdf0e10cSrcweir 
460cdf0e10cSrcweir     //
461cdf0e10cSrcweir     // XModifyBroadcaster & friends:
462cdf0e10cSrcweir     //   inform listeners about changes in our values
463cdf0e10cSrcweir     //
464cdf0e10cSrcweir 
465cdf0e10cSrcweir public:
466cdf0e10cSrcweir 
467cdf0e10cSrcweir     virtual void SAL_CALL addModifyListener(
468cdf0e10cSrcweir         const XModifyListener_t& xListener )
469cdf0e10cSrcweir         throw( RuntimeException_t );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir     virtual void SAL_CALL removeModifyListener(
472cdf0e10cSrcweir         const XModifyListener_t& xListener )
473cdf0e10cSrcweir         throw( RuntimeException_t );
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 
476cdf0e10cSrcweir 
477cdf0e10cSrcweir 
478cdf0e10cSrcweir     //
479cdf0e10cSrcweir     // XNamed:
480cdf0e10cSrcweir     //   get/set name
481cdf0e10cSrcweir     //
482cdf0e10cSrcweir 
483cdf0e10cSrcweir public:
484cdf0e10cSrcweir 
485cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getName()
486cdf0e10cSrcweir         throw( RuntimeException_t );
487cdf0e10cSrcweir 
488cdf0e10cSrcweir     virtual void SAL_CALL setName( const rtl::OUString& )
489cdf0e10cSrcweir         throw( RuntimeException_t );
490cdf0e10cSrcweir 
491cdf0e10cSrcweir 
492cdf0e10cSrcweir 
493cdf0e10cSrcweir     //
494cdf0e10cSrcweir     // xml::dom::event::XEventListener
495cdf0e10cSrcweir     //   receive an event if our node changed
496cdf0e10cSrcweir     //
497cdf0e10cSrcweir 
498cdf0e10cSrcweir     virtual void SAL_CALL handleEvent(
499cdf0e10cSrcweir         const XEvent_t& xEvent )
500cdf0e10cSrcweir         throw( RuntimeException_t );
501cdf0e10cSrcweir 
502cdf0e10cSrcweir 
503cdf0e10cSrcweir 
504cdf0e10cSrcweir     //
505cdf0e10cSrcweir     // XUnoTunnel
506cdf0e10cSrcweir     //
507cdf0e10cSrcweir 
508cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething( const IntSequence_t& )
509cdf0e10cSrcweir         throw( RuntimeException_t );
510cdf0e10cSrcweir 
511cdf0e10cSrcweir 
512cdf0e10cSrcweir     //
513cdf0e10cSrcweir     // XCloneable
514cdf0e10cSrcweir     //
515cdf0e10cSrcweir 
516cdf0e10cSrcweir     virtual XCloneable_t SAL_CALL createClone()
517cdf0e10cSrcweir         throw( RuntimeException_t );
518cdf0e10cSrcweir };
519cdf0e10cSrcweir 
520cdf0e10cSrcweir 
521cdf0e10cSrcweir } // namespace xforms
522cdf0e10cSrcweir 
523cdf0e10cSrcweir #endif
524