Update ooo320-m1
[ooovba.git] / forms / source / xforms / mip.hxx
blobd7ec1509eda600013484ab90edf4d4757e4df12d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mip.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _MIP_HXX
32 #define _MIP_HXX
34 #include <rtl/ustring.hxx>
36 namespace xforms
39 /** represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a
40 * given XNode in the instance data at a given point in time. The
41 * values will not be updated; for updated values new MIP objects have
42 * to be created/queried. */
43 class MIP
45 bool mbHasReadonly;
46 bool mbReadonly;
48 bool mbHasRequired;
49 bool mbRequired;
51 bool mbHasRelevant;
52 bool mbRelevant;
54 bool mbHasConstraint;
55 bool mbConstraint;
57 bool mbHasCalculate;
59 bool mbHasTypeName;
60 rtl::OUString msTypeName;
62 rtl::OUString msConstraintExplanation;
64 public:
65 MIP();
66 ~MIP();
68 /// inherit from upper-level MIPs
69 void inherit( const MIP& );
71 /// join with same-level MIPs
72 void join( const MIP& );
75 // - type (static; default: xsd:string)
76 // (currently default implemented as empty string)
77 bool hasTypeName() const;
78 rtl::OUString getTypeName() const;
79 void setTypeName( const rtl::OUString& );
80 void resetTypeName();
82 // - readonly (computed XPath; default: false; true if calculate exists)
83 bool hasReadonly() const;
84 bool isReadonly() const;
85 void setReadonly( bool );
86 void resetReadonly();
88 // - required (computed XPath; default: false)
89 bool hasRequired() const;
90 bool isRequired() const;
91 void setRequired( bool );
92 void resetRequired();
94 // - relevant (computed XPath; default: true)
95 bool hasRelevant() const;
96 bool isRelevant() const;
97 void setRelevant( bool );
98 void resetRelevant();
100 // - constraing (computed XPath; default: true)
101 bool hasConstraint() const;
102 bool isConstraint() const;
103 void setConstraint( bool );
104 void resetConstraint();
106 // explain _why_ a constraint failed
107 void setConstraintExplanation( const rtl::OUString& );
108 rtl::OUString getConstraintExplanation() const;
110 // - calculate (computed XPath; default: has none (false))
111 // (for calculate, we only store whether a calculate MIP is present;
112 // the actual calculate value is handled my changing the instance
113 // directly)
114 bool hasCalculate() const;
115 void setHasCalculate( bool );
116 void resetCalculate();
118 // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
119 // - p3ptype (static; no default)
123 } // namespace xforms
125 #endif